~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/xpdflib/gmem.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2005-02-24 22:09:16 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050224220916-9vxiiqjz066r5489
Tags: 6.0pre23-2
debian/control: Ipe should depend on exact version of libipe.
Closes: #296771.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- C++ -*-
2
 
/*
3
 
 * gmem.h
4
 
 *
5
 
 * Memory routines with out-of-memory checking.
6
 
 *
7
 
 * Copyright 1996-2002 Glyph & Cog, LLC
8
 
 */
9
 
 
10
 
#ifndef GMEM_H
11
 
#define GMEM_H
12
 
 
13
 
#include <stdio.h>
14
 
 
15
 
#ifdef __cplusplus
16
 
extern "C" {
17
 
#endif
18
 
 
19
 
/*
20
 
 * Same as malloc, but prints error message and exits if malloc()
21
 
 * returns NULL.
22
 
 */
23
 
extern void *gmalloc(int size);
24
 
 
25
 
/*
26
 
 * Same as realloc, but prints error message and exits if realloc()
27
 
 * returns NULL.  If <p> is NULL, calls malloc instead of realloc().
28
 
 */
29
 
extern void *grealloc(void *p, int size);
30
 
 
31
 
/*
32
 
 * Same as free, but checks for and ignores NULL pointers.
33
 
 */
34
 
extern void gfree(void *p);
35
 
 
36
 
#ifdef DEBUG_MEM
37
 
/*
38
 
 * Report on unfreed memory.
39
 
 */
40
 
extern void gMemReport(FILE *f);
41
 
#else
42
 
#define gMemReport(f)
43
 
#endif
44
 
 
45
 
/*
46
 
 * Allocate memory and copy a string into it.
47
 
 */
48
 
extern char *copyString(char *s);
49
 
 
50
 
#ifdef __cplusplus
51
 
}
52
 
#endif
53
 
 
54
 
#endif