VSF Documented
Macros | Functions
vsf_list.c File Reference
#include "utilities/vsf_utilities_cfg.h"
#include "vsf_list.h"

Macros

#define __vsf_get_slist_address(__node_ptr, __offset)    ((vsf_slist_t *)(((uint8_t *)(__node_ptr)) + (__offset)))
 

Functions

uint_fast16_t __vsf_slist_get_length_imp (vsf_slist_t *this_ptr, size_t list_offset)
 calculate the length of the target list !
 
void * __vsf_slist_get_item_by_index_imp (vsf_slist_t *this_ptr, uint_fast16_t index, size_t list_offset)
 get the specified item with a given index from the target list !
 
int_fast16_t __vsf_slist_get_index_imp (vsf_slist_t *this_ptr, void *item, size_t list_offset)
 find the index number of a given item from the target list !
 
void * __vsf_slist_remove_imp (vsf_slist_t *this_ptr, void *item, size_t list_offset)
 remove a item from the target list !
 
void * __vsf_slist_append_imp (vsf_slist_t *this_ptr, void *item, size_t list_offset)
 append a item to the target list !
 
void * __vsf_slist_remove_tail_imp (vsf_slist_t *this_ptr, size_t list_offset)
 
uint_fast16_t __vsf_dlist_get_length_imp (vsf_dlist_t *this_ptr)
 
bool __vsf_dlist_is_in_imp (vsf_dlist_t *this_ptr, vsf_dlist_node_t *node)
 
void __vsf_dlist_add_to_head_imp (vsf_dlist_t *this_ptr, vsf_dlist_node_t *node)
 
void __vsf_dlist_add_to_tail_imp (vsf_dlist_t *this_ptr, vsf_dlist_node_t *node)
 
vsf_dlist_node_t__vsf_dlist_remove_head_imp (vsf_dlist_t *this_ptr)
 
vsf_dlist_node_t__vsf_dlist_remove_tail_imp (vsf_dlist_t *this_ptr)
 
void __vsf_dlist_insert_after_imp (vsf_dlist_t *this_ptr, vsf_dlist_node_t *node_prv, vsf_dlist_node_t *node)
 
void __vsf_dlist_insert_before_imp (vsf_dlist_t *this_ptr, vsf_dlist_node_t *node_nxt, vsf_dlist_node_t *node)
 
void __vsf_dlist_remove_imp (vsf_dlist_t *this_ptr, vsf_dlist_node_t *node)
 

Macro Definition Documentation

◆ __vsf_get_slist_address

#define __vsf_get_slist_address (   __node_ptr,
  __offset 
)     ((vsf_slist_t *)(((uint8_t *)(__node_ptr)) + (__offset)))

Function Documentation

◆ __vsf_slist_get_length_imp()

uint_fast16_t __vsf_slist_get_length_imp ( vsf_slist_t this_ptr,
size_t  list_offset 
)

calculate the length of the target list !

Parameters
this_ptraddress of the target list !
list_offsetthe list offset in byte within a host type !
Returns
the length of the list

◆ __vsf_slist_get_item_by_index_imp()

void * __vsf_slist_get_item_by_index_imp ( vsf_slist_t this_ptr,
uint_fast16_t  index,
size_t  list_offset 
)

get the specified item with a given index from the target list !

Parameters
this_ptraddress of the target list !
indexindex number of the wanted item !
list_offsetthe list offset in byte within a host type !
Return values
NULLIllegal input !
!NULLthe address of the wanted item

◆ __vsf_slist_get_index_imp()

int_fast16_t __vsf_slist_get_index_imp ( vsf_slist_t this_ptr,
void *  item,
size_t  list_offset 
)

find the index number of a given item from the target list !

Parameters
this_ptraddress of the target list !
itemaddress of the target item !
list_offsetthe list offset in byte within a host type !
Returns
the index number, (-1) means illegal input or the item doesn't exist

◆ __vsf_slist_remove_imp()

void * __vsf_slist_remove_imp ( vsf_slist_t this_ptr,
void *  item,
size_t  list_offset 
)

remove a item from the target list !

Parameters
this_ptraddress of the target list !
itemaddress of the target item !
list_offsetthe list offset in byte within a host type !
Return values
NULLIllegal input !
!NULLthe address of the removed item

remove the target item

cut the item off from the list

◆ __vsf_slist_append_imp()

void * __vsf_slist_append_imp ( vsf_slist_t this_ptr,
void *  item,
size_t  list_offset 
)

append a item to the target list !

append a item from the target list !

Parameters
this_ptraddress of the target list !
itemaddress of the target item !
list_offsetthe list offset in byte within a host type !
Return values
NULLIllegal input !
!NULLthe address of the appended item

< append the item

◆ __vsf_slist_remove_tail_imp()

void * __vsf_slist_remove_tail_imp ( vsf_slist_t this_ptr,
size_t  list_offset 
)

◆ __vsf_dlist_get_length_imp()

uint_fast16_t __vsf_dlist_get_length_imp ( vsf_dlist_t this_ptr)

◆ __vsf_dlist_is_in_imp()

bool __vsf_dlist_is_in_imp ( vsf_dlist_t this_ptr,
vsf_dlist_node_t node 
)

◆ __vsf_dlist_add_to_head_imp()

void __vsf_dlist_add_to_head_imp ( vsf_dlist_t this_ptr,
vsf_dlist_node_t node 
)

◆ __vsf_dlist_add_to_tail_imp()

void __vsf_dlist_add_to_tail_imp ( vsf_dlist_t this_ptr,
vsf_dlist_node_t node 
)

◆ __vsf_dlist_remove_head_imp()

vsf_dlist_node_t * __vsf_dlist_remove_head_imp ( vsf_dlist_t this_ptr)

◆ __vsf_dlist_remove_tail_imp()

vsf_dlist_node_t * __vsf_dlist_remove_tail_imp ( vsf_dlist_t this_ptr)

◆ __vsf_dlist_insert_after_imp()

void __vsf_dlist_insert_after_imp ( vsf_dlist_t this_ptr,
vsf_dlist_node_t node_prv,
vsf_dlist_node_t node 
)

◆ __vsf_dlist_insert_before_imp()

void __vsf_dlist_insert_before_imp ( vsf_dlist_t this_ptr,
vsf_dlist_node_t node_nxt,
vsf_dlist_node_t node 
)

◆ __vsf_dlist_remove_imp()

void __vsf_dlist_remove_imp ( vsf_dlist_t this_ptr,
vsf_dlist_node_t node 
)