|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /*
26: * Copyright (c) 1994 NeXT Computer, Inc.
27: *
28: * Kernel generic queue object(s).
29: *
30: * HISTORY
31: *
32: * 24 June 1994 ? at NeXT
33: * Created.
34: */
35:
36: #ifdef KERNEL_PRIVATE
37:
38: #import <objc/Object.h>
39:
40: typedef struct _QueueChain {
41: void *next;
42: void *prev;
43: } _QueueChain;
44:
45: @interface KernQueue : Object
46: {
47: @private
48: _QueueChain _head;
49: }
50:
51: - first;
52: - last;
53:
54: - dequeueFirst;
55: - dequeueLast;
56:
57: - dequeueFirstObject;
58: - dequeueLastObject;
59:
60: - enqueueObjectAsFirst: object;
61: - enqueueObjectAsLast: object;
62:
63: - (BOOL)isEmpty;
64:
65: @end
66:
67: @interface KernQueueEntry : Object
68: {
69: @private
70: _QueueChain _link;
71: id _queue;
72: id _object;
73: }
74:
75: - initForQueue: queue
76: withObject: object;
77:
78: - freeObject;
79:
80: - enterAsFirst;
81: - enterAsFirstOnQueue: queue;
82: - enterAsLast;
83: - enterAsLastOnQueue: queue;
84:
85: - removeFromQueue;
86: - insertAfterEntry: prevEntry;
87: - insertBeforeEntry: nextEntry;
88:
89: - next;
90: - prev;
91: - nextObject: (id *)nextEntry;
92: - prevObject: (id *)prevEntry;
93:
94: - object;
95: - queue;
96:
97: - (BOOL)isQueued;
98:
99: @end
100:
101: KernQueueEntry *
102: KernQueueFirst(
103: KernQueue *queue
104: );
105: KernQueueEntry *
106: KernQueueLast(
107: KernQueue *queue
108: );
109: KernQueueEntry *
110: KernQueueNext(
111: KernQueueEntry *entry
112: );
113: KernQueueEntry *
114: KernQueuePrev(
115: KernQueueEntry *entry
116: );
117:
118: void *
119: KernQueueEntryObject(
120: KernQueueEntry *entry
121: );
122: void *
123: KernQueueNextObject(
124: KernQueueEntry **entry /* IN/OUT */
125: );
126: void *
127: KernQueuePrevObject(
128: KernQueueEntry **entry /* IN/OUT */
129: );
130:
131: BOOL
132: KernQueueIsEmpty(
133: KernQueue *queue
134: );
135: BOOL
136: KernQueueEntryIsQueued(
137: KernQueueEntry *entry
138: );
139:
140: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.