Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hash.h
Go to the documentation of this file.
1 #ifndef MDVI_HASH
2 #define MDVI_HASH
3 
4 /* Hash tables */
5 
6 
8 typedef struct _DviHashTable DviHashTable;
9 
10 /*
11  * Hash tables
12  */
13 
14 typedef Uchar *DviHashKey;
15 #define MDVI_KEY(x) ((DviHashKey)(x))
16 
17 typedef Ulong (*DviHashFunc) __PROTO((DviHashKey key));
18 typedef int (*DviHashComp) __PROTO((DviHashKey key1, DviHashKey key2));
19 typedef void (*DviHashFree) __PROTO((DviHashKey key, void *data));
20 
21 
22 struct _DviHashTable {
24  int nbucks;
25  int nkeys;
26  DviHashFunc hash_func;
27  DviHashComp hash_comp;
28  DviHashFree hash_free;
29 };
30 #define MDVI_EMPTY_HASH_TABLE {NULL, 0, 0, NULL, NULL, NULL}
31 
32 #define MDVI_HASH_REPLACE 0
33 #define MDVI_HASH_UNIQUE 1
34 #define MDVI_HASH_UNCHECKED 2
35 
36 extern void mdvi_hash_init __PROTO((DviHashTable *));
37 extern void mdvi_hash_create __PROTO((DviHashTable *, int));
38 extern int mdvi_hash_add __PROTO((DviHashTable *, DviHashKey, void *, int));
40 extern void mdvi_hash_reset __PROTO((DviHashTable *, int));
44 
45 #define mdvi_hash_flush(h) mdvi_hash_reset((h), 1)
46 #define mdvi_hash_destroy(h) mdvi_hash_reset((h), 0)
47 
48 #endif
49