| Calling Sequence | CreateCProgram(p,name)
| ||||||||||||
| Parameters |
| ||||||||||||
| Return Type | NULL | ||||||||||||
| Synopsis | Creates a file, named name.c, containing a skeleton C program corresponding to procedure p and prints to the terminal a procedure packaging the call to the external program. | ||||||||||||
| Examples | > Increment := proc(x) x+1 end; Increment := proc (x) x+1 end > CreateCProgram(Increment,AddOne); AddOne := proc (x)
CallExternal ('AddOne', x)
end:
> CallSystem( 'cat AddOne.c' ); #include "extcalls.h"
#define MaxReturnSize 10000
#define MaxReturnArgs 1
main (int argc, char **argv)
{
extref *x;
extenter (argv[1], MaxReturnSize, MaxReturnArgs);
x = extget (1);
/* Here comes the actual C code */
extexit ();
}
| ||||||||||||
| See also | CallExternal | ||||||||||||