clsync
Macros | Typedefs | Enumerations | Functions
error.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BACKTRACE_LENGTH   256
 
#define DEBUGLEVEL_LIMIT   9
 
#define critical(...)   _critical(__func__, __VA_ARGS__)
 
#define critical_on(cond)   {debug(30, "critical_on: checking: %s", TOSTR(cond)); if (unlikely(cond)) {critical("Assert: "TOSTR(cond));}}
 
#define error(...)   _error(__func__, __VA_ARGS__)
 
#define error_on(cond)   {if (unlikely(cond)) {error("Error: ("TOSTR(cond)") != 0");}}
 
#define warning(...)   _warning(__func__, __VA_ARGS__)
 
#define info(...)   _info(__func__, __VA_ARGS__)
 
#define debug(debug_level, ...)   {}
 
#define error_or_debug(debug_level, ...)   ((debug_level)<0 ? _error(__func__, __VA_ARGS__) : (void)0)
 
#define debug_call(debug_level, code)   debug(debug_level, "%s -> %i", TOSTR(code), code)
 
#define critical_or_warning(cond, ...)   ((cond) ? _critical : _warning)(__func__, __VA_ARGS__)
 

Typedefs

typedef enum ipc_type ipc_type_t
 
typedef enum outputmethod outputmethod_t
 

Enumerations

enum  ipc_type { IPCT_PRIVATE, IPCT_SHARED }
 
enum  outputmethod { OM_STDERR = 0, OM_STDOUT, OM_SYSLOG, OM_MAX }
 

Functions

void _critical (const char *const function_name, const char *fmt,...)
 
void _error (const char *const function_name, const char *fmt,...)
 
void _warning (const char *const function_name, const char *fmt,...)
 
void _info (const char *const function_name, const char *fmt,...)
 
void error_init (void *_outputmethod, int *_quiet, int *_verbose, int *_debug)
 
void error_init_ipc (ipc_type_t ipc_type)
 
void error_deinit ()
 

Macro Definition Documentation

◆ BACKTRACE_LENGTH

#define BACKTRACE_LENGTH   256

Definition at line 23 of file error.h.

◆ critical

#define critical (   ...)    _critical(__func__, __VA_ARGS__)

Definition at line 32 of file error.h.

◆ critical_on

#define critical_on (   cond)    {debug(30, "critical_on: checking: %s", TOSTR(cond)); if (unlikely(cond)) {critical("Assert: "TOSTR(cond));}}

Definition at line 33 of file error.h.

◆ critical_or_warning

#define critical_or_warning (   cond,
  ... 
)    ((cond) ? _critical : _warning)(__func__, __VA_ARGS__)

Definition at line 57 of file error.h.

◆ debug

#define debug (   debug_level,
  ... 
)    {}

Definition at line 50 of file error.h.

◆ debug_call

#define debug_call (   debug_level,
  code 
)    debug(debug_level, "%s -> %i", TOSTR(code), code)

Definition at line 55 of file error.h.

◆ DEBUGLEVEL_LIMIT

#define DEBUGLEVEL_LIMIT   9

Definition at line 28 of file error.h.

◆ error

#define error (   ...)    _error(__func__, __VA_ARGS__)

Definition at line 36 of file error.h.

◆ error_on

#define error_on (   cond)    {if (unlikely(cond)) {error("Error: ("TOSTR(cond)") != 0");}}

Definition at line 37 of file error.h.

◆ error_or_debug

#define error_or_debug (   debug_level,
  ... 
)    ((debug_level)<0 ? _error(__func__, __VA_ARGS__) : (void)0)

Definition at line 51 of file error.h.

◆ info

#define info (   ...)    _info(__func__, __VA_ARGS__)

Definition at line 43 of file error.h.

◆ warning

#define warning (   ...)    _warning(__func__, __VA_ARGS__)

Definition at line 40 of file error.h.

Typedef Documentation

◆ ipc_type_t

typedef enum ipc_type ipc_type_t

Definition at line 63 of file error.h.

◆ outputmethod_t

Definition at line 76 of file error.h.

Enumeration Type Documentation

◆ ipc_type

enum ipc_type
Enumerator
IPCT_PRIVATE 
IPCT_SHARED 

Definition at line 59 of file error.h.

◆ outputmethod

Enumerator
OM_STDERR 
OM_STDOUT 
OM_SYSLOG 
OM_MAX 

Definition at line 69 of file error.h.

Function Documentation

◆ _critical()

void _critical ( const char *const  function_name,
const char *  fmt,
  ... 
)

Definition at line 184 of file error.c.

Here is the call graph for this function:

◆ _error()

void _error ( const char *const  function_name,
const char *  fmt,
  ... 
)

Definition at line 238 of file error.c.

Here is the call graph for this function:

◆ _info()

void _info ( const char *const  function_name,
const char *  fmt,
  ... 
)

Definition at line 270 of file error.c.

Here is the call graph for this function:

◆ _warning()

void _warning ( const char *const  function_name,
const char *  fmt,
  ... 
)

Definition at line 298 of file error.c.

Here is the call graph for this function:

◆ error_deinit()

void error_deinit ( )

Definition at line 389 of file error.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ error_init()

void error_init ( void *  _outputmethod,
int *  _quiet,
int *  _verbose,
int *  _debug 
)

Definition at line 356 of file error.c.

◆ error_init_ipc()

void error_init_ipc ( ipc_type_t  ipc_type)

Definition at line 367 of file error.c.

Here is the call graph for this function: