5 #include <ccan/container_of/container_of.h>
6 #include <ccan/ptrint/ptrint.h>
8 #include <ccan/aga/aga.h>
10 #include "simple-graph.h"
12 static ptrint_t *shortcut2_first_edge(const struct aga_graph *g,
13 const struct aga_node *n)
15 struct shortcut2_graph *s1g = container_of(g, struct shortcut2_graph,
17 int ni = n - s1g->sg.nodes;
32 static ptrint_t *shortcut2_next_edge(const struct aga_graph *g,
33 const struct aga_node *n,
36 struct shortcut2_graph *s1g = container_of(g, struct shortcut2_graph,
38 int ni = n - s1g->sg.nodes;
39 int index = ptr2int(e);
57 static int shortcut2_edge_info(const struct aga_graph *g,
58 const struct aga_node *n,
59 ptrint_t *e, struct aga_edge_info *ei)
61 struct shortcut2_graph *s1g = container_of(g, struct shortcut2_graph,
63 int ni = n - s1g->sg.nodes;
64 int index = ptr2int(e);
69 ei->to = &s1g->sg.nodes[3];
72 ei->to = &s1g->sg.nodes[2];
79 ei->to = &s1g->sg.nodes[3];
89 void shortcut2_graph_init(struct shortcut2_graph *s1g)
91 simple_graph_init(&s1g->sg, shortcut2_first_edge,