irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_hashtable.h
Go to the documentation of this file.
1 /* For copyright information please refer to files in the COPYRIGHT directory
2  */
3 #ifndef HASHTABLE_H__
4 #define HASHTABLE_H__
5 #include <string.h>
6 #include <stdio.h>
7 #include "region.h"
8 #define HASH_BASE 5381
9 #define myhash(x) B_hash((unsigned char*)(x))
10 
11 struct bucket {
12  char* key;
13  const void* value;
14  struct bucket *next;
15 };
16 typedef struct hashtable {
17  struct bucket **buckets;
18  int size; /* capacity */
19  int len;
20  int dynamic;
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 struct bucket *newBucket( const char* key, const void* value );
29 unsigned long B_hash( unsigned char* string );
32 int insertIntoHashTable( Hashtable *h, const char* key, const void *value );
33 const void* updateInHashTable( Hashtable *h, const char* key, const void *value );
34 const void* deleteFromHashTable( Hashtable *h, const char* key );
35 const void* lookupFromHashTable( Hashtable *h, const char* key );
36 void deleteHashTable( Hashtable *h, void ( *f )( const void * ) );
37 void deleteBucket( struct bucket *h, void ( *f )( const void * ) );
38 struct bucket* lookupBucketFromHashTable( Hashtable *h, const char* key );
39 struct bucket* nextBucket( struct bucket *h, const char* key );
40 void nop( const void *a );
41 void free_const( const void *a );
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif // HASHTABLE_H__
hashtable::dynamic
int dynamic
Definition: irods_hashtable.h:20
bucket::key
char * key
Definition: irods_hashtable.h:12
Hashtable
struct hashtable Hashtable
bucket
Definition: irods_hashtable.h:11
region.h
deleteBucket
void deleteBucket(struct bucket *h, void(*f)(const void *))
Definition: hashtable.cpp:273
deleteFromHashTable
const void * deleteFromHashTable(Hashtable *h, const char *key)
Definition: hashtable.cpp:184
free_const
void free_const(const void *a)
Definition: hashtable.cpp:287
hashtable::buckets
struct bucket ** buckets
Definition: irods_hashtable.h:17
newHashTable2
Hashtable * newHashTable2(int size, Region *r)
Definition: hashtable.cpp:72
insertIntoHashTable
int insertIntoHashTable(Hashtable *h, const char *key, const void *value)
Definition: hashtable.cpp:99
nextBucket
struct bucket * nextBucket(struct bucket *h, const char *key)
Definition: hashtable.cpp:249
hashtable::bucketRegion
Region * bucketRegion
Definition: irods_hashtable.h:21
get_irods_version.value
dictionary value
Definition: get_irods_version.py:27
hashtable::len
int len
Definition: irods_hashtable.h:19
bucket::next
struct bucket * next
Definition: irods_hashtable.h:14
lookupFromHashTable
const void * lookupFromHashTable(Hashtable *h, const char *key)
Definition: hashtable.cpp:222
region
Definition: region.h:45
newBucket
struct bucket * newBucket(const char *key, const void *value)
Definition: hashtable.cpp:18
lookupBucketFromHashTable
struct bucket * lookupBucketFromHashTable(Hashtable *h, const char *key)
Definition: hashtable.cpp:237
updateInHashTable
const void * updateInHashTable(Hashtable *h, const char *key, const void *value)
Definition: hashtable.cpp:164
newHashTable
Hashtable * newHashTable(int size)
Definition: hashtable.cpp:46
hashtable::size
int size
Definition: irods_hashtable.h:18
bucket::value
const void * value
Definition: irods_hashtable.h:13
hashtable
Definition: irods_hashtable.h:16
B_hash
unsigned long B_hash(unsigned char *string)
Definition: hashtable.cpp:293
size
long long size
Definition: filesystem.cpp:102
deleteHashTable
void deleteHashTable(Hashtable *h, void(*f)(const void *))
Definition: hashtable.cpp:260
nop
void nop(const void *a)
Definition: hashtable.cpp:284