ToolChain/bin/targets/m68k-amigaos/ndk/Tutorials/ARexx/Host/Host.c
LONG
Cmd_Fault(APTR UserData,struct RexxMsg *Message,STRPTR *Args)
{
	enum	{ ARG_NUMBER };

	UBYTE ErrorText[100];
	LONG Number;

	Number = *(LONG *)Args[ARG_NUMBER];

	Printf("FAULT %d",Number);
	Printf("\n");

		/* Obtain the AmigaDOS error text corresponding
		 * to the error code. In your own applications
		 * you would want to supply descriptive texts
		 * for each error code your program supports
		 * in addition to the standard AmigaDOS set.
		 */

	if(Fault(Number,"",ErrorText,99) > 0)
	{
		ReturnRexxMsg(Message,&ErrorText[2]);

		return(0);
	}
	else
		return(ERROR_OBJECT_NOT_FOUND);
}
/* The following routines implement the 15 mandatory ARexx commands
	 * every ARexx host should support, as per the "Amiga User Interface
	 * Style Guide". With the exception of the FAULT, HELP, QUIT and RX
	 * commands none of the example commands do any real work. They just
	 * print their arguments and return an error code.
	 *
	 * Every routine is invoked with three parameters:
	 *
	 * UserData -- The user data pointer passed to CreateRexxHost.
	 *
	 * Message -- Pointer to the RexxMsg received from the client.
	 *
	 * Args -- Pointer to an array of 32 string pointers, as set up
	 *         by the dos.library/ReadArgs parser.
	 *
	 * Each routine has to return an error code. If the code returned
	 * is nonzero the command dispatcher in HandleRexxMsg() will
	 * reply the RexxMsg. If the code is zero, the routine is
	 * responsible for replying the RexxMsg.
	 */
The following routines implement the 15 mandatory ARexx commands
every ARexx host should support, as per the "Amiga User Interface
Style Guide". With the exception of the FAULT, HELP, QUIT and RX
commands none of the example commands do any real work. They just
print their arguments and return an error code.

Every routine is invoked with three parameters.

- The user data pointer passed to CreateRexxHost.

- Pointer to the RexxMsg received from the client.

- Pointer to an array of 32 string pointers, as set up
by the dos.library/ReadArgs parser.

Each routine has to return an error code. If the code returned
is nonzero the command dispatcher in HandleRexxMsg() will
reply the RexxMsg. If the code is zero, the routine is
responsible for replying the RexxMsg.
The following routines implement the 15 mandatory ARexx commands every ARexx host should support as per the " Amiga User Interface Style Guide " . With the exception of the FAULT HELP QUIT and RX commands none of the example commands do any real work . They just print their arguments and return an error code . Every routine is invoked with three parameters . - The user data pointer passed to CreateRexxHost . - Pointer to the RexxMsg received from the client . - Pointer to an array of 32 string pointers as set up by the dos . library / ReadArgs parser . Each routine has to return an error code . If the code returned is nonzero the command dispatcher in HandleRexxMsg () will reply the RexxMsg . If the code is zero the routine is responsible for replying the RexxMsg .
LONG
Cmd_Fault(APTR UserData,struct RexxMsg *Message,STRPTR *Args)
{
	enum	{ ARG_NUMBER };
	UBYTE ErrorText[100];
	LONG Number;
	Number = *(LONG *)Args[ARG_NUMBER];
	Printf("FAULT %d",Number);
	Printf("\n");
	if(Fault(Number,"",ErrorText,99) > 0)
	{
		ReturnRexxMsg(Message,&ErrorText[2]);
		return(0);
	}
	else
		return(ERROR_OBJECT_NOT_FOUND);
}
LONG Cmd_Fault ( APTR UserData , struct RexxMsg * Message , STRPTR * Args ) { enum { ARG_NUMBER } ; UBYTE ErrorText [ 100 ] ; LONG Number ; Number = * ( LONG * ) Args [ ARG_NUMBER ] ; Printf ( " " , Number ) ; Printf ( " \n " ) ; if ( Fault ( Number , " " , ErrorText , 99 ) > 0 ) { ReturnRexxMsg ( Message , & ErrorText [ 2 ] ) ; return ( 0 ) ; } else return ( ERROR_OBJECT_NOT_FOUND ) ; }
The following routines implement the 15 mandatory ARexx commands
 every ARexx host should support, as per the "Amiga User Interface
 Style Guide".
The following routines implement the 15 mandatory ARexx commands every ARexx host should support as per the " Amiga User Interface Style Guide " .
/* Obtain the AmigaDOS error text corresponding
		 * to the error code. In your own applications
		 * you would want to supply descriptive texts
		 * for each error code your program supports
		 * in addition to the standard AmigaDOS set.
		 */