Subject: Informix Online prototypes
From: [email-masked] (Dave Kosenko)
Date: 18 Mar 1994 16:38:52 GMT
Newsgroups: comp.databases.informix

Spanky Sautins writes:
|> 	We are in the process of ansifying our C code containing
|> informix calls.  The problem is, there don't seem to be any
|> prototypes for these calls.  Does anyone know if they are available??

Ansi prototypes of the sqli libs are now included in a header with 6.0 
releases of esql/c.  There is nothing official prior to this.

On the unofficial side, I put the following together for a customer some
time ago.  I believe it is accurate for 4.0 esql/c.  I make no promises
on any later releases. It shows the esql statement, the function call
it is translated into, and the arguments for that call.  The functions
themselves should be type int.

$begin work; 
_iqbeginwork();

$close database;
 _iqdbclose();

$commit work; 
 _iqcommit();

$database ...
_iqdatabase(db_name, exclusive, icnt, ibind)
    char *db_name;			/* select statement text */
    int exclusive;			/* exclusive flag */
    int    icnt;			/* number of input variables supplied */
    struct sqlvar_struct *ibind;	/* input variables supplied */

$declare ...
_iqdclcur(cursor, curname, cmdtxt, icnt, ibind, ocnt, obind, flags)
    _SQCURSOR *cursor;		/* cursor block */
    char *curname;		/* cursor name */
    char **cmdtxt;		/* select or insert statement text */
    int icnt;			/* number of input variables */
    struct sqlvar_struct *ibind;	/* input variables supplied */
    int ocnt;			/* number of output variables */
    struct sqlvar_struct *obind;	/* output variables supplied */
    int flags;

$close (cursor)
_iqclose(cursor)
    _SQCURSOR *cursor;		/* cursor block */

$prepare ...
_iqprepare(cursor, stmt)
    _SQCURSOR *cursor;		/* cursor block */
    char *stmt;				/* statement text */

$describe ...
_iqdscribe(cursor, descp)
    _SQCURSOR *cursor;		/* cursor block */
    struct sqlda **descp;		/* address of descriptor pointer */

$execute ...
_iqxecute(cursor, icnt, ibind, idesc , ivalues)
    _SQCURSOR *cursor;		/* cursor block */
    int icnt;				/* number of input variables */
    struct sqlvar_struct *ibind;	/* input variables supplied */
    struct sqlda *idesc;		/* input descriptor */
    struct value *ivalues;		/* input values */

$execute immediate ...
_iqeximm(stmt)
    char *stmt;				/* statement text */

$fetch ...
_iqnftch(cursor, ocnt, obind, odescriptor,
    fetch_type, val, icnt, ibind, idescriptor, chkind)
    _SQCURSOR *cursor;          /* cursor block */
    int    ocnt;                /* number of output variables supplied */
    struct sqlvar_struct *obind;/* output variables supplied */
    struct sqlda *odescriptor;  /* output descriptor */
    int    fetch_type;          /* fetch type, NEXT, PREVIOUS, ... */
    long   val;                 /* rowid value */
    int    icnt;                /* number of input variables supplied */
    struct sqlvar_struct *ibind;/* input variables supplied */
    struct sqlda *idescriptor;  /* input descriptor */
    int chkind;			/* check for indicator? */

$flush ...
_iqflush(cursor)
    _SQCURSOR *cursor;		/* cursor block */

$free ...
_iqfree(cursor)
    _SQCURSOR *cursor;		/* cursor block */

$open ...
_iqcopen(cursor, icnt, ibind, idesc, ivalues, useflag)
    _SQCURSOR *cursor;		/* cursor block */
    int icnt;				/* number of input variables */
    struct sqlvar_struct *ibind;	/* input variables supplied */
    struct sqlda *idesc;		/* input descriptor */
    struct value *ivalues;		/* input values */
    int useflag;

$put ...
_iqinsput(cursor, icnt, ibind, idesc, ivalues)
    _SQCURSOR *cursor;		/* cursor block */
    int	icnt;				/* number of input variables */
    struct sqlvar_struct *ibind;	/* input variables supplied */
    struct sqlda *idesc;		/* input descriptor */
    struct value *ivalues;		/* input values */

$rollback work;
 _iqrollback();

$select ...
_iqslct(cursor, cmdtxt, icnt, ibind, ocnt, obind, chkind)
    _SQCURSOR *cursor;		/* cursor block */
    char **cmdtxt;			/* select statement text */
    int icnt;				/* number of input variables */
    struct sqlvar_struct *ibind;	/* input variables supplied */
    int ocnt;				/* number of output variables */

ALL OTHER SQL STATEMENTS
_iqstmnt(scb, cmdtxt, icnt, ibind, ivalues)
    _SQSTMT *scb;		/* Statement control block pointer */
    char **cmdtxt;			/* Text of statement */
    int icnt;				/* number of input host variables */
    struct sqlvar_struct *ibind;	/* input variables supplied */
    struct value *ivalues;		/* input values */

Dave
Disclaimer: The opinions expressed in this message are not those of Informix 
Software, its partners or lackeys.  Anyone who says otherwise is itching for 
a fight.
****************************************************************************
"I look back with some satisfaction on what an idiot I was when I was 25,
 but when I do that, I'm assuming I'm no longer an idiot." - Andy Rooney