C-Munipack 1.2 / Application programming interface / API reference
C-Munipack 1.2 / Application programming interface / API reference
CmpackOutputLevel | Verbosity level. |
CmpackCallbackType | Callback procedure. |
CmpackConsole | Console context. |
cmpack_con_init | Create a new console context that prints all output to stderr stream. |
cmpack_con_init_cb | Create a new console context that uses a user-defined function to print messages. |
cmpack_con_set_level | Set the debug level. |
C-Munipack functions use a console as an output device for output and debug messages. By default, all messages are thrown away. If you want to print them to standard error stream or process them in a user defined callback, make a console and attach it to an object using cmpack_*_set_console function.
Callback procedure.
typedef void CmpackCallbackType(const char *text, void *user_data)
Prototype for custom callback procedures. The procedure receives the pointer to message string. It points to internal memory buffer, the callee must not free or modify it. The second parameter contains callback registration data.
Console context.
typedef struct _CmpackConsole CmpackConsole
This private structure holds the console parameters
Verbosity level.
enum CmpackOutputLevel
{
CMPACK_LEVEL_QUIET,
CMPACK_LEVEL_NORMAL,
CMPACK_LEVEL_DEBUG
};
CMPACK_LEVEL_QUIET | Be quiet, suppress all messages. |
CMPACK_LEVEL_NORMAL | Print messages, suppress debug output (default). |
CMPACK_LEVEL_DEBUG | Be verbose, print all messages including debug ones. |
Create a new console context that prints all output to stderr stream.
CmpackConsole * cmpack_con_init (void)
pointer to context of zero if failed
Create a new console context that uses a user-defined function to print messages.
CmpackConsole * cmpack_con_init_cb (CmpackCallbackType * cbproc, void * cbdata)
pointer to context of zero if failed
Set the debug level.
void cmpack_con_set_level (CmpackConsole * ctx, CmpackOutputLevel level)
ctx | [in] | any context |
level | [in] | verbosity level (see CMPACK_LEVEL_xxx constants) |