CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
The declarations in this header file correspond to the definitions in list.c. Many of the functions here are static in-line for performance reasons and they don't contain much logic. More...
#include "utilities_api.h"
#include <assert.h>
#include <stddef.h>
#include <stdbool.h>
#include "cdi_os_api.h"
Go to the source code of this file.
Data Structures | |
struct | CdiListEntry |
This structure represents a single list entry. More... | |
struct | CdiList |
This structure represents a list. More... | |
struct | CdiListIterator |
This structure represents a list iterator. More... | |
Typedefs | |
typedef struct CdiListEntry | CdiListEntry |
Forward declaration to create pointer to list entry when used. | |
Functions | |
void | CdiListInit (CdiList *list_ptr) |
static CdiListEntry * | CdiListGetHead (CdiList *list_ptr) |
static bool | CdiListIsEmpty (const CdiList *list_ptr) |
static void | CdiListAddAfter (CdiList *list_ptr, CdiListEntry *new_entry_ptr, CdiListEntry *prev_entry_ptr) |
static void | CdiListAddBefore (CdiList *list_ptr, CdiListEntry *new_entry_ptr, CdiListEntry *next_entry_ptr) |
static void | CdiListAddHead (CdiList *list_ptr, CdiListEntry *new_entry_ptr) |
static void | CdiListAddTail (CdiList *list_ptr, CdiListEntry *new_entry_ptr) |
static CdiListEntry * | CdiListPeek (const CdiList *list_ptr) |
static CdiListEntry * | CdiListPeekTail (const CdiList *list_ptr) |
static void | CdiListRemove (CdiList *list_ptr, CdiListEntry *entry_ptr) |
static CdiListEntry * | CdiListPop (CdiList *list_ptr) |
static int | CdiListCount (const CdiList *list_ptr) |
static void | CdiListIteratorInit (CdiList *list_ptr, CdiListIterator *ret_iterator_ptr) |
static CdiListEntry * | CdiListIteratorGetNext (CdiListIterator *iterator_ptr) |
The declarations in this header file correspond to the definitions in list.c. Many of the functions here are static in-line for performance reasons and they don't contain much logic.
|
inlinestatic |
Add a new entry after the item specified in prev_ptr. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
new_entry_ptr | Pointer to new entry to add to the list. |
prev_entry_ptr | Pointer to entry to add the new item after. |
|
inlinestatic |
Add a new entry before the item specified in next_ptr. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
new_entry_ptr | Pointer to new entry to add to the list. |
next_entry_ptr | Pointer to entry to add the new item before. |
|
inlinestatic |
Add a new entry to the head of the list. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
new_entry_ptr | Pointer to new entry to add to the list. |
|
inlinestatic |
Add a new entry to the tail of the list. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
new_entry_ptr | Pointer to new entry to add to the list. |
|
inlinestatic |
Get the number of items in the list. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
|
inlinestatic |
Get the head pointer of the list. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
void CdiListInit | ( | CdiList * | list_ptr | ) |
Initialize a list. Doesn't need to be inline, since it is only used once for each instance of the list.
NOTE: All the APIs in this file are not thread-safe. However, read list entry APIs that use next_entry_ptr such as CdiListIteratorGetNext() can be used without thread-safe resource locks.
list_ptr | Pointer to instance of the list. |
|
inlinestatic |
Check if the list is empty. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
|
inlinestatic |
Get the next entry in an iterator list. Concerning thread-safety,
iterator_ptr | Pointer to list entry to get the next element. |
|
inlinestatic |
Initialize an iterator list. Concerning thread-safety,
list_ptr | Pointer to list being initialized. |
ret_iterator_ptr | Return pointer of list that was initialized. |
|
inlinestatic |
Return the next head entry of the list. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
|
inlinestatic |
Return the tail entry of the list. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
|
inlinestatic |
Pop an item off the head of the list, removing it from the list. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
|
inlinestatic |
Remove an item from the list. Concerning thread-safety,
list_ptr | Pointer to instance of the list. |
entry_ptr | Pointer to list item to remove. |