Header And Logo

PostgreSQL
| The world's most advanced open source database.

Defines | Functions

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.

Defines

#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)

Define Documentation

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

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


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

{
    switch(ret)
    {
        case ECPG_INFORMIX_ENOTDMY:
            printf("(ECPG_INFORMIX_ENOTDMY)");
            break;
        case ECPG_INFORMIX_ENOSHORTDATE:
            printf("(ECPG_INFORMIX_ENOSHORTDATE)");
            break;
        case ECPG_INFORMIX_BAD_DAY:
            printf("(ECPG_INFORMIX_BAD_DAY)");
            break;
        case ECPG_INFORMIX_BAD_MONTH:
            printf("(ECPG_INFORMIX_BAD_MONTH)");
            break;
        default:
            printf("(unknown ret: %d)", ret);
            break;
    }
    printf("\n");
}

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

{
    static int i;
    int r;
    char buf[30];

    r = rfmtlong(lng, fmt, buf);
    printf("r: %d ", r);
    if (r == 0)
    {
        printf("%d: %s (fmt was: %s)\n", i++, buf, fmt);
    }
    else
        check_return(r);
}

int main ( void   ) 

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

References ECPGdebug, and fmtlong().

{
    ECPGdebug(1, stderr);

    fmtlong(-8494493, "-<<<<,<<<,<<<,<<<");
    fmtlong(-8494493, "################");
    fmtlong(-8494493, "+++$$$$$$$$$$$$$.##");
    fmtlong(-8494493, "(&,&&&,&&&,&&&.)");
    fmtlong(-8494493, "<<<<,<<<,<<<,<<<");
    fmtlong(-8494493, "$************.**");
    fmtlong(-8494493, "---$************.**");
    fmtlong(-8494493, "+-+################");
    fmtlong(-8494493, "abc: ################+-+");
    fmtlong(-8494493, "+<<<<,<<<,<<<,<<<");

    return (0);
}