Objectively
Object oriented framework for C.
Loading...
Searching...
No Matches
List.h File Reference

Doubly-linked lists of raw C pointers. More...

Go to the source code of this file.

Data Structures

struct  List
 Doubly-linked lists of raw C pointers. More...
 
struct  ListNode
 A node in a List. More...
 

Typedefs

typedef bool(* ListEnumerator) (const List *list, ListNode *node, ident data)
 The ListEnumerator function type.
 

Functions

OBJECTIVELY_EXPORT Class * _List (void)
 

Detailed Description

Doubly-linked lists of raw C pointers.

Definition in file List.h.

Typedef Documentation

◆ ListEnumerator

typedef bool(* ListEnumerator) (const List *list, ListNode *node, ident data)

The ListEnumerator function type.

Parameters
listThe List.
nodeThe current node.
dataUser data.
Returns
True to stop enumeration, false to continue.

Definition at line 44 of file List.h.

Function Documentation

◆ _List()

OBJECTIVELY_EXPORT Class * _List ( void  )

Definition at line 406 of file List.c.

406 {
407 static Class *clazz;
408 static Once once;
409
410 do_once(&once, {
411 clazz = _initialize(&(const ClassDef) {
412 .name = "List",
413 .superclass = _Object(),
414 .instanceSize = sizeof(List),
415 .interfaceSize = sizeof(ListInterface),
416 .initialize = initialize,
417 });
418 });
419
420 return clazz;
421}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition Class.c:151
static void initialize(Class *clazz)
Definition List.c:378
Class * _Object(void)
Definition Object.c:136
long Once
The Once type.
Definition Once.h:37
#define do_once(once, block)
Executes the given block at most one time.
Definition Once.h:43
ClassDefs are passed to _initialize via an archetype to initialize a Class.
Definition Class.h:41
The runtime representation of a Class.
Definition Class.h:90
Doubly-linked lists of raw C pointers.
Definition List.h:60