3 /* Copyright © 1995-2011, The AROS Development Team. All rights reserved. */
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 **************************************/
105 /* AROS: pointer should be 32bit aligned, but we can not do this on
106 the native machine because of binary compatibility.
111 inline Node () { return; }
120 inline MinNode () { return; }
124 /**************************************
126 **************************************/
127 /* Values for ln_Type */
128 #define NT_UNKNOWN 0 /* Unknown node */
129 #define NT_TASK 1 /* Exec task */
130 #define NT_INTERRUPT 2 /* Interrupt */
131 #define NT_DEVICE 3 /* Device */
132 #define NT_MSGPORT 4 /* Message-Port */
133 #define NT_MESSAGE 5 /* Indicates message currently pending */
135 #define NT_REPLYMSG 7 /* Message has been replied */
136 #define NT_RESOURCE 8
139 #define NT_SOFTINT 11 /* Internal flag used by SoftInits */
141 #define NT_PROCESS 13 /* AmigaDOS Process */
142 #define NT_SEMAPHORE 14
143 #define NT_SIGNALSEM 15 /* signal semaphores */
144 #define NT_BOOTNODE 16
145 #define NT_KICKMEM 17
146 #define NT_GRAPHICS 18
147 #define NT_DEATHMESSAGE 19
149 #define NT_USER 254 /* User node types work down from here */
150 #define NT_EXTENDED 255
153 /******************************************************************************
154 ***** ENDE exec/nodes.h
155 ******************************************************************************/
157 #endif /* EXEC_NODES_H */