Hello Everyone,
I am new to the group. I'm trying to implement a glue routine for running bash commands from Pforth on my mac. I've just started programming in C. I know a Forth string address points to the count byte, but I'm not sure how to convert it to a C string and call system(). Here is what I have tried in pfcustom.c , with the various components separated by dashes:
------
#include <stdlib.h>
-------
static void Shell( const char *Val3 );
-------
static void Shell( const char *Val3 )
{
int system( const char *Val3 );
}
-------
CustomFunctionTable[2] = Shell;
-------
(CFunc0) Shell
-------
err = CreateGlueToC( "SHELL", i++, C_RETURNS_VOID, 1 );
if( err < 0 ) return err;
-------
It compiles fine, but doesn't produce the desired result. My test goal is to have the directory listing appear in the terminal within Pforth. Any ideas or suggestions you may have would be greatly appreciated!
Thank you,
Michael