dpkg 1.21.11
pkg-queue.h
Go to the documentation of this file.
1/*
2 * libdpkg - Debian packaging suite library routines
3 * pkg-queue.h - primitives for pkg queue handling
4 *
5 * Copyright © 2010 Guillem Jover <guillem@debian.org>
6 *
7 * This is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef DPKG_PKG_QUEUE_H
22#define DPKG_PKG_QUEUE_H
23
24#include <dpkg/macros.h>
25#include <dpkg/pkg-list.h>
26
28
35struct pkg_queue {
36 struct pkg_list *head, *tail;
37 int length;
38};
39
43#define PKG_QUEUE_INIT \
44 { .head = NULL, .tail = NULL, .length = 0 }
45
49#define PKG_QUEUE_OBJECT \
50 (struct pkg_queue)PKG_QUEUE_INIT
51
52void pkg_queue_init(struct pkg_queue *queue);
53void pkg_queue_destroy(struct pkg_queue *queue);
54
55int pkg_queue_is_empty(struct pkg_queue *queue);
56
57struct pkg_list *pkg_queue_push(struct pkg_queue *queue, struct pkginfo *pkg);
58struct pkginfo *pkg_queue_pop(struct pkg_queue *queue);
59
63
64#endif /* DPKG_PKG_QUEUE_H */
#define DPKG_BEGIN_DECLS
Definition: macros.h:86
#define DPKG_END_DECLS
Definition: macros.h:87
struct pkginfo * pkg_queue_pop(struct pkg_queue *queue)
Pop a node containing pkginfo from the head of the queue.
Definition: pkg-queue.c:107
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.
Definition: pkg-queue.c:78
void pkg_queue_destroy(struct pkg_queue *queue)
Destroy a package queue.
Definition: pkg-queue.c:50
void pkg_queue_init(struct pkg_queue *queue)
Initialize a package queue.
Definition: pkg-queue.c:35
int pkg_queue_is_empty(struct pkg_queue *queue)
Check if a package queue is empty.
Definition: pkg-queue.c:64
Definition: pkg-list.h:34
struct pkginfo * pkg
Definition: pkg-list.h:36
Definition: pkg-queue.h:35
struct pkg_list * tail
Definition: pkg-queue.h:36
int length
Definition: pkg-queue.h:37
struct pkg_list * head
Definition: pkg-queue.h:36
Node describing an architecture package instance.
Definition: dpkg-db.h:198