Vertegs is a library with C header files only that provide data types, macros and functions that operate on graphs.
All procedures are implemented for a vertex data type that stores a single pointer that points to the neighbourhood of the vertex. The graph template extends the vertex type with additional member of a type specified by the template parameter. The purpose of this template is to provide an interface for defining intrusive data structures.
Vertegs examples
List
Define a list data type
typedef SomeData MyData;
#define VX_LIST(name, type)
Define the list.
Definition list.h:67
List example "push"
void push(struct MyList** listp, MyData data)
{
struct MyList* entry = malloc(sizeof(*entry));
}
#define vx_graph_datap(graph)
Get a pointer to the data member of a graph node.
Definition graph.h:126
#define vx_list_ins(list,...)
Insert, at a given position, an entry into a list.
Definition list.h:89
Cirq
Define a cirq data type
typedef SomeData MyData;
#define VX_CIRQ(name, type)
Define the cirq.
Definition cirq.h:67
Cirq example "push"
void push(struct MyCirq** headp, MyData data)
{
struct MyCirq* entry = malloc(sizeof(*entry));
}
#define vx_cirq_ins(cirq,...)
Insert, at a given position, an entry into a cirq.
Definition cirq.h:81