SANEI 1.3.1.76-0750
|
Support for printing debug messages. More...
Go to the source code of this file.
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:
| |
#define | ENTRY(name) |
Expands to sane_BACKEND_NAME_name. More... | |
#define | DBG_LEVEL |
Current debug level. More... | |
#define | DBG_INIT() |
Initialize sanei_debug. More... | |
#define | DBG_LOCAL |
Expands to sane_BACKEND_NAME_name. More... | |
#define | DBG |
Print a message at debug level ‘level’ or higher using a printf-like function. More... | |
#define | IF_DBG(x) |
Compile code only if debugging is enabled. More... | |
void | sanei_debug_msg (int level, int max_level, const char *be, const char *fmt, va_list ap) |
Expands to sane_BACKEND_NAME_name. More... | |
void | sanei_init_debug (const char *backend, int *debug_level_var) |
Expands to sane_BACKEND_NAME_name. More... | |
Support for printing debug messages.
Use the functions of this header file to print debug or warning messages.
#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_LOCAL |
Expands to sane_BACKEND_NAME_name.
Example: ENTRY(init) in mustek.c will expand to sane_mustek_init.
#define DBG |
Print a message at debug level ‘level’ or higher using a printf-like function.
Example: DBG(1, "sane_open: opening fd \%d\\n", fd).
level | debug level |
fmt | format (see man 3 printf for details) |
... | additional arguments |
#define IF_DBG | ( | x | ) |
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.
x | code to expand when debugging is enabled |
void sanei_debug_msg | ( | int | level, |
int | max_level, | ||
const char * | be, | ||
const char * | fmt, | ||
va_list | ap | ||
) |
Expands to sane_BACKEND_NAME_name.
Example: ENTRY(init) in mustek.c will expand to sane_mustek_init.
void sanei_init_debug | ( | const char * | backend, |
int * | debug_level_var | ||
) |
Expands to sane_BACKEND_NAME_name.
Example: ENTRY(init) in mustek.c will expand to sane_mustek_init.