~ubuntu-branches/ubuntu/lucid/postgresql-8.4/lucid-proposed

« back to all changes in this revision

Viewing changes to src/interfaces/ecpg/include/ecpgtype.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 * $PostgreSQL$
 
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
};
 
66
 
 
67
 /* descriptor items */
 
68
enum ECPGdtype
 
69
{
 
70
        ECPGd_count = 1,
 
71
        ECPGd_data,
 
72
        ECPGd_di_code,
 
73
        ECPGd_di_precision,
 
74
        ECPGd_indicator,
 
75
        ECPGd_key_member,
 
76
        ECPGd_length,
 
77
        ECPGd_name,
 
78
        ECPGd_nullable,
 
79
        ECPGd_octet,
 
80
        ECPGd_precision,
 
81
        ECPGd_ret_length,
 
82
        ECPGd_ret_octet,
 
83
        ECPGd_scale,
 
84
        ECPGd_type,
 
85
        ECPGd_EODT,                                     /* End of descriptor types. */
 
86
        ECPGd_cardinality
 
87
};
 
88
 
 
89
#define IS_SIMPLE_TYPE(type) ((type) >= ECPGt_char && (type) <= ECPGt_interval)
 
90
 
 
91
/* we also have to handle different statement types */
 
92
enum ECPG_statement_type
 
93
{
 
94
        ECPGst_normal,
 
95
        ECPGst_execute,
 
96
        ECPGst_exec_immediate,
 
97
        ECPGst_prepnormal
 
98
};
 
99
 
 
100
#ifdef __cplusplus
 
101
}
 
102
#endif
 
103
 
 
104
#endif   /* _ECPGTYPE_H */