4 #include <itemkeyfun.h>
7 * A tuple is an array of void*
12 * A tupleschema record declares the itemkeyfun functions for tuple
13 * items together with applicable arity and domain combinations.
14 * Records are created dynamically via the \ref tupleschema_create
15 * function or the \ref TUPLESCHEMA convenience macro.
21 * These are the itemkeyfun callback functions to support
22 * hashvector use for tuple items. The functions expects their
23 * itemkeyfun pointer to be within a tupleschema record so as to
24 * provide the handling of the tuple columns.
29 * This is the number of columns in a tuple.
34 * This points to an array of pointers to the tuple item domains
35 * as represented by their associated itemkeyfun records.
41 * Create a tuples with given values.
43 * \related tupleschema
45 extern tuple *tuple_create(int arity,...);
48 * Create a tuples with given values.
50 * \related tupleschema
52 extern tupleschema *tupleschema_create(int arity,tuple *columns);
55 * Copy the given tupleschema into a new tupleschema with some columns
56 * masked. This represents a sub-index type using the unmasked columns
59 * \related tupleschema
61 extern tupleschema *tupleschema_mask(tupleschema *schema,...);
64 * \brief Return 1/0 to indicate whether the query matches the item.
66 * \related tupleschema
68 extern int tupleschema_match(tupleschema *def,tuple *query,tuple *item);
71 * \brief Generic macro to determine the number of expressions in a
74 * \related tupleschema
76 #define NUMARGS(...) (sizeof((void*[]){__VA_ARGS__})/sizeof(void*))
79 * \brief Create a tuple with the given values.
81 * This invokes \ref tuple_create to allocate and assign a void*
82 * array with the given values.
84 * \related tupleschema
86 #define TUPLE(...) tuple_create( NUMARGS(__VA_ARGS__), __VA_ARGS__ )
89 * \brief Create a \ref tupleschema with the given column "types".
91 * This invokes \ref tupleschema_create to allocate and initialize a
92 * \ref tupleschema for the given columns via the \ref TUPLE macro.
94 * \related tupleschema
96 #define TUPLESCHEMA(...) \
97 tupleschema_create( NUMARGS( __VA_ARGS__ ), TUPLE( __VA_ARGS__ ) )