2015-09-30 12:03:46 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Header file for obi errnos *
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file obierrno.h
|
|
|
|
* @author Eric Coissac (eric.coissac@metabarcoding.org)
|
|
|
|
* @date 23 May 2015
|
|
|
|
* @brief Header file for obi errnos.
|
2015-05-23 14:54:48 +03:00
|
|
|
*/
|
|
|
|
|
2015-09-30 12:03:46 +02:00
|
|
|
|
2015-05-23 14:54:48 +03:00
|
|
|
#ifndef OBIERRNO_H_
|
|
|
|
#define OBIERRNO_H_
|
|
|
|
|
2015-09-30 12:03:46 +02:00
|
|
|
|
2015-05-23 14:54:48 +03:00
|
|
|
/**
|
|
|
|
* @brief The declaration of the external variable `obi_errno`.
|
|
|
|
*
|
2015-06-10 15:19:02 +02:00
|
|
|
* `obi_errno` is an equivalent of `errno` for the system level error,
|
2015-09-30 12:03:46 +02:00
|
|
|
* but for errors generated by the C layer of the OBITools3 framework.
|
2015-05-23 14:54:48 +03:00
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @TODO We have to look into defining this variable as thread specific.
|
2015-05-23 14:54:48 +03:00
|
|
|
*/
|
|
|
|
extern int obi_errno;
|
|
|
|
|
2015-06-10 15:19:02 +02:00
|
|
|
|
2015-05-23 14:54:48 +03:00
|
|
|
/**
|
2015-06-10 15:19:02 +02:00
|
|
|
* @brief Sets the global `obi_errno` variable with
|
2015-05-23 14:54:48 +03:00
|
|
|
* the specified `err` code
|
|
|
|
*
|
|
|
|
* This function is defined as a macro to reduce the risk
|
2015-09-30 12:03:46 +02:00
|
|
|
* of increasing the problem by generating another error by calling
|
|
|
|
* another function.
|
2015-05-23 14:54:48 +03:00
|
|
|
*
|
2015-06-10 15:19:02 +02:00
|
|
|
* @param err The error code as an integer value.
|
2015-05-23 14:54:48 +03:00
|
|
|
*
|
|
|
|
* @since May 2015
|
|
|
|
* @author Eric Coissac (eric.coissac@metabarcoding.org)
|
|
|
|
*/
|
|
|
|
#define obi_set_errno(err) (obi_errno = (err))
|
|
|
|
|
2015-06-10 15:19:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup OBIDMSErrors OBIDMS related error codes
|
|
|
|
*
|
|
|
|
* Error codes set in errno following an error related
|
|
|
|
* to the manipulation of an OBIDMS.
|
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @TODO
|
|
|
|
*
|
2015-06-10 15:19:02 +02:00
|
|
|
* @{
|
|
|
|
*/
|
2015-06-23 17:56:21 +02:00
|
|
|
#define OBIDMS_EXIST_ERROR (1) /**< Trying to create an OBIDMS with a name
|
|
|
|
* that corresponds to an existing one
|
|
|
|
*/
|
|
|
|
#define OBIDMS_NOT_EXIST_ERROR (2) /**< Trying to open a non-existing OBIDMS
|
|
|
|
*/
|
|
|
|
#define OBIDMS_LONG_NAME_ERROR (3) /**< The specified OBIDMS name is too long
|
|
|
|
*/
|
|
|
|
#define OBIDMS_MEMORY_ERROR (4) /**< A memory error occurred during allocation while handling
|
|
|
|
* an OBIDMS
|
|
|
|
*/
|
|
|
|
#define OBIDMS_UNKNOWN_ERROR (5) /**< Undetermined error while handling an OBIDMS
|
|
|
|
*/
|
|
|
|
#define OBIDMS_ACCESS_ERROR (6) /**< Permission error trying to access the database
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define OBICOLDIR_EXIST_ERROR (7) /**< Trying to create an OBIDMS column directory with a name
|
|
|
|
* that corresponds to an existing one
|
|
|
|
*/
|
|
|
|
#define OBICOLDIR_NOT_EXIST_ERROR (8) /**< Trying to open a non-existing OBIDMS column directory
|
|
|
|
*/
|
|
|
|
#define OBICOLDIR_LONG_NAME_ERROR (9) /**< The specified OBIDMS column directory name is too long
|
|
|
|
*/
|
|
|
|
#define OBICOLDIR_MEMORY_ERROR (10) /**< A memory error occurred during allocation while handling
|
|
|
|
* an OBIDMS column directory
|
|
|
|
*/
|
|
|
|
#define OBICOLDIR_UNKNOWN_ERROR (11) /**< Undetermined error while handling an OBIDMS column directory
|
|
|
|
*/
|
|
|
|
#define OBICOLDIR_ACCESS_ERROR (12) /**< Permission error trying to access an OBIDSM column directory
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define OBICOL_BAD_ENDIAN_ERROR (13) /**< The opened data structure does not corresponds
|
|
|
|
* to the endianness of the platform.
|
|
|
|
*/
|
|
|
|
#define OBICOL_EXIST_ERROR (14) /**< Trying to create an OBIDMS column with a name
|
|
|
|
* that corresponds to an existing one
|
|
|
|
*/
|
|
|
|
#define OBICOL_NOT_EXIST_ERROR (15) /**< Trying to open a non-existing OBIDMS column directory
|
|
|
|
*/
|
|
|
|
#define OBICOL_LONG_NAME_ERROR (16) /**< The specified OBIDMS column directory name is too long
|
|
|
|
*/
|
|
|
|
#define OBICOL_MEMORY_ERROR (17) /**< A memory error occurred during allocation while handling
|
|
|
|
* an OBIDMS column directory
|
|
|
|
*/
|
|
|
|
#define OBICOL_UNKNOWN_ERROR (18) /**< Undetermined error while handling an OBIDMS column directory
|
|
|
|
*/
|
|
|
|
#define OBICOL_ACCESS_ERROR (19) /**< Permission error trying to access an OBIDSM column directory
|
|
|
|
*/
|
2015-11-06 17:55:15 +01:00
|
|
|
#define OBI_ARRAY_ERROR (20) /** Error while handling an array
|
2015-11-03 14:22:00 +01:00
|
|
|
*/
|
2015-06-10 15:19:02 +02:00
|
|
|
/**@}*/
|
|
|
|
|
2015-05-23 14:54:48 +03:00
|
|
|
#endif /* OBIERRNO_H_ */
|