5 #include <ccan/aga/aga.h>
6 #include <ccan/container_of/container_of.h>
7 #include <ccan/ptrint/ptrint.h>
9 #include "simple-graph.h"
11 static ptrint_t *error_first_edge(const struct aga_graph *g,
12 const struct aga_node *n)
17 static ptrint_t *error_next_edge(const struct aga_graph *g,
18 const struct aga_node *n,
21 assert(edge == int2ptr(1));
26 static int error_edge_info(const struct aga_graph *g, const struct aga_node *n,
27 ptrint_t *edge, struct aga_edge_info *ei)
29 struct error_graph *eg = container_of(g, struct error_graph, sg.g);
30 int fromindex = n - eg->sg.nodes;
34 ei->to = &eg->sg.nodes[2];
42 ei->to = &eg->sg.nodes[4];
52 void error_graph_init(struct error_graph *eg)
54 simple_graph_init(&eg->sg, error_first_edge, error_next_edge,