FreeBASIC
0.91.0
|
#include "fb.h"
Go to the source code of this file.
Functions | |
void | fb_hListInit (FB_LIST *list, void *table, size_t elem_size, size_t size) |
Initializes a list. More... | |
FB_LISTELEM * | fb_hListAllocElem (FB_LIST *list) |
Allocate a new list element. More... | |
void | fb_hListFreeElem (FB_LIST *list, FB_LISTELEM *elem) |
Free a list element. More... | |
FB_LISTELEM* fb_hListAllocElem | ( | FB_LIST * | list) |
Allocate a new list element.
This function gets an element from the list of free elements ( struct _FB_LIST::fhead ) and adds to the tail. It also increases the number of used elements ( struct _FB_LIST::cnt ).
list | Pointer to the list structure. |
Definition at line 47 of file list.c.
void fb_hListFreeElem | ( | FB_LIST * | list, |
FB_LISTELEM * | elem | ||
) |
Free a list element.
This function frees a list element by removing it from the list of used elements and adding it to the list of free elements ( struct _FB_LIST::fhead ). It also decreses the number of used elements ( struct _FB_LIST::cnt ).
list | Pointer to the list structure. |
elem | List element to add to the list of free elements. |
Definition at line 74 of file list.c.
void fb_hListInit | ( | FB_LIST * | list, |
void * | table, | ||
size_t | elem_size, | ||
size_t | size | ||
) |
Initializes a list.
This list implementation is based on a static array.
list | Pointer to list structure to initialize. |
table | Pointer to the pool of available list elements. |
elem_size | Size of elements in the array. |
size | Number of elements in the array. |
Definition at line 14 of file list.c.