added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / compiler / include / dos / notify.h
blobc97a0437df2b84947d5fce2cf18c5f495432475f
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 ULONG nr_MsgCount; /* Number of unreplied messages. */
60 struct MsgPort *nr_Handler; /* Filesystem task/device. Used by EndNotify() */
63 /* nr_Flags */
64 /* The two following flags specify by which means the watching task is to be
65 notified. */
66 #define NRB_SEND_MESSAGE 0 /* Send a message to the specified message port. */
67 #define NRB_SEND_SIGNAL 1 /* Set a signal of the specified task. */
68 #define NRB_WAIT_REPLY 3 /* Wait for a reply by the application before
69 going on with watching? */
70 #define NRB_NOTIFY_INITIAL 4 /* Notify if the file/directory exists when
71 the notification request is posted */
73 #define NRF_SEND_MESSAGE (1L<<NRB_SEND_MESSAGE)
74 #define NRF_SEND_SIGNAL (1L<<NRB_SEND_SIGNAL)
75 #define NRF_WAIT_REPLY (1L<<NRB_WAIT_REPLY)
76 #define NRF_NOTIFY_INITIAL (1L<<NRB_NOTIFY_INITIAL)
78 /* The following flags are for use by handlers only! */
79 #define NR_HANDLER_FLAGS 0xffff0000
80 #define NRB_MAGIC 31
81 #define NRF_MAGIC (1L<<31)
83 /**********************************************************************
84 **************************** NotifyMessage ***************************
85 **********************************************************************/
87 /* The NotifyMessage if send to the message port specified in
88 NotifyRequest->nr_Msg->nr_Port, if NRF_SEND_MESSAGE was set in
89 NotifyRequest->nr_Flags and the watched file changes. */
90 struct NotifyMessage
92 /* Embedded message structure as defined in <exec/ports.h>. */
93 struct Message nm_ExecMessage;
95 ULONG nm_Class; /* see below */
96 UWORD nm_Code; /* see below */
97 /* The notify structure that was passed to StartNotify(). */
98 struct NotifyRequest * nm_NReq;
100 /* The following two fields are for PRIVATE use by handlers. */
101 IPTR nm_DoNotTouch;
102 IPTR nm_DoNotTouch2;
105 /* nm_Class. Do not use, yet. */
106 #define NOTIFY_CLASS 0x40000000
108 /* nm_Code. Do not use, yet. */
109 #define NOTIFY_CODE 0x1234
111 #endif /* DOS_NOTIFY_H */