aboutsummaryrefslogtreecommitdiff
path: root/src/include/util.h
blob: cfc85c2cf0759d6b6d9710b78e28e4138e2a7796 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef UTIL_H
#define UTIL_H

#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>


/* log some debug information */
void log_dbg(const char*, ...);
/* log some information */
void log_inf(const char*, ...);
/* log something with no formatting */
void log_raw(const char*, ...);
/* log a warning */
void log_war(const char*, ...);
/* log an error */
void log_err(const char*, ...);
/* die and leave message */
void die(const char*, ...);

/* if calloc() returns null, die */
void* ecalloc(size_t, size_t);
/* if malloc() returns null, die */
void* emalloc(size_t);
/* if realloc() returns null, die */
void* erealloc(void*, size_t);

#endif