Go to the documentation of this file.00001 #ifndef H_FINGERPRINT
00002 #define H_FINGERPRINT
00003
00009 #include "rpmhash.h"
00010
00013 typedef struct fprintCache_s * fingerPrintCache;
00014
00018 typedef struct fingerPrint_s fingerPrint;
00019
00026 struct fprintCacheEntry_s {
00027 const char * dirName;
00028 dev_t dev;
00029 ino_t ino;
00030 };
00031
00035 struct fprintCache_s {
00036 hashTable ht;
00037 };
00038
00043 struct fingerPrint_s {
00045 const struct fprintCacheEntry_s * entry;
00047
00048 const char * subDir;
00049
00050 const char * baseName;
00051 };
00052
00055 #define FP_ENTRY_EQUAL(a, b) (((a)->dev == (b)->dev) && ((a)->ino == (b)->ino))
00056
00059 #define FP_EQUAL(a, b) ( \
00060 FP_ENTRY_EQUAL((a).entry, (b).entry) && \
00061 !strcmp((a).baseName, (b).baseName) && ( \
00062 ((a).subDir == (b).subDir) || \
00063 ((a).subDir && (b).subDir && !strcmp((a).subDir, (b).subDir)) \
00064 ) \
00065 )
00066
00067 #ifdef __cplusplus
00068 extern "C" {
00069 #endif
00070
00080 int rpmdbFindFpList( void * _db, fingerPrint * fpList,
00081 void * _matchList, int numItems,
00082 unsigned int exclude)
00083
00084
00085 ;
00086
00087
00088
00094 fingerPrintCache fpCacheCreate(int sizeHint)
00095
00096 ;
00097
00103
00104 fingerPrintCache fpCacheFree( fingerPrintCache cache)
00105
00106 ;
00107
00116 fingerPrint fpLookup(fingerPrintCache cache, const char * dirName,
00117 const char * baseName, int scareMem)
00118
00119 ;
00120
00129 rpmuint32_t fpHashFunction(rpmuint32_t h, const void * data, size_t size)
00130 ;
00131
00139 int fpEqual(const void * key1, const void * key2)
00140 ;
00141
00152 void fpLookupList(fingerPrintCache cache, const char ** dirNames,
00153 const char ** baseNames, const rpmuint32_t * dirIndexes,
00154 rpmuint32_t fileCount, fingerPrint * fpList)
00155
00156 ;
00157
00158 #ifdef __cplusplus
00159 }
00160 #endif
00161
00162 #endif