6 #define COLUMN def->schema[i]
8 unsigned long tupleitem_hashcode(itemkeyfun *this,void *key) {
9 tupleschema *def = (tupleschema *) this;
10 tuple *kp = (tuple*) key;
12 unsigned long value = 0;
13 for ( ; i < def->arity; i++ ) {
16 value += COLUMN->hashcode( COLUMN, (*kp)[i] );
23 * This callback function determines whether an item has a
26 int tupleitem_haskey(itemkeyfun *this,void *item,void *key) {
27 tupleschema *def = (tupleschema *) this;
28 tuple *kp = (tuple*) key;
29 tuple *tp = (tuple*) item;
32 for ( ; i < def->arity; i++ ) {
34 haskey &= COLUMN->haskey( COLUMN, (*tp)[i], (*kp)[i] );
42 * This callback function returns the key of an item by considering
45 void *tupleitem_itemkey(itemkeyfun *this,void *item) {
46 tupleschema *def = (tupleschema *) this;
47 tuple *tp = (tuple*) item;
50 for ( i = 0 ; i < def->arity; i++ ) {
55 void **parts = calloc( keylen, sizeof( void* ) );
56 for ( i = 0, j = 0; i < def->arity; i++ ) {
58 parts[j++] = COLUMN->itemkey( COLUMN, (*tp)[i] );
65 * This callback function handles a key obtained from the itemkey
66 * callback function to reclaim temporary allocation.
68 void tupleitem_releasekey(itemkeyfun *this,void *key) {
69 tupleschema *def = (tupleschema *) this;
70 tuple *kp = (tuple*) key;
72 for ( i = 0, j = 0; i < def->arity; i++ ) {
74 COLUMN->releasekey( COLUMN, (*kp)[j++] );