PostgreSQL Source Code
git master
ecpgtype.h
Go to the documentation of this file.
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
* src/interfaces/ecpg/include/ecpgtype.h
9
*/
10
11
/*
12
* Here are all the types that we are to handle. Note that it is the type
13
* that is registered and that has nothing whatsoever to do with the storage
14
* class.
15
*
16
* Simple types
17
* integers: char, short, int, long (signed and unsigned)
18
* floats: float, double
19
*
20
* Complex types:
21
* VARCHAR, VARCHAR2 - Strings with length (maxlen is given in the declaration)
22
* Arrays of simple types and of VARCHAR, VARCHAR2 (size given in declaration)
23
* Records build of simple types, arrays and other structs.
24
*
25
* Complicating things:
26
* typedefs and struct names!
27
*
28
* Conclusion:
29
* This is a typically recursive definition. A structure of typed list elements
30
* would probably work fine:
31
*/
32
33
#ifndef _ECPGTYPE_H
34
#define _ECPGTYPE_H
35
36
#ifdef __cplusplus
37
extern
"C"
38
{
39
#endif
40
41
enum
ECPGttype
42
{
43
ECPGt_char
= 1,
ECPGt_unsigned_char
,
ECPGt_short
,
ECPGt_unsigned_short
,
44
ECPGt_int
,
ECPGt_unsigned_int
,
ECPGt_long
,
ECPGt_unsigned_long
,
45
ECPGt_long_long
,
ECPGt_unsigned_long_long
,
46
ECPGt_bool
,
47
ECPGt_float
,
ECPGt_double
,
48
ECPGt_varchar
,
ECPGt_varchar2
,
49
ECPGt_numeric
,
/* this is a decimal that stores its digits in
50
* a malloced array */
51
ECPGt_decimal
,
/* this is a decimal that stores its digits in
52
* a fixed array */
53
ECPGt_date
,
54
ECPGt_timestamp
,
55
ECPGt_interval
,
56
ECPGt_array
,
57
ECPGt_struct
,
58
ECPGt_union
,
59
ECPGt_descriptor
,
/* sql descriptor, no C variable */
60
ECPGt_char_variable
,
61
ECPGt_const
,
/* a constant is needed sometimes */
62
ECPGt_EOIT
,
/* End of insert types. */
63
ECPGt_EORT
,
/* End of result types. */
64
ECPGt_NO_INDICATOR
,
/* no indicator */
65
ECPGt_string
,
/* trimmed (char *) type */
66
ECPGt_sqlda
,
/* C struct descriptor */
67
ECPGt_bytea
68
};
69
70
/* descriptor items */
71
enum
ECPGdtype
72
{
73
ECPGd_count
= 1,
74
ECPGd_data
,
75
ECPGd_di_code
,
76
ECPGd_di_precision
,
77
ECPGd_indicator
,
78
ECPGd_key_member
,
79
ECPGd_length
,
80
ECPGd_name
,
81
ECPGd_nullable
,
82
ECPGd_octet
,
83
ECPGd_precision
,
84
ECPGd_ret_length
,
85
ECPGd_ret_octet
,
86
ECPGd_scale
,
87
ECPGd_type
,
88
ECPGd_EODT
,
/* End of descriptor types. */
89
ECPGd_cardinality
90
};
91
92
#define IS_SIMPLE_TYPE(type) (((type) >= ECPGt_char && (type) <= ECPGt_interval) || ((type) == ECPGt_string) || ((type) == ECPGt_bytea))
93
94
/* we also have to handle different statement types */
95
enum
ECPG_statement_type
96
{
97
ECPGst_normal
,
98
ECPGst_execute
,
99
ECPGst_exec_immediate
,
100
ECPGst_prepnormal
,
101
ECPGst_prepare
,
102
ECPGst_exec_with_exprlist
103
};
104
105
#ifdef __cplusplus
106
}
107
#endif
108
109
#endif
/* _ECPGTYPE_H */
ECPG_statement_type
ECPG_statement_type
Definition:
ecpgtype.h:96
ECPGst_normal
@ ECPGst_normal
Definition:
ecpgtype.h:97
ECPGst_execute
@ ECPGst_execute
Definition:
ecpgtype.h:98
ECPGst_exec_immediate
@ ECPGst_exec_immediate
Definition:
ecpgtype.h:99
ECPGst_exec_with_exprlist
@ ECPGst_exec_with_exprlist
Definition:
ecpgtype.h:102
ECPGst_prepare
@ ECPGst_prepare
Definition:
ecpgtype.h:101
ECPGst_prepnormal
@ ECPGst_prepnormal
Definition:
ecpgtype.h:100
ECPGttype
ECPGttype
Definition:
ecpgtype.h:42
ECPGt_float
@ ECPGt_float
Definition:
ecpgtype.h:47
ECPGt_EOIT
@ ECPGt_EOIT
Definition:
ecpgtype.h:62
ECPGt_long_long
@ ECPGt_long_long
Definition:
ecpgtype.h:45
ECPGt_sqlda
@ ECPGt_sqlda
Definition:
ecpgtype.h:66
ECPGt_short
@ ECPGt_short
Definition:
ecpgtype.h:43
ECPGt_decimal
@ ECPGt_decimal
Definition:
ecpgtype.h:51
ECPGt_char_variable
@ ECPGt_char_variable
Definition:
ecpgtype.h:60
ECPGt_bytea
@ ECPGt_bytea
Definition:
ecpgtype.h:67
ECPGt_numeric
@ ECPGt_numeric
Definition:
ecpgtype.h:49
ECPGt_union
@ ECPGt_union
Definition:
ecpgtype.h:58
ECPGt_varchar
@ ECPGt_varchar
Definition:
ecpgtype.h:48
ECPGt_struct
@ ECPGt_struct
Definition:
ecpgtype.h:57
ECPGt_timestamp
@ ECPGt_timestamp
Definition:
ecpgtype.h:54
ECPGt_unsigned_short
@ ECPGt_unsigned_short
Definition:
ecpgtype.h:43
ECPGt_int
@ ECPGt_int
Definition:
ecpgtype.h:44
ECPGt_long
@ ECPGt_long
Definition:
ecpgtype.h:44
ECPGt_unsigned_char
@ ECPGt_unsigned_char
Definition:
ecpgtype.h:43
ECPGt_double
@ ECPGt_double
Definition:
ecpgtype.h:47
ECPGt_varchar2
@ ECPGt_varchar2
Definition:
ecpgtype.h:48
ECPGt_array
@ ECPGt_array
Definition:
ecpgtype.h:56
ECPGt_NO_INDICATOR
@ ECPGt_NO_INDICATOR
Definition:
ecpgtype.h:64
ECPGt_EORT
@ ECPGt_EORT
Definition:
ecpgtype.h:63
ECPGt_date
@ ECPGt_date
Definition:
ecpgtype.h:53
ECPGt_interval
@ ECPGt_interval
Definition:
ecpgtype.h:55
ECPGt_unsigned_long
@ ECPGt_unsigned_long
Definition:
ecpgtype.h:44
ECPGt_const
@ ECPGt_const
Definition:
ecpgtype.h:61
ECPGt_bool
@ ECPGt_bool
Definition:
ecpgtype.h:46
ECPGt_unsigned_long_long
@ ECPGt_unsigned_long_long
Definition:
ecpgtype.h:45
ECPGt_unsigned_int
@ ECPGt_unsigned_int
Definition:
ecpgtype.h:44
ECPGt_descriptor
@ ECPGt_descriptor
Definition:
ecpgtype.h:59
ECPGt_char
@ ECPGt_char
Definition:
ecpgtype.h:43
ECPGt_string
@ ECPGt_string
Definition:
ecpgtype.h:65
ECPGdtype
ECPGdtype
Definition:
ecpgtype.h:72
ECPGd_scale
@ ECPGd_scale
Definition:
ecpgtype.h:86
ECPGd_precision
@ ECPGd_precision
Definition:
ecpgtype.h:83
ECPGd_length
@ ECPGd_length
Definition:
ecpgtype.h:79
ECPGd_nullable
@ ECPGd_nullable
Definition:
ecpgtype.h:81
ECPGd_di_precision
@ ECPGd_di_precision
Definition:
ecpgtype.h:76
ECPGd_type
@ ECPGd_type
Definition:
ecpgtype.h:87
ECPGd_cardinality
@ ECPGd_cardinality
Definition:
ecpgtype.h:89
ECPGd_indicator
@ ECPGd_indicator
Definition:
ecpgtype.h:77
ECPGd_ret_length
@ ECPGd_ret_length
Definition:
ecpgtype.h:84
ECPGd_di_code
@ ECPGd_di_code
Definition:
ecpgtype.h:75
ECPGd_count
@ ECPGd_count
Definition:
ecpgtype.h:73
ECPGd_name
@ ECPGd_name
Definition:
ecpgtype.h:80
ECPGd_key_member
@ ECPGd_key_member
Definition:
ecpgtype.h:78
ECPGd_EODT
@ ECPGd_EODT
Definition:
ecpgtype.h:88
ECPGd_octet
@ ECPGd_octet
Definition:
ecpgtype.h:82
ECPGd_ret_octet
@ ECPGd_ret_octet
Definition:
ecpgtype.h:85
ECPGd_data
@ ECPGd_data
Definition:
ecpgtype.h:74
src
interfaces
ecpg
include
ecpgtype.h
Generated on Tue Nov 5 2024 00:13:27 for PostgreSQL Source Code by
1.9.1