Header And Logo

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

Defines | Functions

ecpg_informix.h File Reference

#include <ecpglib.h>
#include <pgtypes_date.h>
#include <pgtypes_interval.h>
#include <pgtypes_numeric.h>
#include <pgtypes_timestamp.h>
Include dependency graph for ecpg_informix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SQLNOTFOUND   100
#define ECPG_INFORMIX_NUM_OVERFLOW   -1200
#define ECPG_INFORMIX_NUM_UNDERFLOW   -1201
#define ECPG_INFORMIX_DIVIDE_ZERO   -1202
#define ECPG_INFORMIX_BAD_YEAR   -1204
#define ECPG_INFORMIX_BAD_MONTH   -1205
#define ECPG_INFORMIX_BAD_DAY   -1206
#define ECPG_INFORMIX_ENOSHORTDATE   -1209
#define ECPG_INFORMIX_DATE_CONVERT   -1210
#define ECPG_INFORMIX_OUT_OF_MEMORY   -1211
#define ECPG_INFORMIX_ENOTDMY   -1212
#define ECPG_INFORMIX_BAD_NUMERIC   -1213
#define ECPG_INFORMIX_BAD_EXPONENT   -1216
#define ECPG_INFORMIX_BAD_DATE   -1218
#define ECPG_INFORMIX_EXTRA_CHARS   -1264

Functions

int rdatestr (date, char *)
void rtoday (date *)
int rjulmdy (date, short *)
int rdefmtdate (date *, char *, char *)
int rfmtdate (date, char *, char *)
int rmdyjul (short *, date *)
int rstrdate (char *, date *)
int rdayofweek (date)
int rfmtlong (long, char *, char *)
int rgetmsg (int, char *, int)
int risnull (int, char *)
int rsetnull (int, char *)
int rtypalign (int, int)
int rtypmsize (int, int)
int rtypwidth (int, int)
void rupshift (char *)
int byleng (char *, int)
void ldchar (char *, int, char *)
void ECPG_informix_set_var (int, void *, int)
void * ECPG_informix_get_var (int)
void ECPG_informix_reset_sqlca (void)
int decadd (decimal *, decimal *, decimal *)
int deccmp (decimal *, decimal *)
void deccopy (decimal *, decimal *)
int deccvasc (char *, int, decimal *)
int deccvdbl (double, decimal *)
int deccvint (int, decimal *)
int deccvlong (long, decimal *)
int decdiv (decimal *, decimal *, decimal *)
int decmul (decimal *, decimal *, decimal *)
int decsub (decimal *, decimal *, decimal *)
int dectoasc (decimal *, char *, int, int)
int dectodbl (decimal *, double *)
int dectoint (decimal *, int *)
int dectolong (decimal *, long *)
void dtcurrent (timestamp *)
int dtcvasc (char *, timestamp *)
int dtsub (timestamp *, timestamp *, interval *)
int dttoasc (timestamp *, char *)
int dttofmtasc (timestamp *, char *, int, char *)
int intoasc (interval *, char *)
int dtcvfmtasc (char *, char *, timestamp *)

Define Documentation

#define ECPG_INFORMIX_BAD_DATE   -1218

Definition at line 28 of file ecpg_informix.h.

#define ECPG_INFORMIX_BAD_DAY   -1206

Definition at line 21 of file ecpg_informix.h.

Referenced by check_return().

#define ECPG_INFORMIX_BAD_EXPONENT   -1216

Definition at line 27 of file ecpg_informix.h.

#define ECPG_INFORMIX_BAD_MONTH   -1205

Definition at line 20 of file ecpg_informix.h.

Referenced by check_return().

#define ECPG_INFORMIX_BAD_NUMERIC   -1213

Definition at line 26 of file ecpg_informix.h.

#define ECPG_INFORMIX_BAD_YEAR   -1204

Definition at line 19 of file ecpg_informix.h.

#define ECPG_INFORMIX_DATE_CONVERT   -1210

Definition at line 23 of file ecpg_informix.h.

#define ECPG_INFORMIX_DIVIDE_ZERO   -1202

Definition at line 18 of file ecpg_informix.h.

#define ECPG_INFORMIX_ENOSHORTDATE   -1209

Definition at line 22 of file ecpg_informix.h.

Referenced by check_return().

#define ECPG_INFORMIX_ENOTDMY   -1212

Definition at line 25 of file ecpg_informix.h.

Referenced by check_return().

#define ECPG_INFORMIX_EXTRA_CHARS   -1264

Definition at line 29 of file ecpg_informix.h.

#define ECPG_INFORMIX_NUM_OVERFLOW   -1200

Definition at line 16 of file ecpg_informix.h.

Referenced by check_errno().

#define ECPG_INFORMIX_NUM_UNDERFLOW   -1201

Definition at line 17 of file ecpg_informix.h.

Referenced by check_errno().

#define ECPG_INFORMIX_OUT_OF_MEMORY   -1211

Definition at line 24 of file ecpg_informix.h.

#define SQLNOTFOUND   100

Definition at line 14 of file ecpg_informix.h.


Function Documentation

int byleng ( char *  ,
int   
)

Definition at line 968 of file informix.c.

Referenced by ldchar(), and main().

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

int decadd ( decimal ,
decimal ,
decimal  
)

Definition at line 151 of file informix.c.

References deccall3(), PGTYPES_NUM_OVERFLOW, PGTYPES_NUM_UNDERFLOW, and PGTYPESnumeric_add().

Referenced by main().

{
    errno = 0;
    deccall3(arg1, arg2, sum, PGTYPESnumeric_add);

    if (errno == PGTYPES_NUM_OVERFLOW)
        return ECPG_INFORMIX_NUM_OVERFLOW;
    else if (errno == PGTYPES_NUM_UNDERFLOW)
        return ECPG_INFORMIX_NUM_UNDERFLOW;
    else if (errno != 0)
        return -1;
    else
        return 0;
}

int deccmp ( decimal ,
decimal  
)

Definition at line 167 of file informix.c.

References deccall2(), and PGTYPESnumeric_cmp().

Referenced by main().

{
    return (deccall2(arg1, arg2, PGTYPESnumeric_cmp));
}

void deccopy ( decimal ,
decimal  
)

Definition at line 173 of file informix.c.

{
    memcpy(target, src, sizeof(decimal));
}

int deccvasc ( char *  ,
int  ,
decimal  
)

Definition at line 198 of file informix.c.

References CDECIMALTYPE, CSTRINGTYPE, ecpg_strndup(), free, i, NULL, PGTYPES_NUM_BAD_NUMERIC, PGTYPES_NUM_OVERFLOW, PGTYPESnumeric_free(), PGTYPESnumeric_from_asc(), PGTYPESnumeric_to_decimal(), risnull(), and rsetnull().

Referenced by main().

{
    char       *str;
    int         ret = 0;
    numeric    *result;

    rsetnull(CDECIMALTYPE, (char *) np);
    if (risnull(CSTRINGTYPE, cp))
        return 0;

    str = ecpg_strndup(cp, len);/* decimal_in always converts the complete
                                 * string */
    if (!str)
        ret = ECPG_INFORMIX_NUM_UNDERFLOW;
    else
    {
        errno = 0;
        result = PGTYPESnumeric_from_asc(str, NULL);
        if (!result)
        {
            switch (errno)
            {
                case PGTYPES_NUM_OVERFLOW:
                    ret = ECPG_INFORMIX_NUM_OVERFLOW;
                    break;
                case PGTYPES_NUM_BAD_NUMERIC:
                    ret = ECPG_INFORMIX_BAD_NUMERIC;
                    break;
                default:
                    ret = ECPG_INFORMIX_BAD_EXPONENT;
                    break;
            }
        }
        else
        {
            int         i = PGTYPESnumeric_to_decimal(result, np);

            PGTYPESnumeric_free(result);
            if (i != 0)
                ret = ECPG_INFORMIX_NUM_OVERFLOW;
        }
    }

    free(str);
    return ret;
}

int deccvdbl ( double  ,
decimal  
)

Definition at line 246 of file informix.c.

References CDECIMALTYPE, CDOUBLETYPE, NULL, PGTYPESnumeric_free(), PGTYPESnumeric_from_double(), PGTYPESnumeric_new(), PGTYPESnumeric_to_decimal(), risnull(), and rsetnull().

{
    numeric    *nres;
    int         result = 1;

    rsetnull(CDECIMALTYPE, (char *) np);
    if (risnull(CDOUBLETYPE, (char *) &dbl))
        return 0;

    nres = PGTYPESnumeric_new();
    if (nres == NULL)
        return ECPG_INFORMIX_OUT_OF_MEMORY;

    result = PGTYPESnumeric_from_double(dbl, nres);
    if (result == 0)
        result = PGTYPESnumeric_to_decimal(nres, np);

    PGTYPESnumeric_free(nres);
    return (result);
}

int deccvint ( int  ,
decimal  
)

Definition at line 268 of file informix.c.

References CDECIMALTYPE, CINTTYPE, NULL, PGTYPESnumeric_free(), PGTYPESnumeric_from_int(), PGTYPESnumeric_new(), PGTYPESnumeric_to_decimal(), risnull(), and rsetnull().

Referenced by main().

{
    numeric    *nres;
    int         result = 1;

    rsetnull(CDECIMALTYPE, (char *) np);
    if (risnull(CINTTYPE, (char *) &in))
        return 0;

    nres = PGTYPESnumeric_new();
    if (nres == NULL)
        return ECPG_INFORMIX_OUT_OF_MEMORY;

    result = PGTYPESnumeric_from_int(in, nres);
    if (result == 0)
        result = PGTYPESnumeric_to_decimal(nres, np);

    PGTYPESnumeric_free(nres);
    return (result);
}

int deccvlong ( long  ,
decimal  
)

Definition at line 290 of file informix.c.

References CDECIMALTYPE, CLONGTYPE, NULL, PGTYPESnumeric_free(), PGTYPESnumeric_from_long(), PGTYPESnumeric_new(), PGTYPESnumeric_to_decimal(), risnull(), and rsetnull().

Referenced by main().

{
    numeric    *nres;
    int         result = 1;

    rsetnull(CDECIMALTYPE, (char *) np);
    if (risnull(CLONGTYPE, (char *) &lng))
        return 0;

    nres = PGTYPESnumeric_new();
    if (nres == NULL)
        return ECPG_INFORMIX_OUT_OF_MEMORY;

    result = PGTYPESnumeric_from_long(lng, nres);
    if (result == 0)
        result = PGTYPESnumeric_to_decimal(nres, np);

    PGTYPESnumeric_free(nres);
    return (result);
}

int decdiv ( decimal ,
decimal ,
decimal  
)

Definition at line 312 of file informix.c.

References deccall3(), i, PGTYPES_NUM_DIVIDE_ZERO, PGTYPES_NUM_OVERFLOW, and PGTYPESnumeric_div().

Referenced by main().

{

    int         i;

    errno = 0;
    i = deccall3(n1, n2, result, PGTYPESnumeric_div);

    if (i != 0)
        switch (errno)
        {
            case PGTYPES_NUM_DIVIDE_ZERO:
                return ECPG_INFORMIX_DIVIDE_ZERO;
                break;
            case PGTYPES_NUM_OVERFLOW:
                return ECPG_INFORMIX_NUM_OVERFLOW;
                break;
            default:
                return ECPG_INFORMIX_NUM_UNDERFLOW;
                break;
        }

    return 0;
}

int decmul ( decimal ,
decimal ,
decimal  
)

Definition at line 338 of file informix.c.

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

Referenced by main().

{
    int         i;

    errno = 0;
    i = deccall3(n1, n2, result, PGTYPESnumeric_mul);

    if (i != 0)
        switch (errno)
        {
            case PGTYPES_NUM_OVERFLOW:
                return ECPG_INFORMIX_NUM_OVERFLOW;
                break;
            default:
                return ECPG_INFORMIX_NUM_UNDERFLOW;
                break;
        }

    return 0;
}

int decsub ( decimal ,
decimal ,
decimal  
)

Definition at line 360 of file informix.c.

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

Referenced by main().

{
    int         i;

    errno = 0;
    i = deccall3(n1, n2, result, PGTYPESnumeric_sub);

    if (i != 0)
        switch (errno)
        {
            case PGTYPES_NUM_OVERFLOW:
                return ECPG_INFORMIX_NUM_OVERFLOW;
                break;
            default:
                return ECPG_INFORMIX_NUM_UNDERFLOW;
                break;
        }

    return 0;
}

int dectoasc ( decimal ,
char *  ,
int  ,
int   
)

Definition at line 382 of file informix.c.

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

Referenced by dump_sqlda(), and main().

{
    char       *str;
    numeric    *nres;

    rsetnull(CSTRINGTYPE, (char *) cp);
    if (risnull(CDECIMALTYPE, (char *) np))
        return 0;

    nres = PGTYPESnumeric_new();
    if (nres == NULL)
        return ECPG_INFORMIX_OUT_OF_MEMORY;

    if (PGTYPESnumeric_from_decimal(np, nres) != 0)
    {
        PGTYPESnumeric_free(nres);
        return ECPG_INFORMIX_OUT_OF_MEMORY;
    }

    if (right >= 0)
        str = PGTYPESnumeric_to_asc(nres, right);
    else
        str = PGTYPESnumeric_to_asc(nres, nres->dscale);

    PGTYPESnumeric_free(nres);
    if (!str)
        return -1;

    /*
     * TODO: have to take care of len here and create exponential notation if
     * necessary
     */
    if ((int) (strlen(str) + 1) > len)
    {
        if (len > 1)
        {
            cp[0] = '*';
            cp[1] = '\0';
        }
        free(str);
        return -1;
    }
    else
    {
        strcpy(cp, str);
        free(str);
        return 0;
    }
}

int dectodbl ( decimal ,
double *   
)

Definition at line 433 of file informix.c.

References i, NULL, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), and PGTYPESnumeric_to_double().

Referenced by main().

{
    int         i;
    numeric    *nres = PGTYPESnumeric_new();

    if (nres == NULL)
        return ECPG_INFORMIX_OUT_OF_MEMORY;

    if (PGTYPESnumeric_from_decimal(np, nres) != 0)
    {
        PGTYPESnumeric_free(nres);
        return ECPG_INFORMIX_OUT_OF_MEMORY;
    }

    i = PGTYPESnumeric_to_double(nres, dblp);
    PGTYPESnumeric_free(nres);

    return i;
}

int dectoint ( decimal ,
int *   
)

Definition at line 454 of file informix.c.

References NULL, PGTYPES_NUM_OVERFLOW, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), and PGTYPESnumeric_to_int().

Referenced by main().

{
    int         ret;
    numeric    *nres = PGTYPESnumeric_new();

    if (nres == NULL)
        return ECPG_INFORMIX_OUT_OF_MEMORY;

    if (PGTYPESnumeric_from_decimal(np, nres) != 0)
    {
        PGTYPESnumeric_free(nres);
        return ECPG_INFORMIX_OUT_OF_MEMORY;
    }

    ret = PGTYPESnumeric_to_int(nres, ip);
    PGTYPESnumeric_free(nres);

    if (ret == PGTYPES_NUM_OVERFLOW)
        ret = ECPG_INFORMIX_NUM_OVERFLOW;

    return ret;
}

int dectolong ( decimal ,
long *   
)

Definition at line 478 of file informix.c.

References NULL, PGTYPES_NUM_OVERFLOW, PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), and PGTYPESnumeric_to_long().

Referenced by main().

{
    int         ret;
    numeric    *nres = PGTYPESnumeric_new();

    if (nres == NULL)
        return ECPG_INFORMIX_OUT_OF_MEMORY;

    if (PGTYPESnumeric_from_decimal(np, nres) != 0)
    {
        PGTYPESnumeric_free(nres);
        return ECPG_INFORMIX_OUT_OF_MEMORY;
    }

    ret = PGTYPESnumeric_to_long(nres, lngp);
    PGTYPESnumeric_free(nres);

    if (ret == PGTYPES_NUM_OVERFLOW)
        ret = ECPG_INFORMIX_NUM_OVERFLOW;

    return ret;
}

void dtcurrent ( timestamp  ) 

Definition at line 608 of file informix.c.

References PGTYPEStimestamp_current().

int dtcvasc ( char *  ,
timestamp  
)

Definition at line 614 of file informix.c.

References i, and PGTYPEStimestamp_from_asc().

{
    timestamp   ts_tmp;
    int         i;
    char      **endptr = &str;

    errno = 0;
    ts_tmp = PGTYPEStimestamp_from_asc(str, endptr);
    i = errno;
    if (i)
        /* TODO: rewrite to Informix error codes */
        return i;
    if (**endptr)
    {
        /* extra characters exist at the end */
        return ECPG_INFORMIX_EXTRA_CHARS;
    }
    /* TODO: other Informix error codes missing */

    /* everything went fine */
    *ts = ts_tmp;

    return 0;
}

int dtcvfmtasc ( char *  ,
char *  ,
timestamp  
)

Definition at line 640 of file informix.c.

References PGTYPEStimestamp_defmt_asc().

{
    return PGTYPEStimestamp_defmt_asc(inbuf, fmtstr, dtvalue);
}

int dtsub ( timestamp ,
timestamp ,
interval  
)

Definition at line 646 of file informix.c.

References PGTYPEStimestamp_sub().

{
    return PGTYPEStimestamp_sub(ts1, ts2, iv);
}

int dttoasc ( timestamp ,
char *   
)

Definition at line 652 of file informix.c.

References free, and PGTYPEStimestamp_to_asc().

{
    char       *asctime = PGTYPEStimestamp_to_asc(*ts);

    strcpy(output, asctime);
    free(asctime);
    return 0;
}

int dttofmtasc ( timestamp ,
char *  ,
int  ,
char *   
)

Definition at line 662 of file informix.c.

References PGTYPEStimestamp_fmt_asc().

{
    return PGTYPEStimestamp_fmt_asc(ts, output, str_len, fmtstr);
}

void* ECPG_informix_get_var ( int   ) 

Definition at line 1023 of file informix.c.

References ECPGget_var().

{
    return ECPGget_var(number);
}

void ECPG_informix_reset_sqlca ( void   ) 

Definition at line 1029 of file informix.c.

References ECPGget_sqlca(), and sqlca.

Referenced by main().

{
    struct sqlca_t *sqlca = ECPGget_sqlca();

    memcpy((char *) sqlca, (char *) &sqlca_init, sizeof(struct sqlca_t));
}

void ECPG_informix_set_var ( int  ,
void *  ,
int   
)

Definition at line 1017 of file informix.c.

References ECPGset_var().

{
    ECPGset_var(number, pointer, lineno);
}

int intoasc ( interval ,
char *   
)

Definition at line 668 of file informix.c.

References PGTYPESinterval_to_asc().

{
    errno = 0;
    str = PGTYPESinterval_to_asc(i);

    if (!str)
        return -errno;

    return 0;
}

void ldchar ( char *  ,
int  ,
char *   
)

Definition at line 975 of file informix.c.

References byleng(), and memmove.

Referenced by main().

{
    int         dlen = byleng(src, len);

    memmove(dest, src, dlen);
    dest[dlen] = '\0';
}

int rdatestr ( date  ,
char *   
)

Definition at line 503 of file informix.c.

References free, and PGTYPESdate_to_asc().

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

{
    char       *tmp = PGTYPESdate_to_asc(d);

    if (!tmp)
        return ECPG_INFORMIX_DATE_CONVERT;

    /* move to user allocated buffer */
    strcpy(str, tmp);
    free(tmp);

    return 0;
}

int rdayofweek ( date   ) 

Definition at line 600 of file informix.c.

References PGTYPESdate_dayofweek().

{
    return (PGTYPESdate_dayofweek(d));
}

int rdefmtdate ( date ,
char *  ,
char *   
)

Definition at line 549 of file informix.c.

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

{
    /* TODO: take care of DBCENTURY environment variable */
    /* PGSQL functions allow all centuries */

    errno = 0;
    if (PGTYPESdate_defmt_asc(d, fmt, str) == 0)
        return 0;

    switch (errno)
    {
        case PGTYPES_DATE_ERR_ENOSHORTDATE:
            return ECPG_INFORMIX_ENOSHORTDATE;
        case PGTYPES_DATE_ERR_EARGS:
        case PGTYPES_DATE_ERR_ENOTDMY:
            return ECPG_INFORMIX_ENOTDMY;
        case PGTYPES_DATE_BAD_DAY:
            return ECPG_INFORMIX_BAD_DAY;
        case PGTYPES_DATE_BAD_MONTH:
            return ECPG_INFORMIX_BAD_MONTH;
        default:
            return ECPG_INFORMIX_BAD_YEAR;
    }
}

int rfmtdate ( date  ,
char *  ,
char *   
)

Definition at line 575 of file informix.c.

References PGTYPESdate_fmt_asc().

Referenced by date_test_fmt().

{
    errno = 0;
    if (PGTYPESdate_fmt_asc(d, fmt, str) == 0)
        return 0;

    if (errno == ENOMEM)
        return ECPG_INFORMIX_OUT_OF_MEMORY;

    return ECPG_INFORMIX_DATE_CONVERT;
}

int rfmtlong ( long  ,
char *  ,
char *   
)

Definition at line 765 of file informix.c.

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

Referenced by fmtlong().

{
    size_t      fmt_len = strlen(fmt);
    size_t      temp_len;
    int         i,
                j,              /* position in temp */
                k,
                dotpos;
    int         leftalign = 0,
                blank = 0,
                sign = 0,
                entitydone = 0,
                signdone = 0,
                brackets_ok = 0;
    char       *temp;
    char        tmp[2] = " ";
    char        lastfmt = ' ',
                fmtchar = ' ';

    temp = (char *) malloc(fmt_len + 1);
    if (!temp)
    {
        errno = ENOMEM;
        return -1;
    }

    /* put all info about the long in a struct */
    if (initValue(lng_val) == -1)
    {
        free(temp);
        errno = ENOMEM;
        return -1;
    }

    /* '<' is the only format, where we have to align left */
    if (strchr(fmt, (int) '<'))
        leftalign = 1;

    /* '(' requires ')' */
    if (strchr(fmt, (int) '(') && strchr(fmt, (int) ')'))
        brackets_ok = 1;

    /* get position of the right-most dot in the format-string */
    /* and fill the temp-string wit '0's up to there. */
    dotpos = getRightMostDot(fmt);

    /* start to parse the formatstring */
    temp[0] = '\0';
    k = value.digits - 1;       /* position in the value_string */
    for (i = fmt_len - 1, j = 0; i >= 0; i--, j++)
    {
        /* qualify, where we are in the value_string */
        if (k < 0)
        {
            blank = 1;
            if (k == -1)
                sign = 1;
            if (leftalign)
            {
                /* can't use strncat(,,0) here, Solaris would freek out */
                if (sign)
                    if (signdone)
                    {
                        temp[j] = '\0';
                        break;
                    }
            }
        }
        /* if we're right side of the right-most dot, print '0' */
        if (dotpos >= 0 && dotpos <= i)
        {
            if (dotpos < i)
            {
                if (fmt[i] == ')')
                    tmp[0] = value.sign == '-' ? ')' : ' ';
                else
                    tmp[0] = '0';
            }
            else
                tmp[0] = '.';
            strcat(temp, tmp);
            continue;
        }
        /* the ',' needs special attention, if it is in the blank area */
        if (blank && fmt[i] == ',')
            fmtchar = lastfmt;
        else
            fmtchar = fmt[i];
        /* waiting for the sign */
        if (k < 0 && leftalign && sign && !signdone && fmtchar != '+' && fmtchar != '-')
            continue;
        /* analyse this format-char */
        switch (fmtchar)
        {
            case ',':
                tmp[0] = ',';
                k++;
                break;
            case '*':
                if (blank)
                    tmp[0] = '*';
                else
                    tmp[0] = value.val_string[k];
                break;
            case '&':
                if (blank)
                    tmp[0] = '0';
                else
                    tmp[0] = value.val_string[k];
                break;
            case '#':
                if (blank)
                    tmp[0] = ' ';
                else
                    tmp[0] = value.val_string[k];
                break;
            case '-':
                if (sign && value.sign == '-' && !signdone)
                {
                    tmp[0] = '-';
                    signdone = 1;
                }
                else if (blank)
                    tmp[0] = ' ';
                else
                    tmp[0] = value.val_string[k];
                break;
            case '+':
                if (sign && !signdone)
                {
                    tmp[0] = value.sign;
                    signdone = 1;
                }
                else if (blank)
                    tmp[0] = ' ';
                else
                    tmp[0] = value.val_string[k];
                break;
            case '(':
                if (sign && brackets_ok && value.sign == '-')
                    tmp[0] = '(';
                else if (blank)
                    tmp[0] = ' ';
                else
                    tmp[0] = value.val_string[k];
                break;
            case ')':
                if (brackets_ok && value.sign == '-')
                    tmp[0] = ')';
                else
                    tmp[0] = ' ';
                break;
            case '$':
                if (blank && !entitydone)
                {
                    tmp[0] = '$';
                    entitydone = 1;
                }
                else if (blank)
                    tmp[0] = ' ';
                else
                    tmp[0] = value.val_string[k];
                break;
            case '<':
                tmp[0] = value.val_string[k];
                break;
            default:
                tmp[0] = fmt[i];
        }
        strcat(temp, tmp);
        lastfmt = fmt[i];
        k--;
    }
    /* safety-net */
    temp[fmt_len] = '\0';

    /* reverse the temp-string and put it into the outbuf */
    temp_len = strlen(temp);
    outbuf[0] = '\0';
    for (i = temp_len - 1; i >= 0; i--)
    {
        tmp[0] = temp[i];
        strcat(outbuf, tmp);
    }
    outbuf[temp_len] = '\0';

    /* cleaning up */
    free(temp);
    free(value.val_string);

    return 0;
}

int rgetmsg ( int  ,
char *  ,
int   
)

Definition at line 984 of file informix.c.

{
    (void) msgnum;              /* keep the compiler quiet */
    (void) s;                   /* keep the compiler quiet */
    (void) maxsize;             /* keep the compiler quiet */
    return 0;
}

int risnull ( int  ,
char *   
)

Definition at line 1044 of file informix.c.

References ECPGis_noind_null().

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

{
    return (ECPGis_noind_null(t, ptr));
}

int rjulmdy ( date  ,
short *   
)
int rmdyjul ( short *  ,
date  
)
int rsetnull ( int  ,
char *   
)

Definition at line 1037 of file informix.c.

References ECPGset_noind_null().

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

{
    ECPGset_noind_null(t, ptr);
    return 0;
}

int rstrdate ( char *  ,
date  
)

Definition at line 524 of file informix.c.

References rdefmtdate().

Referenced by date_test_strdate().

{
    return rdefmtdate(d, "mm/dd/yyyy", str);
}

void rtoday ( date  ) 

Definition at line 530 of file informix.c.

References PGTYPESdate_today().

{
    PGTYPESdate_today(d);
    return;
}

int rtypalign ( int  ,
int   
)

Definition at line 993 of file informix.c.

{
    (void) offset;              /* keep the compiler quiet */
    (void) type;                /* keep the compiler quiet */
    return 0;
}

int rtypmsize ( int  ,
int   
)

Definition at line 1001 of file informix.c.

{
    (void) type;                /* keep the compiler quiet */
    (void) len;                 /* keep the compiler quiet */
    return 0;
}

int rtypwidth ( int  ,
int   
)

Definition at line 1009 of file informix.c.

{
    (void) sqltype;             /* keep the compiler quiet */
    (void) sqllen;              /* keep the compiler quiet */
    return 0;
}

void rupshift ( char *   ) 

Definition at line 959 of file informix.c.

Referenced by main().

{
    for (; *str != '\0'; str++)
        if (islower((unsigned char) *str))
            *str = toupper((unsigned char) *str);
    return;
}