1 #ifndef _LIBSAPLING_GRAPH_H_
2 #define _LIBSAPLING_GRAPH_H_
98 typedef struct edge_storage *node_t;
152 typedef void (*
fpfdata_t)(FILE *stream,
const void *data);
237 fpfdata_t fpfdata,
const char *graph_attributes);
void(* apply_t)(node_t *ref, const struct info_stack *info)
Performs a user-defined operation on the node.
Definition: graph.h:117
void graph__access(enum qt qt, node_t *ref, const struct info_stack *info, predicate_t predicate, apply_t apply, next_t next)
Access protocol. Traverses the graph according to a quantifier modifier and specific implementation w...
void(* fpfdata_t)(FILE *stream, const void *data)
File print format data function prototype.
Definition: graph.h:152
int graph__length(const node_t *ref, all_access_adapter_fn access_adapter)
Returns the number of items contained in the set.
int(* predicate_t)(const node_t *ref, const struct info_stack *info)
Decides whether to run the apply function on an item. Behavior is modified by quantifiers.
Definition: graph.h:112
void graph__print(FILE *stream, node_t *ref, all_access_adapter_fn access_adapter, fpfnode_t fpfnode, fpfdata_t fpfdata)
Prints all the data contained in the set.
void graph__delete(node_t *ref, const struct info_stack *info, edge_management_t edge_management)
Deletion protocol.
void * graph__data(const node_t node, size_t edge_storage)
Returns a pointer to the data storage of a node.
void graph__dump_dot(FILE *stream, node_t *ref, all_access_adapter_fn access_adapter, fpfnode_t fpfnode, fpfdata_t fpfdata, const char *graph_attributes)
Dumps the graph in the DOT graph description language.
int predicate_1(UNUSED const node_t *ref, UNUSED const struct info_stack *info)
Trivial predicate function that always returns 1.
int(* next_t)(node_t **ref, const struct info_stack *info)
Chooses the next node to visit.
Definition: graph.h:124
void graph__insert(node_t *ref, const struct info_stack *info, edge_management_t edge_management, size_t edge_storage)
Insertion protocol.
void(* edge_management_t)(node_t *ref, const node_t node, void *impl_ptr)
Called upon the insertion and deletion protocols.
Definition: graph.h:146
void(* fpfnode_t)(FILE *stream, const node_t node, fpfdata_t fpfdata, void *impl_ptr)
File print format node function prototype.
Definition: graph.h:157
void(* all_access_adapter_fn)(node_t *ref, void *info, apply_t apply)
Generic access all nodes adapter function prototype.
Definition: graph.h:167
int predicate_0(UNUSED const node_t *ref, UNUSED const struct info_stack *info)
Trivial predicate function that always returns 0.
#define UNUSED
Decorator to mark unused function parameters.
Definition: idiom.h:11
Logic related definitions.
qt
Quantifier definitions.
Definition: logic.h:10
Information required to perform insertion.
Definition: graph.h:92
void * info
Definition: graph.h:95
void * data
Definition: graph.h:94
size_t size
Definition: graph.h:93
Means of passing arbitrary user and implementation information between function calls.
Definition: graph.h:72