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)
Vincent Birlouez wrote:
>
> All,
>
> I would like to call a C function from a 4GL program.
>
> My function looks like :
>
> int func1(struct mystruct **, int *)
>
> My question is how do I get this information back to 4GL ?
If this has to be callable from C source also wrap it with a 4GL
callable function that pops the structure elements and the integer off
of the 4GL stack into a local copy of the struct passing the address to
func1(). On return the wrapper pushes the parts of the structure and
the integer back onto the 4GL stack on return. This is all done with
the 4GL/C interface functions (like pushint() and popint()) documented
in the 4GL manual (neat things those manuals). If you only need this
function to be called from 4GL convert it to a 4GL callable function.
The manual has examples and there are several 4GL callable "C" function
packages you can use as samples in the IIUG Software Repository.
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.