|
| void | _CreateRexxMsg (void) |
| void | _DeleteRexxMsg (void) |
| void | _FillRexxMsg (void) |
| void | _ClearRexxMsg (void) |
| void | _CreateArgString (void) |
| void | _DeleteArgString (void) |
| void | _SendRexxCommand (void) |
| void | _ReplyRexxMsg (void) |
| void | _GetRexxResult (void) |
| void | _GetRexxCommand (void) |
| void | _GetResultString (void) |
| void | _RexxEvent (void) |
| void | _IsRexxMsg (void) |
| void | _RexxError (void) |
| void | SetUpRoutine (void) |
| void | arexxlib_CloseRoutine (void) |
| void | getrexxresultchk (void) |
| void | getrexxcommandchk (void) |
| static ULONG | error_routine (ULONG code) |
| static int | tstrexxmsg (ULONG msg) |
| static int | tstargstring (ULONG arg) |
| static ULONG | createargstring (const UBYTE *s, ULONG len) |
| static void | deleteargstring_rexx (ULONG arg) |
| static ULONG | createargstring_rexx (ULONG str, ULONG len) |
| static void | deleteargstring (ULONG arg) |
| static void | clearrexxmsg (ULONG msg) |
| static WORD | argindex (ULONG n) |
| static ULONG | setup_c (void) |
| | SetUpRoutine (init): OldOpenLibrary("rexxsyslib.library").
|
| static void | close_c (void) |
| | CloseRoutine (finit): CloseLibrary(RexxSysBase) if it was opened.
|
| static ULONG | createrexxmsg_c (ULONG port, ULONG exten, ULONG host, const ULONG *lens) |
| | CreateRexxMsg(ReplyPort,Exten,Host): a RexxMsg of 128 bytes.
|
| | BLITZ_ALIAS (_CreateRexxMsg, createrexxmsg_c) |
| static void | deleterexxmsg_c (ULONG msg) |
| | DeleteRexxMsg rexxmsg: delete rm_FileExt, rm_CommAddr and the message (mn_Length bytes, memlib globfree).
|
| | BLITZ_ALIAS (_DeleteRexxMsg, deleterexxmsg_c) |
| static void | clearrexxmsg_c (ULONG msg) |
| | ClearRexxMsg rexxmsg: delete the ArgStrings of rm_Args[].
|
| | BLITZ_ALIAS (_ClearRexxMsg, clearrexxmsg_c) |
| static void | fillrexxmsg_c (ULONG msg, const UBYTE *fill) |
| | FillRexxMsg rexxmsg,&FillStruct: fill rm_Args[] from a FillStruct.
|
| | BLITZ_ALIAS (_FillRexxMsg, fillrexxmsg_c) |
| static ULONG | createargstring_c (const UBYTE *s, const ULONG *lens) |
| | CreateArgString(String): a BB2 ArgString.
|
| | BLITZ_ALIAS (_CreateArgString, createargstring_c) |
| static void | deleteargstring_c (ULONG arg) |
| | DeleteArgString argstring: free an ArgString.
|
| | BLITZ_ALIAS (_DeleteArgString, deleteargstring_c) |
| static void | sendrexxcommand_c (ULONG msg, ULONG cmd, ULONG action, const ULONG *lens) |
| | SendRexxCommand rexxmsg,CommandString,ActionCodes: send the message to the public port "REXX".
|
| | BLITZ_ALIAS (_SendRexxCommand, sendrexxcommand_c) |
| static void | replyrexxmsg_c (ULONG msg, ULONG res1, ULONG res2, ULONG str, const ULONG *lens) |
| | ReplyRexxMsg rexxmsg,Result1,Result2,ResultString: reply to a message from ARexx.
|
| | BLITZ_ALIAS (_ReplyRexxMsg, replyrexxmsg_c) |
| static ULONG | getrexxresult_c (ULONG msg, ULONG n) |
| | GetRexxResult(rexxmsg,ResultNum): rm_Result1 (1) or rm_Result2 (2).
|
| | BLITZ_ALIAS (_GetRexxResult, getrexxresult_c) |
| static ULONG | copyarg (const UBYTE *s) |
| static ULONG | getrexxcommand_c (ULONG msg, ULONG n) |
| | GetRexxCommand(rexxmsg,ARGNum): rm_Args[ARGNum-1] as string.
|
| | BLITZ_ALIAS (_GetRexxCommand, getrexxcommand_c) |
| static ULONG | getresultstring_c (ULONG msg) |
| | GetResultString(rexxmsg): rm_Result2 as string, then the ArgString is deleted.
|
| | BLITZ_ALIAS (_GetResultString, getresultstring_c) |
| static ULONG | rexxevent_c (struct MsgPort *port) |
| | RexxEvent(PortAddress): the first message of the port, removed.
|
| | BLITZ_ALIAS (_RexxEvent, rexxevent_c) |
| static ULONG | isrexxmsg_c (ULONG msg) |
| | IsRexxMsg(rexxmsg): rexxsyslib IsRexxMsg.
|
| | BLITZ_ALIAS (_IsRexxMsg, isrexxmsg_c) |
| static ULONG | rexxerror_c (ULONG code) |
| | RexxError(ErrorCode): the ARexx error message as string.
|
| | BLITZ_ALIAS (_RexxError, rexxerror_c) |
| static void | getrexxresultchk_c (ULONG n) |
| | The error check of GetRexxResult (debugger only).
|
| static void | getrexxcommandchk_c (ULONG n) |
| | The error check of GetRexxCommand (debugger only).
|
| void clearrexxmsg_c |
( |
ULONG | msg | ) |
|
|
static |
ClearRexxMsg rexxmsg: delete the ArgStrings of rm_Args[].
All 16 slots, each slot cleared (the guide: "from slot number 1
forward to 16"). Fixed (#49): the original had no limit of 16 and with all slots used went on into rm_PassPort, rm_CommAddr, rm_FileExt ... (deleted and cleared). Fixed (#50): the original stopped at the first 0 slot; FillRexxMsg now stores an integer 0, with more arguments behind it. An integer in a slot is "deleted" if the memory before it looks like an ArgString. Not a RexxMsg (rexxsyslib IsRexxMsg): nothing happens. Without rexxsyslib: its alert, then nothing happens (fixed, #56: the original took the message as valid with address 0).
- Parameters
-
| ULONG createargstring_c |
( |
const UBYTE * | s, |
|
|
const ULONG * | lens ) |
|
static |
CreateArgString(String): a BB2 ArgString.
A RexxArg in memory of memlib (globalloc, MEMF_PUBLIC|MEMF_CLEAR): ra_Size = length+9 with bit 31 set (allocated by Blitz), ra_Length, ra_Flags $46, ra_Hash = byte sum of the characters, the characters and a 0. At most 65535 characters (ra_Length is a word): a longer string is cut to 65535 (fixed, #57: the original allocated length+9 bytes but copied and stored length & $FFFF). a3 = the string afterwards (not a bug, intended).
- Parameters
-
| s | d0: the string |
| lens | a2: the compiler's string stack, -4(a2) = its length |
- Returns
- d0: the ArgString (its characters, ra_Buff), 0 if there is no memory
| ULONG createrexxmsg_c |
( |
ULONG | port, |
|
|
ULONG | exten, |
|
|
ULONG | host, |
|
|
const ULONG * | lens ) |
|
static |
CreateRexxMsg(ReplyPort,Exten,Host): a RexxMsg of 128 bytes.
memlib globalloc (MEMF_PUBLIC|MEMF_CLEAR); ln_Name "REXX" (so that rexxsyslib IsRexxMsg accepts it), mn_ReplyPort, mn_Length 128, rm_FileExt/rm_CommAddr = BB2 ArgStrings of the extension and host strings. a3 = the extension afterwards (not a bug, intended: "preserve
the BB2 string work area"). DIFF: the host length -8(a2) is not copied to -4(a2) on the compiler's stack, a2 is never changed. Errors: no memory - recoverable alert ("SORRY CAN NOT ALLOCATE THE
MEMORY"), d0 = the error code 4.
- Parameters
-
| port | d0: the reply port |
| exten | d1: the file extension string |
| host | d2: the host address string |
| lens | a2: the compiler's string stack, -4(a2)/-8(a2) = the lengths of exten/host |
- Returns
- d0: the RexxMsg, or the error code (4) after the alert
| void fillrexxmsg_c |
( |
ULONG | msg, |
|
|
const UBYTE * | fill ) |
|
static |
FillRexxMsg rexxmsg,&FillStruct: fill rm_Args[] from a FillStruct.
FillStruct = {flags.w, value.l, ..., 0}: flag bit 15-n set = value n is an integer, else a C string that becomes a BB2 ArgString. A string value of 0 ends the list; an integer slot takes its value, 0 too (fixed, #50: the original tested every value for 0 before the flag, an integer 0 ended the list). At most the 16 slots are filled (fixed, #49: the original had no limit, a 17th value went to rm_PassPort, the next ones to rm_CommAddr ...). Errors: no memory - recoverable alert, the rest is not filled. Not a RexxMsg (rexxsyslib IsRexxMsg): nothing happens. Without rexxsyslib: its alert, then nothing happens (fixed, #56: the original took the message as valid with address 0).
- Parameters
-
| msg | d0: the RexxMsg |
| fill | d1: the FillStruct |
| ULONG getrexxcommand_c |
( |
ULONG | msg, |
|
|
ULONG | n ) |
|
static |
GetRexxCommand(rexxmsg,ARGNum): rm_Args[ARGNum-1] as string.
Copies the ArgString to a3 (the string work area), a3 ends on the 0. Fixed (#52): the original left a3 BEHIND the 0. Errors (debugger only, getrexxcommandchk): "Illegal Argument Number" for an n outside 1 to 16 (fixed, #51: the original had no check; without the debugger the index is a word, n = 0 reads rm_Result2, an invalid argument).
- Parameters
-
| msg | d0: the RexxMsg |
| n | d1: 1..16 |
- Returns
- d0: the string length; 0 if msg is no RexxMsg or the slot is no ArgString
| ULONG getrexxresult_c |
( |
ULONG | msg, |
|
|
ULONG | n ) |
|
static |
GetRexxResult(rexxmsg,ResultNum): rm_Result1 (1) or rm_Result2 (2).
Errors (debugger only, getrexxresultchk): "Illegal Result Number" for an n other than 1 or 2 (fixed, #51: the original had no check; without the debugger the index (n-1)*4 is a word (MULU, d1.w), n = 0 reads rm_Action, an invalid argument). Without rexxsyslib: the alert, then 0 (fixed, #56: the original read the field of a message at address 0).
- Parameters
-
| msg | d0: the RexxMsg |
| n | d1: 1 or 2 |
- Returns
- d0: the result, 0 if msg is no RexxMsg
| void replyrexxmsg_c |
( |
ULONG | msg, |
|
|
ULONG | res1, |
|
|
ULONG | res2, |
|
|
ULONG | str, |
|
|
const ULONG * | lens ) |
|
static |
ReplyRexxMsg rexxmsg,Result1,Result2,ResultString: reply to a message from ARexx.
Sets rm_Result1/rm_Result2 and ReplyMsg()s the message (not for one that is already a reply). The result ArgString (rexxsyslib, freed by ARexx) is made when Result1 = 0 and the sender asked for a result (RXFF_RESULT in rm_Action). Fixed (#48): the original tested BTST
#17,28(a0) - bit 1 of the HIGH byte of rm_Action, i.e. RXFUNC, not RXFF_RESULT. a3 = the result string afterwards (not a bug, intended). DIFF: with something that is not a RexxMsg it returns; the original pulls 15 registers it never pushed (crash). Errors: no memory - recoverable alert, no reply.
- Parameters
-
| msg | d0: the RexxMsg |
| res1 | d1: rm_Result1 |
| res2 | d2: rm_Result2 |
| str | d3: the result string |
| lens | a2: the compiler's string stack, -4(a2) = the result string's length |
| void sendrexxcommand_c |
( |
ULONG | msg, |
|
|
ULONG | cmd, |
|
|
ULONG | action, |
|
|
const ULONG * | lens ) |
|
static |
SendRexxCommand rexxmsg,CommandString,ActionCodes: send the message to the public port "REXX".
Creates the command ArgString only if rm_Args[0] is 0 (not a bug: keeps an ArgString the user put into slot 0), sets rm_Action and PutMsg()s the message (FindPort under Disable). a3 = the command afterwards (valid RexxMsg only; not a bug, intended). Errors: no memory - recoverable alert; no REXX port - recoverable alert ("SORRY CAN NOT
FIND THE REXXPORT"), after the Enable (fixed, #55: the original showed it and returned with interrupts still disabled). Not a RexxMsg (rexxsyslib IsRexxMsg): nothing happens. Without rexxsyslib: its alert, then nothing happens (fixed, #56: the original took the message as valid with address 0).
- Parameters
-
| msg | d0: the RexxMsg |
| cmd | d1: the command string |
| action | d2: rm_Action |
| lens | a2: the compiler's string stack, -4(a2) = the command's length |