#include "common.h"
#include <stdlib.h>
#include "xmalloc.h"
#include "assert.h"
#include "mlist_tmpl_h.inc"
Include dependency graph for mlist_tmpl_c.inc:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
This module contains a data type independant doubly linked list template. It can easily be customized for new data types by defining ML_LIST_NAME
, which becomes the name of the new list "class", ML_FUNC_PFX
, which is prepended to all function names listed below, and MlCargo
which must expand to the actual data type to be stored in the list.
In case the list should store a non-integral data type like a struct the macro ML_INVALID
must be defined whose value is returned as an error indicator by functions returning an MlCargo
object. If undefined ML_INVALID
is set to 0L
which should be a reasonable default in many cases.
Following things can be defined optionally:
ML_IS_VALID_CARGO(cargo)
true
if cargo
is valid. Defaults to !cargo
!
= ML_INVALID
".ML_CREATE_CARGO(cargo)
cargo
so actual data can be stored in it. Defaults to a NOOP.ML_COPY_CARGO(dest, source)
MlCargo
object source
into dest
. dest
will have been prepared using ML_CREATE_CARGO, if nessessary. Defaults to "dest
= \c
source".ML_FREE_CARGO(cargo)
ML_FREE_CARGO
is used on MlCargo
objects which have been prepared using ML_CREATE_CARGO
and are no longer used. Should free all ressources allocated by ML_CREATE_CARGO
. Defaults to a NOOP.
Definition in file mlist_tmpl_c.inc.