i have mostly finished a script/program in which i made a small rexx script that checks its OS if its in TSO it does one thing if its in linux it does another.
which works fine however the code to run when its in linux is a call to a c function. i had this element working in a windows environment compiling the c code with TCC.
however when i move it over to linux the c code will compile fine with gcc( -pedantic -Wall -std-C99 e.t.c) but wont with TCC
the main problem is that the REXX script no longer communicates with the c function it says it can't find testfunc. testfunc.c
if anyone could tell me why this could be happening that would be greatly appreciated. is there something i should be doing that windows has gone and done automatically ?
example code.
/**REXX**/
SAY ' PLEASE ENTER A CONSOLE NAME '
PULL INPUT
ostype = address()
say ostype
IF ostype = 'TSO' THEN DO
/*STUFF*/
END
ELSE IF ostype = 'COMMAND'| ostype = 'SYSTEM' THEN DO
/*call testfunc "testfunc"*/
pull INPUT
out=testfunc(filename)
say out /* output from c code */
say rc /* return value from c code */
END
this works on windows with tcc
and this is the c code it calls
#define MAX_SIZE 80
int check();//char input);
void exec_it(char* execname);
APIRET APIENTRY RexxRegisterFunctionExe(testfunc,testfunc);
/*APIRET APIENTRY RexxPullQueue(
PSZ QueueName,
PRXSTRING DataBuf,
PDATETIME TimeStamp,
ULONG WaitFlag
) ;
*/
int main(int argc, char *argv[])
{
printf("argc is %d\n",argc);
//printf("the first argument is %s \nthe second is |%s|\n", argv[0],argv[1]);
char input[100];
check(argv[1]);
exec_it(argv[1]);
return 59;
}
int check ()//char input)
{
//read file into array and search it
}
/* Function to start rdesktop application */
void exec_it(char* execname)
{
//check if process running
//run process
}
int check();//char input);
void exec_it(char* execname);
APIRET APIENTRY RexxRegisterFunctionExe(testfunc,testfunc);
/*APIRET APIENTRY RexxPullQueue(
PSZ QueueName,
PRXSTRING DataBuf,
PDATETIME TimeStamp,
ULONG WaitFlag
) ;
*/
int main(int argc, char *argv[])
{
printf("argc is %d\n",argc);
//printf("the first argument is %s \nthe second is |%s|\n", argv[0],argv[1]);
char input[100];
check(argv[1]);
exec_it(argv[1]);
return 59;
}
int check ()//char input)
{
//read file into array and search it
}
/* Function to start rdesktop application */
void exec_it(char* execname)
{
//check if process running
//run process
}
the error i get is
sh: TESTFUNC: not found
any help very much appreciated