00001 #ifndef H_FINGERPRINT
00002 #define H_FINGERPRINT
00003
00009 #include "rpmhash.h"
00010 #include "header.h"
00011
00014 typedef struct fprintCache_s * fingerPrintCache;
00015
00019 typedef struct fingerPrint_s fingerPrint;
00020
00027 struct fprintCacheEntry_s {
00028 const char * dirName;
00029 dev_t dev;
00030 ino_t ino;
00031 };
00032
00036 struct fprintCache_s {
00037 hashTable ht;
00038 };
00039
00044 struct fingerPrint_s {
00046 const struct fprintCacheEntry_s * entry;
00048
00049 const char * subDir;
00050
00051 const char * baseName;
00052 };
00053
00056 #define FP_ENTRY_EQUAL(a, b) (((a)->dev == (b)->dev) && ((a)->ino == (b)->ino))
00057
00060 #define FP_EQUAL(a, b) ( \
00061 FP_ENTRY_EQUAL((a).entry, (b).entry) && \
00062 !strcmp((a).baseName, (b).baseName) && ( \
00063 ((a).subDir == (b).subDir) || \
00064 ((a).subDir && (b).subDir && !strcmp((a).subDir, (b).subDir)) \
00065 ) \
00066 )
00067
00068 #ifdef __cplusplus
00069 extern "C" {
00070 #endif
00071
00081 int rpmdbFindFpList( rpmdb db, fingerPrint * fpList,
00082 dbiIndexSet * matchList, int numItems,
00083 unsigned int exclude)
00084
00085
00086 ;
00087
00088
00089
00095 fingerPrintCache fpCacheCreate(int sizeHint)
00096 ;
00097
00103
00104 fingerPrintCache fpCacheFree( fingerPrintCache cache)
00105 ;
00106
00115 fingerPrint fpLookup(fingerPrintCache cache, const char * dirName,
00116 const char * baseName, int scareMem)
00117 ;
00118
00127 uint32_t fpHashFunction(uint32_t h, const void * data, size_t size)
00128 ;
00129
00137 int fpEqual(const void * key1, const void * key2)
00138 ;
00139
00150 void fpLookupList(fingerPrintCache cache, const char ** dirNames,
00151 const char ** baseNames, const uint_32 * dirIndexes,
00152 int fileCount, fingerPrint * fpList)
00153 ;
00154
00155 #ifdef __cplusplus
00156 }
00157 #endif
00158
00159 #endif