Objectively
Ultra-lightweight object oriented framework for GNU 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 385 of file List.c.

385 {
386 static Class *clazz;
387 static Once once;
388
389 do_once(&once, {
390 clazz = _initialize(&(const ClassDef) {
391 .name = "List",
392 .superclass = _Object(),
393 .instanceSize = sizeof(List),
394 .interfaceOffset = offsetof(List, interface),
395 .interfaceSize = sizeof(ListInterface),
397 });
398 });
399
400 return clazz;
401}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition Class.c:86
static void initialize(Class *clazz)
Definition List.c:358
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:95
Doubly-linked lists of raw C pointers.
Definition List.h:60