* Return non-zero if y is reachable from x using a brute force * search. If reachable and path is non-null, return the route taken * in path. */
| 2040 | * in path. |
| 2041 | */ |
| 2042 | static int |
| 2043 | graph_reaches(struct owner_vertex *x, struct owner_vertex *y, |
| 2044 | struct owner_vertex_list *path) |
| 2045 | { |
| 2046 | struct owner_edge *e; |
| 2047 | |
| 2048 | if (x == y) { |
| 2049 | if (path) |
| 2050 | TAILQ_INSERT_HEAD(path, x, v_link); |
| 2051 | return 1; |
| 2052 | } |
| 2053 | |
| 2054 | LIST_FOREACH(e, &x->v_outedges, e_outlink) { |
| 2055 | if (graph_reaches(e->e_to, y, path)) { |
| 2056 | if (path) |
| 2057 | TAILQ_INSERT_HEAD(path, x, v_link); |
| 2058 | return 1; |
| 2059 | } |
| 2060 | } |
| 2061 | return 0; |
| 2062 | } |
| 2063 | |
| 2064 | /* |
| 2065 | * Perform consistency checks on the graph. Make sure the values of |
no outgoing calls
no test coverage detected