| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: queue.h,v 1.7 2009/02/26 16:14:18 joerg Exp $ */ | | 1 | /* $NetBSD: queue.h,v 1.8 2009/03/02 13:54:56 joerg Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1991, 1993 | | 4 | * Copyright (c) 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -313,26 +313,31 @@ struct { \ | | | @@ -313,26 +313,31 @@ struct { \ |
313 | (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) | | 313 | (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) |
314 | #endif | | 314 | #endif |
315 | | | 315 | |
316 | #ifndef TAILQ_EMPTY | | 316 | #ifndef TAILQ_EMPTY |
317 | #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) | | 317 | #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) |
318 | #endif | | 318 | #endif |
319 | #ifndef TAILQ_FIRST | | 319 | #ifndef TAILQ_FIRST |
320 | #define TAILQ_FIRST(head) ((head)->tqh_first) | | 320 | #define TAILQ_FIRST(head) ((head)->tqh_first) |
321 | #endif | | 321 | #endif |
322 | #ifndef TAILQ_NEXT | | 322 | #ifndef TAILQ_NEXT |
323 | #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) | | 323 | #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) |
324 | #endif | | 324 | #endif |
325 | | | 325 | |
| | | 326 | #ifndef TAILQ_LAST |
| | | 327 | #define TAILQ_LAST(head, headname) \ |
| | | 328 | (*(((struct headname *)((head)->tqh_last))->tqh_last)) |
| | | 329 | #endif |
| | | 330 | |
326 | #ifndef CIRCLEQ_HEAD | | 331 | #ifndef CIRCLEQ_HEAD |
327 | #define CIRCLEQ_HEAD(name, type) \ | | 332 | #define CIRCLEQ_HEAD(name, type) \ |
328 | struct name { \ | | 333 | struct name { \ |
329 | struct type *cqh_first; /* first element */ \ | | 334 | struct type *cqh_first; /* first element */ \ |
330 | struct type *cqh_last; /* last element */ \ | | 335 | struct type *cqh_last; /* last element */ \ |
331 | } | | 336 | } |
332 | #endif | | 337 | #endif |
333 | | | 338 | |
334 | #ifndef CIRCLEQ_HEAD_INITIALIZER | | 339 | #ifndef CIRCLEQ_HEAD_INITIALIZER |
335 | #define CIRCLEQ_HEAD_INITIALIZER(head) \ | | 340 | #define CIRCLEQ_HEAD_INITIALIZER(head) \ |
336 | { (void *)&head, (void *)&head } | | 341 | { (void *)&head, (void *)&head } |
337 | #endif | | 342 | #endif |
338 | | | 343 | |