7 /* This is really a directory and symlink cache. We don't differentiate between
8 the two. We can prepopulate it, which allows us to easily conduct "fake"
9 installs of a system w/o actually mounting filesystems. */
10 struct fprintCacheEntry_s {
17 typedef struct fprintCache_s {
18 hashTable ht; /* hashed by dirName */
21 typedef struct fingerprint_s {
22 const struct fprintCacheEntry_s * entry;
24 const char * baseName;
27 /* only if !scarceMemory */
28 #define fpFree(a) free((void *)(a).baseName)
30 #define FP_EQUAL(a, b) ((&(a) == &(b)) || \
31 (((a).entry == (b).entry) && \
32 !strcmp((a).subDir, (b).subDir) && \
33 !strcmp((a).baseName, (b).baseName)))
39 /* Be carefull with the memory... assert(*fullName == '/' || !scareMemory) */
40 fingerPrintCache fpCacheCreate(int sizeHint);
41 void fpCacheFree(fingerPrintCache cache);
42 fingerPrint fpLookup(fingerPrintCache cache, const char * dirName,
43 const char * baseName, int scareMemory);
45 /* Hash based on dev and inode only! */
46 unsigned int fpHashFunction(const void * key);
47 /* exactly equivalent to FP_EQUAL */
48 int fpEqual(const void * key1, const void * key2);
50 /* scareMemory is assumed for both of these! */
51 void fpLookupList(fingerPrintCache cache, const char ** dirNames,
52 const char ** baseNames, const int * dirIndexes,
53 int fileCount, fingerPrint * fpList);
54 void fpLookupHeader(fingerPrintCache cache, Header h, fingerPrint * fpList);