aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/include
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2003-03-30 11:48:19 +0000
committerMichael Meskes <meskes@postgresql.org>2003-03-30 11:48:19 +0000
commit999f12982e6180a88aedc76f8e6e25f461367761 (patch)
tree331d0826c2b1a0c998fe5e69fe26a45838d4e647 /src/interfaces/ecpg/include
parent82a91eb54ed0c6561050a0ae01661ea6302445ba (diff)
downloadpostgresql-999f12982e6180a88aedc76f8e6e25f461367761.tar.gz
postgresql-999f12982e6180a88aedc76f8e6e25f461367761.zip
Moved Informix stuff to its own compat library. Interval datetype is now fully functional.
Diffstat (limited to 'src/interfaces/ecpg/include')
-rw-r--r--src/interfaces/ecpg/include/ecpg_informix.h3
-rw-r--r--src/interfaces/ecpg/include/pgtypes_date.h13
-rw-r--r--src/interfaces/ecpg/include/pgtypes_error.h17
-rw-r--r--src/interfaces/ecpg/include/pgtypes_numeric.h2
4 files changed, 25 insertions, 10 deletions
diff --git a/src/interfaces/ecpg/include/ecpg_informix.h b/src/interfaces/ecpg/include/ecpg_informix.h
index 3d39c90b02b..46df5a2d32a 100644
--- a/src/interfaces/ecpg/include/ecpg_informix.h
+++ b/src/interfaces/ecpg/include/ecpg_informix.h
@@ -2,6 +2,9 @@
* This file contains stuff needed to be as compatible to Informix as possible.
*/
+#include <decimal.h>
+#include <datetime.h>
+
#define SQLNOTFOUND 100
#ifndef Date
diff --git a/src/interfaces/ecpg/include/pgtypes_date.h b/src/interfaces/ecpg/include/pgtypes_date.h
index 882ddab82df..76dedb866cf 100644
--- a/src/interfaces/ecpg/include/pgtypes_date.h
+++ b/src/interfaces/ecpg/include/pgtypes_date.h
@@ -1,12 +1,17 @@
#ifndef PGTYPES_DATETIME
#define PGTYPES_DATETIME
+#include <pgtypes_timestamp.h>
+
#define Date long
extern Date PGTYPESdate_atod(char *, char **);
extern char *PGTYPESdate_dtoa(Date);
-extern int PGTYPESdate_julmdy(Date, int*);
-extern int PGTYPESdate_mdyjul(int*, Date *);
-extern int PGTYPESdate_day(Date);
-
+extern Date PGTYPESdate_ttod(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_defmtdate(Date *, char *, char *);
+extern int PGTYPESdate_fmtdate(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 7cab1971b98..2965a01476e 100644
--- a/src/interfaces/ecpg/include/pgtypes_error.h
+++ b/src/interfaces/ecpg/include/pgtypes_error.h
@@ -1,8 +1,15 @@
-#define PGTYPES_OVERFLOW 201
-#define PGTYPES_BAD_NUMERIC 202
-#define PGTYPES_DIVIDE_ZERO 203
+#define PGTYPES_NUM_OVERFLOW 201
+#define PGTYPES_NUM_BAD_NUMERIC 202
+#define PGTYPES_NUM_DIVIDE_ZERO 203
-#define PGTYPES_BAD_DATE 210
+#define PGTYPES_DATE_BAD_DATE 210
+#define PGTYPES_DATE_ERR_EARGS 211
+#define PGTYPES_DATE_ERR_ENOSHORTDATE 212
+#define PGTYPES_DATE_ERR_ENOTDMY 213
+#define PGTYPES_DATE_BAD_DAY 214
+#define PGTYPES_DATE_BAD_MONTH 215
-#define PGTYPES_BAD_TIMESTAMP 220
+#define PGTYPES_TS_BAD_TIMESTAMP 220
+
+#define PGTYPES_INTVL_BAD_INTERVAL 230
diff --git a/src/interfaces/ecpg/include/pgtypes_numeric.h b/src/interfaces/ecpg/include/pgtypes_numeric.h
index 3fe849a3ad9..977233afca0 100644
--- a/src/interfaces/ecpg/include/pgtypes_numeric.h
+++ b/src/interfaces/ecpg/include/pgtypes_numeric.h
@@ -23,7 +23,7 @@ typedef struct
Numeric *PGTYPESnew(void);
void PGTYPESnumeric_free(Numeric *);
Numeric *PGTYPESnumeric_aton(char *, char **);
-char *PGTYPESnumeric_ntoa(Numeric *);
+char *PGTYPESnumeric_ntoa(Numeric *, int);
int PGTYPESnumeric_add(Numeric *, Numeric *, Numeric *);
int PGTYPESnumeric_sub(Numeric *, Numeric *, Numeric *);
int PGTYPESnumeric_mul(Numeric *, Numeric *, Numeric *);