ea439c5dbe3ea9955fbb52565bcc26f722b48916
[rrq/rrqmisc.git] / vector / Tuple.h
1 #ifndef Tuple_H
2 #define Tuple_H
3
4 #include <ItemKeyFun.h>
5
6 typedef struct TupleSchema TupleSchema;
7
8 /**
9  * A Tuple is a "self typed" array of elements.
10  */
11 typedef struct {
12     /**
13      * The number of elements.
14      */
15     unsigned long size;
16     /**
17      * Base address for element pointers, which thus follow this
18      * struct in memory.
19      */
20     void *elements[];
21 } Tuple;
22
23 /**
24  * \brief Create an untyped tuple with given values.
25  *
26  * \related Tuple
27  */
28 extern Tuple *Tuple_create(int arity,...);
29
30 /**
31  * \brief Create an untyped tuple with 0 values.
32  *
33  * \related Tuple
34  */
35 extern Tuple *Tuple_calloc(unsigned long arity);
36
37 /**
38  * \brief Create a tuple as a clone of a given tuple.
39  *
40  * \related Tuple
41  */
42 extern Tuple *Tuple_clone(Tuple *t);
43
44 #endif