1 /***************************************************************************
3 openurl.library - universal URL display and browser launcher library
4 Copyright (C) 1998-2005 by Troels Walsted Hansen, et al.
5 Copyright (C) 2005-2013 by openurl.library Open Source Team
7 This library is free software; it has been placed in the public domain
8 and you can freely redistribute it and/or modify it. Please note, however,
9 that some components may be under the LGPL or GPL license.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 openurl.library project: http://sourceforge.net/projects/openurllib/
19 ***************************************************************************/
24 /***********************************************************************/
26 static BOOL
localSendRexxMsg(struct MsgPort
*reply
, STRPTR rxport
, STRPTR rxcmd
)
29 struct RexxMsg
*rxmsg
;
33 if((rxmsg
= CreateRexxMsg(reply
, NULL
, NULL
)) != NULL
)
35 rxmsg
->rm_Action
= RXCOMM
|RXFF_STRING
|RXFF_NOIO
;
37 if((rxmsg
->rm_Args
[0] = (IPTR
)CreateArgstring(rxcmd
,strlen(rxcmd
))) != 0)
43 if((port
= FindPort(rxport
)) != NULL
)
45 PutMsg(port
, (struct Message
*)rxmsg
);
53 DeleteArgstring((APTR
)rxmsg
->rm_Args
[0]);
64 /**************************************************************************/
66 void SAVEDS
handler(void)
68 struct Process
*me
= (struct Process
*)FindTask(NULL
);
69 struct startMsg
*smsg
;
75 WaitPort(&me
->pr_MsgPort
);
76 smsg
= (struct startMsg
*)GetMsg(&me
->pr_MsgPort
);
78 #if defined(__amigaos4__)
79 port
= AllocSysObject(ASOT_PORT
, TAG_DONE
);
81 port
= CreateMsgPort();
85 res
= localSendRexxMsg(port
, smsg
->port
, smsg
->cmd
);
88 ReplyMsg((struct Message
*)smsg
);
92 struct RexxMsg
*rxmsg
;
95 rxmsg
= (struct RexxMsg
*)GetMsg(port
);
97 DeleteArgstring((APTR
)rxmsg
->rm_Args
[0]);
103 #if defined(__amigaos4__)
104 FreeSysObject(ASOT_PORT
, port
);
110 ObtainSemaphore(&OpenURLBase
->libSem
);
111 OpenURLBase
->rexx_use
--;
112 ReleaseSemaphore(&OpenURLBase
->libSem
);
114 #if !defined(__amigaos4__)
115 // all systems except OS4 should leave this function in forbidden state
122 /**************************************************************************/