
Go to the source code of this file.
Functions | |
| void | kb_set_debug_mask (unsigned int mask) |
| void | kb_set_debug_level (unsigned int level) |
| void | kb_set_error_handler (kb_error_handler_t handler) |
| void | kb_vmsg (const char *msg, va_list argptr) |
| void | kb_msg (const char *msg,...) |
| int | kb_vdebug (const char *file, unsigned int line, const char *func, unsigned int mask, const char *msg, va_list argptr) |
| int | kb_debug (const char *file, unsigned int line, const char *func, unsigned int mask, const char *msg,...) |
| int | kb_verror (const char *file, unsigned int line, const char *func, unsigned int error, va_list argptr) |
| int | kb_error (const char *file, unsigned int line, const char *func, unsigned int error,...) |
| int | kb_vwarning (unsigned int error, va_list argptr) |
| int | kb_warning (unsigned int error,...) |
| void | kb_fatal (const char *file, unsigned int line, const char *func, unsigned int error,...) |
Variables | |
| const char * | kb_errmsg [] |
| const char * | kb_warnmsg [] |
| static kb_error_handler_t | kb_user_error_handler = NULL |
| static kb_warning_handler_t | kb_user_warning_handler = NULL |
| unsigned int | kb_debug_level = 0 |
| unsigned int | kb_debug_mask = 0 |
Error Handling
Definition in file kb_error.c.
| int kb_debug | ( | const char * | file, | |
| unsigned int | line, | |||
| const char * | func, | |||
| unsigned int | mask, | |||
| const char * | msg, | |||
| ... | ||||
| ) |
This function displays a debug message on standard output.
| file | caller's source file (usually __FILE__) | |
| line | caller's source line (usually __LINE__) | |
| func | caller's name | |
| mask | debug mask | |
| msg | debug message | |
| ... | list of arguments |
Definition at line 213 of file kb_error.c.
References kb_vdebug().

| int kb_error | ( | const char * | file, | |
| unsigned int | line, | |||
| const char * | func, | |||
| unsigned int | error, | |||
| ... | ||||
| ) |
This function displays an error message on standard error
| file | caller's source file (usually __FILE__) | |
| line | caller's source line (usually __LINE__) | |
| func | caller's name | |
| error | number of the error | |
| ... | list of arguments |
Definition at line 280 of file kb_error.c.
References kb_verror().
Referenced by kb_is_valid_identifier(), kb_parse_alias(), kb_parse_command(), kb_parse_config_file(), kb_parse_device(), kb_parse_modbus(), kb_parse_modbusaddr(), kb_parse_register(), kb_parse_section(), knet_device_destroy(), knet_i2c_init(), knet_i2c_open(), knet_open(), and knet_rs232_open().

| void kb_fatal | ( | const char * | file, | |
| unsigned int | line, | |||
| const char * | func, | |||
| unsigned int | error, | |||
| ... | ||||
| ) |
This function displaya an error message on standard error and exit the application.
| file | caller's source file (usually __FILE__) | |
| line | caller's source line (usually __LINE__) | |
| func | caller's name | |
| error | number of the error | |
| ... | list of arguments |
Definition at line 357 of file kb_error.c.
References KB_EXIT_ON_ERROR, and kb_verror().

| void kb_msg | ( | const char * | msg, | |
| ... | ||||
| ) |
This function displays a message on standard output
| msg | message | |
| ... | list of arguments |
Definition at line 161 of file kb_error.c.
References kb_vmsg().
Referenced by kb_dump_symbol_table(), kb_init(), main(), print_device(), print_register(), and print_section().

| void kb_set_debug_level | ( | unsigned int | level | ) |
This function changes the debug level
| level | New debug level |
Definition at line 126 of file kb_error.c.
References kb_debug_level.
| void kb_set_debug_mask | ( | unsigned int | mask | ) |
This function changes the debug mask
| level | New debug mask |
Definition at line 115 of file kb_error.c.
References kb_debug_mask.
| void kb_set_error_handler | ( | kb_error_handler_t | handler | ) |
This function sets a user error handler
| handler | Pointer to the user error handler |
Definition at line 137 of file kb_error.c.
References kb_user_error_handler.
Referenced by kb_parse_config_file().
| int kb_vdebug | ( | const char * | file, | |
| unsigned int | line, | |||
| const char * | func, | |||
| unsigned int | mask, | |||
| const char * | msg, | |||
| va_list | argptr | |||
| ) |
This function displays a debug message on standard output.
| file | caller's source file (usually __FILE__) | |
| line | caller's source line (usually __LINE__) | |
| func | caller's name | |
| level | debug level | |
| msg | debug message | |
| argptr | list of arguments |
Definition at line 184 of file kb_error.c.
References kb_debug_mask.
Referenced by kb_debug().
| int kb_verror | ( | const char * | file, | |
| unsigned int | line, | |||
| const char * | func, | |||
| unsigned int | error, | |||
| va_list | argptr | |||
| ) |
This function displays an error message on standard error.
| file | caller's source file (usually __FILE__) | |
| line | caller's source line (usually __LINE__) | |
| func | caller's name | |
| error | number of the error | |
| argptr | list of arguments |
Definition at line 241 of file kb_error.c.
References kb_debug_level, kb_errmsg, and kb_user_error_handler.
Referenced by kb_config_error(), kb_error(), and kb_fatal().
| void kb_vmsg | ( | const char * | msg, | |
| va_list | argptr | |||
| ) |
This function displays a message on standard output
| msg | message | |
| argptr | list of arguments |
Definition at line 149 of file kb_error.c.
Referenced by kb_msg().
| int kb_vwarning | ( | unsigned int | error, | |
| va_list | argptr | |||
| ) |
This function displays a warning message on standard error.
| error | number of the error | |
| argptr | list of arguments |
Definition at line 304 of file kb_error.c.
References kb_debug_level, kb_user_warning_handler, and kb_warnmsg.
Referenced by kb_warning().
| int kb_warning | ( | unsigned int | error, | |
| ... | ||||
| ) |
This function displays a warning message on standard error
| error | number of the error | |
| ... | list of arguments |
Definition at line 335 of file kb_error.c.
References kb_vwarning().
Referenced by kb_config_init(), kb_wav_play(), and ksock_next_connection().

| unsigned int kb_debug_level = 0 |
Definition at line 106 of file kb_error.c.
Referenced by kb_set_debug_level(), kb_verror(), and kb_vwarning().
| unsigned int kb_debug_mask = 0 |
| const char* kb_errmsg[] |
Error Messages Error codes are defined in kb_error.h and are always returned as negative integers.
Definition at line 31 of file kb_error.c.
Referenced by kb_verror().
kb_error_handler_t kb_user_error_handler = NULL [static] |
kb_warning_handler_t kb_user_warning_handler = NULL [static] |
| const char* kb_warnmsg[] |
Initial value:
{
"no configuration file available in %s" ,
"unable to open directory '%s'" ,
"Handling client %s",
"i/o error in reading file '%s' !",
"error in playing sample errno=%d",
NULL
}
Definition at line 95 of file kb_error.c.
Referenced by kb_vwarning().
1.5.5