/* --------------------------------------------------------------------- */ /* BEGIN COPYRIGHT AND LICENSE NOTICE */ /* --------------------------------------------------------------------- */ /* ** Copyright (c) 2008 by Richard Harter. ** ** Permission is hereby granted, free of charge, to any person ** obtaining a copy of this software and associated documentation ** files (the "Software"), to deal in the Software without ** restriction, including without limitation the rights to use, ** copy, modify, merge, publish, distribute, sublicense, and/or ** sell copies of the Software, and to permit persons to whom the ** Software is furnished to do so, subject to the following ** conditions: ** ** The above copyright notices and this permission notice shall be ** included in all copies or substantial portions of the ** Software. ** ** Derivative works shall include a notice that the software is a ** modified version of the copyrighted software. ** ** There is no guarantee that this software is useful for anything ** or that it is any way correct or of value. The author disclaims ** any responsibility for the consequences of using this software. ** */ /* --------------------------------------------------------------------- */ /* END COPYRIGHT AND LICENSE NOTICE */ /* --------------------------------------------------------------------- */ #ifndef HAVE_GETSPACE_INCLUDE_H #define HAVE_GETSPACE_INCLUDE_H #include #include #include #define HACK_STR(x) HACK_VAL(x) #define HACK_VAL(x) #x #define HACK_CAT(x,y) x##y #define LINELOC __FILE__ ":" HACK_STR(__LINE__) struct cfgspace_s { FILE * fptr; /* error file pointer */ size_t slabsz; /* slab size */ size_t nnode; /* # nodes to fetch */ size_t nh; /* # of address hashes */ size_t nabits; size_t idsize; /* ID print buffer size */ size_t ssz; /* # of small lists */ int ufree; /* calls free flag */ int kslab; /* kill empty slabs flag */ int dbgflag; /* debug flag */ int nokill; /* no kill on error flag */ int zero; /* zero allocated memory */ }; void cfgspace (struct cfgspace_s *); int freespace (void *, char * ); void * getspace (size_t, char * ); void * morespace (void *, size_t, size_t, char *); void printspace (FILE *, char *); size_t queryspace (void *); #endif