home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d07xx
/
d0745.lha
/
ARexxBox
/
rxif
/
rx_cmdshell.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-12
|
2KB
|
86 lines
/*
* Dieses Kommando kann nur von ARexx aus eine CmdShell
* _╓FFNEN_, und nur von einer CmdShell aus diese _SCHLIE▀EN_.
*
* Mit etwas mehr Aufwand (Buchfⁿhrung ⁿber die Hosts) kann man
* auch eine andere (flexiblere) L÷sung finden.
*
* ACHTUNG: Buchfⁿhrung ⁿber offene CmdShells ist zwingend
* notwendig fⁿr den CloseDown! Sonst bleiben nach 'Quit' u.U.
* noch CmdShells offen!
*
*/
#include <dos/dostags.h>
extern struct Library *SysBase, *DOSBase;
static void runCommandShell( void )
{
BPTR fh;
struct RexxHost *rh;
/* diese Funktion wird als eigener Proze▀ gestartet */
geta4();
if( rh = SetupARexxHost(NULL) )
{
if( fh = Open( "CON:////CommandShell/AUTO", MODE_NEWFILE ) )
{
CommandShell( rh, fh, fh, "> " );
Close( fh );
}
CloseDownARexxHost( rh );
}
}
void rx_cmdshell( struct RexxHost *host, struct rxd_cmdshell **rxd, long action )
{
struct rxd_cmdshell *rd = *rxd;
switch( action )
{
case RXIF_INIT:
*rxd = calloc( sizeof *rd, 1 );
break;
case RXIF_ACTION:
/* Insert your code HERE */
if( rd->arg.close ) /* schlie▀en */
{
if( host->flags & ARB_HF_CMDSHELL )
{
host->flags &= ~ARB_HF_CMDSHELL;
}
else
{
rd->rc = -10;
rd->rc2 = (long) "Not a CommandShell";
}
}
else /* ÷ffnen (OPEN ist unn÷tig) */
{
CreateNewProcTags(
NP_Entry, runCommandShell,
NP_Name, "CommandShell",
TAG_DONE );
}
break;
case RXIF_FREE:
/* FREE your local data HERE */
free( rd );
break;
}
return;
}