| 49 | } |
| 50 | |
| 51 | static void |
| 52 | graph_insert_ordered(struct graph *graph) |
| 53 | { |
| 54 | struct graph *after, *g; |
| 55 | |
| 56 | after = NULL; |
| 57 | STAILQ_FOREACH(g, &graph_list, next) { |
| 58 | if (g->id < graph->id) |
| 59 | after = g; |
| 60 | else if (g->id > graph->id) |
| 61 | break; |
| 62 | } |
| 63 | if (after == NULL) { |
| 64 | STAILQ_INSERT_HEAD(&graph_list, graph, next); |
| 65 | } else { |
| 66 | STAILQ_INSERT_AFTER(&graph_list, after, graph, next); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | struct graph_head * |
| 71 | graph_list_head_get(void) |
no outgoing calls
no test coverage detected