]> granicus.if.org Git - postgresql/blob - src/interfaces/ecpg/include/ecpgtype.h
8ca4d697c158e887dd7ffd1cddc016c4978ca2fb
[postgresql] / src / interfaces / ecpg / include / ecpgtype.h
1 /*
2  * This file implements a data structure that is built and maintained by the
3  * preprocessor.
4  *
5  * All types that can be handled for host variable declarations has to
6  * be handled eventually.
7  */
8
9 /*
10  * Here are all the types that we are to handle. Note that it is the type
11  * that is registered and that has nothing whatsoever to do with the storage
12  * class.
13  *
14  * Simle types
15  * integers: char, short, int, long (signed and unsigned)
16  * floats: float, double
17  *
18  * Complex types:
19  * VARCHAR, VARCHAR2 - Strings with length (maxlen is given in the declaration)
20  * Arrays of simple types and of VARCHAR, VARCHAR2 (size given in declaration)
21  * Records build of simple types, arrays and other structs.
22  *
23  * Complicating things:
24  * typedefs and struct names!
25  *
26  * Conclusion:
27  * This is a typically recursive definition. A structure of typed list elements
28  * would probably work fine:
29  */
30 #include <stdio.h>
31
32 #ifdef __cplusplus
33 extern          "C"
34 {
35 #endif
36
37         enum ECPGttype
38         {
39                 ECPGt_char = 1, ECPGt_unsigned_char, ECPGt_short, ECPGt_unsigned_short,
40                 ECPGt_int, ECPGt_unsigned_int, ECPGt_long, ECPGt_unsigned_long,
41                 ECPGt_bool,
42                 ECPGt_float, ECPGt_double,
43                 ECPGt_varchar, ECPGt_varchar2,
44                 ECPGt_array,
45                 ECPGt_struct,
46                 ECPGt_char_variable,
47                 ECPGt_EOIT,                             /* End of insert types. */
48                 ECPGt_EORT,                             /* End of result types. */
49                 ECPGt_NO_INDICATOR              /* no indicator */
50         };
51
52 #define IS_SIMPLE_TYPE(type) ((type) >= ECPGt_char && (type) <= ECPGt_varchar2)
53
54         const char *ECPGtype_name(enum ECPGttype);
55
56 #ifdef __cplusplus
57 }
58
59 #endif