aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/include
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2003-03-20 15:56:50 +0000
committerMichael Meskes <meskes@postgresql.org>2003-03-20 15:56:50 +0000
commit2e6f97560a837f692a143d74c0255b4c92c1bbdb (patch)
tree29103e353c5fd2ddd5795c40566bab2641d19ec8 /src/interfaces/ecpg/include
parent26a6378e842db462114b267a0a94c7723e6583c2 (diff)
downloadpostgresql-2e6f97560a837f692a143d74c0255b4c92c1bbdb.tar.gz
postgresql-2e6f97560a837f692a143d74c0255b4c92c1bbdb.zip
Started adding date and timestamp.
Diffstat (limited to 'src/interfaces/ecpg/include')
-rw-r--r--src/interfaces/ecpg/include/decimal.h10
-rw-r--r--src/interfaces/ecpg/include/ecpgtype.h4
-rw-r--r--src/interfaces/ecpg/include/pgtypes_date.h12
-rw-r--r--src/interfaces/ecpg/include/pgtypes_error.h4
-rw-r--r--src/interfaces/ecpg/include/pgtypes_timestamp.h16
5 files changed, 44 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/include/decimal.h b/src/interfaces/ecpg/include/decimal.h
index f307207adce..2c13a33c708 100644
--- a/src/interfaces/ecpg/include/decimal.h
+++ b/src/interfaces/ecpg/include/decimal.h
@@ -2,4 +2,14 @@
#ifndef dec_t
#define dec_t NumericVar
+
+#define CSHORTTYPE 0
+#define CMONEYTYPE 0
+#define CCHARTYPE 0
+#define CDECIMALTYPE 0
+#define CINTTYPE 0
+#define CDATETYPE 0
+#define CDOUBLETYPE 0
+#define CLONGTYPE 0
+
#endif /* dec_t */
diff --git a/src/interfaces/ecpg/include/ecpgtype.h b/src/interfaces/ecpg/include/ecpgtype.h
index 6ed5f5d3e4f..31738d421f1 100644
--- a/src/interfaces/ecpg/include/ecpgtype.h
+++ b/src/interfaces/ecpg/include/ecpgtype.h
@@ -52,7 +52,9 @@ enum ECPGttype
ECPGt_NO_INDICATOR, /* no indicator */
ECPGt_long_long, ECPGt_unsigned_long_long,
ECPGt_descriptor, /* sql descriptor, no C variable */
- ECPGt_numeric
+ ECPGt_numeric,
+ ECPGt_date,
+ ECPGt_timestamp
};
/* descriptor items */
diff --git a/src/interfaces/ecpg/include/pgtypes_date.h b/src/interfaces/ecpg/include/pgtypes_date.h
new file mode 100644
index 00000000000..882ddab82df
--- /dev/null
+++ b/src/interfaces/ecpg/include/pgtypes_date.h
@@ -0,0 +1,12 @@
+#ifndef PGTYPES_DATETIME
+#define PGTYPES_DATETIME
+
+#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);
+
+#endif /* PGTYPES_DATETIME */
diff --git a/src/interfaces/ecpg/include/pgtypes_error.h b/src/interfaces/ecpg/include/pgtypes_error.h
index e997b03ae01..7cab1971b98 100644
--- a/src/interfaces/ecpg/include/pgtypes_error.h
+++ b/src/interfaces/ecpg/include/pgtypes_error.h
@@ -2,5 +2,7 @@
#define PGTYPES_BAD_NUMERIC 202
#define PGTYPES_DIVIDE_ZERO 203
-#define PGTYPES_BAD_DATE 300
+#define PGTYPES_BAD_DATE 210
+
+#define PGTYPES_BAD_TIMESTAMP 220
diff --git a/src/interfaces/ecpg/include/pgtypes_timestamp.h b/src/interfaces/ecpg/include/pgtypes_timestamp.h
new file mode 100644
index 00000000000..48a54b1381f
--- /dev/null
+++ b/src/interfaces/ecpg/include/pgtypes_timestamp.h
@@ -0,0 +1,16 @@
+#ifndef PGTYPES_TIMESTAMP
+#define PGTYPES_TIMESTAMP
+
+#ifdef HAVE_INT64_TIMESTAMP
+typedef int64 Timestamp;
+typedef int64 TimestampTz;
+
+#else
+typedef double Timestamp;
+typedef double TimestampTz;
+#endif
+
+extern Timestamp PGTYPEStimestamp_atot(char *, char **);
+extern char *PGTYPEStimestamp_ttoa(Timestamp);
+
+#endif /* PGTYPES_TIMESTAMP */