Tenncor
Classes | Functions
list.h File Reference
#include <assert.h>
#include <stdlib.h>
Include dependency graph for list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NumNode
 Node of a decimal linked list. More...
 
struct  NumList
 Decimal linked list. More...
 
struct  PtrNode
 Node of a pointer linked list. More...
 
struct  PtrList
 Pointer linked list. More...
 

Functions

struct NumListnew_numlist (void)
 Return a new decimal linked list. More...
 
void numlist_clear (struct NumList *list)
 Free all nodes in list and reset list head and tail to null. More...
 
void numlist_free (struct NumList *list)
 Clear list then free the list. More...
 
void numlist_pushback (struct NumList *list, double val)
 Append val to linked list. More...
 
struct PtrListnew_ptrlist (size_t type)
 Return a new pointer list of specified enumerated type. More...
 
void ptrlist_clear (struct PtrList *list, void(*val_mgr)(void *))
 
void ptrlist_free (struct PtrList *list, void(*val_mgr)(void *))
 Clear the list using val_mgr, then free the list. More...
 
void ptrlist_pushback (struct PtrList *list, void *val)
 Append the pointer to the list. More...
 

Function Documentation

◆ new_numlist()

struct NumList* new_numlist ( void  )

Return a new decimal linked list.

◆ new_ptrlist()

struct PtrList* new_ptrlist ( size_t  type)

Return a new pointer list of specified enumerated type.

◆ numlist_clear()

void numlist_clear ( struct NumList list)

Free all nodes in list and reset list head and tail to null.

◆ numlist_free()

void numlist_free ( struct NumList list)

Clear list then free the list.

◆ numlist_pushback()

void numlist_pushback ( struct NumList list,
double  val 
)

Append val to linked list.

◆ ptrlist_clear()

void ptrlist_clear ( struct PtrList list,
void(*)(void *)  val_mgr 
)

Frees all node in list and reset list head and tail to null Before freeing for every pointer value x in list call val_mgr(x) if val_mgr is not null

◆ ptrlist_free()

void ptrlist_free ( struct PtrList list,
void(*)(void *)  val_mgr 
)

Clear the list using val_mgr, then free the list.

◆ ptrlist_pushback()

void ptrlist_pushback ( struct PtrList list,
void *  val 
)

Append the pointer to the list.