summaryrefslogtreecommitdiffstats
path: root/src/dbstruct.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbstruct.h')
-rw-r--r--src/dbstruct.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/dbstruct.h b/src/dbstruct.h
new file mode 100644
index 0000000..2555cc1
--- /dev/null
+++ b/src/dbstruct.h
@@ -0,0 +1,60 @@
+#ifndef foodbstructhfoo
+#define foodbstructhfoo
+
+#include <limits.h>
+#include <stdint.h>
+
+#include "syrep.h"
+
+struct syrep_md {
+ uint8_t digest[SYREP_DIGESTLENGTH];
+};
+
+struct syrep_name {
+ char path[PATH_MAX+1];
+};
+
+struct syrep_id {
+ struct syrep_md md;
+ struct syrep_name name;
+};
+
+struct syrep_meta {
+ uint32_t first_seen;
+ uint32_t last_seen;
+};
+
+/* struct syrep_namels { */
+/* uint32_t last_seen; */
+/* struct syrep_name name; */
+/* }; */
+
+/* struct syrep_mdls { */
+/* uint32_t last_seen; */
+/* struct syrep_md md; */
+/* }; */
+
+struct syrep_timestamp {
+ uint32_t t;
+};
+
+struct syrep_version {
+ uint32_t v;
+};
+
+/* Table layout:
+ *
+ * syrep_id :: syrep_meta => id_meta
+ * syrep_md :: syrep_name => md_name (DUP)
+ * syrep_name :: syrep_md => name_md (DUP)
+ * syrep_version :: syrep_timestamp => version_timestamp
+ * syrep_name :: syrep_md => name_lastmd
+ * syrep_md :: last_md => md_lastmd
+ *
+ */
+
+/*
+ * syrep_namels :: syrep_md => namels_md
+ * syrep_mdls :: syrep_name => mdls_name
+ */
+#endif