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));
181 size_t real_len = strlen(
str);
182 int use_len = (int) ((real_len >
len) ?
len : real_len);
184 char *
new =
malloc(use_len + 1);
188 memcpy(
new,
str, use_len);
413 if ((
int) (strlen(
str) + 1) >
len)
546 mdy[0] = (short) mdy_int[0];
547 mdy[1] = (short) mdy_int[1];
548 mdy[2] = (short) mdy_int[2];
622 char **endptr = &
str;
710 value.val = lng_val >= 0 ? lng_val : lng_val * (-1);
711 value.sign = lng_val >= 0 ?
'+' :
'-';
712 value.maxdigits = log10(2) * (8 *
sizeof(long) - 1);
722 while ((l - 1) <
value.val && l <= LONG_MAX / 10);
724 if (l <= LONG_MAX / 10)
738 for (
i =
value.digits,
j = 0;
i > 0;
i--,
j++)
740 value.val_string[
j] = dig / l +
'0';
757 for (
i =
len - 1;
i >= 0;
i--)
770 size_t fmt_len = strlen(
fmt);
787 temp = (
char *)
malloc(fmt_len + 1);
803 if (strchr(
fmt, (
int)
'<'))
807 if (strchr(
fmt, (
int)
'(') && strchr(
fmt, (
int)
')'))
816 k =
value.digits - 1;
817 for (
i = fmt_len - 1,
j = 0;
i >= 0;
i--,
j++)
837 if (dotpos >= 0 && dotpos <=
i)
842 tmp[0] =
value.sign ==
'-' ?
')' :
' ';
852 if (blank &&
fmt[
i] ==
',')
870 tmp[0] =
value.val_string[k];
876 tmp[0] =
value.val_string[k];
882 tmp[0] =
value.val_string[k];
885 if (
sign &&
value.sign ==
'-' && !signdone)
893 tmp[0] =
value.val_string[k];
896 if (
sign && !signdone)
904 tmp[0] =
value.val_string[k];
907 if (
sign && brackets_ok &&
value.sign ==
'-')
912 tmp[0] =
value.val_string[k];
915 if (brackets_ok &&
value.sign ==
'-')
921 if (blank && !entitydone)
929 tmp[0] =
value.val_string[k];
932 tmp[0] =
value.val_string[k];
942 temp[fmt_len] =
'\0';
945 temp_len = strlen(temp);
947 for (
i = temp_len - 1;
i >= 0;
i--)
952 outbuf[temp_len] =
'\0';
964 for (; *
str !=
'\0';
str++)
965 if (islower((
unsigned char) *
str))
966 *
str = toupper((
unsigned char) *
str);
981 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
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)