author | sandman <sandman> | 2002-04-13 00:47:20 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-04-13 00:47:20 (UTC) |
commit | 98a1e3f36567639344f12932b629e526a8783aa8 (patch) (unidiff) | |
tree | 0433d296857faceeafc54f7deabddb621f45a933 /noncore/unsupported/qpdf/goo/gmem.h | |
parent | 7e31b1fba119f69929d6744d7295555ff1727f4f (diff) | |
download | opie-98a1e3f36567639344f12932b629e526a8783aa8.zip opie-98a1e3f36567639344f12932b629e526a8783aa8.tar.gz opie-98a1e3f36567639344f12932b629e526a8783aa8.tar.bz2 |
CVS import of QPdf
Diffstat (limited to 'noncore/unsupported/qpdf/goo/gmem.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/goo/gmem.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/unsupported/qpdf/goo/gmem.h b/noncore/unsupported/qpdf/goo/gmem.h new file mode 100644 index 0000000..7ab5ddb --- a/dev/null +++ b/noncore/unsupported/qpdf/goo/gmem.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * gmem.h | ||
3 | * | ||
4 | * Memory routines with out-of-memory checking. | ||
5 | * | ||
6 | * Copyright 1996 Derek B. Noonburg | ||
7 | */ | ||
8 | |||
9 | #ifndef GMEM_H | ||
10 | #define GMEM_H | ||
11 | |||
12 | #include <stdio.h> | ||
13 | |||
14 | #ifdef __cplusplus | ||
15 | extern "C" { | ||
16 | #endif | ||
17 | |||
18 | /* | ||
19 | * Same as malloc, but prints error message and exits if malloc() | ||
20 | * returns NULL. | ||
21 | */ | ||
22 | extern void *gmalloc(int size); | ||
23 | |||
24 | /* | ||
25 | * Same as realloc, but prints error message and exits if realloc() | ||
26 | * returns NULL. If <p> is NULL, calls malloc instead of realloc(). | ||
27 | */ | ||
28 | extern void *grealloc(void *p, int size); | ||
29 | |||
30 | /* | ||
31 | * Same as free, but checks for and ignores NULL pointers. | ||
32 | */ | ||
33 | extern void gfree(void *p); | ||
34 | |||
35 | #ifdef DEBUG_MEM | ||
36 | /* | ||
37 | * Report on unfreed memory. | ||
38 | */ | ||
39 | extern void gMemReport(FILE *f); | ||
40 | #else | ||
41 | #define gMemReport(f) | ||
42 | #endif | ||
43 | |||
44 | /* | ||
45 | * Allocate memory and copy a string into it. | ||
46 | */ | ||
47 | extern char *copyString(char *s); | ||
48 | |||
49 | #ifdef __cplusplus | ||
50 | } | ||
51 | #endif | ||
52 | |||
53 | #endif | ||