PostgreSQL Source Code  git master
informix.c File Reference
#include "postgres_fe.h"
#include <math.h>
#include <ctype.h>
#include <limits.h>
#include <ecpgtype.h>
#include <ecpg_informix.h>
#include <pgtypes_error.h>
#include <pgtypes_date.h>
#include <pgtypes_numeric.h>
#include <sqltypes.h>
#include <sqlca.h>
#include <ecpgerrno.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)
 
static char * ecpg_strndup (const char *str, size_t len)
 
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 971 of file informix.c.

Referenced by ldchar(), and main().

972 {
973  for (len--; str[len] && str[len] == ' '; len--);
974  return (len + 1);
975 }

◆ 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:722

◆ 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:1652
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
static FormData_pg_attribute a1
Definition: heap.c:144
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24
int i
static FormData_pg_attribute a2
Definition: heap.c:150

◆ 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:1050
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1652
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1629
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
#define CDECIMALTYPE
Definition: sqltypes.h:12
static FormData_pg_attribute a1
Definition: heap.c:144
int rsetnull(int t, char *ptr)
Definition: informix.c:1043
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24
int i
static FormData_pg_attribute a2
Definition: heap.c:150

◆ 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:1367
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 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, PGTYPES_NUM_BAD_NUMERIC, PGTYPES_NUM_OVERFLOW, PGTYPESnumeric_free(), PGTYPESnumeric_from_asc(), PGTYPESnumeric_to_decimal(), risnull(), rsetnull(), and generate_unaccent_rules::str.

Referenced by main().

199 {
200  char *str;
201  int ret = 0;
202  numeric *result;
203 
204  rsetnull(CDECIMALTYPE, (char *) np);
205  if (risnull(CSTRINGTYPE, cp))
206  return 0;
207 
208  str = ecpg_strndup(cp, len); /* decimal_in always converts the complete
209  * string */
210  if (!str)
212  else
213  {
214  errno = 0;
215  result = PGTYPESnumeric_from_asc(str, NULL);
216  if (!result)
217  {
218  switch (errno)
219  {
222  break;
225  break;
226  default:
228  break;
229  }
230  }
231  else
232  {
233  int i = PGTYPESnumeric_to_decimal(result, np);
234 
235  PGTYPESnumeric_free(result);
236  if (i != 0)
238  }
239  }
240 
241  free(str);
242  return ret;
243 }
#define ECPG_INFORMIX_BAD_NUMERIC
Definition: ecpg_informix.h:26
static char * ecpg_strndup(const char *str, size_t len)
Definition: informix.c:179
int risnull(int t, const char *ptr)
Definition: informix.c:1050
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1629
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
#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:406
#define free(a)
Definition: header.h:65
int rsetnull(int t, char *ptr)
Definition: informix.c:1043
#define PGTYPES_NUM_BAD_NUMERIC
Definition: pgtypes_error.h:4
int i

◆ deccvdbl()

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

247 {
248  numeric *nres;
249  int result = 1;
250 
251  rsetnull(CDECIMALTYPE, (char *) np);
252  if (risnull(CDOUBLETYPE, (char *) &dbl))
253  return 0;
254 
255  nres = PGTYPESnumeric_new();
256  if (nres == NULL)
258 
259  result = PGTYPESnumeric_from_double(dbl, nres);
260  if (result == 0)
261  result = PGTYPESnumeric_to_decimal(nres, np);
262 
263  PGTYPESnumeric_free(nres);
264  return result;
265 }
int risnull(int t, const char *ptr)
Definition: informix.c:1050
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1629
int PGTYPESnumeric_from_double(double, numeric *)
Definition: numeric.c:1498
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
#define CDOUBLETYPE
Definition: sqltypes.h:11
#define CDECIMALTYPE
Definition: sqltypes.h:12
int rsetnull(int t, char *ptr)
Definition: informix.c:1043
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ deccvint()

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

269 {
270  numeric *nres;
271  int result = 1;
272 
273  rsetnull(CDECIMALTYPE, (char *) np);
274  if (risnull(CINTTYPE, (char *) &in))
275  return 0;
276 
277  nres = PGTYPESnumeric_new();
278  if (nres == NULL)
280 
281  result = PGTYPESnumeric_from_int(in, nres);
282  if (result == 0)
283  result = PGTYPESnumeric_to_decimal(nres, np);
284 
285  PGTYPESnumeric_free(nres);
286  return result;
287 }
int risnull(int t, const char *ptr)
Definition: informix.c:1050
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1629
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
int PGTYPESnumeric_from_int(signed int, numeric *)
Definition: numeric.c:1396
#define CDECIMALTYPE
Definition: sqltypes.h:12
int rsetnull(int t, char *ptr)
Definition: informix.c:1043
#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 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().

291 {
292  numeric *nres;
293  int result = 1;
294 
295  rsetnull(CDECIMALTYPE, (char *) np);
296  if (risnull(CLONGTYPE, (char *) &lng))
297  return 0;
298 
299  nres = PGTYPESnumeric_new();
300  if (nres == NULL)
302 
303  result = PGTYPESnumeric_from_long(lng, nres);
304  if (result == 0)
305  result = PGTYPESnumeric_to_decimal(nres, np);
306 
307  PGTYPESnumeric_free(nres);
308  return result;
309 }
int PGTYPESnumeric_from_long(signed long int, numeric *)
Definition: numeric.c:1405
int risnull(int t, const char *ptr)
Definition: informix.c:1050
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
Definition: numeric.c:1629
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
#define CDECIMALTYPE
Definition: sqltypes.h:12
#define CLONGTYPE
Definition: sqltypes.h:9
int rsetnull(int t, char *ptr)
Definition: informix.c:1043
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ decdiv()

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

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

313 {
314  int i;
315 
316  errno = 0;
317  i = deccall3(n1, n2, result, PGTYPESnumeric_div);
318 
319  if (i != 0)
320  switch (errno)
321  {
324  break;
327  break;
328  default:
330  break;
331  }
332 
333  return 0;
334 }
#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:1138
#define PGTYPES_NUM_OVERFLOW
Definition: pgtypes_error.h:3
int i

◆ decmul()

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

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

338 {
339  int i;
340 
341  errno = 0;
342  i = deccall3(n1, n2, result, PGTYPESnumeric_mul);
343 
344  if (i != 0)
345  switch (errno)
346  {
349  break;
350  default:
352  break;
353  }
354 
355  return 0;
356 }
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:981

◆ decsub()

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

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

360 {
361  int i;
362 
363  errno = 0;
364  i = deccall3(n1, n2, result, PGTYPESnumeric_sub);
365 
366  if (i != 0)
367  switch (errno)
368  {
371  break;
372  default:
374  break;
375  }
376 
377  return 0;
378 }
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:850

◆ dectoasc()

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, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), PGTYPESnumeric_to_asc(), risnull(), rsetnull(), and generate_unaccent_rules::str.

Referenced by dump_sqlda(), and main().

382 {
383  char *str;
384  numeric *nres;
385 
386  rsetnull(CSTRINGTYPE, (char *) cp);
387  if (risnull(CDECIMALTYPE, (char *) np))
388  return 0;
389 
390  nres = PGTYPESnumeric_new();
391  if (nres == NULL)
393 
394  if (PGTYPESnumeric_from_decimal(np, nres) != 0)
395  {
396  PGTYPESnumeric_free(nres);
398  }
399 
400  if (right >= 0)
401  str = PGTYPESnumeric_to_asc(nres, right);
402  else
403  str = PGTYPESnumeric_to_asc(nres, nres->dscale);
404 
405  PGTYPESnumeric_free(nres);
406  if (!str)
407  return -1;
408 
409  /*
410  * TODO: have to take care of len here and create exponential notation if
411  * necessary
412  */
413  if ((int) (strlen(str) + 1) > len)
414  {
415  if (len > 1)
416  {
417  cp[0] = '*';
418  cp[1] = '\0';
419  }
420  free(str);
421  return -1;
422  }
423  else
424  {
425  strcpy(cp, str);
426  free(str);
427  return 0;
428  }
429 }
int risnull(int t, const char *ptr)
Definition: informix.c:1050
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1652
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
#define CDECIMALTYPE
Definition: sqltypes.h:12
char * PGTYPESnumeric_to_asc(numeric *, int)
Definition: numeric.c:428
#define CSTRINGTYPE
Definition: sqltypes.h:14
#define free(a)
Definition: header.h:65
int rsetnull(int t, char *ptr)
Definition: informix.c:1043
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24

◆ dectodbl()

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

433 {
434  int i;
435  numeric *nres = PGTYPESnumeric_new();
436 
437  if (nres == NULL)
439 
440  if (PGTYPESnumeric_from_decimal(np, nres) != 0)
441  {
442  PGTYPESnumeric_free(nres);
444  }
445 
446  i = PGTYPESnumeric_to_double(nres, dblp);
447  PGTYPESnumeric_free(nres);
448 
449  return i;
450 }
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1652
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
int PGTYPESnumeric_to_double(numeric *, double *)
Definition: numeric.c:1570
#define ECPG_INFORMIX_OUT_OF_MEMORY
Definition: ecpg_informix.h:24
int i

◆ dectoint()

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

454 {
455  int ret;
456  numeric *nres = PGTYPESnumeric_new();
457 
458  if (nres == NULL)
460 
461  if (PGTYPESnumeric_from_decimal(np, nres) != 0)
462  {
463  PGTYPESnumeric_free(nres);
465  }
466 
467  ret = PGTYPESnumeric_to_int(nres, ip);
468  PGTYPESnumeric_free(nres);
469 
470  if (ret == PGTYPES_NUM_OVERFLOW)
472 
473  return ret;
474 }
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1652
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
int PGTYPESnumeric_to_int(numeric *, int *)
Definition: numeric.c:1581
#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 477 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().

478 {
479  int ret;
480  numeric *nres = PGTYPESnumeric_new();
481 
482  if (nres == NULL)
484 
485  if (PGTYPESnumeric_from_decimal(np, nres) != 0)
486  {
487  PGTYPESnumeric_free(nres);
489  }
490 
491  ret = PGTYPESnumeric_to_long(nres, lngp);
492  PGTYPESnumeric_free(nres);
493 
494  if (ret == PGTYPES_NUM_OVERFLOW)
496 
497  return ret;
498 }
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
Definition: numeric.c:1652
#define ECPG_INFORMIX_NUM_OVERFLOW
Definition: ecpg_informix.h:16
void PGTYPESnumeric_free(numeric *)
Definition: numeric.c:470
numeric * PGTYPESnumeric_new(void)
Definition: numeric.c:127
int PGTYPESnumeric_to_long(numeric *, long *)
Definition: numeric.c:1600
#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 607 of file informix.c.

References PGTYPEStimestamp_current().

608 {
610 }
void PGTYPEStimestamp_current(timestamp *)
Definition: timestamp.c:299

◆ dtcvasc()

int dtcvasc ( char *  str,
timestamp ts 
)

Definition at line 613 of file informix.c.

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

614 {
615  timestamp ts_tmp;
616  int i;
617  char **endptr = &str;
618 
619  errno = 0;
620  ts_tmp = PGTYPEStimestamp_from_asc(str, endptr);
621  i = errno;
622  if (i)
623  /* TODO: rewrite to Informix error codes */
624  return i;
625  if (**endptr)
626  {
627  /* extra characters exist at the end */
629  }
630  /* TODO: other Informix error codes missing */
631 
632  /* everything went fine */
633  *ts = ts_tmp;
634 
635  return 0;
636 }
int64 timestamp
int i
#define ECPG_INFORMIX_EXTRA_CHARS
Definition: ecpg_informix.h:29
timestamp PGTYPEStimestamp_from_asc(char *, char **)
Definition: timestamp.c:207

◆ dtcvfmtasc()

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

Definition at line 639 of file informix.c.

References PGTYPEStimestamp_defmt_asc().

640 {
641  return PGTYPEStimestamp_defmt_asc(inbuf, fmtstr, dtvalue);
642 }
int PGTYPEStimestamp_defmt_asc(const char *, const char *, timestamp *)
Definition: timestamp.c:816
static void fmtstr(char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target)
Definition: snprintf.c:794

◆ dtsub()

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

Definition at line 645 of file informix.c.

References PGTYPEStimestamp_sub().

646 {
647  return PGTYPEStimestamp_sub(ts1, ts2, iv);
648 }
int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *)
Definition: timestamp.c:803

◆ dttoasc()

int dttoasc ( timestamp ts,
char *  output 
)

Definition at line 651 of file informix.c.

References free, and PGTYPEStimestamp_to_asc().

652 {
653  char *asctime = PGTYPEStimestamp_to_asc(*ts);
654 
655  strcpy(output, asctime);
656  free(asctime);
657  return 0;
658 }
static void output(uint64 loop_count)
#define free(a)
Definition: header.h:65
char * PGTYPEStimestamp_to_asc(timestamp)
Definition: timestamp.c:277

◆ dttofmtasc()

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

Definition at line 661 of file informix.c.

References PGTYPEStimestamp_fmt_asc().

662 {
663  return PGTYPEStimestamp_fmt_asc(ts, output, str_len, fmtstr);
664 }
static void output(uint64 loop_count)
int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, const char *)
Definition: timestamp.c:788
static void fmtstr(char *value, int leftjust, int minlen, int maxwidth, int pointflag, PrintfTarget *target)
Definition: snprintf.c:794

◆ ECPG_informix_get_var()

void* ECPG_informix_get_var ( int  number)

Definition at line 1026 of file informix.c.

References ECPGget_var().

1027 {
1028  return ECPGget_var(number);
1029 }
void * ECPGget_var(int number)
Definition: misc.c:568

◆ ECPG_informix_reset_sqlca()

void ECPG_informix_reset_sqlca ( void  )

Definition at line 1032 of file informix.c.

References ECPGget_sqlca(), and sqlca.

Referenced by main().

1033 {
1034  struct sqlca_t *sqlca = ECPGget_sqlca();
1035 
1036  if (sqlca == NULL)
1037  return;
1038 
1039  memcpy((char *) sqlca, (char *) &sqlca_init, sizeof(struct sqlca_t));
1040 }
#define sqlca
Definition: sqlca.h:59
struct sqlca_t * ECPGget_sqlca(void)
Definition: misc.c:142
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 1020 of file informix.c.

References ECPGset_var().

1021 {
1022  ECPGset_var(number, pointer, lineno);
1023 }
void ECPGset_var(int number, void *pointer, int lineno)
Definition: misc.c:524

◆ ecpg_strndup()

static char* ecpg_strndup ( const char *  str,
size_t  len 
)
static

Definition at line 179 of file informix.c.

References malloc.

Referenced by deccvasc().

180 {
181  size_t real_len = strlen(str);
182  int use_len = (int) ((real_len > len) ? len : real_len);
183 
184  char *new = malloc(use_len + 1);
185 
186  if (new)
187  {
188  memcpy(new, str, use_len);
189  new[use_len] = '\0';
190  }
191  else
192  errno = ENOMEM;
193 
194  return new;
195 }
#define malloc(a)
Definition: header.h:50

◆ getRightMostDot()

static int getRightMostDot ( const char *  str)
static

Definition at line 750 of file informix.c.

References i.

Referenced by rfmtlong().

751 {
752  size_t len = strlen(str);
753  int i,
754  j;
755 
756  j = 0;
757  for (i = len - 1; i >= 0; i--)
758  {
759  if (str[i] == '.')
760  return len - j - 1;
761  j++;
762  }
763  return -1;
764 }
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 702 of file informix.c.

References i, malloc, and value.

Referenced by rfmtlong().

703 {
704  int i,
705  j;
706  long l,
707  dig;
708 
709  /* set some obvious things */
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);
713 
714  /* determine the number of digits */
715  i = 0;
716  l = 1;
717  do
718  {
719  i++;
720  l *= 10;
721  }
722  while ((l - 1) < value.val && l <= LONG_MAX / 10);
723 
724  if (l <= LONG_MAX / 10)
725  {
726  value.digits = i;
727  l /= 10;
728  }
729  else
730  value.digits = i + 1;
731 
732  value.remaining = value.digits;
733 
734  /* convert the long to string */
735  if ((value.val_string = (char *) malloc(value.digits + 1)) == NULL)
736  return -1;
737  dig = value.val;
738  for (i = value.digits, j = 0; i > 0; i--, j++)
739  {
740  value.val_string[j] = dig / l + '0';
741  dig = dig % l;
742  l /= 10;
743  }
744  value.val_string[value.digits] = '\0';
745  return 0;
746 }
#define malloc(a)
Definition: header.h:50
static struct @121 value
int i

◆ intoasc()

int intoasc ( interval i,
char *  str 
)

Definition at line 667 of file informix.c.

References free, and PGTYPESinterval_to_asc().

668 {
669  char *tmp;
670 
671  errno = 0;
672  tmp = PGTYPESinterval_to_asc(i);
673 
674  if (!tmp)
675  return -errno;
676 
677  memcpy(str, tmp, strlen(tmp));
678  free(tmp);
679  return 0;
680 }
#define free(a)
Definition: header.h:65
char * PGTYPESinterval_to_asc(interval *)
Definition: interval.c:1076

◆ ldchar()

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

Definition at line 978 of file informix.c.

References byleng(), and memmove.

Referenced by main().

979 {
980  int dlen = byleng(src, len);
981 
982  memmove(dest, src, dlen);
983  dest[dlen] = '\0';
984 }
int byleng(char *str, int len)
Definition: informix.c:971
#define memmove(d, s, c)
Definition: c.h:1045

◆ rdatestr()

int rdatestr ( date  d,
char *  str 
)

Definition at line 502 of file informix.c.

References ECPG_INFORMIX_DATE_CONVERT, free, and PGTYPESdate_to_asc().

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

503 {
504  char *tmp = PGTYPESdate_to_asc(d);
505 
506  if (!tmp)
508 
509  /* move to user allocated buffer */
510  strcpy(str, tmp);
511  free(tmp);
512 
513  return 0;
514 }
char * PGTYPESdate_to_asc(date)
Definition: datetime.c:102
#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 599 of file informix.c.

References PGTYPESdate_dayofweek().

600 {
601  return PGTYPESdate_dayofweek(d);
602 }
int PGTYPESdate_dayofweek(date)
Definition: datetime.c:139

◆ rdefmtdate()

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

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

549 {
550  /* TODO: take care of DBCENTURY environment variable */
551  /* PGSQL functions allow all centuries */
552 
553  errno = 0;
554  if (PGTYPESdate_defmt_asc(d, fmt, str) == 0)
555  return 0;
556 
557  switch (errno)
558  {
563  return ECPG_INFORMIX_ENOTDMY;
565  return ECPG_INFORMIX_BAD_DAY;
568  default:
569  return ECPG_INFORMIX_BAD_YEAR;
570  }
571 }
int PGTYPESdate_defmt_asc(date *, const char *, const char *)
Definition: datetime.c:332
#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 574 of file informix.c.

References ECPG_INFORMIX_DATE_CONVERT, ECPG_INFORMIX_OUT_OF_MEMORY, and PGTYPESdate_fmt_asc().

Referenced by date_test_fmt().

575 {
576  errno = 0;
577  if (PGTYPESdate_fmt_asc(d, fmt, str) == 0)
578  return 0;
579 
580  if (errno == ENOMEM)
582 
584 }
int PGTYPESdate_fmt_asc(date, const char *, char *)
Definition: datetime.c:170
#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 768 of file informix.c.

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

Referenced by fmtlong().

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

◆ rgetmsg()

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

Definition at line 987 of file informix.c.

988 {
989  (void) msgnum; /* keep the compiler quiet */
990  (void) s; /* keep the compiler quiet */
991  (void) maxsize; /* keep the compiler quiet */
992  return 0;
993 }

◆ risnull()

int risnull ( int  t,
const char *  ptr 
)

Definition at line 1050 of file informix.c.

References ECPGis_noind_null().

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

1051 {
1052  return ECPGis_noind_null(t, ptr);
1053 }
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 536 of file informix.c.

References PGTYPESdate_julmdy().

537 {
538  int mdy_int[3];
539 
540  PGTYPESdate_julmdy(d, mdy_int);
541  mdy[0] = (short) mdy_int[0];
542  mdy[1] = (short) mdy_int[1];
543  mdy[2] = (short) mdy_int[2];
544  return 0;
545 }
void PGTYPESdate_julmdy(date, int *)
Definition: datetime.c:116

◆ rmdyjul()

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

Definition at line 587 of file informix.c.

References PGTYPESdate_mdyjul().

Referenced by main().

588 {
589  int mdy_int[3];
590 
591  mdy_int[0] = mdy[0];
592  mdy_int[1] = mdy[1];
593  mdy_int[2] = mdy[2];
594  PGTYPESdate_mdyjul(mdy_int, d);
595  return 0;
596 }
void PGTYPESdate_mdyjul(int *, date *)
Definition: datetime.c:129

◆ rsetnull()

int rsetnull ( int  t,
char *  ptr 
)

Definition at line 1043 of file informix.c.

References ECPGset_noind_null().

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

1044 {
1045  ECPGset_noind_null(t, ptr);
1046  return 0;
1047 }
void ECPGset_noind_null(enum ECPGttype type, void *ptr)
Definition: misc.c:320

◆ rstrdate()

int rstrdate ( const char *  str,
date d 
)

Definition at line 523 of file informix.c.

References rdefmtdate().

Referenced by date_test_strdate().

524 {
525  return rdefmtdate(d, "mm/dd/yyyy", str);
526 }
int rdefmtdate(date *d, const char *fmt, const char *str)
Definition: informix.c:548

◆ rtoday()

void rtoday ( date d)

Definition at line 529 of file informix.c.

References PGTYPESdate_today().

530 {
532  return;
533 }
void PGTYPESdate_today(date *)
Definition: datetime.c:149

◆ rtypalign()

int rtypalign ( int  offset,
int  type 
)

Definition at line 996 of file informix.c.

997 {
998  (void) offset; /* keep the compiler quiet */
999  (void) type; /* keep the compiler quiet */
1000  return 0;
1001 }

◆ rtypmsize()

int rtypmsize ( int  type,
int  len 
)

Definition at line 1004 of file informix.c.

1005 {
1006  (void) type; /* keep the compiler quiet */
1007  (void) len; /* keep the compiler quiet */
1008  return 0;
1009 }

◆ rtypwidth()

int rtypwidth ( int  sqltype,
int  sqllen 
)

Definition at line 1012 of file informix.c.

1013 {
1014  (void) sqltype; /* keep the compiler quiet */
1015  (void) sqllen; /* keep the compiler quiet */
1016  return 0;
1017 }

◆ rupshift()

void rupshift ( char *  str)

Definition at line 962 of file informix.c.

Referenced by main().

963 {
964  for (; *str != '\0'; str++)
965  if (islower((unsigned char) *str))
966  *str = toupper((unsigned char) *str);
967  return;
968 }

Variable Documentation

◆ digits

◆ maxdigits

int maxdigits

Definition at line 690 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 689 of file informix.c.

Referenced by _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(), 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(), exec_command_pset(), exec_stmt_assert(), ExecBuildSlotPartitionKeyDescription(), ExecBuildSlotValueDescription(), exp_var(), extractModify(), findTargetlistEntrySQL92(), flatten_set_variable_args(), float4_numeric(), float4_to_char(), float4in(), float8_numeric(), float8_to_char(), float8in_internal(), 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(), heap_fill_tuple(), hstore_contains(), hstore_from_text(), hstore_to_jsonb(), hstore_to_jsonb_loose(), 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(), json_agg_transfn(), jsonb_agg_transfn(), jsonb_contained(), jsonb_contains(), jsonb_object_agg_transfn(), libpqGetCurrentXlogInsertLocation(), load_domaintype_info(), ltree_compress(), ltxtq_exec(), LWLockReleaseClearVar(), LWLockUpdateVar(), main(), make_array_ref(), make_const(), make_one_range_bound(), make_valid(), MergeWithExistingConstraint(), mode_final(), nodeRead(), nodeTokenType(), 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(), pgstat_progress_update_param(), plperl_build_tuple_result(), plperl_modify_tuple(), plperl_to_hstore(), plpython_to_hstore(), PLy_elog(), 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(), RelationBuildPartitionDesc(), 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(), text_format_parse_digits(), time_part(), timestamp_part(), timestamp_trunc(), timestamp_zone(), timestamptz_part(), timestamptz_trunc(), timestamptz_zone(), timetz_part(), timetz_zone(), to_json(), to_jsonb(), transformExprRecurse(), transformInsertStmt(), trgm2int(), ts_match_vq(), tsqueryrecv(), tstoreReceiveSlot_detoast(), tuple_to_stringinfo(), tuplesort_putdatum(), txid_current(), txid_current_if_assigned(), untransformRelOptions(), upc_cast_from_ean13(), and validateCheckConstraint().

◆ val_string

char* val_string

Definition at line 694 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(), brin_minmax_consistent(), bytea_string_agg_transfn(), call_subtype_diff(), cash_in(), cash_out(), cash_words(), check_pghost_envvar(), 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(), datumCopy(), 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(), exec_stmt_assert(), exec_stmt_case(), exec_stmt_exit(), exec_stmt_foreach_a(), exec_stmt_fori(), exec_stmt_if(), exec_stmt_while(), ExecEvalRowNullInt(), ExecEvalXmlExpr(), ExecWindowAgg(), filter_list_to_array(), flatten_reloptions(), float4_to_char(), float8_to_char(), flushbuffer(), fmtfloat(), fmtint(), format_expr_params(), format_preparedparamsdata(), from_char_set_int(), fsm_set_avail(), gather_boolean_expression(), get_int_item(), get_len_position(), GetComment(), getDatumCopy(), hstore_from_record(), hstore_populate_record(), hstore_to_plperl(), hstore_to_plpython(), initValue(), int4_to_char(), int8_to_char(), IpcSemaphoreInitialize(), is_true_boolean_expression(), LWLockConflictsWithVar(), main(), 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_ltoa(), pg_ltostr(), pg_ltostr_zeropad(), PGTYPESnumeric_from_asc(), plperl_to_hstore(), plpgsql_token_is_unreserved_keyword(), plpython_to_hstore(), PLy_output(), PLy_subtransaction_exit(), PLyDict_FromTuple(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLySequence_ToComposite(), PostmasterMain(), postquel_get_single_result(), pq_parse_errornotice(), pqRowProcessor(), printsimple(), process_postgres_switches(), process_startup_options(), ProcessGUCArray(), prune_element_hashtable(), psql_get_variable(), push_assignment(), putVariableNumber(), read_client_final_message(), read_dictionary(), record_out(), RelationBuildPartitionDesc(), ResourceArrayAdd(), rfmtlong(), set_config_by_name(), ShowGUCConfigOption(), statext_ndistinct_serialize(), StoreQueryTuple(), text_format(), tfuncFetchRows(), tfuncInitialize(), to_hex32(), to_hex64(), toast_delete(), transformPartitionBound(), transformPartitionBoundValue(), transformRelOptions(), transtime(), txid_snapshot_xip(), and txid_visible_in_snapshot().