aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/include')
-rw-r--r--src/interfaces/ecpg/include/datetime.h18
-rw-r--r--src/interfaces/ecpg/include/decimal.h31
-rw-r--r--src/interfaces/ecpg/include/ecpg_informix.h36
-rw-r--r--src/interfaces/ecpg/include/ecpgerrno.h4
-rw-r--r--src/interfaces/ecpg/include/ecpglib.h9
-rw-r--r--src/interfaces/ecpg/include/ecpgtype.h18
-rw-r--r--src/interfaces/ecpg/include/pgtypes_date.h15
-rw-r--r--src/interfaces/ecpg/include/pgtypes_error.h5
-rw-r--r--src/interfaces/ecpg/include/pgtypes_interval.h15
-rw-r--r--src/interfaces/ecpg/include/pgtypes_numeric.h88
-rw-r--r--src/interfaces/ecpg/include/pgtypes_timestamp.h10
-rw-r--r--src/interfaces/ecpg/include/sqlca.h2
-rw-r--r--src/interfaces/ecpg/include/sqlda.h1
-rw-r--r--src/interfaces/ecpg/include/sqltypes.h22
14 files changed, 141 insertions, 133 deletions
diff --git a/src/interfaces/ecpg/include/datetime.h b/src/interfaces/ecpg/include/datetime.h
index da16faa4855..ed8f31dfc8a 100644
--- a/src/interfaces/ecpg/include/datetime.h
+++ b/src/interfaces/ecpg/include/datetime.h
@@ -3,16 +3,16 @@
#ifndef dtime_t
#define dtime_t Timestamp
-#endif /* dtime_t */
+#endif /* dtime_t */
#ifndef intrvl_t
#define intrvl_t Interval
-#endif /* intrvl_t */
+#endif /* intrvl_t */
-extern void dtcurrent (dtime_t *);
-extern int dtcvasc (char *, dtime_t *);
-extern int dtsub (dtime_t *, dtime_t *, intrvl_t *);
-extern int dttoasc (dtime_t *, char *);
-extern int dttofmtasc (dtime_t *, char *, int, char *);
-extern int intoasc(intrvl_t *, char *);
-extern int dtcvfmtasc(char *, char *, dtime_t *);
+extern void dtcurrent(dtime_t *);
+extern int dtcvasc(char *, dtime_t *);
+extern int dtsub(dtime_t *, dtime_t *, intrvl_t *);
+extern int dttoasc(dtime_t *, char *);
+extern int dttofmtasc(dtime_t *, char *, int, char *);
+extern int intoasc(intrvl_t *, char *);
+extern int dtcvfmtasc(char *, char *, dtime_t *);
diff --git a/src/interfaces/ecpg/include/decimal.h b/src/interfaces/ecpg/include/decimal.h
index e0cb06bd5c8..c68e253e682 100644
--- a/src/interfaces/ecpg/include/decimal.h
+++ b/src/interfaces/ecpg/include/decimal.h
@@ -2,20 +2,19 @@
#ifndef dec_t
#define dec_t Decimal
-#endif /* dec_t */
-
-int decadd(dec_t *, dec_t *, dec_t *);
-int deccmp(dec_t *, dec_t *);
-void deccopy(dec_t *, dec_t *);
-int deccvasc(char *, int, dec_t *);
-int deccvdbl(double, dec_t *);
-int deccvint(int, dec_t *);
-int deccvlong(long, dec_t *);
-int decdiv(dec_t *, dec_t *, dec_t *);
-int decmul(dec_t *, dec_t *, dec_t *);
-int decsub(dec_t *, dec_t *, dec_t *);
-int dectoasc(dec_t *, char *, int, int);
-int dectodbl(dec_t *, double *);
-int dectoint(dec_t *, int *);
-int dectolong(dec_t *, long *);
+#endif /* dec_t */
+int decadd(dec_t *, dec_t *, dec_t *);
+int deccmp(dec_t *, dec_t *);
+void deccopy(dec_t *, dec_t *);
+int deccvasc(char *, int, dec_t *);
+int deccvdbl(double, dec_t *);
+int deccvint(int, dec_t *);
+int deccvlong(long, dec_t *);
+int decdiv(dec_t *, dec_t *, dec_t *);
+int decmul(dec_t *, dec_t *, dec_t *);
+int decsub(dec_t *, dec_t *, dec_t *);
+int dectoasc(dec_t *, char *, int, int);
+int dectodbl(dec_t *, double *);
+int dectoint(dec_t *, int *);
+int dectolong(dec_t *, long *);
diff --git a/src/interfaces/ecpg/include/ecpg_informix.h b/src/interfaces/ecpg/include/ecpg_informix.h
index 59991c70a91..b5c8ed4884f 100644
--- a/src/interfaces/ecpg/include/ecpg_informix.h
+++ b/src/interfaces/ecpg/include/ecpg_informix.h
@@ -1,4 +1,4 @@
-/*
+/*
* This file contains stuff needed to be as compatible to Informix as possible.
*/
@@ -10,27 +10,27 @@
#ifndef Date
#define Date long
-#endif /* ! Date */
+#endif /* ! Date */
-extern int rdatestr (Date, char *);
-extern void rtoday (Date *);
-extern int rjulmdy (Date, short *);
-extern int rdefmtdate (Date *, char *, char *);
-extern int rfmtdate (Date, char *, char *);
-extern int rmdyjul (short *, Date *);
-extern int rstrdate (char *, Date *);
-extern int rdayofweek(Date);
+extern int rdatestr(Date, char *);
+extern void rtoday(Date *);
+extern int rjulmdy(Date, short *);
+extern int rdefmtdate(Date *, char *, char *);
+extern int rfmtdate(Date, char *, char *);
+extern int rmdyjul(short *, Date *);
+extern int rstrdate(char *, Date *);
+extern int rdayofweek(Date);
-extern int rfmtlong(long, char *, char *);
-extern int rgetmsg(int, char *, int);
-extern int risnull(int, char *);
-extern int rsetnull(int, char *);
-extern int rtypalign(int, int);
-extern int rtypmsize(int, int);
-extern int rtypwidth(int, int);
+extern int rfmtlong(long, char *, char *);
+extern int rgetmsg(int, char *, int);
+extern int risnull(int, char *);
+extern int rsetnull(int, char *);
+extern int rtypalign(int, int);
+extern int rtypmsize(int, int);
+extern int rtypwidth(int, int);
extern void rupshift(char *);
-extern int byleng(char *, int);
+extern int byleng(char *, int);
extern void ldchar(char *, int, char *);
extern void ECPG_informix_set_var(int, void *, int);
diff --git a/src/interfaces/ecpg/include/ecpgerrno.h b/src/interfaces/ecpg/include/ecpgerrno.h
index eb1936beb18..7a551551541 100644
--- a/src/interfaces/ecpg/include/ecpgerrno.h
+++ b/src/interfaces/ecpg/include/ecpgerrno.h
@@ -52,8 +52,8 @@
/* for compatibility we define some different error codes for the same error
* if adding a new one make sure to not double define it */
-#define ECPG_INFORMIX_DUPLICATE_KEY -239
-#define ECPG_INFORMIX_SUBSELECT_NOT_ONE -284
+#define ECPG_INFORMIX_DUPLICATE_KEY -239
+#define ECPG_INFORMIX_SUBSELECT_NOT_ONE -284
/* backend WARNINGs, starting at 600 */
#define ECPG_WARNING_UNRECOGNIZED -600
diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h
index 3f510fbfa60..fc429c96433 100644
--- a/src/interfaces/ecpg/include/ecpglib.h
+++ b/src/interfaces/ecpg/include/ecpglib.h
@@ -41,7 +41,7 @@ extern "C"
struct sqlca_t;
-void ECPGinit_sqlca(struct sqlca_t *sqlca);
+void ECPGinit_sqlca(struct sqlca_t * sqlca);
void ECPGdebug(int, FILE *);
bool ECPGstatus(int, const char *);
bool ECPGsetcommit(int, const char *, const char *);
@@ -57,7 +57,7 @@ bool ECPGdeallocate_all(int);
char *ECPGprepared_statement(char *);
void ECPGlog(const char *format,...);
-char *ECPGerrmsg(void);
+char *ECPGerrmsg(void);
/* print an error message */
void sqlprint(void);
@@ -79,14 +79,13 @@ bool ECPGget_desc(int, char *, int,...);
void ECPGset_informix_null(enum ECPGttype, void *);
bool ECPGis_informix_null(enum ECPGttype, void *);
-bool ECPGdescribe(int, bool, const char *, ...);
+bool ECPGdescribe(int, bool, const char *,...);
/* dynamic result allocation */
void ECPGfree_auto_mem(void);
#ifdef __cplusplus
}
-
#endif
-#endif /* _ECPGLIB_H */
+#endif /* _ECPGLIB_H */
diff --git a/src/interfaces/ecpg/include/ecpgtype.h b/src/interfaces/ecpg/include/ecpgtype.h
index 7a299d0be89..3d544029b73 100644
--- a/src/interfaces/ecpg/include/ecpgtype.h
+++ b/src/interfaces/ecpg/include/ecpgtype.h
@@ -44,20 +44,22 @@ enum ECPGttype
ECPGt_bool,
ECPGt_float, ECPGt_double,
ECPGt_varchar, ECPGt_varchar2,
- ECPGt_numeric, /* this is a decimal that stores its digits in a malloced array */
- ECPGt_decimal, /* this is a decimal that stores its digits in a fixed array */
+ ECPGt_numeric, /* this is a decimal that stores its
+ * digits in a malloced array */
+ ECPGt_decimal, /* this is a decimal that stores its
+ * digits in a fixed array */
ECPGt_date,
ECPGt_timestamp,
ECPGt_interval,
ECPGt_array,
ECPGt_struct,
ECPGt_union,
- ECPGt_descriptor, /* sql descriptor, no C variable */
+ ECPGt_descriptor, /* sql descriptor, no C variable */
ECPGt_char_variable,
- ECPGt_const, /* a constant is needed sometimes */
- ECPGt_EOIT, /* End of insert types. */
- ECPGt_EORT, /* End of result types. */
- ECPGt_NO_INDICATOR /* no indicator */
+ ECPGt_const, /* a constant is needed sometimes */
+ ECPGt_EOIT, /* End of insert types. */
+ ECPGt_EORT, /* End of result types. */
+ ECPGt_NO_INDICATOR /* no indicator */
};
/* descriptor items */
@@ -88,4 +90,4 @@ enum ECPGdtype
}
#endif
-#endif /* _ECPGTYPE_H */
+#endif /* _ECPGTYPE_H */
diff --git a/src/interfaces/ecpg/include/pgtypes_date.h b/src/interfaces/ecpg/include/pgtypes_date.h
index 190a9de703a..391eeedce8c 100644
--- a/src/interfaces/ecpg/include/pgtypes_date.h
+++ b/src/interfaces/ecpg/include/pgtypes_date.h
@@ -8,10 +8,11 @@
extern Date PGTYPESdate_from_asc(char *, char **);
extern char *PGTYPESdate_to_asc(Date);
extern Date PGTYPESdate_from_timestamp(Timestamp);
-extern void PGTYPESdate_julmdy(Date, int*);
-extern void PGTYPESdate_mdyjul(int*, Date *);
-extern int PGTYPESdate_dayofweek(Date);
-extern void PGTYPESdate_today (Date *);
-extern int PGTYPESdate_defmt_asc(Date *, char *, char *);
-extern int PGTYPESdate_fmt_asc(Date, char *, char *);
-#endif /* PGTYPES_DATETIME */
+extern void PGTYPESdate_julmdy(Date, int *);
+extern void PGTYPESdate_mdyjul(int *, Date *);
+extern int PGTYPESdate_dayofweek(Date);
+extern void PGTYPESdate_today(Date *);
+extern int PGTYPESdate_defmt_asc(Date *, char *, char *);
+extern int PGTYPESdate_fmt_asc(Date, char *, char *);
+
+#endif /* PGTYPES_DATETIME */
diff --git a/src/interfaces/ecpg/include/pgtypes_error.h b/src/interfaces/ecpg/include/pgtypes_error.h
index e5a102ca98d..4a1008adc33 100644
--- a/src/interfaces/ecpg/include/pgtypes_error.h
+++ b/src/interfaces/ecpg/include/pgtypes_error.h
@@ -1,4 +1,4 @@
-#define PGTYPES_NUM_OVERFLOW 301
+#define PGTYPES_NUM_OVERFLOW 301
#define PGTYPES_NUM_BAD_NUMERIC 302
#define PGTYPES_NUM_DIVIDE_ZERO 303
@@ -10,7 +10,6 @@
#define PGTYPES_DATE_BAD_MONTH 315
#define PGTYPES_TS_BAD_TIMESTAMP 320
-#define PGTYPES_TS_ERR_EINFTIME 321
+#define PGTYPES_TS_ERR_EINFTIME 321
#define PGTYPES_INTVL_BAD_INTERVAL 330
-
diff --git a/src/interfaces/ecpg/include/pgtypes_interval.h b/src/interfaces/ecpg/include/pgtypes_interval.h
index 884df67216a..4e1fa6e10b2 100644
--- a/src/interfaces/ecpg/include/pgtypes_interval.h
+++ b/src/interfaces/ecpg/include/pgtypes_interval.h
@@ -4,15 +4,18 @@
typedef struct
{
#ifdef HAVE_INT64_TIMESTAMP
- int64 time; /* all time units other than months and years */
+ int64 time; /* all time units other than months and
+ * years */
#else
- double time; /* all time units other than months and years */
+ double time; /* all time units other than months and
+ * years */
#endif
- long month; /* months and years, after time for alignment */
+ long month; /* months and years, after time for
+ * alignment */
} Interval;
extern Interval *PGTYPESinterval_from_asc(char *, char **);
extern char *PGTYPESinterval_to_asc(Interval *);
-extern int PGTYPESinterval_copy(Interval *, Interval *);
-
-#endif /* PGTYPES_INTERVAL */
+extern int PGTYPESinterval_copy(Interval *, Interval *);
+
+#endif /* PGTYPES_INTERVAL */
diff --git a/src/interfaces/ecpg/include/pgtypes_numeric.h b/src/interfaces/ecpg/include/pgtypes_numeric.h
index 28b902f290d..55d2924e593 100644
--- a/src/interfaces/ecpg/include/pgtypes_numeric.h
+++ b/src/interfaces/ecpg/include/pgtypes_numeric.h
@@ -1,55 +1,59 @@
#ifndef PGTYPES_NUMERIC
#define PGTYPES_NUMERIC
-#define NUMERIC_POS 0x0000
-#define NUMERIC_NEG 0x4000
-#define NUMERIC_NAN 0xC000
-#define NUMERIC_MAX_PRECISION 1000
-#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
-#define NUMERIC_MIN_DISPLAY_SCALE 0
-#define NUMERIC_MIN_SIG_DIGITS 16
+#define NUMERIC_POS 0x0000
+#define NUMERIC_NEG 0x4000
+#define NUMERIC_NAN 0xC000
+#define NUMERIC_MAX_PRECISION 1000
+#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
+#define NUMERIC_MIN_DISPLAY_SCALE 0
+#define NUMERIC_MIN_SIG_DIGITS 16
#define DECSIZE 30
typedef unsigned char NumericDigit;
-typedef struct
+typedef struct
{
- int ndigits; /* number of digits in digits[] - can be 0! */
- int weight; /* weight of first digit */
- int rscale; /* result scale */
- int dscale; /* display scale */
- int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- NumericDigit *buf; /* start of alloc'd space for digits[] */
- NumericDigit *digits; /* decimal digits */
+ int ndigits; /* number of digits in digits[] - can be
+ * 0! */
+ int weight; /* weight of first digit */
+ int rscale; /* result scale */
+ int dscale; /* display scale */
+ int sign; /* NUMERIC_POS, NUMERIC_NEG, or
+ * NUMERIC_NAN */
+ NumericDigit *buf; /* start of alloc'd space for digits[] */
+ NumericDigit *digits; /* decimal digits */
} Numeric;
-typedef struct
+typedef struct
{
- int ndigits; /* number of digits in digits[] - can be 0! */
- int weight; /* weight of first digit */
- int rscale; /* result scale */
- int dscale; /* display scale */
- int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */
- NumericDigit digits[DECSIZE]; /* decimal digits */
-} Decimal;
+ int ndigits; /* number of digits in digits[] - can be
+ * 0! */
+ int weight; /* weight of first digit */
+ int rscale; /* result scale */
+ int dscale; /* display scale */
+ int sign; /* NUMERIC_POS, NUMERIC_NEG, or
+ * NUMERIC_NAN */
+ NumericDigit digits[DECSIZE]; /* decimal digits */
+} Decimal;
-Numeric *PGTYPESnumeric_new(void);
-void PGTYPESnumeric_free(Numeric *);
-Numeric *PGTYPESnumeric_from_asc(char *, char **);
-char *PGTYPESnumeric_to_asc(Numeric *, int);
-int PGTYPESnumeric_add(Numeric *, Numeric *, Numeric *);
-int PGTYPESnumeric_sub(Numeric *, Numeric *, Numeric *);
-int PGTYPESnumeric_mul(Numeric *, Numeric *, Numeric *);
-int PGTYPESnumeric_div(Numeric *, Numeric *, Numeric *);
-int PGTYPESnumeric_cmp(Numeric *, Numeric *);
-int PGTYPESnumeric_from_int(signed int, Numeric *);
-int PGTYPESnumeric_from_long(signed long int, Numeric *);
-int PGTYPESnumeric_copy(Numeric *, Numeric *);
-int PGTYPESnumeric_from_double(double, Numeric *);
-int PGTYPESnumeric_to_double(Numeric *, double *);
-int PGTYPESnumeric_to_int(Numeric *, int *);
-int PGTYPESnumeric_to_long(Numeric *, long *);
-int PGTYPESnumeric_to_decimal(Numeric *, Decimal *);
-int PGTYPESnumeric_from_decimal(Decimal *, Numeric *);
+Numeric *PGTYPESnumeric_new(void);
+void PGTYPESnumeric_free(Numeric *);
+Numeric *PGTYPESnumeric_from_asc(char *, char **);
+char *PGTYPESnumeric_to_asc(Numeric *, int);
+int PGTYPESnumeric_add(Numeric *, Numeric *, Numeric *);
+int PGTYPESnumeric_sub(Numeric *, Numeric *, Numeric *);
+int PGTYPESnumeric_mul(Numeric *, Numeric *, Numeric *);
+int PGTYPESnumeric_div(Numeric *, Numeric *, Numeric *);
+int PGTYPESnumeric_cmp(Numeric *, Numeric *);
+int PGTYPESnumeric_from_int(signed int, Numeric *);
+int PGTYPESnumeric_from_long(signed long int, Numeric *);
+int PGTYPESnumeric_copy(Numeric *, Numeric *);
+int PGTYPESnumeric_from_double(double, Numeric *);
+int PGTYPESnumeric_to_double(Numeric *, double *);
+int PGTYPESnumeric_to_int(Numeric *, int *);
+int PGTYPESnumeric_to_long(Numeric *, long *);
+int PGTYPESnumeric_to_decimal(Numeric *, Decimal *);
+int PGTYPESnumeric_from_decimal(Decimal *, Numeric *);
-#endif /* PGTYPES_NUMERIC */
+#endif /* PGTYPES_NUMERIC */
diff --git a/src/interfaces/ecpg/include/pgtypes_timestamp.h b/src/interfaces/ecpg/include/pgtypes_timestamp.h
index 9294e1d77a0..f1aabcbea2b 100644
--- a/src/interfaces/ecpg/include/pgtypes_timestamp.h
+++ b/src/interfaces/ecpg/include/pgtypes_timestamp.h
@@ -14,9 +14,9 @@ typedef double TimestampTz;
extern Timestamp PGTYPEStimestamp_from_asc(char *, char **);
extern char *PGTYPEStimestamp_to_asc(Timestamp);
-extern int PGTYPEStimestamp_sub (Timestamp *, Timestamp *, Interval *);
-extern int PGTYPEStimestamp_fmt_asc (Timestamp *, char *, int, char *);
-extern void PGTYPEStimestamp_current (Timestamp *);
-extern int PGTYPEStimestamp_defmt_asc(char *, char *, Timestamp *);
+extern int PGTYPEStimestamp_sub(Timestamp *, Timestamp *, Interval *);
+extern int PGTYPEStimestamp_fmt_asc(Timestamp *, char *, int, char *);
+extern void PGTYPEStimestamp_current(Timestamp *);
+extern int PGTYPEStimestamp_defmt_asc(char *, char *, Timestamp *);
-#endif /* PGTYPES_TIMESTAMP */
+#endif /* PGTYPES_TIMESTAMP */
diff --git a/src/interfaces/ecpg/include/sqlca.h b/src/interfaces/ecpg/include/sqlca.h
index 37370b6f605..8d58d3dfd36 100644
--- a/src/interfaces/ecpg/include/sqlca.h
+++ b/src/interfaces/ecpg/include/sqlca.h
@@ -56,7 +56,7 @@ struct sqlca_t
struct sqlca_t *ECPGget_sqlca(void);
#ifndef POSTGRES_ECPG_INTERNAL
-# define sqlca (*ECPGget_sqlca())
+#define sqlca (*ECPGget_sqlca())
#endif
#ifdef __cplusplus
diff --git a/src/interfaces/ecpg/include/sqlda.h b/src/interfaces/ecpg/include/sqlda.h
index e69de29bb2d..8b137891791 100644
--- a/src/interfaces/ecpg/include/sqlda.h
+++ b/src/interfaces/ecpg/include/sqlda.h
@@ -0,0 +1 @@
+
diff --git a/src/interfaces/ecpg/include/sqltypes.h b/src/interfaces/ecpg/include/sqltypes.h
index c50bf54314b..1ebde04714e 100644
--- a/src/interfaces/ecpg/include/sqltypes.h
+++ b/src/interfaces/ecpg/include/sqltypes.h
@@ -3,23 +3,23 @@
#define CINTTYPE ECPGt_int
#define CLONGTYPE ECPGt_long
#define CFLOATTYPE ECPGt_float
-#define CDOUBLETYPE ECPGt_double
+#define CDOUBLETYPE ECPGt_double
#define CDECIMALTYPE ECPGt_decimal
#define CFIXCHARTYPE 108
-#define CSTRINGTYPE ECPGt_char
+#define CSTRINGTYPE ECPGt_char
#define CDATETYPE ECPGt_date
#define CMONEYTYPE 111
#define CDTIMETYPE 112
-#define CLOCATORTYPE 113
-#define CVCHARTYPE ECPGt_varchar
+#define CLOCATORTYPE 113
+#define CVCHARTYPE ECPGt_varchar
#define CINVTYPE 115
#define CFILETYPE 116
#define CINT8TYPE ECPGt_long_long
-#define CCOLLTYPE 118
-#define CLVCHARTYPE 119
-#define CFIXBINTYPE 120
-#define CVARBINTYPE 121
-#define CBOOLTYPE ECPGt_bool
-#define CROWTYPE 123
-#define CLVCHARPTRTYPE 124
+#define CCOLLTYPE 118
+#define CLVCHARTYPE 119
+#define CFIXBINTYPE 120
+#define CVARBINTYPE 121
+#define CBOOLTYPE ECPGt_bool
+#define CROWTYPE 123
+#define CLVCHARPTRTYPE 124
#define CTYPEMAX 25