00001 #ifndef NPS_ALLOC_H 00002 #define NPS_ALLOC_H 00003 #include <stdlib.h> /* size_t, and uses in the .c */ 00004 #include "../error/error.h" 00005 00006 #if !defined BUILDING_NPS_ALLOC && !defined NPS_SMALL 00007 # define NPS_ALLOC_LKG static inline 00008 #else 00009 # define NPS_ALLOC_LKG 00010 #endif 00011 00012 /* These two errors can be employed by the _caller_ to indicate the cause of failure */ 00013 extern nps_domain_t NPS_ALLOC; 00014 extern nps_errorType_t NPS_ALLOC_OutOfMemory; 00015 00016 NPS_ALLOC_LKG void *nps_malloc(size_t size); 00017 NPS_ALLOC_LKG void *nps_calloc(size_t nmemb, size_t size); 00018 NPS_ALLOC_LKG void nps_free(void *ptr); 00019 NPS_ALLOC_LKG void *nps_realloc(void *ptr, size_t size); 00020 00021 00022 #endif