elemy-utils 1.0.0
|
#include "elutils/c_decls.h"
Go to the source code of this file.
Data Structures | |
struct | _psl_ndx_t |
Macros | |
#define | PSL_NDX_ELEM_NEXT(ARR_BASE, LINK_FIELD_NAME, NDX) (ARR_BASE[NDX].LINK_FIELD_NAME.next) |
return index of next elem in list More... | |
#define | PSL_NDX_ELEM_PREV(ARR_BASE, LINK_FIELD_NAME, NDX) (ARR_BASE[NDX].LINK_FIELD_NAME.prev) |
#define | PSL_NDX_ELEM_PREV_PTR(ARR_BASE, LINK_FIELD_NAME, NDX) (ARR_BASE[NDX].LINK_FIELD_NAME.prev != -1? &(ARR_BASE[ARR_BASE[NDX].LINK_FIELD_NAME.prev]) : NULL) |
#define | PSL_NDX_ELEM_NEXT_PTR(ARR_BASE, LINK_FIELD_NAME, NDX) (ARR_BASE[NDX].LINK_FIELD_NAME.prev != -1? &(ARR_BASE[ARR_BASE[NDX].LINK_FIELD_NAME.next]) : NULL) |
Typedefs | |
typedef __BEGIN_DECLS struct _psl_ndx_t | psl_ndx_t |
Functions | |
static void | psl_ndx_init (psl_ndx_t *ndx) |
static void | psl_ndx_add_head (psl_ndx_t *base, psl_ndx_t *new_node, psl_ndx_t *next_node, int new_ndx) |
static void | psl_ndx_add_tail (psl_ndx_t *base, psl_ndx_t *new_node, psl_ndx_t *prev_node, int new_ndx) |
Created on: 26 февр. 2024 г. Author: ps
#define PSL_NDX_ELEM_NEXT | ( | ARR_BASE, | |
LINK_FIELD_NAME, | |||
NDX | |||
) | (ARR_BASE[NDX].LINK_FIELD_NAME.next) |
return index of next elem in list
#define PSL_NDX_ELEM_NEXT_PTR | ( | ARR_BASE, | |
LINK_FIELD_NAME, | |||
NDX | |||
) | (ARR_BASE[NDX].LINK_FIELD_NAME.prev != -1? &(ARR_BASE[ARR_BASE[NDX].LINK_FIELD_NAME.next]) : NULL) |
#define PSL_NDX_ELEM_PREV | ( | ARR_BASE, | |
LINK_FIELD_NAME, | |||
NDX | |||
) | (ARR_BASE[NDX].LINK_FIELD_NAME.prev) |
#define PSL_NDX_ELEM_PREV_PTR | ( | ARR_BASE, | |
LINK_FIELD_NAME, | |||
NDX | |||
) | (ARR_BASE[NDX].LINK_FIELD_NAME.prev != -1? &(ARR_BASE[ARR_BASE[NDX].LINK_FIELD_NAME.prev]) : NULL) |
typedef __BEGIN_DECLS struct _psl_ndx_t psl_ndx_t |
Working with lists in arrays
prev and next ptr limits to -1 (wrong index). E.g. [0]{-1, 3} - [3]{0, 4} - [4]{3, 7} - [7]{4, -1}
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |