#include <itemkeyfun.h>
+/**
+ * A tuple is an array of void*
+ */
+typedef void *tuple[];
+
/**
* A tupleschema record declares the itemkeyfun functions for tuple
* items together with applicable arity and domain combinations. The
* provide the handling of the tuple columns.
*/
itemkeyfun functions;
+
/**
* This is the number of columns in a tuple.
*/
int arity;
+
/**
- * This is an array of pointers to the tuple item domains as
- * represented by their associated itemkeyfun records.
+ * This points to an array of pointers to the tuple item domains
+ * as represented by their associated itemkeyfun records.
*/
- itemkeyfun **schema;
+ itemkeyfun **columns;
} tupleschema;
/**
*/
extern void tupleitem_releasekey(itemkeyfun *this,void *key);
+/**
+ * Create a tuples with given values.
+ */
+extern tuple *tuple_create(int arity,...);
+
+/**
+ * Create a tuples with given values.
+ */
+extern tupleschema *tupleschema_create(int arity,tuple *columns);
+
+/**
+ * Copy the given tupleschema into a new tupleschema with some columns
+ * masked. This represents a sub-index type using the unmasked columns
+ * for indexing.
+ */
+extern tupleschema *tupleschema_mask(tupleschema *schema,...);
+
/**
* The TUPLEITEMINIT macro is used for initializing a tupleschema
* record appropriately for a given arity and corresponding sequence
* of parts itemkeyfun pointers.
*/
#define TUPLEITEMINIT(arity, ... ) { \
- functions = { \
+ .functions = { \
.hashcode = tupleitem_hashcode, \
.haskey = tupleitem_haskey, \
.itemkey = tupleitem_itemkey, \