libdom
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
list.h File Reference
#include <stdbool.h>
#include "comparators.h"

Go to the source code of this file.

Classes

struct  list_elt
 
struct  list
 

Typedefs

typedef enum TYPE TYPE
 
typedef struct list list
 

Enumerations

enum  TYPE { INT = 0x0001 , STRING = 0x0100 , DOM_STRING = 0x0101 , NODE = 0x0200 }
 

Functions

struct listlist_new (TYPE type)
 
void list_destroy (struct list *list)
 
void list_add (struct list *list, void *data)
 
bool list_remove (struct list *list, void *data)
 
struct listlist_clone (struct list *list)
 
bool list_contains (struct list *list, void *data, comparator comparator)
 
bool list_contains_all (struct list *superList, struct list *subList, comparator comparator)
 

Typedef Documentation

◆ list

typedef struct list list

◆ TYPE

typedef enum TYPE TYPE

Enumeration Type Documentation

◆ TYPE

enum TYPE
Enumerator
INT 
STRING 
DOM_STRING 
NODE 

Function Documentation

◆ list_add()

void list_add ( struct list * list,
void * data )

Add data to the tail of the list.

◆ list_clone()

struct list * list_clone ( struct list * list)

◆ list_contains()

bool list_contains ( struct list * list,
void * data,
comparator comparator )

Tests if data is equal to any element in the list.

◆ list_contains_all()

bool list_contains_all ( struct list * superList,
struct list * subList,
comparator comparator )

Tests if superlist contains all elements in sublist. Order is not important.

◆ list_destroy()

void list_destroy ( struct list * list)

◆ list_new()

struct list * list_new ( TYPE type)

◆ list_remove()

bool list_remove ( struct list * list,
void * data )

Remove element containing data from list. The list element is freed, but the caller must free the data itself if necessary.

Returns true if data was found in the list.