3 /* (C) 1995 AROS - The Amiga Research OS */
5 /******************************************************************************
11 Header-file for nodes.
13 ******************************************************************************/
15 /**************************************
17 **************************************/
18 /* #ifndef AROS_CONFIG_H
19 # include <aros/config.h>
22 # include <exec/types.h>
29 /* Here I overload the -> (dereference) operator. When you dereferenece
30 a NodePtr, then you get a struct Node *. Here is how it works:
34 ... give nptr a valid value ...
38 The C++ compiler creates this code for the last line:
40 struct Node * temp = nptr.operator-> ();
43 This means that you can use any field name which is valid after
44 "struct Node *" after an NodePtr.
46 inline struct Node
* operator -> ()
48 return (struct Node
*) ntohl (data
);
51 /* Convert a NodePtr to a Node */
52 inline operator struct Node
* ()
54 return (struct Node
*) ntohl (data
);
57 /* Convert it to void * */
58 inline operator void * ()
60 return (struct Node
*) ntohl (data
);
63 /* Create a NodePtr from a struct Node pointer. */
64 inline NodePtr (struct Node
* v
)
66 data
= htonl ((long)v
);
75 /* Pretty much the same but this time for MinNodePtr */
76 class MinNodePtr
: APTR
79 inline struct MinNode
* operator -> ()
81 return (struct MinNode
*) ntohl (data
);
84 inline MinNodePtr (struct MinNode
* v
)
86 data
= htonl ((long)v
);
95 /**************************************
97 **************************************/
99 #if (AROS_FLAVOUR & AROS_FLAVOUR_BINCOMPAT)
106 /* AROS: pointer should be 32bit aligned, but we can not do this on
107 the native machine because of binary compatibility.
112 inline Node () { return; }
120 /* AROS: pointer should be 32bit aligned */
126 inline Node () { return; }
128 #endif /* AROS_FLAVOUR */
136 inline MinNode () { return; }
140 /**************************************
142 **************************************/
143 /* Values for ln_Type */
144 #define NT_UNKNOWN 0 /* Unknown node */
145 #define NT_TASK 1 /* Exec task */
146 #define NT_INTERRUPT 2 /* Interrupt */
147 #define NT_DEVICE 3 /* Device */
148 #define NT_MSGPORT 4 /* Message-Port */
149 #define NT_MESSAGE 5 /* Indicates message currently pending */
151 #define NT_REPLYMSG 7 /* Message has been replied */
152 #define NT_RESOURCE 8
155 #define NT_SOFTINT 11 /* Internal flag used by SoftInits */
157 #define NT_PROCESS 13 /* AmigaDOS Process */
158 #define NT_SEMAPHORE 14
159 #define NT_SIGNALSEM 15 /* signal semaphores */
160 #define NT_BOOTNODE 16
161 #define NT_KICKMEM 17
162 #define NT_GRAPHICS 18
163 #define NT_DEATHMESSAGE 19
165 #define NT_USER 254 /* User node types work down from here */
166 #define NT_EXTENDED 255
169 /******************************************************************************
170 ***** ENDE exec/nodes.h
171 ******************************************************************************/
173 #endif /* EXEC_NODES_H */