PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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, char *fmt)
 
int main (void)
 

Macro Definition Documentation

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

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

Referenced by main().

Function Documentation

static void check_return ( int  ret)
static

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

References ECPG_INFORMIX_BAD_DAY, ECPG_INFORMIX_BAD_MONTH, ECPG_INFORMIX_ENOSHORTDATE, and ECPG_INFORMIX_ENOTDMY.

Referenced by fmtlong().

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_BAD_MONTH
Definition: ecpg_informix.h:20
#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
static void fmtlong ( long  lng,
char *  fmt 
)
static

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

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

Referenced by main().

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)
static char * buf
Definition: pg_test_fsync.c:65
int rfmtlong(long lng_val, char *fmt, char *outbuf)
Definition: informix.c:768
int i
int main ( void  )

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

References ECPGdebug, and fmtlong().

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 }
#define ECPGdebug(X, Y)
static void fmtlong(long lng, char *fmt)