CIRCLEQ_EMPTY - Linux


Overview

CIRCLEQ_EMPTY tests if the circular queue is empty. It returns 1 (true) if the queue is empty and 0 (false) if the queue is not empty.

Syntax

#include <sys/queue.h>

int CIRCLEQ_EMPTY(struct circlequeue *head);

Options/Flags

None.

Examples

#include <sys/queue.h>

struct circlequeue head;

if (CIRCLEQ_EMPTY(&head)) {
    // The queue is empty.
} else {
    // The queue is not empty.
}

Common Issues

None.

Integration

CIRCLEQ_EMPTY can be used with other circular queue operations, such as CIRCLEQ_INSERT_HEAD() and CIRCLEQ_REMOVE_HEAD(), to manage circular queues.

Related Commands

  • CIRCLEQ_INSERT_HEAD()
  • CIRCLEQ_REMOVE_HEAD()
  • CIRCLEQ_FIRST()
  • CIRCLEQ_LAST()