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)
145 memset(&a, 0x00,
sizeof(a));
146 a.addr_data32[0] = 0x01020304;
150 printf(
"failed to get host: ");
181 if (ptr1a != ptr1b) {
185 if (ptr2a != ptr2b) {
189 if (ptr3a != ptr3b) {
204 static int HostStorageTest02(
void)
218 memset(&a, 0x00,
sizeof(a));
219 a.addr_data32[0] = 0x01020304;
223 printf(
"failed to get host: ");
239 if (ptr1a != ptr1b) {
254 static int HostStorageTest03(
void)
274 memset(&a, 0x00,
sizeof(a));
275 a.addr_data32[0] = 0x01020304;
279 printf(
"failed to get host: ");
306 if (ptr1a != ptr1b) {
310 if (ptr2a != ptr2b) {
314 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.