2 #include <stringitem.h>
3 #include <hashvector.h>
5 unsigned long integeritem_hashcode(itemkeyfun *this,void *key) {
6 return hashvector_hashcode( (unsigned char*)key, strlen( (char*)key ) );
10 * This callback function determines whether an item has a
13 int integeritem_haskey(itemkeyfun *this,void *item,void *key) {
14 return strcmp( item, key ) == 0;
18 * This callback function returns the key of an item by considering
19 * the arity and schema.
21 void *integeritem_itemkey(itemkeyfun *this,void *item) {
26 * This callback function handles a key obtained from the itemkey
27 * callback function to reclaim temporary allocation.
29 void integeritem_releasekey(itemkeyfun *this,void *key) {
32 itemkeyfun stringitem = {
33 .hashcode = stringitem_hashcode,
34 .haskey = stringitem_haskey,
35 .itemkey = stringitem_itemkey,
36 .releasekey = stringitem_releasekey