2 * Simple ARexx interface by Michael Sinz
4 * This is a very "Simple" interface...
10 #include <exec/types.h>
11 #include <exec/nodes.h>
12 #include <exec/lists.h>
13 #include <exec/ports.h>
15 #include <rexx/storage.h>
16 #include <rexx/rxslib.h>
19 * This is the handle that SimpleRexx will give you
20 * when you initialize an ARexx port...
22 * The conditional below is used to skip this if we have
23 * defined it earlier...
27 typedef void *AREXXCONTEXT
;
29 #endif /* AREXXCONTEXT */
32 * The value of RexxMsg (from GetARexxMsg) if there was an error returned
34 #define REXX_RETURN_ERROR ((struct RexxMsg *)-1L)
37 * This function closes down the ARexx context that was opened
40 void FreeARexx(AREXXCONTEXT
);
43 * This routine initializes an ARexx port for your process
44 * This should only be done once per process. You must call it
45 * with a valid application name and you must use the handle it
46 * returns in all other calls...
48 * NOTE: The AppName should not have spaces in it...
49 * Example AppNames: "MyWord" or "FastCalc" etc...
50 * The name *MUST* be less that 16 characters...
51 * If it is not, it will be trimmed...
52 * The name will also be UPPER-CASED...
54 * NOTE: The Default file name extension, if NULL will be
55 * "rexx" (the "." is automatic)
57 AREXXCONTEXT
InitARexx(char *,char *);
60 * This function returns the port name of your ARexx port.
61 * It will return NULL if there is no ARexx port...
63 * This string is *READ ONLY* You *MUST NOT* modify it...
65 char *ARexxName(AREXXCONTEXT
);
68 * This function returns the signal mask that the Rexx port is
69 * using. It returns NULL if there is no signal...
71 * Use this signal bit in your Wait() loop...
73 ULONG
ARexxSignal(AREXXCONTEXT
);
76 * This function returns a structure that contains the commands sent from
77 * ARexx... You will need to parse it and return the structure back
78 * so that the memory can be freed...
80 * This returns NULL if there was no message...
82 struct RexxMsg
*GetARexxMsg(AREXXCONTEXT
);
85 * Use this to return a ARexx message...
87 * If you wish to return something, it must be in the RString.
88 * If you wish to return an Error, it must be in the Error.
90 void ReplyARexxMsg(AREXXCONTEXT
,struct RexxMsg
*,char *,LONG
);
93 * This function will send a string to ARexx...
95 * The default host port will be that of your task...
97 * If you set StringFile to TRUE, it will set that bit for the message...
99 * Returns TRUE if it send the message, FALSE if it did not...
101 short SendARexxMsg(AREXXCONTEXT
,char *,short);
104 * This function will set an error string for the ARexx
105 * application in the variable defined as <appname>.LASTERROR
107 * Note that this can only happen if there is an ARexx message...
109 * This returns TRUE if it worked, FALSE if it did not...
111 short SetARexxLastError(AREXXCONTEXT
,struct RexxMsg
*,char *);
113 #endif /* SIMPLE_REXX_H */