-
Notifications
You must be signed in to change notification settings - Fork 0
/
dgraph.h
27 lines (20 loc) · 889 Bytes
/
dgraph.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Copyright © 2021-2023 Chee Bin HOH. All rights reserved.
*
* Directed graph.
*/
#ifndef DGRAPH_H_HAS_INCLUDED
#define DGRAPH_H_HAS_INCLUDED
#include "dgraph-internal.h"
typedef void(DGraphTraversalCallback)(struct DGraphNode *from,
struct DGraphNode *, int *stop,
void *data);
struct DGraphNode *addGraphNodeInt(struct DGraph **graph,
struct DGraphNode *from, int val);
void linkDGraphNode(struct DGraphNode *from, struct DGraphNode *node);
void freeGraph(struct DGraph *graph);
struct DGraph *cloneGraphInt(struct DGraph *graph);
void traverseDGraph(struct DGraph *graph, DGraphTraversalCallback func,
void *data);
void traverseDGraphUniquely(struct DGraph *graph, DGraphTraversalCallback func,
void *data);
#endif