From 0611aea043269d0e3dad7090b590b196aa378382 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 28 Oct 2009 11:10:22 -0700 Subject: [PATCH] queue: New function queue_is_empty(). --- lib/queue.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/queue.h b/lib/queue.h index e94d20c4..879f7a2d 100644 --- a/lib/queue.h +++ b/lib/queue.h @@ -17,6 +17,8 @@ #ifndef QUEUE_H #define QUEUE_H 1 +#include + /* Packet queue. */ struct ovs_queue { int n; /* Number of queued packets. */ @@ -31,4 +33,9 @@ void queue_advance_head(struct ovs_queue *, struct ofpbuf *next); void queue_push_tail(struct ovs_queue *, struct ofpbuf *); struct ofpbuf *queue_pop_head(struct ovs_queue *); +static inline bool queue_is_empty(const struct ovs_queue *q) +{ + return q->n == 0; +} + #endif /* queue.h */ -- 2.30.2