#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <time.h>
Go to the source code of this file.
|
#define | DAP_NEW(a) ( (a*) malloc(sizeof(a))) |
|
#define | DAP_NEW_SIZE(a, b) ( (a*) malloc(b)) |
|
#define | DAP_NEW_Z(a) ( (a*) calloc(1,sizeof(a))) |
|
#define | DAP_NEW_Z_SIZE(a, b) ( (a*) calloc(1,b)) |
|
#define | DAP_DELETE(a) free(a) |
|
#define | DAP_DUP(a) (__typeof(a) ret = memcpy(ret,a,sizeof(*a)) ) |
|
#define | DAP_PROTOCOL_VERSION 21 |
|
#define | log_it(_log_level, ...) _log_it(LOG_TAG,_log_level,##__VA_ARGS__) |
|
#define | vlog_it(a_log_level, a_format, a_ap) _vlog_it(LOG_TAG,a_log_level,a_format,a_ap) |
|
#define DAP_DELETE |
( |
|
a | ) |
free(a) |
#define DAP_DUP |
( |
|
a | ) |
(__typeof(a) ret = memcpy(ret,a,sizeof(*a)) ) |
#define DAP_NEW |
( |
|
a | ) |
( (a*) malloc(sizeof(a))) |
#define DAP_NEW_SIZE |
( |
|
a, |
|
|
|
b |
|
) |
| ( (a*) malloc(b)) |
#define DAP_NEW_Z |
( |
|
a | ) |
( (a*) calloc(1,sizeof(a))) |
#define DAP_NEW_Z_SIZE |
( |
|
a, |
|
|
|
b |
|
) |
| ( (a*) calloc(1,b)) |
#define DAP_PROTOCOL_VERSION 21 |
#define log_it |
( |
|
_log_level, |
|
|
|
... |
|
) |
| _log_it(LOG_TAG,_log_level,##__VA_ARGS__) |
#define vlog_it |
( |
|
a_log_level, |
|
|
|
a_format, |
|
|
|
a_ap |
|
) |
| _vlog_it(LOG_TAG,a_log_level,a_format,a_ap) |
The log_level enum.
Enumerator |
---|
L_CRITICAL |
|
L_ERROR |
|
L_WARNING |
|
L_NOTICE |
|
L_INFO |
|
L_DEBUG |
|
void _log_it |
( |
const char * |
log_tag, |
|
|
enum log_level |
ll, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
_log_it Writes information to the log
- Parameters
-
[in] | log_tag | Tag |
[in] | ll | Log level |
[in] | format | |
void _vlog_it |
( |
const char * |
log_tag, |
|
|
enum |
log_level, |
|
|
const char * |
format, |
|
|
va_list |
ap |
|
) |
| |
void dap_common_deinit |
( |
void |
| ) |
|
dap_common_deinit Deinitialise
int dap_common_init |
( |
const char * |
a_log_file | ) |
|
dap_common_init initialise
- Parameters
-
- Returns
char* dap_random_string_create_alloc |
( |
size_t |
a_length | ) |
|
random_string_create Generates a random string
- Parameters
-
- Returns
- a pointer to an array
void dap_random_string_fill |
( |
char * |
str, |
|
|
size_t |
length |
|
) |
| |
random_string_fill Filling a string with random characters
- Parameters
-
[out] | str | A pointer to a char array |
[in] | length | The length of the array or string |
void dap_set_log_tag_width |
( |
size_t |
width | ) |
|
dap_set_log_tag_width Sets the length of the label
- Parameters
-
[in] | width | Length not more than 99 |
char* exec_with_ret |
( |
const char * |
a_cmd | ) |
|
exec_with_ret Executes a command with result return
- Parameters
-
- Returns
- Result
char* exec_with_ret_multistring |
( |
const char * |
a_cmd | ) |
|
exec_with_ret_multistring performs a command with a result return in the form of a multistring
- Parameters
-
- Returns
- Return
int get_select_breaker |
( |
void |
| ) |
|
const char* log_error |
( |
void |
| ) |
|
log_error Error log
- Returns
int send_select_break |
( |
void |
| ) |
|
set_log_level Sets the logging level
- Parameters
-
int time_to_rfc822 |
( |
char * |
out, |
|
|
size_t |
out_size_max, |
|
|
time_t |
t |
|
) |
| |
time_to_rfc822 Convert time_t to string with RFC822 formatted date and time
- Parameters
-
[out] | out | Output buffer |
[out] | out_size_mac | Maximum size of output buffer |
[in] | t | UNIX time |
- Returns
- Length of resulting string if ok or lesser than zero if not