X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fmem.h;fp=src%2Fmem.h;h=9930761368911746e79e6422166bd5c071a45809;hb=85718e4dcaf5f34496f629e45a47ec91145c6f9e;hp=0000000000000000000000000000000000000000;hpb=abb2bffe08424d2d7e612f423815aeb7c79b42de;p=iptables.git diff --git a/src/mem.h b/src/mem.h new file mode 100644 index 0000000..9930761 --- /dev/null +++ b/src/mem.h @@ -0,0 +1,48 @@ +/* + Copyright (C) Slava Astashonok + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License. + + $Id: mem.h,v 1.1.1.1.2.3 2004/08/13 20:40:43 sla Exp $ +*/ + +#ifndef _MEM_H_ +#define _MEM_H_ + +#if MEM_BITS != 0 && MEM_BITS != 8 && MEM_BITS != 16 +#error illegal value in MEM_BITS +#endif + +#if defined _REENTRANT || defined _THREAD_SAFE +#define MEM_THREADSAFE +#endif + +#include + +#if MEM_BITS == 0 +typedef void* mem_index_t; +#endif +#if MEM_BITS == 8 +typedef uint8_t mem_index_t; +#endif +#if MEM_BITS == 16 +typedef uint16_t mem_index_t; +#endif + +void *mem_alloc(); +void mem_free(void *); +int mem_init(unsigned int, unsigned int, unsigned int); + +struct Mem { + struct Mem *next; + unsigned int free; + void *first; + void *last; + /* + mem_index_t mem_index_table[bulk_quantity] + struct UserDef element_table[bulk_quantity] + */ +}; + +#endif