Contains various helper functions.
More...
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
Go to the source code of this file.
|
| enum | log {
ALL,
INFO,
WARNING,
ERROR,
FATAL
} |
| | Levels of Logging.
|
| |
Contains various helper functions.
Value:({ \
if (ptr == NULL) { \
perror("calloc"); \
exit(EXIT_FAILURE); \
} \
ptr; \
})
#define calloc(NM, S)
wrapper for calloc
Definition: util.h:31
wrapper for calloc
- Parameters
-
- Returns
- pointer to allocated memory
Value:( \
)
#define calloc(NM, S)
wrapper for calloc
Definition: util.h:31
wrapper for malloc
- Parameters
-
- Returns
- pointer to allocated memory
| #define memmove |
( |
|
D, |
|
|
|
S, |
|
|
|
N |
|
) |
| |
Value: if (err != D) { \
perror("memmove"); \
exit(EXIT_FAILURE); \
}
#define memmove(D, S, N)
wraper for memmove
Definition: util.h:19
wraper for memmove
- Parameters
-
| D | destination |
| S | source |
| N | size |
| void cu_init |
( |
void(*)() |
delfn | ) |
|
initializing function for cu internals
- Parameters
-
| delfn | function which shall be called by atexit() |
| void cu_log |
( |
enum log |
level, |
|
|
const char * |
msg |
|
) |
| |
Print a log to target.
- Parameters
-
| level | Level of the Message |
| msg | Message to print |
| void cu_log_level |
( |
enum log |
level | ) |
|
Set the logging Level.
- Parameters
-
| level | Desired logging level |
| void cu_log_target |
( |
FILE * |
fd | ) |
|
Set the logging target.
- Parameters
-