dpkg 1.21.11
Data Structures | Macros | Functions
Package queues
Collaboration diagram for Package queues:

Data Structures

struct  pkg_queue
 

Macros

#define PKG_QUEUE_INIT    { .head = NULL, .tail = NULL, .length = 0 }
 Constant initializer for a package queue. More...
 
#define PKG_QUEUE_OBJECT    (struct pkg_queue)PKG_QUEUE_INIT
 Compound literal for a package queue. More...
 

Functions

void pkg_queue_init (struct pkg_queue *queue)
 Initialize a package queue. More...
 
void pkg_queue_destroy (struct pkg_queue *queue)
 Destroy a package queue. More...
 
int pkg_queue_is_empty (struct pkg_queue *queue)
 Check if a package queue is empty. More...
 
struct pkg_listpkg_queue_push (struct pkg_queue *queue, struct pkginfo *pkg)
 Push a new node containing pkginfo to the tail of the queue. More...
 
struct pkginfopkg_queue_pop (struct pkg_queue *queue)
 Pop a node containing pkginfo from the head of the queue. More...
 

Detailed Description

Macro Definition Documentation

◆ PKG_QUEUE_INIT

#define PKG_QUEUE_INIT    { .head = NULL, .tail = NULL, .length = 0 }

Constant initializer for a package queue.

◆ PKG_QUEUE_OBJECT

#define PKG_QUEUE_OBJECT    (struct pkg_queue)PKG_QUEUE_INIT

Compound literal for a package queue.

Function Documentation

◆ pkg_queue_destroy()

void pkg_queue_destroy ( struct pkg_queue queue)

Destroy a package queue.

It frees the contained package list and resets the queue members.

Parameters
queueThe queue to destroy.

◆ pkg_queue_init()

void pkg_queue_init ( struct pkg_queue queue)

Initialize a package queue.

Parameters
queueThe queue to initialize.

◆ pkg_queue_is_empty()

int pkg_queue_is_empty ( struct pkg_queue queue)

Check if a package queue is empty.

Parameters
queueThe queue to check.
Returns
A boolean value.

Referenced by trigproc_run_deferred().

Here is the caller graph for this function:

◆ pkg_queue_pop()

struct pkginfo * pkg_queue_pop ( struct pkg_queue queue)

Pop a node containing pkginfo from the head of the queue.

This removes and frees the node from the queue, effectively reducing its size.

Parameters
queueThe queue to remove from.
Returns
The pkginfo from the removed node, or NULL if the queue was empty.

◆ pkg_queue_push()

struct pkg_list * pkg_queue_push ( struct pkg_queue queue,
struct pkginfo pkg 
)

Push a new node containing pkginfo to the tail of the queue.

Parameters
queueThe queue to insert to.
pkgThe package to use fo the new node.
Returns
The newly inserted pkg_list node.

Referenced by enqueue_conflictor(), and enqueue_package().

Here is the caller graph for this function: