upgrade to xpdf 3.00.
[swftools.git] / pdf2swf / xpdf / gmem.h
blob587e7fa43c9fd8c14eb1adc459f2369e0be83e3a
1 /*
2 * gmem.h
4 * Memory routines with out-of-memory checking.
6 * Copyright 1996-2003 Glyph & Cog, LLC
7 */
9 #ifndef GMEM_H
10 #define GMEM_H
12 #include <stdio.h>
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
19 * Same as malloc, but prints error message and exits if malloc()
20 * returns NULL.
22 extern void *gmalloc(int size);
25 * Same as realloc, but prints error message and exits if realloc()
26 * returns NULL. If <p> is NULL, calls malloc instead of realloc().
28 extern void *grealloc(void *p, int size);
31 * Same as free, but checks for and ignores NULL pointers.
33 extern void gfree(void *p);
35 #ifdef DEBUG_MEM
37 * Report on unfreed memory.
39 extern void gMemReport(FILE *f);
40 #else
41 #define gMemReport(f)
42 #endif
45 * Allocate memory and copy a string into it.
47 extern char *copyString(char *s);
49 #ifdef __cplusplus
51 #endif
53 #endif