add casts to zune macros to silence some warnings
[tangerine.git] / workbench / libs / asl / abortaslrequest.c
blob30c57f13326d71bc56bc312cdad8e443897519b3
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
10 #include <proto/exec.h>
11 #include "asl_intern.h"
13 /*****************************************************************************
15 NAME */
17 AROS_LH1(void, AbortAslRequest,
19 /* SYNOPSIS */
20 AROS_LHA(APTR, requester, A0),
22 /* LOCATION */
23 struct Library *, AslBase, 13, Asl)
25 /* FUNCTION
27 INPUTS
29 RESULT
31 NOTES
33 EXAMPLE
35 BUGS
37 SEE ALSO
39 INTERNALS
41 HISTORY
42 27-11-96 digulla automatically created from
43 asl_lib.fd and clib/asl_protos.h
45 *****************************************************************************/
47 AROS_LIBFUNC_INIT
49 struct ReqNode *reqnode;
51 if (!requester) return;
53 ObtainSemaphore( &(ASLB(AslBase)->ReqListSem));
55 reqnode = FindReqNode(requester, ASLB(AslBase));
56 if (reqnode)
58 if (reqnode->rn_ReqWindow)
60 struct MsgPort mp;
61 struct IntuiMessage msg;
62 BYTE sig;
64 sig = AllocSignal(-1);
65 if (sig == -1) sig = SIGB_SINGLE;
67 mp.mp_Node.ln_Type = NT_MSGPORT;
68 mp.mp_Node.ln_Pri = 0;
69 mp.mp_Node.ln_Name = NULL;
70 mp.mp_Flags = PA_SIGNAL;
71 mp.mp_SigTask = FindTask(NULL);
72 mp.mp_SigBit = sig;
73 NEWLIST(&mp.mp_MsgList);
75 msg.ExecMessage.mn_Node.ln_Type = NT_MESSAGE;
76 msg.ExecMessage.mn_ReplyPort = &mp;
77 msg.ExecMessage.mn_Length = sizeof(msg);
78 msg.Class = IDCMP_CLOSEWINDOW;
79 msg.Code = 0;
80 msg.Qualifier = 0;
81 msg.IAddress = reqnode->rn_ReqWindow;
82 msg.MouseX = 0;
83 msg.MouseY = 0;
84 msg.Seconds = 0;
85 msg.Micros = 0;
86 msg.IDCMPWindow = reqnode->rn_ReqWindow;
87 msg.SpecialLink = 0;
89 SetSignal(0, 1L << sig);
90 PutMsg(reqnode->rn_ReqWindow->UserPort, &msg.ExecMessage);
91 WaitPort(&mp);
93 if (sig != SIGB_SINGLE) FreeSignal(sig);
95 } /* if (reqnode->rn_ReqWindow) */
97 } /* if (reqnode) */
99 ReleaseSemaphore(&(ASLB(AslBase)->ReqListSem));
102 AROS_LIBFUNC_EXIT
104 } /* AbortAslRequest */