2 * stats.c - various routines to do stats on the key graph
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2002 Project Purple
16 key_getsigs - get the sigs for a key.
17 key_getsigns - get the keys a key signs. */
23 // #include <stdint.h>
29 * struct stats_key - holds key details suitable for doing stats on.
31 * @colour: Used for marking during DFS/BFS.
32 * @parent: The key that lead us to this one for DFS/BFS.
33 * @sigs: A linked list of the signatures on this key.
34 * @gotsigs: A bool indicating if we've initialized the sigs element yet.
45 * initcolour - Clear the key graph ready for use.
46 * @parent: Do we want to clear the parent pointers too?
48 * Clears the parent and colour information on all elements in the key
51 void initcolour(bool parent);
54 * findpath - Given 2 keys finds a path between them.
55 * @have: The key we have.
56 * @want: The key we want to get to.
58 * This does a breadth first search on the key tree, starting with the
59 * key we have. It returns as soon as a path is found or when we run out
60 * of keys; whichever comes sooner.
62 unsigned long findpath(struct stats_key *have, struct stats_key *want);
65 struct stats_key *furthestkey(struct stats_key *have);
67 #endif /* __STATS_H__ */