X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/blobdiff_plain/256c29a27ba79677a78bc676a3cc73ee1aad2d68..a8a4d6d837f5029124d26483e4b3a390de69823e:/trie.h diff --git a/trie.h b/trie.h index ef52a08..ea24ef8 100644 --- a/trie.h +++ b/trie.h @@ -50,6 +50,17 @@ int triebuild_finish(triebuild *tb); void triebuild_free(triebuild *tb); /* ---------------------------------------------------------------------- + * Anomalous function which modifies a trie after it's memory-mapped. + */ + +/* + * Invent new fake atimes for each directory in the trie, by + * taking the maximum (latest) of the directory's previously + * stored atime and the atimes of everything below it. + */ +void trie_fake_dir_atimes(void *t); + +/* ---------------------------------------------------------------------- * Functions to query a trie given a pointer to the start of the * memory-mapped file. */ @@ -80,6 +91,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); @@ -99,6 +115,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); /* ----------------------------------------------------------------------