embeddedlibrary
reusable software modules for embedded systems
list_t Struct Reference

#include <list.h>

Data Fields

list_link_tfirst
 first
 
list_link_tlast
 last
 
uint16_t length
 length
 
uint16_t array_length
 array_length
 
list_link_tlinks
 links
 
uint16_t * item_array
 item_array
 
uint16_t item_size
 item_size
 
sort_fn_t sort_fn
 sort_fn
 
identify_fn_t identify_fn
 identify_fn
 
list_link_tworking [2]
 working
 
list_link_tunlinked [2]
 unlinked
 
list_link_tunused [2]
 unused
 

Detailed Description

Warning
JaH 10/10 The struct list_t is for a doubly-linked list of generic items. Elements of type list_link_t are used, each containing an item pointer, and pointers to next and previous links. first and last list_link_t elements are used to keep track of the ends of the list. length and array_length are used for the current length and maximum declared length of the list, equal to the maximum number of elements. The links list_link_t pointer points to an array of link elements. item_array points to an item array of size item_size. sort_fn and identify_fn function pointers are included, so the user can specify a sorting function and identification function, so that sorting can be performed. working[2], unlinked[2], and unused[2] arrays of link pointers are not strictly necessary, but provide faster operation for interrupt optimization. Working refers to the last elements modified while unlinked can refer to new elements not yet inserted into the list, and unused contains pointers to elements which can be overwritten immediately.
Todo:
Jacob H move (or duplicate) some of the above documentation to the members below and resend to MM

The documentation for this struct was generated from the following file: