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 const char * subDir;
00049 const char * baseName;
00050 };
00051
00053 #define FP_ENTRY_EQUAL(a, b) (((a)->dev == (b)->dev) && ((a)->ino == (b)->ino))
00054
00056 #define FP_EQUAL(a, b) ( \
00057 FP_ENTRY_EQUAL((a).entry, (b).entry) && \
00058 !strcmp((a).baseName, (b).baseName) && ( \
00059 ((a).subDir == (b).subDir) || \
00060 ((a).subDir && (b).subDir && !strcmp((a).subDir, (b).subDir)) \
00061 ) \
00062 )
00063
00064 #ifdef __cplusplus
00065 extern "C" {
00066 #endif
00067
00076 int rpmdbFindFpList( rpmdb db, fingerPrint * fpList,
00077 dbiIndexSet * matchList, int numItems)
00078
00079 ;
00080
00081
00082
00088 fingerPrintCache fpCacheCreate(int sizeHint)
00089 ;
00090
00096
00097 fingerPrintCache fpCacheFree( fingerPrintCache cache)
00098 ;
00099
00108 fingerPrint fpLookup(fingerPrintCache cache, const char * dirName,
00109 const char * baseName, int scareMemory)
00110 ;
00111
00118 unsigned int fpHashFunction(const void * key)
00119 ;
00120
00128 int fpEqual(const void * key1, const void * key2)
00129 ;
00130
00141 void fpLookupList(fingerPrintCache cache, const char ** dirNames,
00142 const char ** baseNames, const int * dirIndexes,
00143 int fileCount, fingerPrint * fpList)
00144 ;
00145
00146 #ifdef __cplusplus
00147 }
00148 #endif
00149
00150 #endif