Move stats_key structure to stats.h
authorJonathan McDowell <noodles@earth.li>
Sat, 25 Aug 2012 04:52:20 +0000 (21:52 -0700)
committerJonathan McDowell <noodles@earth.li>
Sat, 25 Aug 2012 04:52:20 +0000 (21:52 -0700)
It still ends up pulled into the core objects by mem.c / hash.c,
but we no longer pollute keystructs.h

hash.c
hash.h
keystructs.h
mem.c
mem.h
stats.h

diff --git a/hash.c b/hash.c
index 49443ed07093ded1c6a80d017fe46284ca481ed5..506bd4c6dc558a23b94acedb1f31cc23c220a4f5 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -25,6 +25,7 @@
 #include "keystructs.h"
 #include "ll.h"
 #include "mem.h"
+#include "stats.h"
 
 /**
  *     hashtable - the hash table array.
diff --git a/hash.h b/hash.h
index 9d7578dcbd2fe0aa4fd7e0f2bedb1956f62ef541..161fcf509940ccd43120b31c8b9e9c01a8edc16e 100644 (file)
--- a/hash.h
+++ b/hash.h
@@ -22,6 +22,7 @@
 
 #include "keystructs.h"
 #include "ll.h"
+#include "stats.h"
 
 #define HASHSIZE 1024
 #define HASHMASK 0x3FF
index efa9a99e6daf4bb1517a12ab69d08d593f8b7421..fcfed121dd66b9be29114aa314c1b38a0ae11912 100644 (file)
@@ -99,28 +99,6 @@ struct openpgp_publickey {
        struct openpgp_publickey                *next;
 };
 
-/**
- * @brief Holds key details suitable for doing stats on.
- */
-struct stats_key {
-       /** The keyid. */
-       uint64_t keyid;
-       /** Used for marking during DFS/BFS. */
-       int colour;
-       /** The key that lead us to this one for DFS/BFS. */
-       uint64_t parent;
-       /** A linked list of the signatures on this key. */
-       struct ll *sigs;
-       /** A linked list of the keys this key signs. */
-       struct ll *signs;
-       /** A bool indicating if we've initialized the sigs element yet. */
-       bool gotsigs;
-       /** If we shouldn't consider the key in calculations. */
-       bool disabled;
-       /** If the key is revoked (and shouldn't be considered). */
-       bool revoked;
-};
-
 /**
  * @brief Holds an SKS key hash (md5 over sorted packet list)
  */
diff --git a/mem.c b/mem.c
index 2b45158028857d2c57b71f947110d7a621980e21..83c63849f83b356ddfae5ab419dd8c4d17593a5e 100644 (file)
--- a/mem.c
+++ b/mem.c
@@ -24,6 +24,7 @@
 #include "keystructs.h"
 #include "ll.h"
 #include "mem.h"
+#include "stats.h"
 
 /**
  *     packet_dup - duplicate an OpenPGP packet.
diff --git a/mem.h b/mem.h
index de9356790de70d262c6eb1dc7c09736ee9068985..be24e2084e95faf763e288c8d47770d5d0c6d703 100644 (file)
--- a/mem.h
+++ b/mem.h
@@ -21,6 +21,7 @@
 #define __MEM_H_
 
 #include "keystructs.h"
+#include "stats.h"
 
 /**
  *     packet_dup - duplicate an OpenPGP packet.
diff --git a/stats.h b/stats.h
index 19637eb2dba4e470af0dbbf168de6741b7d356e8..08e2abea0152c22384d73e5072ec6f844c68b96b 100644 (file)
--- a/stats.h
+++ b/stats.h
@@ -33,9 +33,30 @@ key_getsigns - get the keys a key signs. */
 #include <inttypes.h>
 #include <stdbool.h>
 
-#include "keystructs.h"
 #include "ll.h"
 
+/**
+ * @brief Holds key details suitable for doing stats on.
+ */
+struct stats_key {
+       /** The keyid. */
+       uint64_t keyid;
+       /** Used for marking during DFS/BFS. */
+       int colour;
+       /** The key that lead us to this one for DFS/BFS. */
+       uint64_t parent;
+       /** A linked list of the signatures on this key. */
+       struct ll *sigs;
+       /** A linked list of the keys this key signs. */
+       struct ll *signs;
+       /** A bool indicating if we've initialized the sigs element yet. */
+       bool gotsigs;
+       /** If we shouldn't consider the key in calculations. */
+       bool disabled;
+       /** If the key is revoked (and shouldn't be considered). */
+       bool revoked;
+};
+
 /**
  *     initcolour - Clear the key graph ready for use.
  *     @parent: Do we want to clear the parent pointers too?