doc
c_lib.h
Go to the documentation of this file.
1 /*
2  * cynapses libc functions
3  *
4  * Copyright (c) 2008 by Andreas Schneider <mail@cynapses.org>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * vim: ts=2 sw=2 et cindent
21  */
22 
23 #include <stdlib.h>
24 #include <string.h>
25 
26 #include "c_macro.h"
27 #include "c_alloc.h"
28 #include "c_dir.h"
29 #include "c_file.h"
30 #include "c_list.h"
31 #include "c_path.h"
32 #include "c_rbtree.h"
33 #include "c_string.h"
34 #include "c_time.h"
35 #include "c_private.h"
36 
37 #ifndef UNIT_TESTING
38 #ifdef malloc
39 #undef malloc
40 #endif
41 #define malloc(x) DO_NOT_CALL_MALLOC__USE_C_MALLOC_INSTEAD
42 
43 #ifdef calloc
44 #undef calloc
45 #endif
46 #define calloc(x,y) DO_NOT_CALL_CALLOC__USE_C_CALLOC_INSTEAD
47 
48 #endif
49 
50 #ifdef realloc
51 #undef realloc
52 #endif
53 #define realloc(x,y) DO_NOT_CALL_REALLOC__USE_C_REALLOC_INSTEAD
54 
55 #ifdef dirname
56 #undef dirname
57 #endif
58 #define dirname(x) DO_NOT_CALL_MALLOC__USE_C_DIRNAME_INSTEAD
59 
60 #ifdef basename
61 #undef basename
62 #endif
63 #define basename(x) DO_NOT_CALL_MALLOC__USE_C_BASENAME_INSTEAD
64 
65 #ifdef strdup
66 #undef strdup
67 #endif
68 #define strdup(x) DO_NOT_CALL_STRDUP__USE_C_STRDUP_INSTEAD
69