2015-05-23 14:54:48 +03:00
|
|
|
/*
|
|
|
|
* obierrno.h
|
|
|
|
*
|
|
|
|
* Created on: 23 mai 2015
|
|
|
|
* Author: coissac
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OBIERRNO_H_
|
|
|
|
#define OBIERRNO_H_
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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,
|
|
|
|
* but for errors generated by the C layer of the OBITools framework.
|
2015-05-23 14:54:48 +03:00
|
|
|
*
|
2015-06-10 15:19:02 +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-06-10 15:19:02 +02:00
|
|
|
* of increasing the problem generating the error by calling
|
2015-05-23 14:54:48 +03:00
|
|
|
* a new function.
|
|
|
|
*
|
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.
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define OBIDMS_EXIST_ERROR (1) /**< Trying to create an OBIDMS with a name
|
|
|
|
* that corresponds to an existing OBIDMS
|
|
|
|
*/
|
|
|
|
#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
|
|
|
|
*/
|
|
|
|
#define OBIDMS_UNKNOWN_ERROR (5) /**< Undetermined error
|
|
|
|
*/
|
|
|
|
#define OBIDMS_ACCESS_ERROR (6) /**< Permission error trying to access the database
|
|
|
|
*/
|
|
|
|
#define OBIDMS_BAD_ENDIAN_ERROR (7) /**< The opened data structure does not corresponds
|
|
|
|
* to the endianess of the platform.
|
|
|
|
*/
|
|
|
|
/**@}*/
|
|
|
|
|
2015-05-23 14:54:48 +03:00
|
|
|
#endif /* OBIERRNO_H_ */
|