All pastes #274951 Raw Edit

Mine

public text v1 · immutable
·published 2006-12-11 02:50 UTC
rendered paste body
Declaration of my structure:
struct my_silly_structure {
	int count;
	AST_LIST_ENTRY(my_silly_structure) list;
};

Declaration of list:
AST_LIST_HEAD_NOLOCK(silly_structures, my_silly_structure) silly_structures;

To initialize the list:
AST_LIST_HEAD_INIT_NOLOCK(&silly_structures);

To add to tail of list:
AST_LIST_INSERT_TAIL(&silly_structures, structure, list);

To add to head of list:
AST_LIST_INSERT_HEAD(&silly_structures, structure, list);