3 #define POSTGRES_ECPG_INTERNAL
24 'S',
'Q',
'L',
'C',
'A',
' ',
' ',
' '
35 'N',
'O',
'T',
' ',
'S',
'E',
'T',
' '
41 0, 0, 0, 0, 0, 0, 0, 0
44 '0',
'0',
'0',
'0',
'0'
132 i = (*ptr) (
a1,
a2, nres);
175 memcpy(target, src,
sizeof(
decimal));
394 if ((
int) (strlen(
str) + 1) >
len)
527 mdy[0] = (short) mdy_int[0];
528 mdy[1] = (short) mdy_int[1];
529 mdy[2] = (short) mdy_int[2];
603 char **endptr = &
str;
691 value.val = lng_val >= 0 ? lng_val : lng_val * (-1);
692 value.sign = lng_val >= 0 ?
'+' :
'-';
693 value.maxdigits = log10(2) * (8 *
sizeof(long) - 1);
703 while ((l - 1) <
value.val && l <= LONG_MAX / 10);
705 if (l <= LONG_MAX / 10)
719 for (
i =
value.digits,
j = 0;
i > 0;
i--,
j++)
721 value.val_string[
j] = dig / l +
'0';
738 for (
i =
len - 1;
i >= 0;
i--)
751 size_t fmt_len = strlen(
fmt);
768 temp = (
char *)
malloc(fmt_len + 1);
784 if (strchr(
fmt, (
int)
'<'))
788 if (strchr(
fmt, (
int)
'(') && strchr(
fmt, (
int)
')'))
797 k =
value.digits - 1;
798 for (
i = fmt_len - 1,
j = 0;
i >= 0;
i--,
j++)
818 if (dotpos >= 0 && dotpos <=
i)
823 tmp[0] =
value.sign ==
'-' ?
')' :
' ';
833 if (blank &&
fmt[
i] ==
',')
851 tmp[0] =
value.val_string[k];
857 tmp[0] =
value.val_string[k];
863 tmp[0] =
value.val_string[k];
866 if (
sign &&
value.sign ==
'-' && !signdone)
874 tmp[0] =
value.val_string[k];
877 if (
sign && !signdone)
885 tmp[0] =
value.val_string[k];
888 if (
sign && brackets_ok &&
value.sign ==
'-')
893 tmp[0] =
value.val_string[k];
896 if (brackets_ok &&
value.sign ==
'-')
902 if (blank && !entitydone)
910 tmp[0] =
value.val_string[k];
913 tmp[0] =
value.val_string[k];
923 temp[fmt_len] =
'\0';
926 temp_len = strlen(temp);
928 for (
i = temp_len - 1;
i >= 0;
i--)
933 outbuf[temp_len] =
'\0';
945 for (; *
str !=
'\0';
str++)
946 if (islower((
unsigned char) *
str))
947 *
str = toupper((
unsigned char) *
str);
962 memmove(
dest, src, dlen);
static const FormData_pg_attribute a1
static const FormData_pg_attribute a2
void ECPGset_var(int number, void *pointer, int lineno)
void ECPGset_noind_null(enum ECPGttype type, void *ptr)
bool ECPGis_noind_null(enum ECPGttype type, const void *ptr)
void * ECPGget_var(int number)
struct sqlca_t * ECPGget_sqlca(void)
static void const char * fmt
char * pnstrdup(const char *in, Size len)
int PGTYPESdate_dayofweek(date dDate)
void PGTYPESdate_today(date *d)
int PGTYPESdate_fmt_asc(date dDate, const char *fmtstring, char *outbuf)
int PGTYPESdate_defmt_asc(date *d, const char *fmt, const char *str)
void PGTYPESdate_julmdy(date jd, int *mdy)
void PGTYPESdate_mdyjul(int *mdy, date *jdate)
char * PGTYPESdate_to_asc(date dDate)
#define PGTYPES_DATE_ERR_ENOTDMY
#define PGTYPES_NUM_BAD_NUMERIC
#define PGTYPES_DATE_BAD_DAY
#define PGTYPES_NUM_OVERFLOW
#define PGTYPES_DATE_ERR_ENOSHORTDATE
#define PGTYPES_NUM_UNDERFLOW
#define PGTYPES_NUM_DIVIDE_ZERO
#define PGTYPES_DATE_ERR_EARGS
#define PGTYPES_DATE_BAD_MONTH
char * PGTYPESinterval_to_asc(interval *span)
int PGTYPESnumeric_from_double(double d, numeric *dst)
int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst)
int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst)
int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result)
int PGTYPESnumeric_to_long(numeric *nv, long *lp)
int PGTYPESnumeric_to_double(numeric *nv, double *dp)
int PGTYPESnumeric_from_long(signed long int long_val, numeric *var)
int PGTYPESnumeric_to_int(numeric *nv, int *ip)
char * PGTYPESnumeric_to_asc(numeric *num, int dscale)
numeric * PGTYPESnumeric_new(void)
int PGTYPESnumeric_from_int(signed int int_val, numeric *var)
int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result)
numeric * PGTYPESnumeric_from_asc(char *str, char **endptr)
void PGTYPESnumeric_free(numeric *var)
int PGTYPESnumeric_cmp(numeric *var1, numeric *var2)
int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result)
int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result)
timestamp PGTYPEStimestamp_from_asc(char *str, char **endptr)
int PGTYPEStimestamp_sub(timestamp *ts1, timestamp *ts2, interval *iv)
void PGTYPEStimestamp_current(timestamp *ts)
char * PGTYPEStimestamp_to_asc(timestamp tstamp)
int PGTYPEStimestamp_fmt_asc(timestamp *ts, char *output, int str_len, const char *fmtstr)
int PGTYPEStimestamp_defmt_asc(const char *str, const char *fmt, timestamp *d)
static void fmtchar(int value, int leftjust, int minlen, PrintfTarget *target)
static void fmtstr(const char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target)