Add an enum to record error codes for aga routines. The current
algorithms, dfs and bfs don't have any error conditions except those
reported by callbacks. So, for now, the only code is "no error", but this
will be expanded in future.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
aga_edge_info_fn edge_info)
{
g->sequence = 0;
- g->error = 0;
+ g->error = AGA_ERR_NONE;
g->first_edge = first_edge;
g->next_edge = next_edge;
void aga_finish(struct aga_graph *g)
{
assert(g->sequence & 1);
- g->error = 0;
+ g->error = AGA_ERR_NONE;
g->sequence++;
}
(aga_edge_info_fn)(eifn_)); \
} while (0)
+/**
+ * enum aga_error - Error codes for aga routines
+ *
+ * These error codes are returned by aga_error() for errors detected
+ * within aga itself (rather than errors reported by supplied
+ * callbacks, which should be negative
+ */
+enum aga_error {
+ /* No error */
+ AGA_ERR_NONE = 0,
+};
+
/**
* aga_error - Determine error state of a graph
* @g: the graph