shithub: fuzz

ref: 8afe0c9f26a30d8df583e8ae9025c29a0b6bdd34
dir: /list.h/

View raw version
#ifndef LIST_H
#define LIST_H

/* List (Queue) Architecture */
typedef struct Node Node;
typedef struct List List;

struct Node {
	Node*	next;
	void*	dat;
};

struct List {
	Node*	root;
	int		size;
};

// Create a new list
List mklist(void);

// Append to a list
void ladd(List*, void*);

// Search → delete from a list
void* ldel(List*, void*, int(*comp)(void *, void *));

// Access elements of a list by 'index'
void* lget(List*, int);

#endif