Classes | Macros | Typedefs | Enumerations | Functions
GenericList

Classes

struct  list_element_tag
 The list element. More...
 
struct  list_label
 The list structure. More...
 

Macros

#define GENERIC_LIST_LIGHT   (0)
 

Typedefs

typedef struct list_element_taglist_element_handle_t
 
typedef struct list_element_tag list_element_t
 The list element. More...
 
typedef struct list_labellist_handle_t
 
typedef struct list_label list_label_t
 The list structure. More...
 
typedef enum _list_status list_status_t
 The list status. More...
 

Enumerations

enum  _list_status {
  kLIST_Ok = kStatus_Success, kLIST_DuplicateError = MAKE_STATUS(kStatusGroup_LIST, 1), kLIST_Full = MAKE_STATUS(kStatusGroup_LIST, 2), kLIST_Empty = MAKE_STATUS(kStatusGroup_LIST, 3),
  kLIST_OrphanElement = MAKE_STATUS(kStatusGroup_LIST, 4), kLIST_NotSupport = MAKE_STATUS(kStatusGroup_LIST, 5)
}
 The list status. More...
 

Functions

list_status_t LIST_AddHead (list_handle_t list, list_element_handle_t element)
 Links element to the head of the list. More...
 
list_status_t LIST_AddPrevElement (list_element_handle_t element, list_element_handle_t newElement)
 Links an element in the previous position relative to a given member of a list. More...
 
list_status_t LIST_AddTail (list_handle_t list, list_element_handle_t element)
 Links element to the tail of the list. More...
 
uint32_t LIST_GetAvailableSize (list_handle_t list)
 Gets the number of free places in the list. More...
 
list_element_handle_t LIST_GetHead (list_handle_t list)
 Gets head element handle. More...
 
list_handle_t LIST_GetList (list_element_handle_t element)
 Gets the list that contains the given element. More...
 
list_element_handle_t LIST_GetNext (list_element_handle_t element)
 Gets next element handle for given element handle. More...
 
list_element_handle_t LIST_GetPrev (list_element_handle_t element)
 Gets previous element handle for given element handle. More...
 
uint32_t LIST_GetSize (list_handle_t list)
 Gets the current size of a list. More...
 
void LIST_Init (list_handle_t list, uint32_t max)
 Initialize the list. More...
 
list_status_t LIST_RemoveElement (list_element_handle_t element)
 Unlinks an element from its list. More...
 
list_element_handle_t LIST_RemoveHead (list_handle_t list)
 Unlinks element from the head of the list. More...
 

Detailed Description

Macro Definition Documentation

◆ GENERIC_LIST_LIGHT

#define GENERIC_LIST_LIGHT   (0)

Include


Public macro definitions

Definition at line 30 of file generic_list.h.

Typedef Documentation

◆ list_element_handle_t

◆ list_element_t

The list element.

◆ list_handle_t

typedef struct list_label * list_handle_t

◆ list_label_t

typedef struct list_label list_label_t

The list structure.

◆ list_status_t

The list status.


Public type definitions

Enumeration Type Documentation

◆ _list_status

The list status.


Public type definitions

Enumerator
kLIST_Ok 

Success

kLIST_DuplicateError 

Duplicate Error

kLIST_Full 

FULL

kLIST_Empty 

Empty

kLIST_OrphanElement 

Orphan Element

kLIST_NotSupport 

Not Support

Definition at line 38 of file generic_list.h.

Function Documentation

◆ LIST_AddHead()

list_status_t LIST_AddHead ( list_handle_t  list,
list_element_handle_t  element 
)

Links element to the head of the list.

Parameters
list- Handle of the list.
element- Handle of the element.
Return values
kLIST_Fullif list is full, kLIST_Ok if insertion was successful.

Parameters
[in]list- ID of list to insert into. element - element to add
Returns
kLIST_Full if list is full. kLIST_Ok if insertion was successful.
Precondition
Postcondition
Remarks

Definition at line 152 of file generic_list.c.

◆ LIST_AddPrevElement()

list_status_t LIST_AddPrevElement ( list_element_handle_t  element,
list_element_handle_t  newElement 
)

Links an element in the previous position relative to a given member of a list.

Parameters
list- Handle of the list.
element- Handle of the element.
newElement- New element to insert before the given member.
Return values
kLIST_OrphanElementif element is not part of any list.
kLIST_Okif removal was successful.

Parameters
[in]element- ID of a member of a list. newElement - new element to insert before the given member.
Returns
kLIST_OrphanElement if element is not part of any list. kLIST_Full if list is full. kLIST_Ok if insertion was successful.
Precondition
Postcondition
Remarks

Definition at line 381 of file generic_list.c.

◆ LIST_AddTail()

list_status_t LIST_AddTail ( list_handle_t  list,
list_element_handle_t  element 
)

Links element to the tail of the list.

Parameters
list- Handle of the list.
element- Handle of the element.
Return values
kLIST_Fullif list is full, kLIST_Ok if insertion was successful.

Parameters
[in]list- ID of list to insert into. element - element to add
Returns
kLIST_Full if list is full. kLIST_Ok if insertion was successful.
Precondition
Postcondition
Remarks

Definition at line 106 of file generic_list.c.

◆ LIST_GetAvailableSize()

uint32_t LIST_GetAvailableSize ( list_handle_t  list)

Gets the number of free places in the list.

Parameters
list- Handle of the list.
Return values
Availablesize of the list.

Parameters
[in]list- ID of the list.
Returns
Available size of the list.
Precondition
Postcondition
Remarks

Definition at line 472 of file generic_list.c.

◆ LIST_GetHead()

list_element_handle_t LIST_GetHead ( list_handle_t  list)

Gets head element handle.

Parameters
list- Handle of the list.
Return values
NULLif list is empty, handle of removed element(pointer) if removal was successful.

Gets head element handle.


Parameters
[in]list- ID of list.
Returns
NULL if list is empty. ID of head element if list is not empty.
Precondition
Postcondition
Remarks

Definition at line 246 of file generic_list.c.

◆ LIST_GetList()

list_handle_t LIST_GetList ( list_element_handle_t  element)

Gets the list that contains the given element.

Parameters
element- Handle of the element.
Return values
NULLif element is orphan, Handle of the list the element is inserted into.

Parameters
[in]element- Handle of the element.
Returns
NULL if element is orphan. Handle of the list the element is inserted into.
Precondition
Postcondition
Remarks

Definition at line 85 of file generic_list.c.

◆ LIST_GetNext()

list_element_handle_t LIST_GetNext ( list_element_handle_t  element)

Gets next element handle for given element handle.

Parameters
element- Handle of the element.
Return values
NULLif list is empty, handle of removed element(pointer) if removal was successful.

Gets next element handle for given element handle.


Parameters
[in]element- ID of the element.
Returns
NULL if element is tail. ID of next element if exists.
Precondition
Postcondition
Remarks

Definition at line 266 of file generic_list.c.

◆ LIST_GetPrev()

list_element_handle_t LIST_GetPrev ( list_element_handle_t  element)

Gets previous element handle for given element handle.

Parameters
element- Handle of the element.
Return values
NULLif list is empty, handle of removed element(pointer) if removal was successful.

Gets previous element handle for given element handle.


Parameters
[in]element- ID of the element.
Returns
NULL if element is head. ID of previous element if exists.
Precondition
Postcondition
Remarks

Definition at line 286 of file generic_list.c.

◆ LIST_GetSize()

uint32_t LIST_GetSize ( list_handle_t  list)

Gets the current size of a list.

Parameters
list- Handle of the list.
Return values
Currentsize of the list.

Parameters
[in]list- ID of the list.
Returns
Current size of the list.
Precondition
Postcondition
Remarks

Definition at line 453 of file generic_list.c.

◆ LIST_Init()

void LIST_Init ( list_handle_t  list,
uint32_t  max 
)

Initialize the list.


Public prototypes

This function initialize the list.

Parameters
list- List handle to initialize.
max- Maximum number of elements in list. 0 for unlimited.

Initialize the list.


Public functions


Parameters
[in]list- LIST_ handle to init. max - Maximum number of elements in list. 0 for unlimited.
Returns
void.
Precondition
Postcondition
Remarks

Definition at line 62 of file generic_list.c.

◆ LIST_RemoveElement()

list_status_t LIST_RemoveElement ( list_element_handle_t  element)

Unlinks an element from its list.

Parameters
element- Handle of the element.
Return values
kLIST_OrphanElementif element is not part of any list.
kLIST_Okif removal was successful.

Parameters
[in]element- ID of the element to remove.
Returns
kLIST_OrphanElement if element is not part of any list. kLIST_Ok if removal was successful.
Precondition
Postcondition
Remarks

Definition at line 310 of file generic_list.c.

◆ LIST_RemoveHead()

list_element_handle_t LIST_RemoveHead ( list_handle_t  list)

Unlinks element from the head of the list.

Parameters
list- Handle of the list.
Return values
NULLif list is empty, handle of removed element(pointer) if removal was successful.

Parameters
[in]list- ID of list to remove from.
Returns
NULL if list is empty. ID of removed element(pointer) if removal was successful.
Precondition
Postcondition
Remarks

Definition at line 198 of file generic_list.c.



picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:09