Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
Milton Santos wrote:
>
> Anyone knows how I can call C function from Informix 4GL?
Assuming compiled 4GL you need to write a wrapper function in C that
will translate the 4GL calling convention (ie arguments on the 4GL
stack and number of args passed as the only real parameter) to C
calling conventions. For RDS or D4GL this wrapper needs to be linked
into the pcode runner. Example of mapping the getenv function:
in 4GL call:
LET informixdir = fgl_getenv( "INFORMIXDIR" )
in C write:
int fgl_getenv( int nargs )
{
char string[1024], var[256];
int i;
if (nargs != 1)
return -1;
/* Get the variable name off the stack. */
popvchar( var, 256 );
strcpy( string, getenv( var ) );
pushquote( string, strlen( string ) );
return 1; /* Return number of return values pushed to the stack */
}
Art S. Kagel
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.