From 2fa7da9ed86ea4be1fc305eac61496c2a109b7d0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 25 Sep 2008 21:36:20 +0000 Subject: [PATCH] Add more queue macros git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@954 42af7a65-404d-4744-a932-0658087f49c3 --- include/queue.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/queue.h b/include/queue.h index 9e45672df3c..28874a5aeec 100644 --- a/include/queue.h +++ b/include/queue.h @@ -1,7 +1,7 @@ /************************************************************************ * queue.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -48,10 +48,17 @@ #define sq_init(q) do { (q)->head = NULL; (q)->tail = NULL; } while (0) #define dq_init(q) do { (q)->head = NULL; (q)->tail = NULL; } while (0) + #define sq_next(p) ((p)->flink) #define dq_next(p) ((p)->flink) #define dq_prev(p) ((p)->prev) +#define sq_empty(q) ((q)->head == NULL) +#define dq_empty(q) ((q)->head == NULL) + +#define sq_peek(q) ((q)->head) +#define dq_peek(q) ((q)->head) + /************************************************************************ * Global Type Declarations ************************************************************************/