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:
| |
| #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. | |
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 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).
| 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 |
1.5.1