Updated README with better build info
[debian/pforth] / csrc / pf_mem.h
1 /* @(#) pf_mem.h 98/01/26 1.3 */
2 #ifndef _pf_mem_h
3 #define _pf_mem_h
4
5 /***************************************************************
6 ** Include file for PForth Fake Memory Allocator
7 **
8 ** Author: Phil Burk
9 ** Copyright 1994 3DO, Phil Burk, Larry Polansky, David Rosenboom
10 **
11 ** Permission to use, copy, modify, and/or distribute this
12 ** software for any purpose with or without fee is hereby granted.
13 **
14 ** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
15 ** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
16 ** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
17 ** THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
18 ** CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
19 ** FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
20 ** CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21 ** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 ***************************************************************/
23
24 #ifdef PF_NO_MALLOC
25
26     #ifdef __cplusplus
27     extern "C" {
28     #endif
29
30     void  pfInitMemoryAllocator( void );
31     char *pfAllocMem( cell_t NumBytes );
32     void  pfFreeMem( void *Mem );
33
34     #ifdef __cplusplus
35     }
36     #endif
37
38 #else
39
40     #ifdef PF_USER_MALLOC
41 /* Get user prototypes or macros from include file.
42 ** API must match that defined above for the stubs.
43 */
44         #include PF_USER_MALLOC
45     #else
46         #define pfInitMemoryAllocator()
47         #define pfAllocMem malloc
48         #define pfFreeMem free
49     #endif
50
51 #endif /* PF_NO_MALLOC */
52
53 #endif /* _pf_mem_h */