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)
521 mdy[0] = (short) mdy_int[0];
522 mdy[1] = (short) mdy_int[1];
523 mdy[2] = (short) mdy_int[2];
597 char **endptr = &
str;
635 strcpy(output, asctime);
657 memcpy(str, tmp, strlen(tmp));
685 value.val = lng_val >= 0 ? lng_val : lng_val * (-1);
686 value.sign = lng_val >= 0 ?
'+' :
'-';
687 value.maxdigits = log10(2) * (8 *
sizeof(long) - 1);
697 while ((l - 1) <
value.val && l <= LONG_MAX / 10);
699 if (l <= LONG_MAX / 10)
705 value.digits = i + 1;
713 for (i =
value.digits, j = 0; i > 0; i--, j++)
715 value.val_string[j] = dig / l +
'0';
727 size_t len = strlen(str);
732 for (i = len - 1; i >= 0; i--)
743 rfmtlong(
long lng_val,
const char *fmt,
char *outbuf)
745 size_t fmt_len = strlen(fmt);
762 temp = (
char *)
malloc(fmt_len + 1);
778 if (strchr(fmt, (
int)
'<'))
782 if (strchr(fmt, (
int)
'(') && strchr(fmt, (
int)
')'))
791 k =
value.digits - 1;
792 for (i = fmt_len - 1, j = 0; i >= 0; i--, j++)
812 if (dotpos >= 0 && dotpos <= i)
817 tmp[0] =
value.sign ==
'-' ?
')' :
' ';
827 if (blank && fmt[i] ==
',')
845 tmp[0] =
value.val_string[k];
851 tmp[0] =
value.val_string[k];
857 tmp[0] =
value.val_string[k];
860 if (
sign &&
value.sign ==
'-' && !signdone)
868 tmp[0] =
value.val_string[k];
871 if (
sign && !signdone)
879 tmp[0] =
value.val_string[k];
882 if (
sign && brackets_ok &&
value.sign ==
'-')
887 tmp[0] =
value.val_string[k];
890 if (brackets_ok &&
value.sign ==
'-')
896 if (blank && !entitydone)
904 tmp[0] =
value.val_string[k];
907 tmp[0] =
value.val_string[k];
917 temp[fmt_len] =
'\0';
920 temp_len = strlen(temp);
922 for (i = temp_len - 1; i >= 0; i--)
927 outbuf[temp_len] =
'\0';
939 for (; *str !=
'\0'; str++)
940 if (islower((
unsigned char) *str))
941 *str = toupper((
unsigned char) *str);
947 for (len--; str[len] && str[len] ==
' '; len--);
954 int dlen =
byleng(src, len);
956 memmove(dest, src, dlen);
1013 memcpy((
char *) sqlca, (
char *) &sqlca_init,
sizeof(
struct sqlca_t));
int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *)
int PGTYPESnumeric_from_long(signed long int, numeric *)
int PGTYPESdate_defmt_asc(date *, const char *, const char *)
char * pnstrdup(const char *in, Size len)
#define PGTYPES_DATE_BAD_DAY
#define PGTYPES_DATE_ERR_EARGS
void * ECPGget_var(int number)
#define PGTYPES_DATE_ERR_ENOTDMY
void PGTYPESdate_julmdy(date, int *)
static void output(uint64 loop_count)
#define PGTYPES_NUM_DIVIDE_ZERO
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
void ECPGset_var(int number, void *pointer, int lineno)
void PGTYPESdate_today(date *)
int PGTYPEStimestamp_defmt_asc(const char *, const char *, timestamp *)
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
static void fmtchar(int value, int leftjust, int minlen, PrintfTarget *target)
int PGTYPESnumeric_from_double(double, numeric *)
char * PGTYPESdate_to_asc(date)
#define PGTYPES_DATE_BAD_MONTH
int PGTYPESdate_fmt_asc(date, const char *, char *)
void PGTYPESnumeric_free(numeric *)
void PGTYPESdate_mdyjul(int *, date *)
int PGTYPESdate_dayofweek(date)
numeric * PGTYPESnumeric_new(void)
static const FormData_pg_attribute a2
int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, const char *)
int PGTYPESnumeric_to_long(numeric *, long *)
int PGTYPESnumeric_to_int(numeric *, int *)
struct sqlca_t * ECPGget_sqlca(void)
int PGTYPESnumeric_cmp(numeric *, numeric *)
void PGTYPEStimestamp_current(timestamp *)
#define PGTYPES_DATE_ERR_ENOSHORTDATE
int PGTYPESnumeric_div(numeric *, numeric *, numeric *)
int PGTYPESnumeric_from_int(signed int, numeric *)
#define PGTYPES_NUM_OVERFLOW
char * PGTYPESnumeric_to_asc(numeric *, int)
#define PGTYPES_NUM_UNDERFLOW
numeric * PGTYPESnumeric_from_asc(char *, char **)
int PGTYPESnumeric_to_double(numeric *, double *)
char * PGTYPEStimestamp_to_asc(timestamp)
#define PGTYPES_NUM_BAD_NUMERIC
int PGTYPESnumeric_add(numeric *, numeric *, numeric *)
char * PGTYPESinterval_to_asc(interval *)
void ECPGset_noind_null(enum ECPGttype type, void *ptr)
bool ECPGis_noind_null(enum ECPGttype type, const void *ptr)
static void fmtstr(const char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target)
int PGTYPESnumeric_mul(numeric *, numeric *, numeric *)
static const FormData_pg_attribute a1
int PGTYPESnumeric_sub(numeric *, numeric *, numeric *)
timestamp PGTYPEStimestamp_from_asc(char *, char **)