Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

rpmdb/fprint.h

Go to the documentation of this file.
00001 #ifndef H_FINGERPRINT
00002 #define H_FINGERPRINT
00003 
00009 #include "rpmhash.h"
00010 #include "header.h"
00011 
00018 struct fprintCacheEntry_s {
00019     const char * dirName;               
00020     dev_t dev;                          
00021     ino_t ino;                          
00022     int isFake;                         
00023 };
00024 
00028 typedef /*@abstract@*/ struct fprintCache_s {
00029     hashTable ht;                       
00030 } * fingerPrintCache;
00031 
00036 typedef struct fingerPrint_s {
00038     const struct fprintCacheEntry_s * entry;
00040 /*@owned@*/ /*@null@*/ const char * subDir;
00041 /*@dependent@*/ const char * baseName;  
00042 } fingerPrint;
00043 
00044 /* only if !scarceMemory */
00046 #define fpFree(a) free((void *)(a).baseName)
00047 
00049 #define FP_ENTRY_EQUAL(a, b) (((a)->dev == (b)->dev) && ((a)->ino == (b)->ino))
00050 
00052 #define FP_EQUAL(a, b) ( \
00053         FP_ENTRY_EQUAL((a).entry, (b).entry) && \
00054         !strcmp((a).baseName, (b).baseName) && ( \
00055             ((a).subDir == (b).subDir) || \
00056             ((a).subDir && (b).subDir && !strcmp((a).subDir, (b).subDir)) \
00057         ) \
00058     )
00059 
00060 #ifdef __cplusplus
00061 extern "C" {
00062 #endif
00063 
00064 /* Be carefull with the memory... assert(*fullName == '/' || !scareMemory) */
00065 
00071 /*@only@*/ fingerPrintCache fpCacheCreate(int sizeHint)
00072         /*@*/;
00073 
00078 void fpCacheFree(/*@only@*/ fingerPrintCache cache)
00079         /*@modifies cache @*/;
00080 
00089 fingerPrint fpLookup(fingerPrintCache cache, const char * dirName, 
00090                         const char * baseName, int scareMemory)
00091         /*@modifies cache @*/;
00092 
00099 unsigned int fpHashFunction(const void * key)
00100         /*@*/;
00101 
00109 int fpEqual(const void * key1, const void * key2)
00110         /*@*/;
00111 
00122 void fpLookupList(fingerPrintCache cache, const char ** dirNames, 
00123                   const char ** baseNames, const int * dirIndexes, 
00124                   int fileCount, fingerPrint * fpList)
00125         /*@modifies cache, *fpList @*/;
00126 
00134 /*@unused@*/
00135 void fpLookupHeader(fingerPrintCache cache, Header h, fingerPrint * fpList)
00136         /*@modifies h, cache, *fpList @*/;
00137 
00138 #ifdef __cplusplus
00139 }
00140 #endif
00141 
00142 #endif

Generated on Wed Mar 13 15:34:50 2002 for rpm by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002