chiark / gitweb /
Create readable text `.bas' for each tokenized BASIC `,ffb' file.
[ssr] / StraySrc / Glass / !Glass / h / indir
1 /*
2  * indir.h
3  *
4  * Control of indirected data allocation
5  *
6  * © 1994-1998 Straylight
7  */
8
9 /*----- Licensing note ----------------------------------------------------*
10  *
11  * This file is part of Straylight's Glass.
12  *
13  * Glass is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2, or (at your option)
16  * any later version.
17  *
18  * Glass is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with Glass.  If not, write to the Free Software Foundation,
25  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26  */
27
28 #ifndef __indir_h
29 #define __indir_h
30
31 /*----- External routines -------------------------------------------------*/
32
33 #ifndef __size_t
34 #define __size_t 1
35 typedef unsigned int size_t;   /* from <stddef.h> */
36 #endif
37
38 /*
39  * void indir_init(void)
40  *
41  * Use
42  *  Jumps in to ensure that indir gets the first flex block, so it doesn't
43  *  move.
44  */
45
46 void indir_init(void);
47
48 /*
49  * void *indir_alloc(int size)
50  *
51  * Use
52  *  Allocate memory from heap.
53  *
54  * Parameters
55  *  int size == the number of bytes the caller wants
56  */
57
58 void *indir_alloc(size_t size);
59
60 /*
61  * void indir_free(void *p)
62  *
63  * Use
64  *  Reclaims the memory from the block pointed to by p.  Some simple checks
65  *  are used to ensure that p is valid.
66  *
67  * Parameters
68  *  void *p == pointer to a block to free.
69  */
70
71 void indir_free(void *p);
72
73 /*
74  * void *indir_realloc(void *p,int newsize)
75  *
76  * Use
77  *  Resizes a heap block.
78  *
79  * Parameters
80  *  void *p == pointer to block to resize
81  *  int newsize == the new size to make it
82  *
83  * Returns
84  *  Pointer to the block (may have moved) or 0 (failure, block didn't move)
85  */
86
87 void *indir_realloc(void *p,int newsize);
88
89 /*
90  * void indir_heapInfo(void)
91  *
92  * Use
93  *  Displays a dialogue box showing current heap stats
94  */
95
96 void indir_heapInfo(void);
97
98 #endif