static StorageList *storage_list = NULL;
static int storage_max_id[STORAGE_MAX];
-static int storage_registraton_closed = 0;
+static int storage_registration_closed = 0;
static StorageMapping **storage_map = NULL;
static const char *StoragePrintType(StorageEnum type)
memset(&storage_max_id, 0x00, sizeof(storage_max_id));
storage_list = NULL;
storage_map = NULL;
- storage_registraton_closed = 0;
+ storage_registration_closed = 0;
}
void StorageCleanup(void)
int StorageRegister(const StorageEnum type, const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void (*Free)(void *))
{
- if (storage_registraton_closed)
+ if (storage_registration_closed)
return -1;
if (type >= STORAGE_MAX || name == NULL || strlen(name) == 0 ||
int count = 0;
int i;
- storage_registraton_closed = 1;
+ storage_registration_closed = 1;
for (i = 0; i < STORAGE_MAX; i++) {
if (storage_max_id[i] > 0)
void *StorageGetById(const Storage *storage, const StorageEnum type, const int id)
{
#ifdef DEBUG
- BUG_ON(!storage_registraton_closed);
+ BUG_ON(!storage_registration_closed);
#endif
SCLogDebug("storage %p id %d", storage, id);
if (storage == NULL)
int StorageSetById(Storage *storage, const StorageEnum type, const int id, void *ptr)
{
#ifdef DEBUG
- BUG_ON(!storage_registraton_closed);
+ BUG_ON(!storage_registration_closed);
#endif
SCLogDebug("storage %p id %d", storage, id);
if (storage == NULL)
void *StorageAllocByIdPrealloc(Storage *storage, StorageEnum type, int id)
{
#ifdef DEBUG
- BUG_ON(!storage_registraton_closed);
+ BUG_ON(!storage_registration_closed);
#endif
SCLogDebug("storage %p id %d", storage, id);
void *StorageAllocById(Storage **storage, StorageEnum type, int id)
{
#ifdef DEBUG
- BUG_ON(!storage_registraton_closed);
+ BUG_ON(!storage_registration_closed);
#endif
SCLogDebug("storage %p id %d", storage, id);
void StorageFreeById(Storage *storage, StorageEnum type, int id)
{
#ifdef DEBUG
- BUG_ON(!storage_registraton_closed);
+ BUG_ON(!storage_registration_closed);
#endif
#ifdef UNITTESTS
if (storage_map == NULL)
if (storage == NULL)
return;
#ifdef DEBUG
- BUG_ON(!storage_registraton_closed);
+ BUG_ON(!storage_registration_closed);
#endif
#ifdef UNITTESTS
if (storage_map == NULL)
return;
#ifdef DEBUG
- BUG_ON(!storage_registraton_closed);
+ BUG_ON(!storage_registration_closed);
#endif
#ifdef UNITTESTS
if (storage_map == NULL)