Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / exec / replymsg.c
blob09893cbacbd662252d891affdd3fbb1326a6e2ae
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Reply a message
6 Lang: english
7 */
8 #include "exec_intern.h"
9 #include <aros/libcall.h>
10 #include <exec/ports.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH1(void, ReplyMsg,
19 /* SYNOPSIS */
20 AROS_LHA(struct Message *, message, A1),
22 /* LOCATION */
23 struct ExecBase *, SysBase, 63, Exec)
25 /* FUNCTION
26 Send a message back to where it came from. It's generally not
27 wise to access the fields of a message after it has been replied.
29 INPUTS
30 message - a message got with GetMsg().
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 WaitPort(), GetMsg(), PutMsg()
43 INTERNALS
45 ******************************************************************************/
47 AROS_LIBFUNC_INIT
49 struct MsgPort *port;
51 /* Protect the message against access by other tasks. */
52 Disable();
54 /* Get replyport */
55 port=message->mn_ReplyPort;
57 /* Not set? Only mark the message as no longer sent. */
58 if(port==NULL)
59 message->mn_Node.ln_Type=NT_FREEMSG;
60 else
62 /* Mark the message as replied */
63 message->mn_Node.ln_Type=NT_REPLYMSG;
65 /* Add it to the replyport's list */
66 AddTail(&port->mp_MsgList,&message->mn_Node);
68 if(port->mp_SigTask)
70 /* And trigger the arrival action. */
71 switch(port->mp_Flags&PF_ACTION)
73 case PA_SIGNAL:
74 /* Send a signal */
75 Signal((struct Task *)port->mp_SigTask,1<<port->mp_SigBit);
76 break;
78 case PA_SOFTINT:
79 /* Raise a software interrupt */
80 Cause((struct Interrupt *)port->mp_SoftInt);
81 break;
83 case PA_IGNORE:
84 /* Do nothing */
85 break;
90 /* All done */
91 Enable();
92 AROS_LIBFUNC_EXIT
93 } /* ReplyMsg() */