PostgreSQL Source Code  git master
informix.c File Reference
#include "postgres_fe.h"
#include <math.h>
#include <ctype.h>
#include <limits.h>
#include "ecpg_informix.h"
#include "ecpgerrno.h"
#include "ecpgtype.h"
#include "pgtypes_date.h"
#include "pgtypes_error.h"
#include "pgtypes_numeric.h"
#include "sqlca.h"
#include "sqltypes.h"
Include dependency graph for informix.c:

Go to the source code of this file.

Macros

#define POSTGRES_ECPG_INTERNAL
 

Functions

static int deccall2 (decimal *arg1, decimal *arg2, int(*ptr)(numeric *, numeric *))
 
static int deccall3 (decimal *arg1, decimal *arg2, decimal *result, int(*ptr)(numeric *, numeric *, numeric *))
 
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)
 
int rdatestr (date d, char *str)
 
int rstrdate (const char *str, date *d)
 
void rtoday (date *d)
 
int rjulmdy (date d, short mdy[3])
 
int rdefmtdate (date *d, const char *fmt, const char *str)
 
int rfmtdate (date d, const char *fmt, char *str)
 
int rmdyjul (short mdy[3], date *d)
 
int rdayofweek (date d)
 
void dtcurrent (timestamp *ts)
 
int dtcvasc (char *str, timestamp *ts)
 
int dtcvfmtasc (char *inbuf, char *fmtstr, timestamp *dtvalue)
 
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)
 
static int initValue (long lng_val)
 
static int getRightMostDot (const char *str)
 
int rfmtlong (long lng_val, const char *fmt, char *outbuf)
 
void rupshift (char *str)
 
int byleng (char *str, int len)
 
void ldchar (char *src, int len, char *dest)
 
int rgetmsg (int msgnum, char *s, int maxsize)
 
int rtypalign (int offset, int type)
 
int rtypmsize (int type, int len)
 
int rtypwidth (int sqltype, int sqllen)
 
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 rsetnull (int t, char *ptr)
 
int risnull (int t, const char *ptr)
 

Variables

static struct sqlca_t sqlca_init
 
struct {
   long   val
 
   int   maxdigits
 
   int   digits
 
   int   remaining
 
   char   sign
 
   char *   val_string
 
value
 

Macro Definition Documentation

◆ POSTGRES_ECPG_INTERNAL

#define POSTGRES_ECPG_INTERNAL

Definition at line 3 of file informix.c.

Function Documentation

◆ byleng()

int byleng ( char *  str,
int  len 
)

Definition at line 945 of file informix.c.

Referenced by ldchar(), and main().

946 {
947  for (len--; str[len] && str[len] == ' '; len--);
948  return (len + 1);
949 }

◆ decadd()

int decadd ( decimal arg1,
decimal arg2,
decimal sum 
)

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().

152 {
153  errno = 0;
154  deccall3(arg1, arg2, sum, PGTYPESnumeric_add);
155 
156  if (errno == PGTYPES_NUM_OVERFLOW)
158  else if (errno == PGTYPES_NUM_UNDERFLOW)
160  else if (errno != 0)
161  return -1;
162  else
163  return 0;
164 }
static int deccall3(decimal *arg1, decimal *arg2, decimal *result, int(*ptr)(numeric *, numeric *, numeric *))
Definition: informix.c:86
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
#define ECPG_INFORMIX_NUM_UNDERFLOW
Definition: ecpg_informix.h:17
#define PGTYPES_NUM_OVERFLOW
Definition: pgtypes_error.h:3
#define PGTYPES_NUM_UNDERFLOW
Definition: pgtypes_error.h:6
int PGTYPESnumeric_add(numeric *, numeric *, numeric *)
Definition: numeric.c:723

◆ deccall2()

static int deccall2 ( decimal arg1,
decimal arg2,
int(*)(numeric *, numeric *)  ptr 
)
static

Definition at line 48 of file informix.c.

References a1, a2, ECPG_INFORMIX_OUT_OF_MEMORY, i, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), and PGTYPESnumeric_new().

Referenced by deccmp().

49 {
50  numeric *a1,
51  *a2;
52  int i;
53 
54  if ((a1 = PGTYPESnumeric_new()) == NULL)
56 
57  if ((a2 = PGTYPESnumeric_new()) == NULL)
58  {
61  }
62 
63  if (PGTYPESnumeric_from_decimal(arg1, a1) != 0)
64  {
68  }
69 
70  if (PGTYPESnumeric_from_decimal(arg2, a2) != 0)
71  {
75  }
76 
77  i = (*ptr) (a1, a2);
78 
81 
82  return i;
83 }
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1653
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
static const FormData_pg_attribute a2
Definition: heap.c:166
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24
int i
static const FormData_pg_attribute a1
Definition: heap.c:152

◆ deccall3()

static int deccall3 ( decimal arg1,
decimal arg2,
decimal result,
int(*)(numeric *, numeric *, numeric *)  ptr 
)
static

Definition at line 86 of file informix.c.

References a1, a2, CDECIMALTYPE, ECPG_INFORMIX_OUT_OF_MEMORY, i, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), PGTYPESnumeric_to_decimal(), risnull(), and rsetnull().

Referenced by decadd(), decdiv(), decmul(), and decsub().

87 {
88  numeric *a1,
89  *a2,
90  *nres;
91  int i;
92 
93  /*
94  * we must NOT set the result to NULL here because it may be the same
95  * variable as one of the arguments
96  */
97  if (risnull(CDECIMALTYPE, (char *) arg1) || risnull(CDECIMALTYPE, (char *) arg2))
98  return 0;
99 
100  if ((a1 = PGTYPESnumeric_new()) == NULL)
102 
103  if ((a2 = PGTYPESnumeric_new()) == NULL)
104  {
107  }
108 
109  if ((nres = PGTYPESnumeric_new()) == NULL)
110  {
114  }
115 
116  if (PGTYPESnumeric_from_decimal(arg1, a1) != 0)
117  {
120  PGTYPESnumeric_free(nres);
122  }
123 
124  if (PGTYPESnumeric_from_decimal(arg2, a2) != 0)
125  {
128  PGTYPESnumeric_free(nres);
130  }
131 
132  i = (*ptr) (a1, a2, nres);
133 
134  if (i == 0) /* No error */
135  {
136 
137  /* set the result to null in case it errors out later */
138  rsetnull(CDECIMALTYPE, (char *) result);
139  PGTYPESnumeric_to_decimal(nres, result);
140  }
141 
142  PGTYPESnumeric_free(nres);
145 
146  return i;
147 }
int risnull(int t, const char *ptr)
Definition: informix.c:1024
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1653
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1630
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
static const FormData_pg_attribute a2
Definition: heap.c:166
#define CDECIMALTYPE
Definition: sqltypes.h:12
int rsetnull(int t, char *ptr)
Definition: informix.c:1017
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24
int i
static const FormData_pg_attribute a1
Definition: heap.c:152

◆ deccmp()

int deccmp ( decimal arg1,
decimal arg2 
)

Definition at line 167 of file informix.c.

References deccall2(), and PGTYPESnumeric_cmp().

Referenced by main().

168 {
169  return deccall2(arg1, arg2, PGTYPESnumeric_cmp);
170 }
int PGTYPESnumeric_cmp(numeric *, numeric *)
Definition: numeric.c:1368
static int deccall2(decimal *arg1, decimal *arg2, int(*ptr)(numeric *, numeric *))
Definition: informix.c:48

◆ deccopy()

void deccopy ( decimal src,
decimal target 
)

Definition at line 173 of file informix.c.

174 {
175  memcpy(target, src, sizeof(decimal));
176 }

◆ deccvasc()

int deccvasc ( const char *  cp,
int  len,
decimal np 
)

Definition at line 179 of file informix.c.

References CDECIMALTYPE, CSTRINGTYPE, ECPG_INFORMIX_BAD_EXPONENT, ECPG_INFORMIX_BAD_NUMERIC, ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_NUM_UNDERFLOW, free, i, PGTYPES_NUM_BAD_NUMERIC, PGTYPES_NUM_OVERFLOW, PGTYPESnumeric_free(), PGTYPESnumeric_from_asc(), PGTYPESnumeric_to_decimal(), pnstrdup(), risnull(), rsetnull(), and generate_unaccent_rules::str.

Referenced by main().

180 {
181  char *str;
182  int ret = 0;
183  numeric *result;
184 
185  rsetnull(CDECIMALTYPE, (char *) np);
186  if (risnull(CSTRINGTYPE, cp))
187  return 0;
188 
189  str = pnstrdup(cp, len); /* decimal_in always converts the complete
190  * string */
191  if (!str)
193  else
194  {
195  errno = 0;
196  result = PGTYPESnumeric_from_asc(str, NULL);
197  if (!result)
198  {
199  switch (errno)
200  {
203  break;
206  break;
207  default:
209  break;
210  }
211  }
212  else
213  {
214  int i = PGTYPESnumeric_to_decimal(result, np);
215 
216  PGTYPESnumeric_free(result);
217  if (i != 0)
219  }
220  }
221 
222  free(str);
223  return ret;
224 }
#define ECPG_INFORMIX_BAD_NUMERIC
Definition: ecpg_informix.h:26
char * pnstrdup(const char *in, Size len)
Definition: mcxt.c:1197
int risnull(int t, const char *ptr)
Definition: informix.c:1024
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1630
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
#define ECPG_INFORMIX_NUM_UNDERFLOW
Definition: ecpg_informix.h:17
#define CDECIMALTYPE
Definition: sqltypes.h:12
#define PGTYPES_NUM_OVERFLOW
Definition: pgtypes_error.h:3
#define CSTRINGTYPE
Definition: sqltypes.h:14
#define ECPG_INFORMIX_BAD_EXPONENT
Definition: ecpg_informix.h:27
numeric * PGTYPESnumeric_from_asc(char *, char **)
Definition: numeric.c:407
#define free(a)
Definition: header.h:65
int rsetnull(int t, char *ptr)
Definition: informix.c:1017
#define PGTYPES_NUM_BAD_NUMERIC
Definition: pgtypes_error.h:4
int i

◆ deccvdbl()

int deccvdbl ( double  dbl,
decimal np 
)

Definition at line 227 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().

228 {
229  numeric *nres;
230  int result = 1;
231 
232  rsetnull(CDECIMALTYPE, (char *) np);
233  if (risnull(CDOUBLETYPE, (char *) &dbl))
234  return 0;
235 
236  nres = PGTYPESnumeric_new();
237  if (nres == NULL)
239 
240  result = PGTYPESnumeric_from_double(dbl, nres);
241  if (result == 0)
242  result = PGTYPESnumeric_to_decimal(nres, np);
243 
244  PGTYPESnumeric_free(nres);
245  return result;
246 }
int risnull(int t, const char *ptr)
Definition: informix.c:1024
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1630
int PGTYPESnumeric_from_double(double, numeric *)
Definition: numeric.c:1499
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
#define CDOUBLETYPE
Definition: sqltypes.h:11
#define CDECIMALTYPE
Definition: sqltypes.h:12
int rsetnull(int t, char *ptr)
Definition: informix.c:1017
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ deccvint()

int deccvint ( int  in,
decimal np 
)

Definition at line 249 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().

250 {
251  numeric *nres;
252  int result = 1;
253 
254  rsetnull(CDECIMALTYPE, (char *) np);
255  if (risnull(CINTTYPE, (char *) &in))
256  return 0;
257 
258  nres = PGTYPESnumeric_new();
259  if (nres == NULL)
261 
262  result = PGTYPESnumeric_from_int(in, nres);
263  if (result == 0)
264  result = PGTYPESnumeric_to_decimal(nres, np);
265 
266  PGTYPESnumeric_free(nres);
267  return result;
268 }
int risnull(int t, const char *ptr)
Definition: informix.c:1024
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1630
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
int PGTYPESnumeric_from_int(signed int, numeric *)
Definition: numeric.c:1397
#define CDECIMALTYPE
Definition: sqltypes.h:12
int rsetnull(int t, char *ptr)
Definition: informix.c:1017
#define CINTTYPE
Definition: sqltypes.h:8
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ deccvlong()

int deccvlong ( long  lng,
decimal np 
)

Definition at line 271 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().

272 {
273  numeric *nres;
274  int result = 1;
275 
276  rsetnull(CDECIMALTYPE, (char *) np);
277  if (risnull(CLONGTYPE, (char *) &lng))
278  return 0;
279 
280  nres = PGTYPESnumeric_new();
281  if (nres == NULL)
283 
284  result = PGTYPESnumeric_from_long(lng, nres);
285  if (result == 0)
286  result = PGTYPESnumeric_to_decimal(nres, np);
287 
288  PGTYPESnumeric_free(nres);
289  return result;
290 }
int PGTYPESnumeric_from_long(signed long int, numeric *)
Definition: numeric.c:1406
int risnull(int t, const char *ptr)
Definition: informix.c:1024
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1630
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
#define CDECIMALTYPE
Definition: sqltypes.h:12
#define CLONGTYPE
Definition: sqltypes.h:9
int rsetnull(int t, char *ptr)
Definition: informix.c:1017
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ decdiv()

int decdiv ( decimal n1,
decimal n2,
decimal result 
)

Definition at line 293 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().

294 {
295  int i;
296 
297  errno = 0;
298  i = deccall3(n1, n2, result, PGTYPESnumeric_div);
299 
300  if (i != 0)
301  switch (errno)
302  {
305  break;
308  break;
309  default:
311  break;
312  }
313 
314  return 0;
315 }
#define ECPG_INFORMIX_DIVIDE_ZERO
Definition: ecpg_informix.h:18
#define PGTYPES_NUM_DIVIDE_ZERO
Definition: pgtypes_error.h:5
static int deccall3(decimal *arg1, decimal *arg2, decimal *result, int(*ptr)(numeric *, numeric *, numeric *))
Definition: informix.c:86
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
#define ECPG_INFORMIX_NUM_UNDERFLOW
Definition: ecpg_informix.h:17
int PGTYPESnumeric_div(numeric *, numeric *, numeric *)
Definition: numeric.c:1139
#define PGTYPES_NUM_OVERFLOW
Definition: pgtypes_error.h:3
int i

◆ decmul()

int decmul ( decimal n1,
decimal n2,
decimal result 
)

Definition at line 318 of file informix.c.

References deccall3(), ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_NUM_UNDERFLOW, i, PGTYPES_NUM_OVERFLOW, and PGTYPESnumeric_mul().

Referenced by main().

319 {
320  int i;
321 
322  errno = 0;
323  i = deccall3(n1, n2, result, PGTYPESnumeric_mul);
324 
325  if (i != 0)
326  switch (errno)
327  {
330  break;
331  default:
333  break;
334  }
335 
336  return 0;
337 }
static int deccall3(decimal *arg1, decimal *arg2, decimal *result, int(*ptr)(numeric *, numeric *, numeric *))
Definition: informix.c:86
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
#define ECPG_INFORMIX_NUM_UNDERFLOW
Definition: ecpg_informix.h:17
#define PGTYPES_NUM_OVERFLOW
Definition: pgtypes_error.h:3
int i
int PGTYPESnumeric_mul(numeric *, numeric *, numeric *)
Definition: numeric.c:982

◆ decsub()

int decsub ( decimal n1,
decimal n2,
decimal result 
)

Definition at line 340 of file informix.c.

References deccall3(), ECPG_INFORMIX_NUM_OVERFLOW, ECPG_INFORMIX_NUM_UNDERFLOW, i, PGTYPES_NUM_OVERFLOW, and PGTYPESnumeric_sub().

Referenced by main().

341 {
342  int i;
343 
344  errno = 0;
345  i = deccall3(n1, n2, result, PGTYPESnumeric_sub);
346 
347  if (i != 0)
348  switch (errno)
349  {
352  break;
353  default:
355  break;
356  }
357 
358  return 0;
359 }
static int deccall3(decimal *arg1, decimal *arg2, decimal *result, int(*ptr)(numeric *, numeric *, numeric *))
Definition: informix.c:86
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
#define ECPG_INFORMIX_NUM_UNDERFLOW
Definition: ecpg_informix.h:17
#define PGTYPES_NUM_OVERFLOW
Definition: pgtypes_error.h:3
int i
int PGTYPESnumeric_sub(numeric *, numeric *, numeric *)
Definition: numeric.c:851

◆ dectoasc()

int dectoasc ( decimal np,
char *  cp,
int  len,
int  right 
)

Definition at line 362 of file informix.c.

References CDECIMALTYPE, CSTRINGTYPE, numeric::dscale, ECPG_INFORMIX_OUT_OF_MEMORY, free, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), PGTYPESnumeric_to_asc(), risnull(), rsetnull(), and generate_unaccent_rules::str.

Referenced by dump_sqlda(), and main().

363 {
364  char *str;
365  numeric *nres;
366 
367  rsetnull(CSTRINGTYPE, (char *) cp);
368  if (risnull(CDECIMALTYPE, (char *) np))
369  return 0;
370 
371  nres = PGTYPESnumeric_new();
372  if (nres == NULL)
374 
375  if (PGTYPESnumeric_from_decimal(np, nres) != 0)
376  {
377  PGTYPESnumeric_free(nres);
379  }
380 
381  if (right >= 0)
382  str = PGTYPESnumeric_to_asc(nres, right);
383  else
384  str = PGTYPESnumeric_to_asc(nres, nres->dscale);
385 
386  PGTYPESnumeric_free(nres);
387  if (!str)
388  return -1;
389 
390  /*
391  * TODO: have to take care of len here and create exponential notation if
392  * necessary
393  */
394  if ((int) (strlen(str) + 1) > len)
395  {
396  if (len > 1)
397  {
398  cp[0] = '*';
399  cp[1] = '\0';
400  }
401  free(str);
402  return -1;
403  }
404  else
405  {
406  strcpy(cp, str);
407  free(str);
408  return 0;
409  }
410 }
int risnull(int t, const char *ptr)
Definition: informix.c:1024
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1653
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
#define CDECIMALTYPE
Definition: sqltypes.h:12
char * PGTYPESnumeric_to_asc(numeric *, int)
Definition: numeric.c:429
#define CSTRINGTYPE
Definition: sqltypes.h:14
#define free(a)
Definition: header.h:65
int rsetnull(int t, char *ptr)
Definition: informix.c:1017
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ dectodbl()

int dectodbl ( decimal np,
double *  dblp 
)

Definition at line 413 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().

414 {
415  int i;
416  numeric *nres = PGTYPESnumeric_new();
417 
418  if (nres == NULL)
420 
421  if (PGTYPESnumeric_from_decimal(np, nres) != 0)
422  {
423  PGTYPESnumeric_free(nres);
425  }
426 
427  i = PGTYPESnumeric_to_double(nres, dblp);
428  PGTYPESnumeric_free(nres);
429 
430  return i;
431 }
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1653
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
int PGTYPESnumeric_to_double(numeric *, double *)
Definition: numeric.c:1571
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24
int i

◆ dectoint()

int dectoint ( decimal np,
int *  ip 
)

Definition at line 434 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().

435 {
436  int ret;
437  numeric *nres = PGTYPESnumeric_new();
438 
439  if (nres == NULL)
441 
442  if (PGTYPESnumeric_from_decimal(np, nres) != 0)
443  {
444  PGTYPESnumeric_free(nres);
446  }
447 
448  ret = PGTYPESnumeric_to_int(nres, ip);
449  PGTYPESnumeric_free(nres);
450 
451  if (ret == PGTYPES_NUM_OVERFLOW)
453 
454  return ret;
455 }
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1653
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
int PGTYPESnumeric_to_int(numeric *, int *)
Definition: numeric.c:1582
#define PGTYPES_NUM_OVERFLOW
Definition: pgtypes_error.h:3
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ dectolong()

int dectolong ( decimal np,
long *  lngp 
)

Definition at line 458 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().

459 {
460  int ret;
461  numeric *nres = PGTYPESnumeric_new();
462 
463  if (nres == NULL)
465 
466  if (PGTYPESnumeric_from_decimal(np, nres) != 0)
467  {
468  PGTYPESnumeric_free(nres);
470  }
471 
472  ret = PGTYPESnumeric_to_long(nres, lngp);
473  PGTYPESnumeric_free(nres);
474 
475  if (ret == PGTYPES_NUM_OVERFLOW)
477 
478  return ret;
479 }
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1653
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:471
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:128
int PGTYPESnumeric_to_long(numeric *, long *)
Definition: numeric.c:1601
#define PGTYPES_NUM_OVERFLOW
Definition: pgtypes_error.h:3
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ dtcurrent()

void dtcurrent ( timestamp ts)

Definition at line 587 of file informix.c.

References PGTYPEStimestamp_current().

588 {
590 }
void PGTYPEStimestamp_current(timestamp *)
Definition: timestamp.c:293

◆ dtcvasc()

int dtcvasc ( char *  str,
timestamp ts 
)

Definition at line 593 of file informix.c.

References ECPG_INFORMIX_EXTRA_CHARS, i, PGTYPEStimestamp_from_asc(), and generate_unaccent_rules::str.

594 {
595  timestamp ts_tmp;
596  int i;
597  char **endptr = &str;
598 
599  errno = 0;
600  ts_tmp = PGTYPEStimestamp_from_asc(str, endptr);
601  i = errno;
602  if (i)
603  /* TODO: rewrite to Informix error codes */
604  return i;
605  if (**endptr)
606  {
607  /* extra characters exist at the end */
609  }
610  /* TODO: other Informix error codes missing */
611 
612  /* everything went fine */
613  *ts = ts_tmp;
614 
615  return 0;
616 }
int64 timestamp
int i
#define ECPG_INFORMIX_EXTRA_CHARS
Definition: ecpg_informix.h:29
timestamp PGTYPEStimestamp_from_asc(char *, char **)
Definition: timestamp.c:205

◆ dtcvfmtasc()

int dtcvfmtasc ( char *  inbuf,
char *  fmtstr,
timestamp dtvalue 
)

Definition at line 619 of file informix.c.

References PGTYPEStimestamp_defmt_asc().

620 {
621  return PGTYPEStimestamp_defmt_asc(inbuf, fmtstr, dtvalue);
622 }
int PGTYPEStimestamp_defmt_asc(const char *, const char *, timestamp *)
Definition: timestamp.c:809
static void fmtstr(const char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target)
Definition: snprintf.c:969

◆ dtsub()

int dtsub ( timestamp ts1,
timestamp ts2,
interval iv 
)

Definition at line 625 of file informix.c.

References PGTYPEStimestamp_sub().

626 {
627  return PGTYPEStimestamp_sub(ts1, ts2, iv);
628 }
int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *)
Definition: timestamp.c:796

◆ dttoasc()

int dttoasc ( timestamp ts,
char *  output 
)

Definition at line 631 of file informix.c.

References free, and PGTYPEStimestamp_to_asc().

632 {
633  char *asctime = PGTYPEStimestamp_to_asc(*ts);
634 
635  strcpy(output, asctime);
636  free(asctime);
637  return 0;
638 }
static void output(uint64 loop_count)
#define free(a)
Definition: header.h:65
char * PGTYPEStimestamp_to_asc(timestamp)
Definition: timestamp.c:271

◆ dttofmtasc()

int dttofmtasc ( timestamp ts,
char *  output,
int  str_len,
char *  fmtstr 
)

Definition at line 641 of file informix.c.

References PGTYPEStimestamp_fmt_asc().

642 {
643  return PGTYPEStimestamp_fmt_asc(ts, output, str_len, fmtstr);
644 }
static void output(uint64 loop_count)
int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, const char *)
Definition: timestamp.c:781
static void fmtstr(const char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target)
Definition: snprintf.c:969

◆ ECPG_informix_get_var()

void* ECPG_informix_get_var ( int  number)

Definition at line 1000 of file informix.c.

References ECPGget_var().

1001 {
1002  return ECPGget_var(number);
1003 }
void * ECPGget_var(int number)
Definition: misc.c:581

◆ ECPG_informix_reset_sqlca()

void ECPG_informix_reset_sqlca ( void  )

Definition at line 1006 of file informix.c.

References ECPGget_sqlca(), and sqlca.

1007 {
1008  struct sqlca_t *sqlca = ECPGget_sqlca();
1009 
1010  if (sqlca == NULL)
1011  return;
1012 
1013  memcpy((char *) sqlca, (char *) &sqlca_init, sizeof(struct sqlca_t));
1014 }
#define sqlca
Definition: sqlca.h:59
struct sqlca_t * ECPGget_sqlca(void)
Definition: misc.c:141
Definition: sqlca.h:19
static struct sqlca_t sqlca_init
Definition: informix.c:21

◆ ECPG_informix_set_var()

void ECPG_informix_set_var ( int  number,
void *  pointer,
int  lineno 
)

Definition at line 994 of file informix.c.

References ECPGset_var().

995 {
996  ECPGset_var(number, pointer, lineno);
997 }
void ECPGset_var(int number, void *pointer, int lineno)
Definition: misc.c:526

◆ getRightMostDot()

static int getRightMostDot ( const char *  str)
static

Definition at line 725 of file informix.c.

References i.

Referenced by rfmtlong().

726 {
727  size_t len = strlen(str);
728  int i,
729  j;
730 
731  j = 0;
732  for (i = len - 1; i >= 0; i--)
733  {
734  if (str[i] == '.')
735  return len - j - 1;
736  j++;
737  }
738  return -1;
739 }
int i

◆ initValue()

static int initValue ( long  lng_val)
static

initialize the struct, which holds the different forms of the long value

Definition at line 677 of file informix.c.

References i, malloc, and value.

Referenced by build_pertrans_for_aggref(), ExecInitAgg(), and rfmtlong().

678 {
679  int i,
680  j;
681  long l,
682  dig;
683 
684  /* set some obvious things */
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);
688 
689  /* determine the number of digits */
690  i = 0;
691  l = 1;
692  do
693  {
694  i++;
695  l *= 10;
696  }
697  while ((l - 1) < value.val && l <= LONG_MAX / 10);
698 
699  if (l <= LONG_MAX / 10)
700  {
701  value.digits = i;
702  l /= 10;
703  }
704  else
705  value.digits = i + 1;
706 
707  value.remaining = value.digits;
708 
709  /* convert the long to string */
710  if ((value.val_string = (char *) malloc(value.digits + 1)) == NULL)
711  return -1;
712  dig = value.val;
713  for (i = value.digits, j = 0; i > 0; i--, j++)
714  {
715  value.val_string[j] = dig / l + '0';
716  dig = dig % l;
717  l /= 10;
718  }
719  value.val_string[value.digits] = '\0';
720  return 0;
721 }
static struct @145 value
#define malloc(a)
Definition: header.h:50
int i

◆ intoasc()

int intoasc ( interval i,
char *  str 
)

Definition at line 647 of file informix.c.

References free, and PGTYPESinterval_to_asc().

648 {
649  char *tmp;
650 
651  errno = 0;
652  tmp = PGTYPESinterval_to_asc(i);
653 
654  if (!tmp)
655  return -errno;
656 
657  memcpy(str, tmp, strlen(tmp));
658  free(tmp);
659  return 0;
660 }
#define free(a)
Definition: header.h:65
char * PGTYPESinterval_to_asc(interval *)
Definition: interval.c:1066

◆ ldchar()

void ldchar ( char *  src,
int  len,
char *  dest 
)

Definition at line 952 of file informix.c.

References byleng(), and memmove.

Referenced by main().

953 {
954  int dlen = byleng(src, len);
955 
956  memmove(dest, src, dlen);
957  dest[dlen] = '\0';
958 }
int byleng(char *str, int len)
Definition: informix.c:945
#define memmove(d, s, c)
Definition: c.h:1267

◆ rdatestr()

int rdatestr ( date  d,
char *  str 
)

Definition at line 483 of file informix.c.

References ECPG_INFORMIX_DATE_CONVERT, free, and PGTYPESdate_to_asc().

Referenced by date_test_defmt(), date_test_strdate(), and main().

484 {
485  char *tmp = PGTYPESdate_to_asc(d);
486 
487  if (!tmp)
489 
490  /* move to user allocated buffer */
491  strcpy(str, tmp);
492  free(tmp);
493 
494  return 0;
495 }
char * PGTYPESdate_to_asc(date)
Definition: datetime.c:101
#define ECPG_INFORMIX_DATE_CONVERT
Definition: ecpg_informix.h:23
#define free(a)
Definition: header.h:65

◆ rdayofweek()

int rdayofweek ( date  d)

Definition at line 579 of file informix.c.

References PGTYPESdate_dayofweek().

580 {
581  return PGTYPESdate_dayofweek(d);
582 }
int PGTYPESdate_dayofweek(date)
Definition: datetime.c:138

◆ rdefmtdate()

int rdefmtdate ( date d,
const char *  fmt,
const char *  str 
)

Definition at line 528 of file informix.c.

References ECPG_INFORMIX_BAD_DAY, ECPG_INFORMIX_BAD_MONTH, ECPG_INFORMIX_BAD_YEAR, ECPG_INFORMIX_ENOSHORTDATE, ECPG_INFORMIX_ENOTDMY, PGTYPES_DATE_BAD_DAY, PGTYPES_DATE_BAD_MONTH, PGTYPES_DATE_ERR_EARGS, PGTYPES_DATE_ERR_ENOSHORTDATE, PGTYPES_DATE_ERR_ENOTDMY, and PGTYPESdate_defmt_asc().

Referenced by date_test_defmt(), and rstrdate().

529 {
530  /* TODO: take care of DBCENTURY environment variable */
531  /* PGSQL functions allow all centuries */
532 
533  errno = 0;
534  if (PGTYPESdate_defmt_asc(d, fmt, str) == 0)
535  return 0;
536 
537  switch (errno)
538  {
543  return ECPG_INFORMIX_ENOTDMY;
545  return ECPG_INFORMIX_BAD_DAY;
548  default:
549  return ECPG_INFORMIX_BAD_YEAR;
550  }
551 }
int PGTYPESdate_defmt_asc(date *, const char *, const char *)
Definition: datetime.c:330
#define PGTYPES_DATE_BAD_DAY
Definition: pgtypes_error.h:12
#define PGTYPES_DATE_ERR_EARGS
Definition: pgtypes_error.h:9
#define PGTYPES_DATE_ERR_ENOTDMY
Definition: pgtypes_error.h:11
#define ECPG_INFORMIX_BAD_MONTH
Definition: ecpg_informix.h:20
#define PGTYPES_DATE_BAD_MONTH
Definition: pgtypes_error.h:13
#define PGTYPES_DATE_ERR_ENOSHORTDATE
Definition: pgtypes_error.h:10
#define ECPG_INFORMIX_BAD_YEAR
Definition: ecpg_informix.h:19
#define ECPG_INFORMIX_ENOSHORTDATE
Definition: ecpg_informix.h:22
#define ECPG_INFORMIX_ENOTDMY
Definition: ecpg_informix.h:25
#define ECPG_INFORMIX_BAD_DAY
Definition: ecpg_informix.h:21

◆ rfmtdate()

int rfmtdate ( date  d,
const char *  fmt,
char *  str 
)

Definition at line 554 of file informix.c.

References ECPG_INFORMIX_DATE_CONVERT, ECPG_INFORMIX_OUT_OF_MEMORY, and PGTYPESdate_fmt_asc().

Referenced by date_test_fmt().

555 {
556  errno = 0;
557  if (PGTYPESdate_fmt_asc(d, fmt, str) == 0)
558  return 0;
559 
560  if (errno == ENOMEM)
562 
564 }
int PGTYPESdate_fmt_asc(date, const char *, char *)
Definition: datetime.c:168
#define ECPG_INFORMIX_DATE_CONVERT
Definition: ecpg_informix.h:23
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ rfmtlong()

int rfmtlong ( long  lng_val,
const char *  fmt,
char *  outbuf 
)

Definition at line 743 of file informix.c.

References fmtchar(), free, getRightMostDot(), i, initValue(), malloc, sign, and value.

Referenced by fmtlong().

744 {
745  size_t fmt_len = strlen(fmt);
746  size_t temp_len;
747  int i,
748  j, /* position in temp */
749  k,
750  dotpos;
751  int leftalign = 0,
752  blank = 0,
753  sign = 0,
754  entitydone = 0,
755  signdone = 0,
756  brackets_ok = 0;
757  char *temp;
758  char tmp[2] = " ";
759  char lastfmt = ' ',
760  fmtchar = ' ';
761 
762  temp = (char *) malloc(fmt_len + 1);
763  if (!temp)
764  {
765  errno = ENOMEM;
766  return -1;
767  }
768 
769  /* put all info about the long in a struct */
770  if (initValue(lng_val) == -1)
771  {
772  free(temp);
773  errno = ENOMEM;
774  return -1;
775  }
776 
777  /* '<' is the only format, where we have to align left */
778  if (strchr(fmt, (int) '<'))
779  leftalign = 1;
780 
781  /* '(' requires ')' */
782  if (strchr(fmt, (int) '(') && strchr(fmt, (int) ')'))
783  brackets_ok = 1;
784 
785  /* get position of the right-most dot in the format-string */
786  /* and fill the temp-string wit '0's up to there. */
787  dotpos = getRightMostDot(fmt);
788 
789  /* start to parse the format-string */
790  temp[0] = '\0';
791  k = value.digits - 1; /* position in the value_string */
792  for (i = fmt_len - 1, j = 0; i >= 0; i--, j++)
793  {
794  /* qualify, where we are in the value_string */
795  if (k < 0)
796  {
797  blank = 1;
798  if (k == -1)
799  sign = 1;
800  if (leftalign)
801  {
802  /* can't use strncat(,,0) here, Solaris would freak out */
803  if (sign)
804  if (signdone)
805  {
806  temp[j] = '\0';
807  break;
808  }
809  }
810  }
811  /* if we're right side of the right-most dot, print '0' */
812  if (dotpos >= 0 && dotpos <= i)
813  {
814  if (dotpos < i)
815  {
816  if (fmt[i] == ')')
817  tmp[0] = value.sign == '-' ? ')' : ' ';
818  else
819  tmp[0] = '0';
820  }
821  else
822  tmp[0] = '.';
823  strcat(temp, tmp);
824  continue;
825  }
826  /* the ',' needs special attention, if it is in the blank area */
827  if (blank && fmt[i] == ',')
828  fmtchar = lastfmt;
829  else
830  fmtchar = fmt[i];
831  /* waiting for the sign */
832  if (k < 0 && leftalign && sign && !signdone && fmtchar != '+' && fmtchar != '-')
833  continue;
834  /* analyse this format-char */
835  switch (fmtchar)
836  {
837  case ',':
838  tmp[0] = ',';
839  k++;
840  break;
841  case '*':
842  if (blank)
843  tmp[0] = '*';
844  else
845  tmp[0] = value.val_string[k];
846  break;
847  case '&':
848  if (blank)
849  tmp[0] = '0';
850  else
851  tmp[0] = value.val_string[k];
852  break;
853  case '#':
854  if (blank)
855  tmp[0] = ' ';
856  else
857  tmp[0] = value.val_string[k];
858  break;
859  case '-':
860  if (sign && value.sign == '-' && !signdone)
861  {
862  tmp[0] = '-';
863  signdone = 1;
864  }
865  else if (blank)
866  tmp[0] = ' ';
867  else
868  tmp[0] = value.val_string[k];
869  break;
870  case '+':
871  if (sign && !signdone)
872  {
873  tmp[0] = value.sign;
874  signdone = 1;
875  }
876  else if (blank)
877  tmp[0] = ' ';
878  else
879  tmp[0] = value.val_string[k];
880  break;
881  case '(':
882  if (sign && brackets_ok && value.sign == '-')
883  tmp[0] = '(';
884  else if (blank)
885  tmp[0] = ' ';
886  else
887  tmp[0] = value.val_string[k];
888  break;
889  case ')':
890  if (brackets_ok && value.sign == '-')
891  tmp[0] = ')';
892  else
893  tmp[0] = ' ';
894  break;
895  case '$':
896  if (blank && !entitydone)
897  {
898  tmp[0] = '$';
899  entitydone = 1;
900  }
901  else if (blank)
902  tmp[0] = ' ';
903  else
904  tmp[0] = value.val_string[k];
905  break;
906  case '<':
907  tmp[0] = value.val_string[k];
908  break;
909  default:
910  tmp[0] = fmt[i];
911  }
912  strcat(temp, tmp);
913  lastfmt = fmt[i];
914  k--;
915  }
916  /* safety-net */
917  temp[fmt_len] = '\0';
918 
919  /* reverse the temp-string and put it into the outbuf */
920  temp_len = strlen(temp);
921  outbuf[0] = '\0';
922  for (i = temp_len - 1; i >= 0; i--)
923  {
924  tmp[0] = temp[i];
925  strcat(outbuf, tmp);
926  }
927  outbuf[temp_len] = '\0';
928 
929  /* cleaning up */
930  free(temp);
931  free(value.val_string);
932 
933  return 0;
934 }
static struct @145 value
static void fmtchar(int value, int leftjust, int minlen, PrintfTarget *target)
Definition: snprintf.c:1099
static int getRightMostDot(const char *str)
Definition: informix.c:725
#define malloc(a)
Definition: header.h:50
char sign
Definition: informix.c:668
static int initValue(long lng_val)
Definition: informix.c:677
#define free(a)
Definition: header.h:65
int i

◆ rgetmsg()

int rgetmsg ( int  msgnum,
char *  s,
int  maxsize 
)

Definition at line 961 of file informix.c.

962 {
963  (void) msgnum; /* keep the compiler quiet */
964  (void) s; /* keep the compiler quiet */
965  (void) maxsize; /* keep the compiler quiet */
966  return 0;
967 }

◆ risnull()

int risnull ( int  t,
const char *  ptr 
)

Definition at line 1024 of file informix.c.

References ECPGis_noind_null().

Referenced by deccall3(), deccvasc(), deccvdbl(), deccvint(), deccvlong(), dectoasc(), main(), and test_null().

1025 {
1026  return ECPGis_noind_null(t, ptr);
1027 }
bool ECPGis_noind_null(enum ECPGttype type, const void *ptr)
Definition: misc.c:388

◆ rjulmdy()

int rjulmdy ( date  d,
short  mdy[3] 
)

Definition at line 516 of file informix.c.

References PGTYPESdate_julmdy().

517 {
518  int mdy_int[3];
519 
520  PGTYPESdate_julmdy(d, mdy_int);
521  mdy[0] = (short) mdy_int[0];
522  mdy[1] = (short) mdy_int[1];
523  mdy[2] = (short) mdy_int[2];
524  return 0;
525 }
void PGTYPESdate_julmdy(date, int *)
Definition: datetime.c:115

◆ rmdyjul()

int rmdyjul ( short  mdy[3],
date d 
)

Definition at line 567 of file informix.c.

References PGTYPESdate_mdyjul().

Referenced by main().

568 {
569  int mdy_int[3];
570 
571  mdy_int[0] = mdy[0];
572  mdy_int[1] = mdy[1];
573  mdy_int[2] = mdy[2];
574  PGTYPESdate_mdyjul(mdy_int, d);
575  return 0;
576 }
void PGTYPESdate_mdyjul(int *, date *)
Definition: datetime.c:128

◆ rsetnull()

int rsetnull ( int  t,
char *  ptr 
)

Definition at line 1017 of file informix.c.

References ECPGset_noind_null().

Referenced by deccall3(), deccvasc(), deccvdbl(), deccvint(), deccvlong(), dectoasc(), and main().

1018 {
1019  ECPGset_noind_null(t, ptr);
1020  return 0;
1021 }
void ECPGset_noind_null(enum ECPGttype type, void *ptr)
Definition: misc.c:319

◆ rstrdate()

int rstrdate ( const char *  str,
date d 
)

Definition at line 504 of file informix.c.

References rdefmtdate().

Referenced by date_test_strdate().

505 {
506  return rdefmtdate(d, "mm/dd/yyyy", str);
507 }
int rdefmtdate(date *d, const char *fmt, const char *str)
Definition: informix.c:528

◆ rtoday()

void rtoday ( date d)

Definition at line 510 of file informix.c.

References PGTYPESdate_today().

511 {
513 }
void PGTYPESdate_today(date *)
Definition: datetime.c:148

◆ rtypalign()

int rtypalign ( int  offset,
int  type 
)

Definition at line 970 of file informix.c.

971 {
972  (void) offset; /* keep the compiler quiet */
973  (void) type; /* keep the compiler quiet */
974  return 0;
975 }

◆ rtypmsize()

int rtypmsize ( int  type,
int  len 
)

Definition at line 978 of file informix.c.

979 {
980  (void) type; /* keep the compiler quiet */
981  (void) len; /* keep the compiler quiet */
982  return 0;
983 }

◆ rtypwidth()

int rtypwidth ( int  sqltype,
int  sqllen 
)

Definition at line 986 of file informix.c.

987 {
988  (void) sqltype; /* keep the compiler quiet */
989  (void) sqllen; /* keep the compiler quiet */
990  return 0;
991 }

◆ rupshift()

void rupshift ( char *  str)

Definition at line 937 of file informix.c.

Referenced by main().

938 {
939  for (; *str != '\0'; str++)
940  if (islower((unsigned char) *str))
941  *str = toupper((unsigned char) *str);
942 }

Variable Documentation

◆ digits

◆ maxdigits

int maxdigits

Definition at line 665 of file informix.c.

Referenced by apply_typmod(), mul_var(), and numeric().

◆ remaining

◆ sign

◆ sqlca_init

struct sqlca_t sqlca_init
static
Initial value:
=
{
{
'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '
},
sizeof(struct sqlca_t),
0,
{
0,
{
0
}
},
{
'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '
},
{
0, 0, 0, 0, 0, 0
},
{
0, 0, 0, 0, 0, 0, 0, 0
},
{
'0', '0', '0', '0', '0'
}
}
Definition: sqlca.h:19

Definition at line 21 of file informix.c.

◆ val

long val

Definition at line 664 of file informix.c.

Referenced by _bt_spools_heapscan(), _copyAConst(), _copyResTarget(), _copyValue(), _equalResTarget(), _equalValue(), _ltree_compress(), _outResTarget(), _readBitmapset(), _ShowOption(), addHeapElement(), addToSimpleStats(), AlterDomainValidateConstraint(), assignVariables(), AttrDefaultFetch(), autoinc(), bitfromint4(), bitfromint8(), brin_page_items(), build_startup_packet(), BuildIndexValueDescription(), byteaout(), calc_distr(), calc_hist(), cash_words(), check_new_partition_bound(), check_timezone(), CheckConstraintFetch(), collectTSQueryValues(), composite_to_json(), composite_to_jsonb(), convert_string_datum(), CopyReadAttributesText(), create_list_bounds(), datum_write(), datumRestore(), decode_varbyte(), DecodeDate(), DecodeDateTime(), DecodeInterval(), DecodeISO8601Interval(), DecodeNumber(), DecodePosixTimezone(), DecodeTimeOnly(), DropConfigurationMapping(), dump_sqlda(), each_object_field_end(), each_worker_jsonb(), ean13_out(), ecpg_set_compat_sqlda(), ecpg_set_native_sqlda(), elem_contained_by_range(), elements_array_element_end(), elements_worker_jsonb(), encode_varbyte(), esc_decode(), evalStandardFunc(), exec_command_pset(), exec_stmt_assert(), ExecBuildSlotPartitionKeyDescription(), ExecBuildSlotValueDescription(), ExecComputeStoredGenerated(), ExecuteCallStmt(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeUnaryArithmExpr(), exp_var(), extractModify(), fill_val(), findTargetlistEntrySQL92(), flatten_set_variable_args(), float4_numeric(), float4_to_char(), float4in(), float8_numeric(), float8_to_char(), float8in_internal_opt_error(), FreePageBtreeSearchInternal(), FreePageBtreeSearchLeaf(), get_attstatsslot(), get_prompt(), get_qual_for_list(), get_range_partbound_string(), get_rule_expr(), get_sql_insert(), get_sql_update(), get_stack_depth_rlimit(), get_string_attr(), getbits(), getTokenTypes(), getv4(), ghstore_compress(), gin_extract_query_trgm(), gin_extract_tsquery(), gin_extract_value_trgm(), ginCompressPostingList(), ginint4_queryextract(), ginPostingListDecodeAllSegments(), gtrgm_compress(), gtsvector_compress(), GUCArrayDelete(), GUCArrayReset(), hash_object_field_end(), hashint8(), hashint8extended(), heap_compute_data_size(), hstore_contains(), hstore_from_text(), hstore_to_jsonb(), hstore_to_jsonb_loose(), HV_to_JsonbValue(), in_range_date_interval(), in_range_float4_float8(), in_range_float8_float8(), in_range_int2_int4(), in_range_int4_int4(), in_range_int4_int8(), in_range_int8_int8(), in_range_interval_interval(), in_range_numeric_numeric(), in_range_time_interval(), in_range_timestamp_interval(), in_range_timestamptz_interval(), in_range_timetz_interval(), index_build(), ineq_histogram_selectivity(), inet_aton(), inet_cidr_pton_ipv6(), inet_spg_choose(), initialize_worker_spi(), int2_numeric(), int4_numeric(), int4_to_char(), int64_to_int128(), int64_to_numericvar(), int8_numeric(), int8_to_char(), int8out(), interval_part(), interval_trunc(), is_superuser(), is_valid(), isbn_cast_from_ean13(), ismn_cast_from_ean13(), isn_out(), issn_cast_from_ean13(), itemptr_to_uint64(), iterate_jsonb_values(), iterate_values_object_field_start(), json_agg_transfn(), jsonb_agg_transfn(), jsonb_contained(), jsonb_contains(), jsonb_object_agg_transfn(), Jsonb_to_SV(), libpqGetCurrentXlogInsertLocation(), load_domaintype_info(), ltree_compress(), ltxtq_exec(), LWLockReleaseClearVar(), LWLockUpdateVar(), main(), make_array_ref(), make_const(), make_one_partition_rbound(), make_valid(), MergeWithExistingConstraint(), mode_final(), nodeRead(), non_negative(), numeric_exp(), numeric_float8_no_overflow(), numeric_int2(), numeric_to_char(), numeric_to_double_no_overflow(), numericvar_to_double(), numericvar_to_double_no_overflow(), numericvar_to_int32(), numericvar_to_int64(), OldSerXidGetMinConflictCommitSeqNo(), parse_args(), parse_hba_line(), parse_int(), parse_real(), parse_sane_timezone(), parse_scalar(), parse_snapshot(), parseIntFromText(), ParseISO8601Number(), parseXidFromText(), percentile_cont_final_common(), percentile_disc_final(), percentile_disc_multi_final(), pg_atomic_unlocked_write_u32_impl(), pg_atomic_write_u32_impl(), pg_get_constraintdef_worker(), pg_stats_ext_mcvlist_items(), pgstat_progress_update_param(), plperl_build_tuple_result(), plperl_modify_tuple(), plperl_to_hstore(), plpython_to_hstore(), PLy_elog_impl(), PLyObject_FromJsonbContainer(), populate_array_dim_jsonb(), populate_recordset_object_field_end(), postgres_fdw_validator(), power_var(), pqBuildErrorMessage3(), PQencryptPasswordConn(), pqRowProcessor(), pqSetenvPoll(), PrintResultsInCrosstab(), prsd_headline(), putVariable(), putVariableInt(), range_contains_elem(), rankSort(), recompute_limits(), RelationBuildTriggers(), RelationGetExclusionInfo(), removeHeapElement(), ReportGUCOption(), ri_ReportViolation(), serialize_deflist(), session_username(), set_string_attr(), setCompoundAffixFlagValue(), simple_oid_list_append(), SPI_getvalue(), sqlda_common_total_size(), standard_strings(), str2txid(), StreamServerPort(), stringlist_to_identifierstr(), strtoint(), sv2cstr(), test_huge_distances(), text_format_parse_digits(), time_part(), timestamp_part(), timestamp_trunc(), timestamp_zone(), timestamptz_part(), timestamptz_trunc_internal(), timestamptz_trunc_zone(), timestamptz_zone(), timetz_part(), timetz_zone(), to_json(), to_jsonb(), transformExprRecurse(), transformInsertStmt(), trgm2int(), ts_match_vq(), tsqueryrecv(), tstoreReceiveSlot_detoast(), tts_virtual_materialize(), tuple_to_stringinfo(), tuplesort_putdatum(), txid_current(), txid_current_if_assigned(), untransformRelOptions(), upc_cast_from_ean13(), validate_index(), and validateCheckConstraint().

◆ val_string

char* val_string

Definition at line 669 of file informix.c.

◆ value

struct { ... } value

Referenced by _copyPartitionRangeDatum(), _crypt_gensalt_extended_rn(), _crypt_gensalt_md5_rn(), _equalPartitionRangeDatum(), _outPartitionRangeDatum(), _readPartitionRangeDatum(), AddVerboseIntPart(), AlterSystemSetConfigFile(), appendReloptionsArray(), AppendSeconds(), array_fill(), array_fill_with_lower_bounds(), array_position_common(), array_positions(), array_to_text_internal(), AuxiliaryProcessMain(), AV_to_JsonbValue(), binary_upgrade_set_missing_value(), brin_minmax_consistent(), build_sorted_items(), bytea_string_agg_transfn(), call_subtype_diff(), cash_in(), cash_out(), cash_words(), check_pghost_envvar(), CloneRowTriggersToPartition(), compute_array_stats(), compute_distinct_stats(), compute_range_stats(), compute_scalar_stats(), compute_trivial_stats(), compute_tsvector_stats(), concat_internal(), conninfo_uri_parse_params(), convert_prep_stmt_params(), CopyOneRowTo(), create_list_bounds(), datumCopy(), DatumGetFloat4(), datumTransfer(), DCH_from_char(), debugtup(), DefineSequence(), domain_in(), domain_recv(), dxsyn_lexize(), ecpg_build_params(), exec_assign_c_string(), exec_assign_expr(), exec_cast_value(), exec_command_echo(), exec_command_T(), exec_move_row_from_fields(), exec_stmt_assert(), exec_stmt_case(), exec_stmt_exit(), exec_stmt_foreach_a(), exec_stmt_fori(), exec_stmt_if(), exec_stmt_while(), ExecEvalRowNullInt(), ExecEvalXmlExpr(), executeDateTimeMethod(), ExecWindowAgg(), filter_list_to_array(), flatten_reloptions(), float4_to_char(), Float4GetDatum(), float8_to_char(), flushbuffer(), fmtfloat(), from_char_set_int(), fsm_set_avail(), gather_boolean_expression(), get_collation_actual_version(), get_int_item(), get_len_position(), GetComment(), getDatumCopy(), GROW(), hstore_from_record(), hstore_populate_record(), hstore_to_plperl(), hstore_to_plpython(), index_store_float8_orderby_distances(), initValue(), int4_to_char(), int8_to_char(), IpcSemaphoreInitialize(), is_true_boolean_expression(), Jsonb_to_SV(), llvm_compile_expr(), load_return_type(), load_type(), LWLockConflictsWithVar(), main(), mp_int_is_even(), mp_int_mod_value(), num_word(), numeric_abbrev_convert(), numeric_in(), numeric_recv(), numeric_to_char(), numeric_to_number(), optionListToArray(), parse_one_reloption(), parse_psql_options(), pg_atomic_unlocked_write_u32_impl(), pg_column_size(), pg_get_triggerdef_worker(), pg_lltoa(), pg_logging_init(), pg_ltoa(), pg_ltostr(), pg_ltostr_zeropad(), pg_strfromd(), PGTYPESnumeric_from_asc(), plperl_to_hstore(), plpython_to_hstore(), PLy_output(), PLy_subtransaction_exit(), PLyDict_FromTuple(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyMapping_ToJsonbValue(), PLySequence_ToComposite(), PLySequence_ToJsonbValue(), PostmasterMain(), postquel_get_single_result(), pq_parse_errornotice(), pqRowProcessor(), print_param_value(), printsimple(), process_postgres_switches(), process_startup_options(), ProcessGUCArray(), prune_element_hashtable(), psql_get_variable(), push_assignment(), putVariableValue(), read_client_final_message(), read_dictionary(), record_out(), ResourceArrayAdd(), rfmtlong(), s_fake(), SerializeEnumBlacklist(), set_config_by_name(), ShowGUCConfigOption(), statext_mcv_serialize(), statext_ndistinct_serialize(), StoreQueryTuple(), test_single_value_and_filler(), text_format(), tfuncFetchRows(), tfuncInitialize(), to_hex32(), to_hex64(), toast_delete_external(), toast_tuple_externalize(), toast_tuple_try_compression(), transformPartitionBound(), transformPartitionBoundValue(), transformPartitionRangeBounds(), transformRelOptions(), transtime(), txid_snapshot_xip(), and txid_visible_in_snapshot().