PostgreSQL Source Code  git master
compat_informix-rfmtlong.c File Reference
#include <ecpglib.h>
#include <ecpgerrno.h>
#include <sqlca.h>
#include <ecpg_informix.h>
#include <stdio.h>
#include <stdlib.h>
#include <pgtypes_error.h>
#include <sqltypes.h>
Include dependency graph for compat_informix-rfmtlong.c:

Go to the source code of this file.

Macros

#define ECPGdebug(X, Y)   ECPGdebug((X)+100,(Y))
 

Functions

static void check_return (int ret)
 
static void fmtlong (long lng, const char *fmt)
 
int main (void)
 

Macro Definition Documentation

◆ ECPGdebug

#define ECPGdebug (   X,
 
)    ECPGdebug((X)+100,(Y))

Definition at line 9 of file compat_informix-rfmtlong.c.

Function Documentation

◆ check_return()

static void check_return ( int  ret)
static

Definition at line 63 of file compat_informix-rfmtlong.c.

64 {
65  switch(ret)
66  {
68  printf("(ECPG_INFORMIX_ENOTDMY)");
69  break;
71  printf("(ECPG_INFORMIX_ENOSHORTDATE)");
72  break;
74  printf("(ECPG_INFORMIX_BAD_DAY)");
75  break;
77  printf("(ECPG_INFORMIX_BAD_MONTH)");
78  break;
79  default:
80  printf("(unknown ret: %d)", ret);
81  break;
82  }
83  printf("\n");
84 }
#define ECPG_INFORMIX_ENOTDMY
Definition: ecpg_informix.h:25
#define ECPG_INFORMIX_BAD_DAY
Definition: ecpg_informix.h:21
#define ECPG_INFORMIX_BAD_MONTH
Definition: ecpg_informix.h:20
#define ECPG_INFORMIX_ENOSHORTDATE
Definition: ecpg_informix.h:22
#define printf(...)
Definition: port.h:244

References ECPG_INFORMIX_BAD_DAY, ECPG_INFORMIX_BAD_MONTH, ECPG_INFORMIX_ENOSHORTDATE, ECPG_INFORMIX_ENOTDMY, and printf.

Referenced by fmtlong().

◆ fmtlong()

static void fmtlong ( long  lng,
const char *  fmt 
)
static

Definition at line 27 of file compat_informix-rfmtlong.c.

28 {
29  static int i;
30  int r;
31  char buf[30];
32 
33  r = rfmtlong(lng, fmt, buf);
34  printf("r: %d ", r);
35  if (r == 0)
36  {
37  printf("%d: %s (fmt was: %s)\n", i++, buf, fmt);
38  }
39  else
40  check_return(r);
41 }
static void check_return(int ret)
int rfmtlong(long lng_val, const char *fmt, char *outbuf)
Definition: informix.c:768
int i
Definition: isn.c:73
static void const char * fmt
static char * buf
Definition: pg_test_fsync.c:73

References buf, check_return(), fmt, i, printf, and rfmtlong().

Referenced by main().

◆ main()

int main ( void  )

Definition at line 44 of file compat_informix-rfmtlong.c.

45 {
46  ECPGdebug(1, stderr);
47 
48  fmtlong(-8494493, "-<<<<,<<<,<<<,<<<");
49  fmtlong(-8494493, "################");
50  fmtlong(-8494493, "+++$$$$$$$$$$$$$.##");
51  fmtlong(-8494493, "(&,&&&,&&&,&&&.)");
52  fmtlong(-8494493, "<<<<,<<<,<<<,<<<");
53  fmtlong(-8494493, "$************.**");
54  fmtlong(-8494493, "---$************.**");
55  fmtlong(-8494493, "+-+################");
56  fmtlong(-8494493, "abc: ################+-+");
57  fmtlong(-8494493, "+<<<<,<<<,<<<,<<<");
58 
59  return 0;
60 }
static void fmtlong(long lng, const char *fmt)
#define ECPGdebug(X, Y)

References ECPGdebug, and fmtlong().