cscvs to tla changeset 77
[onak.git] / stats.h
1 /*
2  * stats.c - various routines to do stats on the key graph
3  *
4  * Jonathan McDowell <noodles@earth.li>
5  *
6  * Copyright 2002 Project Purple
7  *
8  * $Id: stats.h,v 1.5 2003/06/04 20:57:13 noodles Exp $
9  */
10
11 /* MOSTSIGNED
12 SIGNSMOST
13 SIGNS <key>
14 SIGS <key>
15 SIXDEGREES <keyid>
16 MAXPATH
17
18 key_getsigs - get the sigs for a key.
19 key_getsigns - get the keys a key signs. */
20
21 #ifndef __STATS_H__
22 #define __STATS_H__
23
24 #include <inttypes.h>
25 #include <stdbool.h>
26
27 #include "keystructs.h"
28 #include "ll.h"
29
30 /**
31  *      initcolour - Clear the key graph ready for use.
32  *      @parent: Do we want to clear the parent pointers too?
33  *
34  *      Clears the parent and colour information on all elements in the key
35  *      graph.
36  */
37 void initcolour(bool parent);
38
39 /**
40  *      findpath - Given 2 keys finds a path between them.
41  *      @have: The key we have.
42  *      @want: The key we want to get to.
43  *
44  *      This does a breadth first search on the key tree, starting with the
45  *      key we have. It returns as soon as a path is found or when we run out
46  *      of keys; whichever comes sooner.
47  */
48 unsigned long findpath(struct stats_key *have, struct stats_key *want);
49
50 /**
51  *      dofindpath - Given 2 keys displays a path between them.
52  *      @have: The key we have.
53  *      @want: The key we want to get to.
54  *      @html: Should we output in html.
55  *      @count: How many paths we should look for at most.
56  *
57  *      This does a breadth first search on the key tree, starting with the
58  *      key we have. It returns as soon as a path is found or when we run out
59  *      of keys; whichever comes sooner.
60  */
61 void dofindpath(uint64_t have, uint64_t want, bool html, int count);
62
63 struct stats_key *furthestkey(struct stats_key *have);
64
65 #endif /* __STATS_H__ */