Root/qpkg/pkg.h

Source at commit 6a3e471304b939fa920adcf6f6a9ac31b22fd976 created 8 years 10 months ago.
By Werner Almesberger, qpkg: added some field names and relational operators from Ubuntu
1/*
2 * pkg.h - Package structure and operations
3 *
4 * Written 2010 by Werner Almesberger
5 * Copyright 2010 Werner Almesberger
6 *
7 * This program 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
13#ifndef PKG_H
14#define PKG_H
15
16#include "jrb.h"
17
18#include "id.h"
19
20
21enum flags {
22    /* parse-time and fixup-time flags */
23    QPKG_INSTALLED = 1 << 0, /* installed on target */
24    QPKG_PROVIDED = 1 << 1, /* virtual package */
25
26    /* run-time flags */
27    QPKG_ADDING = 1 << 10, /* resolving dependencies */
28};
29
30enum relop {
31    rel_eq, /* = */
32    rel_ge, /* >= */
33    rel_gg, /* >> */
34    rel_lt, /* < */
35    rel_le, /* <= */
36    rel_ll, /* << */
37};
38
39struct pkg;
40
41struct ref {
42    struct id *pkg;
43    struct id *version;
44    enum relop relop; /* undefined if version == NULL */
45    struct ref *next;
46};
47
48struct pkg {
49    struct id *id;
50    struct id *version;
51    const char *arch;
52    struct ref *conflicts;
53    struct ref *depends;
54    struct ref *provides;
55    const char *filename;
56    int flags; /* see enum flags */
57    struct pkg *more;
58    int mark;
59};
60
61
62struct pkg *new_pkg(struct jrb *jrb);
63void free_pkg(struct pkg *pkg);
64
65#endif /* !PKG_H */
66

Archive Download this file

Branches:
master



interactive