Don't call ReadArgs() if started from WB.
[tangerine.git] / compiler / include / dos / notify.h
blobc49aadef6cdc404f55bdbeb56ea7ed6529792460
1 #ifndef DOS_NOTIFY_H
2 #define DOS_NOTIFY_H
4 /*
5 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
6 $Id$
8 Notification handling.
9 */
11 #ifndef EXEC_PORTS_H
12 # include <exec/ports.h>
13 #endif
14 #ifndef EXEC_TASKS_H
15 # include <exec/tasks.h>
16 #endif
17 #ifndef EXEC_TYPES_H
18 # include <exec/types.h>
19 #endif
21 /*** NotifyRequest **********************************************************/
23 /*
24 General notification structure as passed to StartNotify() and EndNotify().
25 After passing it to StartNotify() the first time, this structure becomes
26 READ-ONLY!
29 struct NotifyRequest
31 STRPTR nr_Name; /* Name of the watched file. */
32 STRPTR nr_FullName; /* Fully qualified name of the watched file. This is
33 READ-ONLY! */
34 IPTR nr_UserData; /* Fill in with your own data. */
35 ULONG nr_Flags; /* see below */
38 The following union specified the way to notify the application, if
39 the watched file changes. IF NRF_SEND_MESSAGE is set, nr_Msg is used,
40 when NRF_SEND_SIGNAL is set, nr_Signal is used.
42 union
44 struct
46 struct MsgPort * nr_Port; /* Port to send message to. */
47 } nr_Msg;
48 struct
50 struct Task * nr_Task; /* Task to notify. */
51 UBYTE nr_SignalNum; /* Signal number to set. */
52 UBYTE nr_pad[3]; /* PRIVATE */
53 } nr_Signal;
54 } nr_stuff;
56 ULONG nr_Reserved[4]; /* PRIVATE! Set to 0 for now. */
58 /* The following fields are for PRIVATE use by handlers. */
59 ULONG nr_MsgCount; /* Number of unreplied messages. */
61 /* This used to be struct MsgPort *nr_Handler but as AROS filesystems
62 are different and this is a PRIVATE field anyway no Amiga programs
63 should use it, so I changed it -- SDuvan */
64 struct Device *nr_Device;
67 /* nr_Flags */
68 /* The two following flags specify by which means the watching task is to be
69 notified. */
70 #define NRB_SEND_MESSAGE 0 /* Send a message to the specified message port. */
71 #define NRB_SEND_SIGNAL 1 /* Set a signal of the specified task. */
72 #define NRB_WAIT_REPLY 3 /* Wait for a reply by the application before
73 going on with watching? */
74 #define NRB_NOTIFY_INITIAL 4 /* Notify if the file/directory exists when
75 the notification request is posted */
77 #define NRF_SEND_MESSAGE (1L<<NRB_SEND_MESSAGE)
78 #define NRF_SEND_SIGNAL (1L<<NRB_SEND_SIGNAL)
79 #define NRF_WAIT_REPLY (1L<<NRB_WAIT_REPLY)
80 #define NRF_NOTIFY_INITIAL (1L<<NRB_NOTIFY_INITIAL)
82 /* The following flags are for use by handlers only! */
83 #define NR_HANDLER_FLAGS 0xffff0000
84 #define NRB_MAGIC 31
85 #define NRF_MAGIC (1L<<31)
87 /**********************************************************************
88 **************************** NotifyMessage ***************************
89 **********************************************************************/
91 /* The NotifyMessage if send to the message port specified in
92 NotifyRequest->nr_Msg->nr_Port, if NRF_SEND_MESSAGE was set in
93 NotifyRequest->nr_Flags and the watched file changes. */
94 struct NotifyMessage
96 /* Embedded message structure as defined in <exec/ports.h>. */
97 struct Message nm_ExecMessage;
99 ULONG nm_Class; /* see below */
100 UWORD nm_Code; /* see below */
101 /* The notify structure that was passed to StartNotify(). */
102 struct NotifyRequest * nm_NReq;
104 /* The following two fields are for PRIVATE use by handlers. */
105 IPTR nm_DoNotTouch;
106 IPTR nm_DoNotTouch2;
109 /* nm_Class. Do not use, yet. */
110 #define NOTIFY_CLASS 0x40000000
112 /* nm_Code. Do not use, yet. */
113 #define NOTIFY_CODE 0x1234
115 #endif /* DOS_NOTIFY_H */