Change the magic number used to introduce a trie file, so that instead
[sgt/agedu] / trie.h
diff --git a/trie.h b/trie.h
index 6a6d7ed..e27885f 100644 (file)
--- a/trie.h
+++ b/trie.h
@@ -66,6 +66,14 @@ void trie_fake_dir_atimes(void *t);
  */
 
 /*
+ * Check the magic numbers at the start of the file. This should also
+ * verify that the file was built on a platform whose structure layout
+ * matches that of the agedu reading it. Returns nonzero on successful
+ * match, zero on mismatch.
+ */
+int trie_check_magic(const void *t);
+
+/*
  * Return the path separator character in use in the trie.
  */
 char trie_pathsep(const void *t);
@@ -91,6 +99,11 @@ unsigned long trie_before(const void *t, const char *pathname);
 void trie_getpath(const void *t, unsigned long n, char *buf);
 
 /*
+ * Return the trie_file * for the nth entry in the trie.
+ */
+const struct trie_file *trie_getfile(const void *t, unsigned long n);
+
+/*
  * Return the total number of entries in the whole trie.
  */
 unsigned long trie_count(const void *t);
@@ -110,6 +123,7 @@ unsigned long trie_count(const void *t);
 typedef struct triewalk triewalk;
 triewalk *triewalk_new(const void *t);
 const struct trie_file *triewalk_next(triewalk *tw, char *buf);
+void triewalk_rebase(triewalk *tw, const void *t);
 void triewalk_free(triewalk *tw);
 
 /* ----------------------------------------------------------------------