57d309fd3d5dd857a252679f33d82386c46d45d9
[rrq/rrqmisc.git] / vector / integeritem.c
1 #include <integeritem.h>
2
3 unsigned long integeritem_hashcode(itemkeyfun *this,void *key) {
4     return (unsigned long) key;
5 }
6
7 /**
8  * This callback function determines whether an item has a
9  * given key or not.
10  */
11 int integeritem_haskey(itemkeyfun *this,void *item,void *key) {
12     return item == key;
13 }
14
15 /**
16  * This callback function returns the key of an item by considering
17  * the arity and schema.
18  */
19 void *integeritem_itemkey(itemkeyfun *this,void *item) {
20     return item;
21 }
22
23 /**
24  * This callback function handles a key obtained from the itemkey
25  * callback function to reclaim temporary allocation.
26  */
27 void integeritem_releasekey(itemkeyfun *this,void *key) {
28 }
29
30 itemkeyfun integeritem = {
31     .hashcode = integeritem_hashcode,
32     .haskey = integeritem_haskey,
33     .itemkey = integeritem_itemkey,
34     .releasekey = integeritem_releasekey
35 };