KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
list.h File Reference

A list type. More...

Go to the source code of this file.

Data Structures

struct  List
 List. More...
 

Macros

#define L_INIT(NAME, ENTRY_SIZE, CAPACITY)
 Convenience Macro, defines and inits list. More...
 

Detailed Description

A list type.

Definition in file list.h.

Macro Definition Documentation

#define L_INIT (   NAME,
  ENTRY_SIZE,
  CAPACITY 
)
Value:
static uint8_t NAME ## Mem[ ( ENTRY_SIZE ) * ( CAPACITY ) ]; \
static const List NAME = { \
.memory = NAME ## Mem, \
.capacity = CAPACITY, \
.length = 0, \
};
void *const memory
first element pointer
Definition: list.h:32
List.
Definition: list.h:31

Convenience Macro, defines and inits list.

Example of how to use it:

L_INIT(myList, sizeof(MyStruct), 100);

Must be used outside of any function scope.

Parameters
NAMEName of the list pointer.
ENTRY_SIZESize in bytes of one element (use sizeof()).
CAPACITYMaximum number of elements in list.

Definition at line 55 of file list.h.