Go to the documentation of this file.
60 void *(*Alloc)(
unsigned int),
void (*Free)(
void *))
113 static void *StorageTestAlloc(
unsigned int size)
118 static void StorageTestFree(
void *x)
124 static int HostStorageTest01(
void)
146 memset(&a, 0x00,
sizeof(a));
147 a.addr_data32[0] = 0x01020304;
151 printf(
"failed to get host: ");
182 if (ptr1a != ptr1b) {
186 if (ptr2a != ptr2b) {
190 if (ptr3a != ptr3b) {
205 static int HostStorageTest02(
void)
220 memset(&a, 0x00,
sizeof(a));
221 a.addr_data32[0] = 0x01020304;
225 printf(
"failed to get host: ");
241 if (ptr1a != ptr1b) {
256 static int HostStorageTest03(
void)
277 memset(&a, 0x00,
sizeof(a));
278 a.addr_data32[0] = 0x01020304;
282 printf(
"failed to get host: ");
309 if (ptr1a != ptr1b) {
313 if (ptr2a != ptr2b) {
317 if (ptr3a != ptr3b) {
void StorageFreeAll(Storage *storage, StorageEnum type)
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 * 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.