Change to the linux kernel coding style
[wmaker-crm.git] / WINGs / notification.c
Commit [+]AuthorDateLineData
9d2e6ef9 scottc1998-09-29 22:36:29 +00001
2#include <stdlib.h>
3#include <assert.h>
4#include <stdio.h>
5#include <string.h>
6
7#include "WUtil.h"
8
9d2e6ef9 scottc1998-09-29 22:36:29 +00009typedef struct W_Notification {
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020010 const char *name;
11 void *object;
12 void *clientData;
13 int refCount;
9d2e6ef9 scottc1998-09-29 22:36:29 +000014} Notification;
15
e7495baf dan1999-02-17 11:06:40 +000016extern void W_FlushASAPNotificationQueue();
17
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020018const char *WMGetNotificationName(WMNotification * notification)
9d2e6ef9 scottc1998-09-29 22:36:29 +000019{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020020 return notification->name;
9d2e6ef9 scottc1998-09-29 22:36:29 +000021}
22
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020023void *WMGetNotificationObject(WMNotification * notification)
9d2e6ef9 scottc1998-09-29 22:36:29 +000024{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020025 return notification->object;
9d2e6ef9 scottc1998-09-29 22:36:29 +000026}
27
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020028void *WMGetNotificationClientData(WMNotification * notification)
9d2e6ef9 scottc1998-09-29 22:36:29 +000029{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020030 return notification->clientData;
9d2e6ef9 scottc1998-09-29 22:36:29 +000031}
32
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020033WMNotification *WMCreateNotification(const char *name, void *object, void *clientData)
9d2e6ef9 scottc1998-09-29 22:36:29 +000034{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020035 Notification *nPtr;
6830b057 dan2004-10-12 21:28:27 +000036
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020037 nPtr = wmalloc(sizeof(Notification));
6830b057 dan2004-10-12 21:28:27 +000038
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020039 nPtr->name = name;
40 nPtr->object = object;
41 nPtr->clientData = clientData;
6830b057 dan2004-10-12 21:28:27 +000042
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020043 nPtr->refCount = 1;
6830b057 dan2004-10-12 21:28:27 +000044
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020045 return nPtr;
9d2e6ef9 scottc1998-09-29 22:36:29 +000046}
47
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020048void WMReleaseNotification(WMNotification * notification)
9d2e6ef9 scottc1998-09-29 22:36:29 +000049{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020050 notification->refCount--;
6830b057 dan2004-10-12 21:28:27 +000051
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020052 if (notification->refCount < 1) {
53 wfree(notification);
54 }
9d2e6ef9 scottc1998-09-29 22:36:29 +000055}
56
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020057WMNotification *WMRetainNotification(WMNotification * notification)
9d2e6ef9 scottc1998-09-29 22:36:29 +000058{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020059 notification->refCount++;
6830b057 dan2004-10-12 21:28:27 +000060
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020061 return notification;
9d2e6ef9 scottc1998-09-29 22:36:29 +000062}
63
9d2e6ef9 scottc1998-09-29 22:36:29 +000064/***************** Notification Center *****************/
65
66typedef struct NotificationObserver {
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020067 WMNotificationObserverAction *observerAction;
68 void *observer;
9d2e6ef9 scottc1998-09-29 22:36:29 +000069
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020070 const char *name;
71 void *object;
9d2e6ef9 scottc1998-09-29 22:36:29 +000072
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020073 struct NotificationObserver *prev; /* for tables */
74 struct NotificationObserver *next;
75 struct NotificationObserver *nextAction; /* for observerTable */
9d2e6ef9 scottc1998-09-29 22:36:29 +000076} NotificationObserver;
77
9d2e6ef9 scottc1998-09-29 22:36:29 +000078typedef struct W_NotificationCenter {
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020079 WMHashTable *nameTable; /* names -> observer lists */
80 WMHashTable *objectTable; /* object -> observer lists */
81 NotificationObserver *nilList; /* obervers that catch everything */
6830b057 dan2004-10-12 21:28:27 +000082
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020083 WMHashTable *observerTable; /* observer -> NotificationObserver */
9d2e6ef9 scottc1998-09-29 22:36:29 +000084} NotificationCenter;
85
9d2e6ef9 scottc1998-09-29 22:36:29 +000086/* default (and only) center */
87static NotificationCenter *notificationCenter = NULL;
88
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020089void W_InitNotificationCenter(void)
9d2e6ef9 scottc1998-09-29 22:36:29 +000090{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020091 notificationCenter = wmalloc(sizeof(NotificationCenter));
6830b057 dan2004-10-12 21:28:27 +000092
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +020093 notificationCenter->nameTable = WMCreateHashTable(WMStringPointerHashCallbacks);
94 notificationCenter->objectTable = WMCreateHashTable(WMIntHashCallbacks);
95 notificationCenter->nilList = NULL;
6830b057 dan2004-10-12 21:28:27 +000096
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +020097 notificationCenter->observerTable = WMCreateHashTable(WMIntHashCallbacks);
9d2e6ef9 scottc1998-09-29 22:36:29 +000098}
99
9d2e6ef9 scottc1998-09-29 22:36:29 +0000100void
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200101WMAddNotificationObserver(WMNotificationObserverAction * observerAction,
102 void *observer, const char *name, void *object)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000103{
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200104 NotificationObserver *oRec, *rec;
105
106 oRec = wmalloc(sizeof(NotificationObserver));
107 oRec->observerAction = observerAction;
108 oRec->observer = observer;
109 oRec->name = name;
110 oRec->object = object;
111 oRec->next = NULL;
112 oRec->prev = NULL;
113
114 /* put this action in the list of actions for this observer */
115 rec = (NotificationObserver *) WMHashInsert(notificationCenter->observerTable, observer, oRec);
116
117 if (rec) {
118 /* if this is not the first action for the observer */
119 oRec->nextAction = rec;
120 } else {
121 oRec->nextAction = NULL;
122 }
123
124 if (!name && !object) {
125 /* catch-all */
126 oRec->next = notificationCenter->nilList;
127 if (notificationCenter->nilList) {
128 notificationCenter->nilList->prev = oRec;
129 }
130 notificationCenter->nilList = oRec;
131 } else if (!name) {
132 /* any message coming from object */
133 rec = (NotificationObserver *) WMHashInsert(notificationCenter->objectTable, object, oRec);
134 oRec->next = rec;
135 if (rec) {
136 rec->prev = oRec;
137 }
138 } else {
139 /* name && (object || !object) */
140 rec = (NotificationObserver *) WMHashInsert(notificationCenter->nameTable, name, oRec);
141 oRec->next = rec;
142 if (rec) {
143 rec->prev = oRec;
144 }
145 }
9d2e6ef9 scottc1998-09-29 22:36:29 +0000146}
147
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200148void WMPostNotification(WMNotification * notification)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000149{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200150 NotificationObserver *orec, *tmp;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000151
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200152 WMRetainNotification(notification);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000153
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200154 /* tell the observers that want to know about a particular message */
155 orec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable, notification->name);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000156
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200157 while (orec) {
158 tmp = orec->next;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000159
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200160 if (!orec->object || !notification->object || orec->object == notification->object) {
161 /* tell the observer */
162 if (orec->observerAction) {
163 (*orec->observerAction) (orec->observer, notification);
164 }
165 }
166
167 orec = tmp;
168 }
169
170 /* tell the observers that want to know about an object */
171 orec = (NotificationObserver *) WMHashGet(notificationCenter->objectTable, notification->object);
172
173 while (orec) {
174 tmp = orec->next;
175
176 /* tell the observer */
177 if (orec->observerAction) {
178 (*orec->observerAction) (orec->observer, notification);
179 }
180 orec = tmp;
181 }
182
183 /* tell the catch all observers */
184 orec = notificationCenter->nilList;
185 while (orec) {
186 tmp = orec->next;
187
188 /* tell the observer */
189 if (orec->observerAction) {
190 (*orec->observerAction) (orec->observer, notification);
191 }
192 orec = tmp;
193 }
194
195 WMReleaseNotification(notification);
196}
197
198void WMRemoveNotificationObserver(void *observer)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000199{
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200200 NotificationObserver *orec, *tmp, *rec;
201
202 /* get the list of actions the observer is doing */
203 orec = (NotificationObserver *) WMHashGet(notificationCenter->observerTable, observer);
204
205 /*
206 * FOREACH orec IN actionlist for observer
207 * DO
208 * remove from respective lists/tables
209 * free
210 * END
211 */
212 while (orec) {
213 tmp = orec->nextAction;
214
215 if (!orec->name && !orec->object) {
216 /* catch-all */
217 if (notificationCenter->nilList == orec)
218 notificationCenter->nilList = orec->next;
219 } else if (!orec->name) {
220 /* any message coming from object */
221 rec = (NotificationObserver *) WMHashGet(notificationCenter->objectTable, orec->object);
222 if (rec == orec) {
223 /* replace table entry */
224 if (orec->next) {
225 WMHashInsert(notificationCenter->objectTable, orec->object, orec->next);
226 } else {
227 WMHashRemove(notificationCenter->objectTable, orec->object);
228 }
229 }
230 } else {
231 /* name && (object || !object) */
232 rec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable, orec->name);
233 if (rec == orec) {
234 /* replace table entry */
235 if (orec->next) {
236 WMHashInsert(notificationCenter->nameTable, orec->name, orec->next);
237 } else {
238 WMHashRemove(notificationCenter->nameTable, orec->name);
239 }
240 }
241 }
242 if (orec->prev)
243 orec->prev->next = orec->next;
244 if (orec->next)
245 orec->next->prev = orec->prev;
246
247 wfree(orec);
248
249 orec = tmp;
250 }
251
252 WMHashRemove(notificationCenter->observerTable, observer);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000253}
254
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200255void WMRemoveNotificationObserverWithName(void *observer, const char *name, void *object)
256{
257 NotificationObserver *orec, *tmp, *rec;
258 NotificationObserver *newList = NULL;
259
260 /* get the list of actions the observer is doing */
261 orec = (NotificationObserver *) WMHashGet(notificationCenter->observerTable, observer);
262
263 WMHashRemove(notificationCenter->observerTable, observer);
264
265 /* rebuild the list of actions for the observer */
266
267 while (orec) {
268 tmp = orec->nextAction;
269 if (orec->name == name && orec->object == object) {
270 if (!name && !object) {
271 if (notificationCenter->nilList == orec)
272 notificationCenter->nilList = orec->next;
273 } else if (!name) {
274 rec =
275 (NotificationObserver *) WMHashGet(notificationCenter->objectTable,
276 orec->object);
277 if (rec == orec) {
278 assert(rec->prev == NULL);
279 /* replace table entry */
280 if (orec->next) {
281 WMHashInsert(notificationCenter->objectTable,
282 orec->object, orec->next);
283 } else {
284 WMHashRemove(notificationCenter->objectTable, orec->object);
285 }
286 }
287 } else {
288 rec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable,
289 orec->name);
290 if (rec == orec) {
291 assert(rec->prev == NULL);
292 /* replace table entry */
293 if (orec->next) {
294 WMHashInsert(notificationCenter->nameTable,
295 orec->name, orec->next);
296 } else {
297 WMHashRemove(notificationCenter->nameTable, orec->name);
298 }
299 }
300 }
301
302 if (orec->prev)
303 orec->prev->next = orec->next;
304 if (orec->next)
305 orec->next->prev = orec->prev;
306 wfree(orec);
307 } else {
308 /* append this action in the new action list */
309 orec->nextAction = NULL;
310 if (!newList) {
311 newList = orec;
312 } else {
313 NotificationObserver *p;
314
315 p = newList;
316 while (p->nextAction) {
317 p = p->nextAction;
318 }
319 p->nextAction = orec;
320 }
321 }
322 orec = tmp;
323 }
324
325 /* reinsert the list to the table */
326 if (newList) {
327 WMHashInsert(notificationCenter->observerTable, observer, newList);
328 }
329}
9d2e6ef9 scottc1998-09-29 22:36:29 +0000330
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200331void WMPostNotificationName(const char *name, void *object, void *clientData)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000332{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200333 WMNotification *notification;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000334
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200335 notification = WMCreateNotification(name, object, clientData);
6830b057 dan2004-10-12 21:28:27 +0000336
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200337 WMPostNotification(notification);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000338
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200339 WMReleaseNotification(notification);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000340}
341
9d2e6ef9 scottc1998-09-29 22:36:29 +0000342/**************** Notification Queues ****************/
343
9d2e6ef9 scottc1998-09-29 22:36:29 +0000344typedef struct W_NotificationQueue {
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200345 WMArray *asapQueue;
346 WMArray *idleQueue;
e7495baf dan1999-02-17 11:06:40 +0000347
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200348 struct W_NotificationQueue *next;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000349} NotificationQueue;
350
e7495baf dan1999-02-17 11:06:40 +0000351static WMNotificationQueue *notificationQueueList = NULL;
352
9d2e6ef9 scottc1998-09-29 22:36:29 +0000353/* default queue */
354static WMNotificationQueue *notificationQueue = NULL;
355
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200356WMNotificationQueue *WMGetDefaultNotificationQueue(void)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000357{
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200358 if (!notificationQueue)
359 notificationQueue = WMCreateNotificationQueue();
e7495baf dan1999-02-17 11:06:40 +0000360
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200361 return notificationQueue;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000362}
363
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200364WMNotificationQueue *WMCreateNotificationQueue(void)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000365{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200366 NotificationQueue *queue;
e7495baf dan1999-02-17 11:06:40 +0000367
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200368 queue = wmalloc(sizeof(NotificationQueue));
e7495baf dan1999-02-17 11:06:40 +0000369
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200370 queue->asapQueue = WMCreateArrayWithDestructor(8, (WMFreeDataProc *) WMReleaseNotification);
371 queue->idleQueue = WMCreateArrayWithDestructor(8, (WMFreeDataProc *) WMReleaseNotification);
372 queue->next = notificationQueueList;
e7495baf dan1999-02-17 11:06:40 +0000373
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200374 notificationQueueList = queue;
e7495baf dan1999-02-17 11:06:40 +0000375
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200376 return queue;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000377}
378
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200379void WMEnqueueNotification(WMNotificationQueue * queue, WMNotification * notification, WMPostingStyle postingStyle)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000380{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200381 WMEnqueueCoalesceNotification(queue, notification, postingStyle, WNCOnName | WNCOnSender);
e7495baf dan1999-02-17 11:06:40 +0000382}
383
046403db dan2001-04-15 01:22:56 +0000384#define NOTIF ((WMNotification*)cdata)
385#define ITEM ((WMNotification*)item)
386
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200387static int matchSenderAndName(void *item, void *cdata)
046403db dan2001-04-15 01:22:56 +0000388{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200389 return (NOTIF->object == ITEM->object && strcmp(NOTIF->name, ITEM->name) == 0);
046403db dan2001-04-15 01:22:56 +0000390}
391
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200392static int matchSender(void *item, void *cdata)
046403db dan2001-04-15 01:22:56 +0000393{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200394 return (NOTIF->object == ITEM->object);
046403db dan2001-04-15 01:22:56 +0000395}
396
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200397static int matchName(void *item, void *cdata)
046403db dan2001-04-15 01:22:56 +0000398{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200399 return (strcmp(NOTIF->name, ITEM->name) == 0);
046403db dan2001-04-15 01:22:56 +0000400}
401
402#undef NOTIF
403#undef ITEM
404
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200405void WMDequeueNotificationMatching(WMNotificationQueue * queue, WMNotification * notification, unsigned mask)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000406{
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200407 WMMatchDataProc *matchFunc;
408
409 if ((mask & WNCOnName) && (mask & WNCOnSender))
410 matchFunc = matchSenderAndName;
411 else if (mask & WNCOnName)
412 matchFunc = matchName;
413 else if (mask & WNCOnSender)
414 matchFunc = matchSender;
415 else
416 return;
417
418 WMRemoveFromArrayMatching(queue->asapQueue, matchFunc, notification);
419 WMRemoveFromArrayMatching(queue->idleQueue, matchFunc, notification);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000420}
421
9d2e6ef9 scottc1998-09-29 22:36:29 +0000422void
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200423WMEnqueueCoalesceNotification(WMNotificationQueue * queue,
424 WMNotification * notification, WMPostingStyle postingStyle, unsigned coalesceMask)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000425{
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200426 if (coalesceMask != WNCNone)
427 WMDequeueNotificationMatching(queue, notification, coalesceMask);
428
429 switch (postingStyle) {
430 case WMPostNow:
431 WMPostNotification(notification);
432 WMReleaseNotification(notification);
433 break;
434
435 case WMPostASAP:
436 WMAddToArray(queue->asapQueue, notification);
437 break;
438
439 case WMPostWhenIdle:
440 WMAddToArray(queue->idleQueue, notification);
441 break;
442 }
9d2e6ef9 scottc1998-09-29 22:36:29 +0000443}
444
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200445void W_FlushASAPNotificationQueue()
e7495baf dan1999-02-17 11:06:40 +0000446{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200447 WMNotificationQueue *queue = notificationQueueList;
e7495baf dan1999-02-17 11:06:40 +0000448
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200449 while (queue) {
450 while (WMGetArrayItemCount(queue->asapQueue)) {
451 WMPostNotification(WMGetFromArray(queue->asapQueue, 0));
452 WMDeleteFromArray(queue->asapQueue, 0);
453 }
052ab01c kojima1999-09-16 02:55:56 +0000454
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200455 queue = queue->next;
456 }
e7495baf dan1999-02-17 11:06:40 +0000457}
9d2e6ef9 scottc1998-09-29 22:36:29 +0000458
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200459void W_FlushIdleNotificationQueue()
e7495baf dan1999-02-17 11:06:40 +0000460{
688a56e8 Carlos R. Mafra2009-08-20 00:59:40 +0200461 WMNotificationQueue *queue = notificationQueueList;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000462
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200463 while (queue) {
464 while (WMGetArrayItemCount(queue->idleQueue)) {
465 WMPostNotification(WMGetFromArray(queue->idleQueue, 0));
466 WMDeleteFromArray(queue->idleQueue, 0);
467 }
052ab01c kojima1999-09-16 02:55:56 +0000468
688a56e8
CM
Carlos R. Mafra2009-08-20 00:59:40 +0200469 queue = queue->next;
470 }
e7495baf dan1999-02-17 11:06:40 +0000471}