| 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 |
| 32 |
extern "C" |
| 33 |
{ |
| 34 |
#endif |
| 35 |
|
| 36 |
extern int rdatestr(date d, char *str); |
| 37 |
extern void rtoday(date * d); |
| 38 |
extern int rjulmdy(date d, short *mdy); |
| 39 |
extern int rdefmtdate(date * d, const char *fmt, const char *str); |
| 40 |
extern int rfmtdate(date d, const char *fmt, char *str); |
| 41 |
extern int rmdyjul(short *mdy, date * d); |
| 42 |
extern int rstrdate(const char *str, date * d); |
| 43 |
extern int rdayofweek(date d); |
| 44 |
|
| 45 |
extern int rfmtlong(long lng_val, const char *fmt, char *outbuf); |
| 46 |
extern int rgetmsg(int msgnum, char *s, int maxsize); |
| 47 |
extern int risnull(int t, const char *ptr); |
| 48 |
extern int rsetnull(int t, char *ptr); |
| 49 |
extern int rtypalign(int offset, int type); |
| 50 |
extern int rtypmsize(int type, int len); |
| 51 |
extern int rtypwidth(int sqltype, int sqllen); |
| 52 |
extern void rupshift(char *str); |
| 53 |
|
| 54 |
extern int byleng(char *str, int len); |
| 55 |
extern void ldchar(char *src, int len, char *dest); |
| 56 |
|
| 57 |
extern void ECPG_informix_set_var(int number, void *pointer, int lineno); |
| 58 |
extern void *ECPG_informix_get_var(int number); |
| 59 |
extern void ECPG_informix_reset_sqlca(void); |
| 60 |
|
| 61 |
/* Informix defines these in decimal.h */ |
| 62 |
int decadd(decimal *arg1, decimal *arg2, decimal *sum); |
| 63 |
int deccmp(decimal *arg1, decimal *arg2); |
| 64 |
void deccopy(decimal *src, decimal *target); |
| 65 |
int deccvasc(const char *cp, int len, decimal *np); |
| 66 |
int deccvdbl(double dbl, decimal *np); |
| 67 |
int deccvint(int in, decimal *np); |
| 68 |
int deccvlong(long lng, decimal *np); |
| 69 |
int decdiv(decimal *n1, decimal *n2, decimal *result); |
| 70 |
int decmul(decimal *n1, decimal *n2, decimal *result); |
| 71 |
int decsub(decimal *n1, decimal *n2, decimal *result); |
| 72 |
int dectoasc(decimal *np, char *cp, int len, int right); |
| 73 |
int dectodbl(decimal *np, double *dblp); |
| 74 |
int dectoint(decimal *np, int *ip); |
| 75 |
int dectolong(decimal *np, long *lngp); |
| 76 |
|
| 77 |
/* Informix defines these in datetime.h */ |
| 78 |
extern void dtcurrent(timestamp * ts); |
| 79 |
extern int dtcvasc(char *str, timestamp * ts); |
| 80 |
extern int dtsub(timestamp * ts1, timestamp * ts2, interval * iv); |
| 81 |
extern int dttoasc(timestamp * ts, char *output); |
| 82 |
extern int dttofmtasc(timestamp * ts, char *output, int str_len, char *fmtstr); |
| 83 |
extern int intoasc(interval * i, char *str); |
| 84 |
extern int dtcvfmtasc(char *inbuf, char *fmtstr, timestamp * dtvalue); |
| 85 |
|
| 86 |
#ifdef __cplusplus |
| 87 |
} |
| 88 |
#endif |
| 89 |
|
| 90 |
#endif /* ndef _ECPG_INFORMIX_H */ |