X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/blobdiff_plain/269fa2d1d46469f330eaceaf0e2ca2bf5267abc6..cfe942fb3391ae80e816272d7baa45be30e5e7ec:/trie.h diff --git a/trie.h b/trie.h index 2f88291..ef52a08 100644 --- a/trie.h +++ b/trie.h @@ -9,7 +9,7 @@ * An entry in the trie file describing an actual file. */ struct trie_file { - unsigned long long blocks; + unsigned long long size; unsigned long long atime; }; @@ -107,3 +107,19 @@ void triewalk_free(triewalk *tw); */ void trie_set_index_offset(void *t, off_t ptr); off_t trie_get_index_offset(const void *t); + +/* ---------------------------------------------------------------------- + * Utility functions not directly involved with the trie. + */ + +/* + * Given a pathname in a buffer, adjust the pathname in place so + * that it points at a string which, when passed to trie_before, + * will reliably return the index of the thing that comes after + * that pathname and all its descendants. Usually this is done by + * suffixing ^A (since foo^A is guaranteeably the first thing that + * sorts after foo and foo/stuff); however, if the pathname + * actually ends in a path separator (e.g. if it's just "/"), that + * must be stripped off first. + */ +void make_successor(char *pathbuf);