I need to call a C function from NATURAL (UNIX) with the following parms :
C-ARRAY F8 (100)
The C function uses the corresponding variables below :
char LIBELLE; double MODE; double X1; double X2; char CODE; int ARRAYSIZE; double ARRAY; int TAPE; int ALERT;
The C function is part of a dynamic library which was build following the instructions of SAG doc (use of natuser.h, jumptab.c, ncuxinit.c and Makedyn makefile)
I would like to know if it is possible, and how , to pass the NATURAL parms to the C program.
In the C source code i redefined all the variables with string format. Then i use memmove function to copy the adress of the original NATURAL parm to the address of the string variable in C :
memmove ((char *) ¶m, (char *) parmptr[i], sizeof(param)-1);
and then i try to cast the string but it does not work for float parms nor Numerical fields type N with decimals. (it works with I4 and N3.0 for example)
If you have an example on your desk…
Any help would be appreciated.