|
rpm 5.3.12
|
Identify a file name path by a unique "finger print". More...
#include "rpmhash.h"

Go to the source code of this file.
Data Structures | |
| struct | fprintCacheEntry_s |
| Finger print cache entry. More... | |
| struct | fprintCache_s |
| Finger print cache. More... | |
| struct | fingerPrint_s |
| Associates a trailing sub-directory and final base name with an existing directory finger print. More... | |
Defines | |
| #define | FP_ENTRY_EQUAL(a, b) (((a)->dev == (b)->dev) && ((a)->ino == (b)->ino)) |
| #define | FP_EQUAL(a, b) |
Typedefs | |
| typedef struct fprintCache_s * | fingerPrintCache |
| typedef struct fingerPrint_s | fingerPrint |
Functions | |
| fingerPrintCache | fpCacheCreate (int sizeHint) |
| Create finger print cache. | |
| fingerPrintCache | fpCacheFree (fingerPrintCache cache) |
| Destroy finger print cache. | |
| fingerPrint | fpLookup (fingerPrintCache cache, const char *dirName, const char *baseName, int scareMem) |
| Return finger print of a file path. | |
| uint32_t | fpHashFunction (uint32_t h, const void *data, size_t size) |
| Return hash value for a finger print. | |
| int | fpEqual (const void *key1, const void *key2) |
| Compare two finger print entries. | |
| void | fpLookupList (fingerPrintCache cache, const char **dirNames, const char **baseNames, const rpmuint32_t *dirIndexes, rpmuint32_t fileCount, fingerPrint *fpList) |
| Return finger prints of an array of file paths. | |
| void | fpLookupSubdir (hashTable symlinks, hashTable fphash, fingerPrintCache fpc, void *_p, int filenr) |
| Check file for to be installed symlinks in their path, correct their fingerprint and add it to newht. | |
Identify a file name path by a unique "finger print".
Definition in file fprint.h.
| #define FP_ENTRY_EQUAL | ( | a, | |
| b | |||
| ) | (((a)->dev == (b)->dev) && ((a)->ino == (b)->ino)) |
| #define FP_EQUAL | ( | a, | |
| b | |||
| ) |
( \
FP_ENTRY_EQUAL((a).entry, (b).entry) && \
!strcmp((a).baseName, (b).baseName) && ( \
((a).subDir == (b).subDir) || \
((a).subDir && (b).subDir && !strcmp((a).subDir, (b).subDir)) \
) \
)
Definition at line 66 of file fprint.h.
Referenced by fpEqual().
| typedef struct fingerPrint_s fingerPrint |
| typedef struct fprintCache_s* fingerPrintCache |
| fingerPrintCache fpCacheCreate | ( | int | sizeHint | ) |
Create finger print cache.
| sizeHint | number of elements expected |
Definition at line 21 of file fprint.c.
References fprintCache_s::ht, htCreate(), and xmalloc().
Referenced by rpmtsPrepare().
| fingerPrintCache fpCacheFree | ( | fingerPrintCache | cache | ) |
Destroy finger print cache.
| cache | pointer to fingerprint cache |
Definition at line 31 of file fprint.c.
References fprintCache_s::ht, and htFree().
Referenced by rpmtsPrepare().
| int fpEqual | ( | const void * | key1, |
| const void * | key2 | ||
| ) |
Compare two finger print entries.
This routine is exactly equivalent to the FP_EQUAL macro.
| key1 | finger print 1 |
| key2 | finger print 2 |
Definition at line 212 of file fprint.c.
References FP_EQUAL.
Referenced by rpmtsAddFingerprints(), and rpmtsPrepare().
| uint32_t fpHashFunction | ( | uint32_t | h, |
| const void * | data, | ||
| size_t | size | ||
| ) |
Return hash value for a finger print.
Hash based on dev and inode only!
| h | hash initial value |
| *data | finger print entry |
| size | size of fingerprint entry |
| fingerPrint fpLookup | ( | fingerPrintCache | cache, |
| const char * | dirName, | ||
| const char * | baseName, | ||
| int | scareMem | ||
| ) |
Return finger print of a file path.
| cache | pointer to fingerprint cache |
| dirName | leading directory name of file path |
| baseName | base name of file path |
| scareMem |
Definition at line 190 of file fprint.c.
References doLookup().
Referenced by fpLookupSubdir(), and rpmtsCheckInstalledFiles().
| void fpLookupList | ( | fingerPrintCache | cache, |
| const char ** | dirNames, | ||
| const char ** | baseNames, | ||
| const rpmuint32_t * | dirIndexes, | ||
| rpmuint32_t | fileCount, | ||
| fingerPrint * | fpList | ||
| ) |
Return finger prints of an array of file paths.
| cache | pointer to fingerprint cache |
| dirNames | directory names |
| baseNames | file base names |
| dirIndexes | index into dirNames for each baseNames |
| fileCount | number of file entries |
| *fpList | array of finger prints |
Definition at line 230 of file fprint.c.
References fingerPrint_s::baseName, doLookup(), fingerPrint_s::entry, and fingerPrint_s::subDir.
Referenced by rpmfiFpLookup().
| void fpLookupSubdir | ( | hashTable | symlinks, |
| hashTable | fphash, | ||
| fingerPrintCache | fpc, | ||
| void * | _p, | ||
| int | filenr | ||
| ) |
Check file for to be installed symlinks in their path, correct their fingerprint and add it to newht.
| ht | hash table containing all files fingerprints |
| newht | hash table to add the corrected fingerprints |
| fpc | fingerprint cache |
| _p | transaction element |
| filenr | the number of the file we are dealing with |
Definition at line 299 of file fprint.c.
References _free(), fingerPrint_s::baseName, fpLookup(), htAddEntry(), htGetEntry(), recs, rpmGetPath(), xmalloc(), and xstrdup().
Referenced by rpmtsAddFingerprints().
1.7.4