2 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
8 #include <proto/alib.h>
9 #include <proto/exec.h>
10 #include <proto/rexxsyslib.h>
11 #include <rexx/storage.h>
12 #include <rexx/errors.h>
14 /*****************************************************************************
24 Check to see if provided message was generated by the rexx interpreter
27 msg - The message to check
30 Wether this message is OK.
39 SetRexxVar, GetRexxVar
42 This function creates a rexx message that is sent to the AREXX
43 port with a RXCHECKMSG command.
46 *****************************************************************************/
49 struct Library
*RexxSysBase
= NULL
;
50 struct RexxMsg
*msg2
= NULL
, *msg3
;
51 struct MsgPort
*port
= NULL
, *rexxport
;
54 RexxSysBase
= OpenLibrary("rexxsyslib.library", 0);
55 if (RexxSysBase
== NULL
) goto cleanup
;
57 if (!IsRexxMsg(msg
)) goto cleanup
;
58 rexxport
= FindPort("REXX");
59 if (rexxport
==NULL
) goto cleanup
;
61 port
= CreateMsgPort();
62 if (port
== NULL
) goto cleanup
;
63 msg2
= CreateRexxMsg(port
, NULL
, NULL
);
64 if (msg2
==NULL
) goto cleanup
;
65 msg2
->rm_Private1
= msg
->rm_Private1
;
66 msg2
->rm_Private2
= msg
->rm_Private2
;
67 msg2
->rm_Action
= RXCHECKMSG
;
69 PutMsg(rexxport
, (struct Message
*)msg2
);
74 msg3
= (struct RexxMsg
*)GetMsg(port
);
75 if (msg3
!=msg2
) ReplyMsg((struct Message
*)msg3
);
78 retval
= msg3
->rm_Result1
==RC_OK
;
81 if (msg2
!=NULL
) DeleteRexxMsg(msg2
);
82 if (port
!=NULL
) DeletePort(port
);
83 if (RexxSysBase
!=NULL
) CloseLibrary(RexxSysBase
);