Go to the documentation of this file.
60 void *(*Alloc)(
unsigned int),
void (*Free)(
void *))
118 static void *StorageTestAlloc(
unsigned int size)
123 static void StorageTestFree(
void *x)
129 static int HostStorageTest01(
void)
150 memset(&a, 0x00,
sizeof(a));
151 a.addr_data32[0] = 0x01020304;
155 printf(
"failed to get host: ");
186 if (ptr1a != ptr1b) {
190 if (ptr2a != ptr2b) {
194 if (ptr3a != ptr3b) {
209 static int HostStorageTest02(
void)
223 memset(&a, 0x00,
sizeof(a));
224 a.addr_data32[0] = 0x01020304;
228 printf(
"failed to get host: ");
244 if (ptr1a != ptr1b) {
259 static int HostStorageTest03(
void)
279 memset(&a, 0x00,
sizeof(a));
280 a.addr_data32[0] = 0x01020304;
284 printf(
"failed to get host: ");
311 if (ptr1a != ptr1b) {
315 if (ptr2a != ptr2b) {
319 if (ptr3a != ptr3b) {
void StorageFreeAll(Storage *storage, StorageEnum type)
void HostFreeStorageById(Host *h, HostStorageId id)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
HostStorageId HostStorageRegister(const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
Register a Host storage.
void HostRelease(Host *h)
Host * HostGetHostFromHash(Address *a)
void StorageCleanup(void)
void * HostGetStorageById(Host *h, HostStorageId id)
Get a value from a given Host storage.
void RegisterHostStorageTests(void)
void HostFreeStorage(Host *h)
unsigned int HostStorageSize(void)
int StorageFinalize(void)
void HostShutdown(void)
shutdown the flow engine
int StorageSetById(Storage *storage, const StorageEnum type, const int id, void *ptr)
set storage for id
void * StorageAllocByIdPrealloc(Storage *storage, StorageEnum type, int id)
AllocById func for prealloc'd base storage (storage ptrs are part of another memory block)
void StorageFreeById(Storage *storage, StorageEnum type, int id)
void * HostAllocStorageById(Host *h, HostStorageId id)
void HostInitConfig(bool quiet)
initialize the configuration
void * StorageGetById(const Storage *storage, const StorageEnum type, const int id)
get storage for id
int HostSetStorageById(Host *h, HostStorageId id, void *ptr)
Store a pointer in a given Host storage.
unsigned int StorageGetSize(StorageEnum type)
get the size of the void array used to store the pointers
int StorageRegister(const StorageEnum type, const char *name, const unsigned int size, void *(*Alloc)(unsigned int), void(*Free)(void *))
Register new storage.