lclint annotations.

CVS patchset: 4104
CVS date: 2000/08/23 12:59:48
This commit is contained in:
jbj 2000-08-23 12:59:48 +00:00
parent bb4c04321a
commit e62a4131e4
2 changed files with 18 additions and 14 deletions

View File

@ -68,7 +68,7 @@ extern "C" {
* @param sizeHint number of elements expected * @param sizeHint number of elements expected
* @return pointer to initialized fingerprint cache * @return pointer to initialized fingerprint cache
*/ */
/*@only@*/ fingerPrintCache fpCacheCreate(int sizeHint); /*@only@*/ fingerPrintCache fpCacheCreate(int sizeHint) /*@*/;
/** /**
* Destroy finger print cache. * Destroy finger print cache.
@ -85,7 +85,7 @@ void fpCacheFree(/*@only@*/ fingerPrintCache cache);
* @return pointer to the finger print associated with a file path. * @return pointer to the finger print associated with a file path.
*/ */
fingerPrint fpLookup(fingerPrintCache cache, const char * dirName, fingerPrint fpLookup(fingerPrintCache cache, const char * dirName,
const char * baseName, int scareMemory); const char * baseName, int scareMemory) /*@*/;
/** /**
* Return hash value for a finger print. * Return hash value for a finger print.
@ -93,7 +93,7 @@ fingerPrint fpLookup(fingerPrintCache cache, const char * dirName,
* @param key pointer to finger print entry * @param key pointer to finger print entry
* @return hash value * @return hash value
*/ */
unsigned int fpHashFunction(const void * key); unsigned int fpHashFunction(const void * key) /*@*/;
/** /**
* Compare two finger print entries. * Compare two finger print entries.
@ -102,7 +102,7 @@ unsigned int fpHashFunction(const void * key);
* @param key2 finger print 2 * @param key2 finger print 2
* @return result of comparing key1 and key2 * @return result of comparing key1 and key2
*/ */
int fpEqual(const void * key1, const void * key2); int fpEqual(const void * key1, const void * key2) /*@*/;
/** /**
* Return finger prints of an array of file paths. * Return finger prints of an array of file paths.
@ -116,7 +116,8 @@ int fpEqual(const void * key1, const void * key2);
*/ */
void fpLookupList(fingerPrintCache cache, const char ** dirNames, void fpLookupList(fingerPrintCache cache, const char ** dirNames,
const char ** baseNames, const int * dirIndexes, const char ** baseNames, const int * dirIndexes,
int fileCount, fingerPrint * fpList); int fileCount, fingerPrint * fpList)
/*@modifies cache, *fpList @*/;
/** /**
* Return finger prints of all file names in header. * Return finger prints of all file names in header.
@ -125,7 +126,8 @@ void fpLookupList(fingerPrintCache cache, const char ** dirNames,
* @param h package header * @param h package header
* @retval fpList pointer to array of finger prints * @retval fpList pointer to array of finger prints
*/ */
void fpLookupHeader(fingerPrintCache cache, Header h, fingerPrint * fpList); void fpLookupHeader(fingerPrintCache cache, Header h, fingerPrint * fpList)
/*@modifies cache, *fpList @*/;
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -12,16 +12,16 @@ extern "C" {
#endif #endif
/** */ /** */
typedef unsigned int (*hashFunctionType) (const void * string); typedef unsigned int (*hashFunctionType) (const void * string) /*@*/;
/** */ /** */
typedef int (*hashEqualityType) (const void * key1, const void * key2); typedef int (*hashEqualityType) (const void * key1, const void * key2) /*@*/;
/** /**
* Return hash value of a string * Return hash value of a string
* @param string string on which to calculate hash value * @param string string on which to calculate hash value
* @return hash value * @return hash value
*/ */
unsigned int hashFunctionString(const void * string); unsigned int hashFunctionString(const void * string) /*@*/;
/** /**
* Compare two hash table entries for equality. * Compare two hash table entries for equality.
@ -29,7 +29,7 @@ unsigned int hashFunctionString(const void * string);
* @param key2 entry 2 * @param key2 entry 2
* @return 0 if entries are equal * @return 0 if entries are equal
*/ */
int hashEqualityString(const void * key1, const void * key2); int hashEqualityString(const void * key1, const void * key2) /*@*/;
/** /**
* Create hash table. * Create hash table.
@ -43,7 +43,7 @@ int hashEqualityString(const void * key1, const void * key2);
* @return pointer to initialized hash table * @return pointer to initialized hash table
*/ */
hashTable htCreate(int numBuckets, int keySize, int freeData, hashTable htCreate(int numBuckets, int keySize, int freeData,
hashFunctionType fn, hashEqualityType eq); hashFunctionType fn, hashEqualityType eq) /*@*/;
/** /**
* Destroy hash table. * Destroy hash table.
@ -57,7 +57,8 @@ void htFree( /*@only@*/ hashTable ht);
* @param key pointer to key * @param key pointer to key
* @param data pointer to data value * @param data pointer to data value
*/ */
void htAddEntry(hashTable ht, /*@owned@*/ const void * key, /*@owned@*/ const void * data); void htAddEntry(hashTable ht, /*@owned@*/ const void * key,
/*@owned@*/ const void * data) /*@modifies ht */;
/** /**
* Retrieve item from hash table. * Retrieve item from hash table.
@ -69,7 +70,8 @@ void htAddEntry(hashTable ht, /*@owned@*/ const void * key, /*@owned@*/ const vo
* @return 0 on success, 1 if the item is not found. * @return 0 on success, 1 if the item is not found.
*/ */
int htGetEntry(hashTable ht, const void * key, /*@out@*/ const void *** data, int htGetEntry(hashTable ht, const void * key, /*@out@*/ const void *** data,
/*@out@*/ int * dataCount, /*@out@*/const void ** tableKey); /*@out@*/ int * dataCount, /*@out@*/ const void ** tableKey)
/*@modifies *data, *dataCount, *tableKey @*/;
/** /**
* Check for key in hash table. * Check for key in hash table.
@ -77,7 +79,7 @@ int htGetEntry(hashTable ht, const void * key, /*@out@*/ const void *** data,
* @param key pointer to key value * @param key pointer to key value
* @return 1 if the key is present, 0 otherwise * @return 1 if the key is present, 0 otherwise
*/ */
int htHasEntry(hashTable ht, const void * key); int htHasEntry(hashTable ht, const void * key) /*@*/;
#ifdef __cplusplus #ifdef __cplusplus
} }