Thread: C/ REXX communication problem

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    2

    C/ REXX communication problem

    Hi,

    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.

    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

    Code:
        #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
    
        }
    the error i get is
    sh: TESTFUNC: not found


    any help very much appreciated

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    To bad it's not working under TSO - I could help you with that.

    Mainframes+1

    Dino.
    Mainframe assembler programmer by trade. C coder when I can.

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    2
    but it does work in tso


    my problem now is that the rexx call finds the C but returns these junky errors


    http://i52.tinypic.com/oucy7p.jpg


    when there is definitely no mismatched " or anything

  4. #4
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    What about bad line endings?
    Mainframe assembler programmer by trade. C coder when I can.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  3. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  5. Replies: 5
    Last Post: 11-07-2005, 11:34 PM

Tags for this Thread