Commit afae9c82 authored by David Gibson's avatar David Gibson

aga: Error codes

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: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 2ab26c62
......@@ -15,7 +15,7 @@ void aga_init_graph_(struct aga_graph *g,
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;
......@@ -54,7 +54,7 @@ bool aga_check_state(const struct aga_graph *g)
void aga_finish(struct aga_graph *g)
{
assert(g->sequence & 1);
g->error = 0;
g->error = AGA_ERR_NONE;
g->sequence++;
}
......
......@@ -195,6 +195,18 @@ void aga_init_graph_(struct aga_graph *g,
(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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment