X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Faga%2Faga.h;h=a8a888be1a9d584045e99659bb465459e01af895;hp=867515030a560501ed0c158ec63c406a39a335c7;hb=f9274cce2171d919d72fe9ec186320f85174b7e5;hpb=8835db12da22bfa0d0bd9bb94a275256099584dc diff --git a/ccan/aga/aga.h b/ccan/aga/aga.h index 86751503..a8a888be 100644 --- a/ccan/aga/aga.h +++ b/ccan/aga/aga.h @@ -72,6 +72,10 @@ * reference to that node by the edge callback for *any* node and * index MUST use the same pointer. * + * - The ei->icost field MAY be set by the edge_info callback to + * indicate the edge's cost / length represented as an integer (of + * type aga_icost_t), Otherwise the cost defaults to 1. + * * Concurrency * =========== * @@ -127,9 +131,13 @@ typedef const void *(*aga_next_edge_fn)(const struct aga_graph *g, const struct aga_node *n, const void *e); +typedef long aga_icost_t; + struct aga_edge_info { struct aga_node *to; + aga_icost_t icost; /* integer edge cost */ }; + typedef int (*aga_edge_info_fn)(const struct aga_graph *g, const struct aga_node *n, const void *e, struct aga_edge_info *ei);