PostgreSQL Source Code
git master
|
#include <ecpglib.h>
#include <pgtypes_date.h>
#include <pgtypes_interval.h>
#include <pgtypes_numeric.h>
#include <pgtypes_timestamp.h>
Go to the source code of this file.
Macros | |
#define | SQLNOTFOUND 100 |
#define | ECPG_INFORMIX_NUM_OVERFLOW -1200 |
#define | ECPG_INFORMIX_NUM_UNDERFLOW -1201 |
#define | ECPG_INFORMIX_DIVIDE_ZERO -1202 |
#define | ECPG_INFORMIX_BAD_YEAR -1204 |
#define | ECPG_INFORMIX_BAD_MONTH -1205 |
#define | ECPG_INFORMIX_BAD_DAY -1206 |
#define | ECPG_INFORMIX_ENOSHORTDATE -1209 |
#define | ECPG_INFORMIX_DATE_CONVERT -1210 |
#define | ECPG_INFORMIX_OUT_OF_MEMORY -1211 |
#define | ECPG_INFORMIX_ENOTDMY -1212 |
#define | ECPG_INFORMIX_BAD_NUMERIC -1213 |
#define | ECPG_INFORMIX_BAD_EXPONENT -1216 |
#define | ECPG_INFORMIX_BAD_DATE -1218 |
#define | ECPG_INFORMIX_EXTRA_CHARS -1264 |
Functions | |
int | rdatestr (date d, char *str) |
void | rtoday (date *d) |
int | rjulmdy (date d, short *mdy) |
int | rdefmtdate (date *d, const char *fmt, const char *str) |
int | rfmtdate (date d, const char *fmt, char *str) |
int | rmdyjul (short *mdy, date *d) |
int | rstrdate (const char *str, date *d) |
int | rdayofweek (date d) |
int | rfmtlong (long lng_val, const char *fmt, char *outbuf) |
int | rgetmsg (int msgnum, char *s, int maxsize) |
int | risnull (int t, const char *ptr) |
int | rsetnull (int t, char *ptr) |
int | rtypalign (int offset, int type) |
int | rtypmsize (int type, int len) |
int | rtypwidth (int sqltype, int sqllen) |
void | rupshift (char *str) |
int | byleng (char *str, int len) |
void | ldchar (char *src, int len, char *dest) |
void | ECPG_informix_set_var (int number, void *pointer, int lineno) |
void * | ECPG_informix_get_var (int number) |
void | ECPG_informix_reset_sqlca (void) |
int | decadd (decimal *arg1, decimal *arg2, decimal *sum) |
int | deccmp (decimal *arg1, decimal *arg2) |
void | deccopy (decimal *src, decimal *target) |
int | deccvasc (const char *cp, int len, decimal *np) |
int | deccvdbl (double dbl, decimal *np) |
int | deccvint (int in, decimal *np) |
int | deccvlong (long lng, decimal *np) |
int | decdiv (decimal *n1, decimal *n2, decimal *result) |
int | decmul (decimal *n1, decimal *n2, decimal *result) |
int | decsub (decimal *n1, decimal *n2, decimal *result) |
int | dectoasc (decimal *np, char *cp, int len, int right) |
int | dectodbl (decimal *np, double *dblp) |
int | dectoint (decimal *np, int *ip) |
int | dectolong (decimal *np, long *lngp) |
void | dtcurrent (timestamp *ts) |
int | dtcvasc (char *str, timestamp *ts) |
int | dtsub (timestamp *ts1, timestamp *ts2, interval *iv) |
int | dttoasc (timestamp *ts, char *output) |
int | dttofmtasc (timestamp *ts, char *output, int str_len, char *fmtstr) |
int | intoasc (interval *i, char *str) |
int | dtcvfmtasc (char *inbuf, char *fmtstr, timestamp *dtvalue) |
#define ECPG_INFORMIX_BAD_DATE -1218 |
Definition at line 28 of file ecpg_informix.h.
#define ECPG_INFORMIX_BAD_DAY -1206 |
Definition at line 21 of file ecpg_informix.h.
#define ECPG_INFORMIX_BAD_EXPONENT -1216 |
Definition at line 27 of file ecpg_informix.h.
#define ECPG_INFORMIX_BAD_MONTH -1205 |
Definition at line 20 of file ecpg_informix.h.
#define ECPG_INFORMIX_BAD_NUMERIC -1213 |
Definition at line 26 of file ecpg_informix.h.
#define ECPG_INFORMIX_BAD_YEAR -1204 |
Definition at line 19 of file ecpg_informix.h.
#define ECPG_INFORMIX_DATE_CONVERT -1210 |
Definition at line 23 of file ecpg_informix.h.
#define ECPG_INFORMIX_DIVIDE_ZERO -1202 |
Definition at line 18 of file ecpg_informix.h.
#define ECPG_INFORMIX_ENOSHORTDATE -1209 |
Definition at line 22 of file ecpg_informix.h.
#define ECPG_INFORMIX_ENOTDMY -1212 |
Definition at line 25 of file ecpg_informix.h.
#define ECPG_INFORMIX_EXTRA_CHARS -1264 |
Definition at line 29 of file ecpg_informix.h.
#define ECPG_INFORMIX_NUM_OVERFLOW -1200 |
Definition at line 16 of file ecpg_informix.h.
#define ECPG_INFORMIX_NUM_UNDERFLOW -1201 |
Definition at line 17 of file ecpg_informix.h.
#define ECPG_INFORMIX_OUT_OF_MEMORY -1211 |
Definition at line 24 of file ecpg_informix.h.
#define SQLNOTFOUND 100 |
Definition at line 14 of file ecpg_informix.h.
int byleng | ( | char * | str, |
int | len | ||
) |
Definition at line 970 of file informix.c.
Definition at line 151 of file informix.c.
References deccall3(), ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_NUM_UNDERFLOW, PGTYPES_NUM_OVERFLOW, PGTYPES_NUM_UNDERFLOW, and PGTYPESnumeric_add().
Referenced by main().
Definition at line 167 of file informix.c.
References deccall2(), and PGTYPESnumeric_cmp().
Referenced by main().
Definition at line 173 of file informix.c.
int deccvasc | ( | const char * | cp, |
int | len, | ||
decimal * | np | ||
) |
Definition at line 198 of file informix.c.
References CDECIMALTYPE, CSTRINGTYPE, ECPG_INFORMIX_BAD_EXPONENT, ECPG_INFORMIX_BAD_NUMERIC, ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_NUM_UNDERFLOW, ecpg_strndup(), free, i, len, PGTYPES_NUM_BAD_NUMERIC, PGTYPES_NUM_OVERFLOW, PGTYPESnumeric_free(), PGTYPESnumeric_from_asc(), PGTYPESnumeric_to_decimal(), risnull(), rsetnull(), and str.
Referenced by main().
int deccvdbl | ( | double | dbl, |
decimal * | np | ||
) |
Definition at line 246 of file informix.c.
References CDECIMALTYPE, CDOUBLETYPE, ECPG_INFORMIX_OUT_OF_MEMORY, PGTYPESnumeric_free(), PGTYPESnumeric_from_double(), PGTYPESnumeric_new(), PGTYPESnumeric_to_decimal(), risnull(), and rsetnull().
int deccvint | ( | int | in, |
decimal * | np | ||
) |
Definition at line 268 of file informix.c.
References CDECIMALTYPE, CINTTYPE, ECPG_INFORMIX_OUT_OF_MEMORY, PGTYPESnumeric_free(), PGTYPESnumeric_from_int(), PGTYPESnumeric_new(), PGTYPESnumeric_to_decimal(), risnull(), and rsetnull().
Referenced by main().
int deccvlong | ( | long | lng, |
decimal * | np | ||
) |
Definition at line 290 of file informix.c.
References CDECIMALTYPE, CLONGTYPE, ECPG_INFORMIX_OUT_OF_MEMORY, PGTYPESnumeric_free(), PGTYPESnumeric_from_long(), PGTYPESnumeric_new(), PGTYPESnumeric_to_decimal(), risnull(), and rsetnull().
Referenced by main().
Definition at line 312 of file informix.c.
References deccall3(), ECPG_INFORMIX_DIVIDE_ZERO, ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_NUM_UNDERFLOW, i, PGTYPES_NUM_DIVIDE_ZERO, PGTYPES_NUM_OVERFLOW, and PGTYPESnumeric_div().
Referenced by main().
Definition at line 337 of file informix.c.
References deccall3(), ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_NUM_UNDERFLOW, i, PGTYPES_NUM_OVERFLOW, and PGTYPESnumeric_mul().
Referenced by main().
Definition at line 359 of file informix.c.
References deccall3(), ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_NUM_UNDERFLOW, i, PGTYPES_NUM_OVERFLOW, and PGTYPESnumeric_sub().
Referenced by main().
int dectoasc | ( | decimal * | np, |
char * | cp, | ||
int | len, | ||
int | right | ||
) |
Definition at line 381 of file informix.c.
References CDECIMALTYPE, CSTRINGTYPE, numeric::dscale, ECPG_INFORMIX_OUT_OF_MEMORY, free, len, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), PGTYPESnumeric_to_asc(), risnull(), rsetnull(), and str.
Referenced by dump_sqlda(), and main().
int dectodbl | ( | decimal * | np, |
double * | dblp | ||
) |
Definition at line 432 of file informix.c.
References ECPG_INFORMIX_OUT_OF_MEMORY, i, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), and PGTYPESnumeric_to_double().
Referenced by main().
int dectoint | ( | decimal * | np, |
int * | ip | ||
) |
Definition at line 453 of file informix.c.
References ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_OUT_OF_MEMORY, PGTYPES_NUM_OVERFLOW, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), and PGTYPESnumeric_to_int().
Referenced by main().
int dectolong | ( | decimal * | np, |
long * | lngp | ||
) |
Definition at line 480 of file informix.c.
References ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_OUT_OF_MEMORY, PGTYPES_NUM_OVERFLOW, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), and PGTYPESnumeric_to_long().
Referenced by main().
void dtcurrent | ( | timestamp * | ts | ) |
int dtcvasc | ( | char * | str, |
timestamp * | ts | ||
) |
Definition at line 618 of file informix.c.
References ECPG_INFORMIX_EXTRA_CHARS, i, PGTYPEStimestamp_from_asc(), and str.
int dtcvfmtasc | ( | char * | inbuf, |
char * | fmtstr, | ||
timestamp * | dtvalue | ||
) |
Definition at line 644 of file informix.c.
References fmtstr(), and PGTYPEStimestamp_defmt_asc().
Definition at line 650 of file informix.c.
References PGTYPEStimestamp_sub().
int dttoasc | ( | timestamp * | ts, |
char * | output | ||
) |
int dttofmtasc | ( | timestamp * | ts, |
char * | output, | ||
int | str_len, | ||
char * | fmtstr | ||
) |
Definition at line 666 of file informix.c.
References fmtstr(), output, and PGTYPEStimestamp_fmt_asc().
void* ECPG_informix_get_var | ( | int | number | ) |
void ECPG_informix_reset_sqlca | ( | void | ) |
Definition at line 1031 of file informix.c.
References ECPGget_sqlca(), sqlca, and sqlca_init.
void ECPG_informix_set_var | ( | int | number, |
void * | pointer, | ||
int | lineno | ||
) |
int intoasc | ( | interval * | i, |
char * | str | ||
) |
Definition at line 672 of file informix.c.
References free, i, PGTYPESinterval_to_asc(), and str.
Referenced by main().
void ldchar | ( | char * | src, |
int | len, | ||
char * | dest | ||
) |
Definition at line 977 of file informix.c.
References byleng(), generate_unaccent_rules::dest, and len.
Referenced by main().
int rdatestr | ( | date | d, |
char * | str | ||
) |
Definition at line 508 of file informix.c.
References ECPG_INFORMIX_DATE_CONVERT, free, PGTYPESdate_to_asc(), and str.
Referenced by date_test_defmt(), date_test_strdate(), and main().
int rdayofweek | ( | date | d | ) |
int rdefmtdate | ( | date * | d, |
const char * | fmt, | ||
const char * | str | ||
) |
Definition at line 553 of file informix.c.
References ECPG_INFORMIX_BAD_DAY, ECPG_INFORMIX_BAD_MONTH, ECPG_INFORMIX_BAD_YEAR, ECPG_INFORMIX_ENOSHORTDATE, ECPG_INFORMIX_ENOTDMY, fmt, PGTYPES_DATE_BAD_DAY, PGTYPES_DATE_BAD_MONTH, PGTYPES_DATE_ERR_EARGS, PGTYPES_DATE_ERR_ENOSHORTDATE, PGTYPES_DATE_ERR_ENOTDMY, PGTYPESdate_defmt_asc(), and str.
Referenced by date_test_defmt(), and rstrdate().
int rfmtdate | ( | date | d, |
const char * | fmt, | ||
char * | str | ||
) |
Definition at line 579 of file informix.c.
References ECPG_INFORMIX_DATE_CONVERT, ECPG_INFORMIX_OUT_OF_MEMORY, fmt, PGTYPESdate_fmt_asc(), and str.
Referenced by date_test_fmt().
int rfmtlong | ( | long | lng_val, |
const char * | fmt, | ||
char * | outbuf | ||
) |
Definition at line 768 of file informix.c.
References fmt, fmtchar(), free, getRightMostDot(), i, initValue(), j, malloc, sign, and value.
Referenced by fmtlong().
int rgetmsg | ( | int | msgnum, |
char * | s, | ||
int | maxsize | ||
) |
Definition at line 986 of file informix.c.
int risnull | ( | int | t, |
const char * | ptr | ||
) |
Definition at line 1049 of file informix.c.
References ECPGis_noind_null().
Referenced by deccall3(), deccvasc(), deccvdbl(), deccvint(), deccvlong(), dectoasc(), main(), and test_null().
int rjulmdy | ( | date | d, |
short * | mdy | ||
) |
int rmdyjul | ( | short * | mdy, |
date * | d | ||
) |
int rsetnull | ( | int | t, |
char * | ptr | ||
) |
Definition at line 1042 of file informix.c.
References ECPGset_noind_null().
Referenced by deccall3(), deccvasc(), deccvdbl(), deccvint(), deccvlong(), dectoasc(), and main().
int rstrdate | ( | const char * | str, |
date * | d | ||
) |
Definition at line 529 of file informix.c.
References rdefmtdate(), and str.
Referenced by date_test_strdate().
void rtoday | ( | date * | d | ) |
int rtypalign | ( | int | offset, |
int | type | ||
) |
int rtypmsize | ( | int | type, |
int | len | ||
) |
int rtypwidth | ( | int | sqltype, |
int | sqllen | ||
) |
Definition at line 1011 of file informix.c.