ecpgtype.h 2.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 * This file implements a data structure that is built and maintained by the
 * preprocessor.
 *
 * All types that can be handled for host variable declarations has to
 * be handled eventually.
 */

/*
 * Here are all the types that we are to handle. Note that it is the type
 * that is registered and that has nothing whatsoever to do with the storage
 * class.
 *
 * Simle types
 * integers: char, short, int, long (signed and unsigned)
 * floats: float, double
 *
 * Complex types:
 * VARCHAR, VARCHAR2 - Strings with length (maxlen is given in the declaration)
 * Arrays of simple types and of VARCHAR, VARCHAR2 (size given in declaration)
21
 * Records build of simple types, arrays and other structs.
22 23 24 25 26 27 28 29
 *
 * Complicating things:
 * typedefs and struct names!
 *
 * Conclusion:
 * This is a typically recursive definition. A structure of typed list elements
 * would probably work fine:
 */
30
#ifdef __cplusplus
31 32
extern		"C"
{
33 34
#endif

35 36 37 38 39 40 41 42 43
	enum ECPGttype
	{
		ECPGt_char = 1, ECPGt_unsigned_char, ECPGt_short, ECPGt_unsigned_short,
		ECPGt_int, ECPGt_unsigned_int, ECPGt_long, ECPGt_unsigned_long,
		ECPGt_bool,
		ECPGt_float, ECPGt_double,
		ECPGt_varchar, ECPGt_varchar2,
		ECPGt_array,
		ECPGt_struct,
M
 
Marc G. Fournier 已提交
44
		ECPGt_union,
M
 
Marc G. Fournier 已提交
45
		ECPGt_char_variable,
46 47
		ECPGt_EOIT,				/* End of insert types. */
		ECPGt_EORT,				/* End of result types. */
M
Michael Meskes 已提交
48
		ECPGt_NO_INDICATOR,		/* no indicator */
M
Michael Meskes 已提交
49 50
		ECPGt_long_long, ECPGt_unsigned_long_long,
		ECPGt_descriptor	/* sql descriptor, no C variable */
51
	};
M
Michael Meskes 已提交
52

53
	/* descriptor items */
M
Michael Meskes 已提交
54 55
	enum ECPGdtype
	{
M
Michael Meskes 已提交
56
		ECPGd_count = 1,
M
Michael Meskes 已提交
57 58 59 60 61 62 63 64 65 66 67 68 69 70
		ECPGd_data,
		ECPGd_di_code,
		ECPGd_di_precision,
		ECPGd_indicator,
		ECPGd_key_member,
		ECPGd_length,
		ECPGd_name,
		ECPGd_nullable,
		ECPGd_octet,
		ECPGd_precision,
		ECPGd_ret_length,
		ECPGd_ret_octet,
		ECPGd_scale,
		ECPGd_type,
71 72
		ECPGd_EODT,				/* End of descriptor types. */
		ECPGd_cardinality
M
Michael Meskes 已提交
73
	};
74

M
Michael Meskes 已提交
75
#define IS_SIMPLE_TYPE(type) (((type) >= ECPGt_char && (type) <= ECPGt_varchar2) || ((type)>=ECPGt_long_long && (type) <= ECPGt_unsigned_long_long))
76

77 78
#ifdef __cplusplus
}
79

80
#endif