sanei_debug.h File Reference

Support for printing debug messages. More...

Go to the source code of this file.

Defines

Public macros
These macros can be used in backends and other SANE-related code.

Before including sanei_debug.h, the following macros must be set:

  • BACKEND_NAME - The name of your backend without double-quotes (must be set in any case)
  • STUBS - If this is defined, no macros will be included. Used in backends consisting of more than one .c file.
  • DEBUG_DECLARE_ONLY - Generates prototypes instead of functions. Used in backends consisting of more than one .c file.
  • DEBUG_NOT_STATIC - Doesn't generate static functions. Used in header files if they are include in more than one .c file.


#define ENTRY(name)
 Expands to sane_BACKEND_NAME_name.
#define DBG_LEVEL
 Current debug level.
#define DBG_INIT()
 Initialize sanei_debug.
#define DBG   DBG_LOCAL
 Print a message at debug level `level' or higher using a printf-like function.
#define IF_DBG(x)
 Compile code only if debugging is enabled.


Detailed Description

Support for printing debug messages.

Use the functions of this header file to print debug or warning messages.


Define Documentation

#define ENTRY ( name   ) 

Expands to sane_BACKEND_NAME_name.

Example: ENTRY(init) in mustek.c will expand to sane_mustek_init.

#define DBG_LEVEL

Current debug level.

You can only read this "variable".

 
#define DBG_INIT (  ) 

Initialize sanei_debug.

Call this function before you use any DBG function.

#define DBG   DBG_LOCAL

Print a message at debug level `level' or higher using a printf-like function.

Example: DBG(1, "sane_open: opening fd \%d\\n", fd).

Parameters:
level debug level
fmt format (see man 3 printf for details)
... additional arguments

#define IF_DBG (  ) 

Compile code only if debugging is enabled.

Expands to x if debug support is enabled at compile-time. If NDEBUG is defined at compile-time this macro expands to nothing.

Parameters:
x code to expand when debugging is enabled


Generated on Mon Jan 31 21:43:30 2011 for SANEI by  doxygen 1.5.6