Re: Calling a C function in 4GL
Posted in 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