~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/completion_hash.h

  • Committer: Brian Aker
  • Date: 2009-02-20 22:48:37 UTC
  • Revision ID: brian@tangent.org-20090220224837-fw5wrf46n4ru3e6a
First pass of stripping uint

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
typedef struct bucket
33
33
{
34
 
  uint h;                                       /* Used for numeric indexing */
 
34
  uint32_t h;                                   /* Used for numeric indexing */
35
35
  char *arKey;
36
 
  uint nKeyLength;
37
 
  uint count;
 
36
  uint32_t nKeyLength;
 
37
  uint32_t count;
38
38
  entry *pData;
39
39
  struct bucket *pNext;
40
40
} Bucket;
41
41
 
42
42
typedef struct hashtable {
43
 
  uint nTableSize;
44
 
  uint initialized;
 
43
  uint32_t nTableSize;
 
44
  uint32_t initialized;
45
45
  MEM_ROOT mem_root;
46
 
  uint(*pHashFunction) (const char *arKey, uint nKeyLength);
 
46
  uint(*pHashFunction) (const char *arKey, uint32_t nKeyLength);
47
47
  Bucket **arBuckets;
48
48
} HashTable;
49
49
 
50
 
extern int completion_hash_init(HashTable *ht, uint nSize);
51
 
extern int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, char *str);
 
50
extern int completion_hash_init(HashTable *ht, uint32_t nSize);
 
51
extern int completion_hash_update(HashTable *ht, char *arKey, uint32_t nKeyLength, char *str);
52
52
extern int hash_exists(HashTable *ht, char *arKey);
53
 
extern Bucket *find_all_matches(HashTable *ht, const char *str, uint length, uint *res_length);
54
 
extern Bucket *find_longest_match(HashTable *ht, char *str, uint length, uint *res_length);
 
53
extern Bucket *find_all_matches(HashTable *ht, const char *str, uint32_t length, uint32_t *res_length);
 
54
extern Bucket *find_longest_match(HashTable *ht, char *str, uint32_t length, uint32_t *res_length);
55
55
extern void add_word(HashTable *ht,char *str);
56
56
extern void completion_hash_clean(HashTable *ht);
57
 
extern int completion_hash_exists(HashTable *ht, char *arKey, uint nKeyLength);
 
57
extern int completion_hash_exists(HashTable *ht, char *arKey, uint32_t nKeyLength);
58
58
extern void completion_hash_free(HashTable *ht);
59
59
 
60
 
uint hashpjw(const char *arKey, uint nKeyLength);
 
60
uint32_t hashpjw(const char *arKey, uint32_t nKeyLength);
61
61
 
62
62
#endif /* _HASH_ */