1/*
2 * This file contains stuff needed to be as compatible to Informix as possible.
3 * src/interfaces/ecpg/include/ecpg_informix.h
4 */
5#ifndef _ECPG_INFORMIX_H
6#define _ECPG_INFORMIX_H
7
8#include <ecpglib.h>
9#include <pgtypes_date.h>
10#include <pgtypes_interval.h>
11#include <pgtypes_numeric.h>
12#include <pgtypes_timestamp.h>
13
14#define SQLNOTFOUND 100
15
16#define ECPG_INFORMIX_NUM_OVERFLOW -1200
17#define ECPG_INFORMIX_NUM_UNDERFLOW -1201
18#define ECPG_INFORMIX_DIVIDE_ZERO -1202
19#define ECPG_INFORMIX_BAD_YEAR -1204
20#define ECPG_INFORMIX_BAD_MONTH -1205
21#define ECPG_INFORMIX_BAD_DAY -1206
22#define ECPG_INFORMIX_ENOSHORTDATE -1209
23#define ECPG_INFORMIX_DATE_CONVERT -1210
24#define ECPG_INFORMIX_OUT_OF_MEMORY -1211
25#define ECPG_INFORMIX_ENOTDMY -1212
26#define ECPG_INFORMIX_BAD_NUMERIC -1213
27#define ECPG_INFORMIX_BAD_EXPONENT -1216
28#define ECPG_INFORMIX_BAD_DATE -1218
29#define ECPG_INFORMIX_EXTRA_CHARS -1264
30
31#ifdef __cplusplus
32extern "C"
33{
34#endif
35
36extern int rdatestr(date, char *);
37extern void rtoday(date *);
38extern int rjulmdy(date, short *);
39extern int rdefmtdate(date *, const char *, const char *);
40extern int rfmtdate(date, const char *, char *);
41extern int rmdyjul(short *, date *);
42extern int rstrdate(const char *, date *);
43extern int rdayofweek(date);
44
45extern int rfmtlong(long, const char *, char *);
46extern int rgetmsg(int, char *, int);
47extern int risnull(int, const char *);
48extern int rsetnull(int, char *);
49extern int rtypalign(int, int);
50extern int rtypmsize(int, int);
51extern int rtypwidth(int, int);
52extern void rupshift(char *);
53
54extern int byleng(char *, int);
55extern void ldchar(char *, int, char *);
56
57extern void ECPG_informix_set_var(int, void *, int);
58extern void *ECPG_informix_get_var(int);
59extern void ECPG_informix_reset_sqlca(void);
60
61/* Informix defines these in decimal.h */
62int decadd(decimal *, decimal *, decimal *);
63int deccmp(decimal *, decimal *);
64void deccopy(decimal *, decimal *);
65int deccvasc(const char *, int, decimal *);
66int deccvdbl(double, decimal *);
67int deccvint(int, decimal *);
68int deccvlong(long, decimal *);
69int decdiv(decimal *, decimal *, decimal *);
70int decmul(decimal *, decimal *, decimal *);
71int decsub(decimal *, decimal *, decimal *);
72int dectoasc(decimal *, char *, int, int);
73int dectodbl(decimal *, double *);
74int dectoint(decimal *, int *);
75int dectolong(decimal *, long *);
76
77/* Informix defines these in datetime.h */
78extern void dtcurrent(timestamp *);
79extern int dtcvasc(char *, timestamp *);
80extern int dtsub(timestamp *, timestamp *, interval *);
81extern int dttoasc(timestamp *, char *);
82extern int dttofmtasc(timestamp *, char *, int, char *);
83extern int intoasc(interval *, char *);
84extern int dtcvfmtasc(char *, char *, timestamp *);
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif /* ndef _ECPG_INFORMIX_H */
91