Commit 5e3e6f93 by Eric Coissac

Add a mecanism similar to the classical errno system for reporting error

but specific to the OBITools framwork
parent 3636672b
/*
* obierrno.c
*
* Created on: 23 mai 2015
* Author: coissac
*/
int obi_errno;
/*
* obierrno.h
*
* Created on: 23 mai 2015
* Author: coissac
*/
#ifndef OBIERRNO_H_
#define OBIERRNO_H_
/**
* @brief The declaration of the external variable `obi_errno`.
*
* `obi_errno` is an equivalent of `errno` for the system level error
* but for for error generated by the C layer of the OBITools framework.
*
* @todo We have to look for defining this variable as thread specific.
*/
extern int obi_errno;
/**
* @brief set the global `obi_errno` variable with
* the specified `err` code
*
* This function is defined as a macro to reduce the risk
* to increase the problem generating the error by calling
* a new function.
*
* @param err the error code as an integer value
*
* @since May 2015
* @author Eric Coissac (eric.coissac@metabarcoding.org)
*/
#define obi_set_errno(err) (obi_errno = (err))
#endif /* OBIERRNO_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment