00001 /* src/interfaces/ecpg/pgtypeslib/extern.h */ 00002 00003 #ifndef __PGTYPES_COMMON_H__ 00004 #define __PGTYPES_COMMON_H__ 00005 00006 #include "pgtypes_error.h" 00007 00008 /* These are the constants that decide which printf() format we'll use in 00009 * order to get a string representation of the value */ 00010 #define PGTYPES_TYPE_NOTHING 0 00011 #define PGTYPES_TYPE_STRING_MALLOCED 1 00012 #define PGTYPES_TYPE_STRING_CONSTANT 2 00013 #define PGTYPES_TYPE_CHAR 3 00014 #define PGTYPES_TYPE_DOUBLE_NF 4 /* no fractional part */ 00015 #define PGTYPES_TYPE_INT64 5 00016 #define PGTYPES_TYPE_UINT 6 00017 #define PGTYPES_TYPE_UINT_2_LZ 7 /* 2 digits, pad with leading 00018 * zero */ 00019 #define PGTYPES_TYPE_UINT_2_LS 8 /* 2 digits, pad with leading 00020 * space */ 00021 #define PGTYPES_TYPE_UINT_3_LZ 9 00022 #define PGTYPES_TYPE_UINT_4_LZ 10 00023 #define PGTYPES_TYPE_UINT_LONG 11 00024 00025 #define PGTYPES_FMT_NUM_MAX_DIGITS 40 00026 00027 union un_fmt_comb 00028 { 00029 char *str_val; 00030 unsigned int uint_val; 00031 char char_val; 00032 unsigned long int luint_val; 00033 double double_val; 00034 int64 int64_val; 00035 }; 00036 00037 int pgtypes_fmt_replace(union un_fmt_comb, int, char **, int *); 00038 00039 char *pgtypes_alloc(long); 00040 char *pgtypes_strdup(const char *); 00041 00042 #ifndef bool 00043 #define bool char 00044 #endif /* ndef bool */ 00045 00046 #ifndef FALSE 00047 #define FALSE 0 00048 #endif /* FALSE */ 00049 00050 #ifndef TRUE 00051 #define TRUE 1 00052 #endif /* TRUE */ 00053 00054 #endif /* __PGTYPES_COMMON_H__ */