"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "odt2txt-0.4/mem.h" of archive odt2txt-0.4.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 /*
2 * mem.c: memory allocation wrappers with a few simple checks
3 *
4 * Copyright (c) 2002-2008 Dennis Stosberg <dennis@stosberg.net>
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 * version 2 as published by the Free Software Foundation
9 */
10
11 #ifndef MEM_H
12 #define MEM_H
13
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <string.h>
17 #include <stdarg.h>
18 #include <assert.h>
19
20 #ifdef MEMDEBUG
21
22 /**
23 * A container to keep the information about allocated memory.
24 */
25 typedef struct {
26 void *addr;
27 size_t size;
28 const char *file;
29 int line;
30 } MEMINFO;
31
32 #define yfree(p) yfree_dbg(p, __FILE__, __LINE__)
33 void yfree_dbg(void *p, const char *file, int line);
34
35 #define ymalloc(size) ymalloc_dbg(size, __FILE__, __LINE__)
36 void *ymalloc_dbg(size_t size, const char *file, int line);
37
38 #define ycalloc(num, size) ymalloc_dbg(num, size, __FILE__, __LINE__)
39 void *ycalloc_dbg(size_t number, size_t size, const char *file, int line);
40
41 #define yrealloc(p, size) yrealloc_dbg(p, size, __FILE__, __LINE__)
42 void *yrealloc_dbg(void *p, size_t size, const char *file, int line);
43
44 #else
45 #define yfree(p) free(p)
46 #define ymalloc(size) malloc(size)
47 #define ycalloc(num, size) calloc(num, size);
48 #define yrealloc(p, size) realloc(p, size);
49 #endif
50
51 #endif /* MEM_H */