31 struct Graph *
this = malloc(
sizeof(
struct Graph));
187 if (sourceIdentifier != source) {
198 if (targetIdentifier != target) {
214 if (tailCount < headCount) {
228 if (tailTarget == target) {
250 if (tailTarget == target) {
269 if (headSource == source) {
291 if (headSource == source) {
372 if (0 == lastTail && 0 == lastHead) {
388 }
else if (0 != lastTail && 0 == lastHead) {
412 }
else if (0 == lastTail && 0 != lastHead) {
436 }
else if (0 != lastTail && 0 != lastHead) {
490 if (identifier != target) {
512 if (identifier != source) {
526void Graph_readSources(
const struct Graph *
this,
unsigned int target,
unsigned int length,
unsigned int *sources,
int *error)
538 if (identifier != target) {
549 if (0 == headCount) {
553 if (headCount > length) {
570 unsigned int index = 0;
572 sources[index] = headSource;
576 if (index == length) {
599 sources[index] = headSource;
603void Graph_readTargets(
const struct Graph *
this,
unsigned int source,
unsigned int length,
unsigned int *targets,
int *error)
615 if (identifier != source) {
626 if (0 == tailCount) {
630 if ( tailCount > length) {
647 unsigned int index = 0;
649 targets[index] = tailTarget;
653 if (index == length) {
676 targets[index] = tailTarget;
688 if (identifier != target) {
720 if (identifier != source) {
755 for (
unsigned int index = 0; index < length; index++) {
776void Graph_readCluster(
const struct Graph *
this,
unsigned int predecessor,
unsigned int length,
unsigned int *vertices,
int *error)
788 if (identifier != predecessor) {
794 vertices[0] = predecessor;
798 unsigned int count = 0;
799 unsigned int vertex = predecessor;
803 vertices[count] = vertex;
811 if (vertex == predecessor) {
817 if (count >= length) {
832 if (identifier != predecessor) {
843 if (0 == successor) {
874 if (nextSuccessor != predecessor) {
875 successor = nextSuccessor;
void Graph_import(struct Graph *this, unsigned int index, unsigned int one, unsigned int two, unsigned int three, unsigned int four, unsigned int five, unsigned int six, int *error)
int Graph_hasEdge(const struct Graph *this, unsigned int source, unsigned int target, int *error)
It checks if a graph storage has a directed edge between two vertices.
void Graph_readSources(const struct Graph *this, unsigned int target, unsigned int length, unsigned int *sources, int *error)
It reads all source vertices that have an edge leading to a particular target vertex.
unsigned int Graph_countTargets(const struct Graph *this, unsigned int source, int *error)
It counts all target vertices that have an edge leading from a particular source vertex.
struct Graph * Graph_construct(unsigned int length, int *error)
It constructs a graph storage.
unsigned int Graph_getLength(const struct Graph *this)
unsigned int Graph_countSources(const struct Graph *this, unsigned int target, int *error)
It counts all source vertices that have an edge leading to a particular target vertex.
void Graph_addEdge(struct Graph *this, unsigned int source, unsigned int target, int *error)
It adds a directed edge from a source vertex to a target vertex.
unsigned int Graph_protrudeCluster(struct Graph *this, unsigned int predecessor, int *error)
unsigned int Graph_readLastTarget(const struct Graph *this, unsigned int source, int *error)
It reads the last target vertex of a source vertex, if it exists.
void Graph_export(struct Graph *this, unsigned int index, unsigned int *one, unsigned int *two, unsigned int *three, unsigned int *four, unsigned int *five, unsigned int *six, int *error)
unsigned int Graph_readLastSource(const struct Graph *this, unsigned int target, int *error)
It reads the last source vertex of a target vertex, if it exists.
struct Graph * Graph_destruct(struct Graph *this)
It destructs a graph storage.
void Graph_readCluster(const struct Graph *this, unsigned int predecessor, unsigned int length, unsigned int *vertices, int *error)
void Graph_readTargets(const struct Graph *this, unsigned int source, unsigned int length, unsigned int *targets, int *error)
It reads all target vertices that have an edge leading from a particular source vertex.
unsigned int Graph_addVertex(struct Graph *this, int *error)
It adds a vertex into a graph storage.
void Graph_addCluster(struct Graph *this, unsigned int length, unsigned int *vertices, int *error)
unsigned int Inventory_read(const struct Inventory *this, unsigned int path, int *error)
void Inventory_update(struct Inventory *this, unsigned int path, unsigned int content, int *error)
struct Inventory * Inventory_construct(unsigned int length, int *error)
unsigned int Inventory_getNext(const struct Inventory *this)
void Inventory_append(struct Inventory *this, unsigned int content, int *error)
void Inventory_appendUnchecked(struct Inventory *this, unsigned int content, int *error)
#define ERROR_GRAPH_BUFFER_TOO_SMALL
#define ERROR_NOT_A_VERTEX