Update version number and copyright year.
[exim.git] / src / src / store.h
1 /* $Cambridge: exim/src/src/store.h,v 1.4 2007/01/08 10:50:18 ph10 Exp $ */
2
3 /*************************************************
4 *     Exim - an Internet mail transport agent    *
5 *************************************************/
6
7 /* Copyright (c) University of Cambridge 1995 - 2007 */
8 /* See the file NOTICE for conditions of use and distribution. */
9
10 /* Header for Exim's memory allocation functions */
11
12 #ifndef STORE_H
13 #define STORE_H
14
15 /* Define symbols for identifying the store pools. */
16
17 enum { POOL_MAIN, POOL_PERM, POOL_SEARCH };
18
19 /* This variable (the one for the current pool) is set by store_get() to its
20 yield, and by store_reset() to NULL. This allows string_cat() to optimize its
21 store handling. */
22
23 extern void *store_last_get[3];
24
25 /* This variable contains the current store pool number. */
26
27 extern int store_pool;
28
29 /* Macros for calling the memory allocation routines with
30 tracing information for debugging. */
31
32 #define store_extend(addr,old,new) \
33   store_extend_3(addr, old, new, __FILE__, __LINE__)
34
35 #define store_free(addr)     store_free_3(addr, __FILE__, __LINE__)
36 #define store_get(size)      store_get_3(size, __FILE__, __LINE__)
37 #define store_get_perm(size) store_get_perm_3(size, __FILE__, __LINE__)
38 #define store_malloc(size)   store_malloc_3(size, __FILE__, __LINE__)
39 #define store_release(addr)  store_release_3(addr, __FILE__, __LINE__)
40 #define store_reset(addr)    store_reset_3(addr, __FILE__, __LINE__)
41
42
43 /* The real functions */
44
45 extern BOOL    store_extend_3(void *, int, int, const char *, int);  /* The */
46 extern void    store_free_3(void *, const char *, int);     /* value of the */
47 extern void   *store_get_3(int, const char *, int);         /* 2nd arg is   */
48 extern void   *store_get_perm_3(int, const char *, int);    /* __FILE__ in  */
49 extern void   *store_malloc_3(int, const char *, int);      /* every call,  */
50 extern void    store_release_3(void *, const char *, int);  /* so give its  */
51 extern void    store_reset_3(void *, const char *, int);    /* correct type */
52
53 #endif  /* STORE_H */
54
55 /* End of store.h */