OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / 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  * Simple 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
31 #ifndef _ECPGTYPE_H
32 #define _ECPGTYPE_H
33
34 #ifdef __cplusplus
35 extern          "C"
36 {
37 #endif
38
39 enum ECPGttype
40 {
41         ECPGt_char = 1, ECPGt_unsigned_char, ECPGt_short, ECPGt_unsigned_short,
42         ECPGt_int, ECPGt_unsigned_int, ECPGt_long, ECPGt_unsigned_long,
43         ECPGt_long_long, ECPGt_unsigned_long_long,
44         ECPGt_bool,
45         ECPGt_float, ECPGt_double,
46         ECPGt_varchar, ECPGt_varchar2,
47         ECPGt_numeric,                          /* this is a decimal that stores its
48                                                                  * digits in a malloced array */
49         ECPGt_decimal,                          /* this is a decimal that stores its
50                                                                  * digits in a fixed array */
51         ECPGt_date,
52         ECPGt_timestamp,
53         ECPGt_interval,
54         ECPGt_array,
55         ECPGt_struct,
56         ECPGt_union,
57         ECPGt_descriptor,                       /* sql descriptor, no C variable */
58         ECPGt_char_variable,
59         ECPGt_const,                            /* a constant is needed sometimes */
60         ECPGt_EOIT,                                     /* End of insert types. */
61         ECPGt_EORT,                                     /* End of result types. */
62         ECPGt_NO_INDICATOR                      /* no indicator */
63 };
64
65  /* descriptor items */
66 enum ECPGdtype
67 {
68         ECPGd_count = 1,
69         ECPGd_data,
70         ECPGd_di_code,
71         ECPGd_di_precision,
72         ECPGd_indicator,
73         ECPGd_key_member,
74         ECPGd_length,
75         ECPGd_name,
76         ECPGd_nullable,
77         ECPGd_octet,
78         ECPGd_precision,
79         ECPGd_ret_length,
80         ECPGd_ret_octet,
81         ECPGd_scale,
82         ECPGd_type,
83         ECPGd_EODT,                                     /* End of descriptor types. */
84         ECPGd_cardinality
85 };
86
87 #define IS_SIMPLE_TYPE(type) ((type) >= ECPGt_char && (type) <= ECPGt_interval)
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif   /* _ECPGTYPE_H */