rpm  5.4.15
fprint.h
Go to the documentation of this file.
1 #ifndef H_FINGERPRINT
2 #define H_FINGERPRINT
3 
9 #include "rpmhash.h"
10 
13 typedef /*@abstract@*/ struct fprintCache_s * fingerPrintCache;
14 
18 typedef struct fingerPrint_s fingerPrint;
19 
20 #if defined(_FPRINT_INTERNAL)
21 
27 struct fprintCacheEntry_s {
28  const char * dirName;
29  dev_t dev;
30  ino_t ino;
31 };
32 
36 struct fprintCache_s {
37  hashTable ht;
38 };
39 
40 struct rpmffi_s {
41  rpmte p;
42  int fileno;
43 };
44 #endif /* _FPRINT_INTERNAL */
45 
50 struct fingerPrint_s {
52  const struct fprintCacheEntry_s * entry;
54 /*@owned@*/ /*@relnull@*/
55  const char * subDir;
56 /*@dependent@*/
57  const char * baseName;
58 };
59 
62 #define FP_ENTRY_EQUAL(a, b) (((a)->dev == (b)->dev) && ((a)->ino == (b)->ino))
63 
66 #define FP_EQUAL(a, b) ( \
67  FP_ENTRY_EQUAL((a).entry, (b).entry) && \
68  !strcmp((a).baseName, (b).baseName) && ( \
69  ((a).subDir == (b).subDir) || \
70  ((a).subDir && (b).subDir && !strcmp((a).subDir, (b).subDir)) \
71  ) \
72  )
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
83 /*@only@*/ fingerPrintCache fpCacheCreate(int sizeHint)
84  /*@globals fileSystem @*/
85  /*@modifies fileSystem @*/;
86 
92 /*@null@*/
94  /*@globals fileSystem @*/
95  /*@modifies cache, fileSystem @*/;
96 
105 fingerPrint fpLookup(fingerPrintCache cache, const char * dirName,
106  const char * baseName, int scareMem)
107  /*@globals fileSystem, internalState @*/
108  /*@modifies cache, fileSystem, internalState @*/;
109 
118 uint32_t fpHashFunction(uint32_t h, const void * data, size_t size)
119  /*@*/;
120 
128 int fpEqual(const void * key1, const void * key2)
129  /*@*/;
130 
141 void fpLookupList(fingerPrintCache cache, const char ** dirNames,
142  const char ** baseNames, const rpmuint32_t * dirIndexes,
143  rpmuint32_t fileCount, fingerPrint * fpList)
144  /*@globals fileSystem, internalState @*/
145  /*@modifies cache, *fpList, fileSystem, internalState @*/;
146 
156 void fpLookupSubdir(hashTable symlinks, hashTable fphash, fingerPrintCache fpc,
157  void * _p, int filenr)
158  /*@*/;
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif
fingerPrintCache fpCacheFree(fingerPrintCache cache)
Destroy finger print cache.
Definition: fprint.c:31
const char * baseName
Definition: fprint.h:57
fingerPrint fpLookup(fingerPrintCache cache, const char *dirName, const char *baseName, int scareMem)
Return finger print of a file path.
Definition: fprint.c:190
Hash table implemenation.
uint32_t fpHashFunction(uint32_t h, const void *data, size_t size)
Return hash value for a finger print.
struct rpmte_s * rpmte
An element of a transaction set, i.e.
Definition: rpmtypes.h:38
const char * subDir
Definition: fprint.h:55
unsigned int rpmuint32_t
Definition: rpmiotypes.h:28
int fpEqual(const void *key1, const void *key2)
Compare two finger print entries.
Definition: fprint.c:212
const char const bson * data
Definition: mongo.h:463
Associates a trailing sub-directory and final base name with an existing directory finger print...
Definition: fprint.h:50
static const char * dirName
Definition: parsePrep.c:28
const struct fprintCacheEntry_s * entry
Definition: fprint.h:52
struct fprintCache_s * fingerPrintCache
Definition: fprint.h:13
const char const char size_t size
Definition: bson.h:895
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.
Definition: fprint.c:230
fingerPrintCache fpCacheCreate(int sizeHint)
Create finger print cache.
Definition: fprint.c:21
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...
Definition: fprint.c:299