Hi all,
I need to call a C function from NATURAL (UNIX) with the following parms :
C-LIBELLE A8
C-MODE F8
C-X1 F8
C-X2 F8
C-CODE A3
C-SIZE N3
C-ARRAY F8 (100)
C-TAPE P2
C-ALERT I4
The C function uses the corresponding variables below :
char LIBELLE[16];
double MODE;
double X1;
double X2;
char CODE[3];
int ARRAYSIZE;
double ARRAY[100];
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.
Thank you.