22#ifndef LIBDPKG_VERSION_H
23#define LIBDPKG_VERSION_H
54#define DPKG_VERSION_OBJECT(e, v, r) \
55 (struct dpkg_version){ .epoch = (e), .version = (v), .revision = (r) }
57#define DPKG_VERSION_INIT \
58 DPKG_VERSION_OBJECT(0, NULL, NULL)
#define DPKG_BEGIN_DECLS
Definition: macros.h:86
#define DPKG_END_DECLS
Definition: macros.h:87
#define DPKG_BIT(n)
Return the integer value of bit n.
Definition: macros.h:125
void dpkg_version_blank(struct dpkg_version *version)
Turn the passed version into an empty version.
Definition: version.c:38
int dpkg_version_compare(const struct dpkg_version *a, const struct dpkg_version *b)
Compares two Debian versions.
Definition: version.c:140
bool dpkg_version_is_informative(const struct dpkg_version *version)
Test if a version is not empty.
Definition: version.c:54
dpkg_relation
Enum constants for the supported relation operations that can be done on Debian versions.
Definition: version.h:64
bool dpkg_version_relate(const struct dpkg_version *a, enum dpkg_relation rel, const struct dpkg_version *b)
Check if two versions have a certain relation.
Definition: version.c:172
@ DPKG_RELATION_LT
Less than relation (‘<<’).
Definition: version.h:70
@ DPKG_RELATION_EQ
Equality relation (‘=’).
Definition: version.h:68
@ DPKG_RELATION_NONE
The “none” relation, sentinel value.
Definition: version.h:66
@ DPKG_RELATION_GE
Greater than or equal to relation (‘>=’).
Definition: version.h:76
@ DPKG_RELATION_GT
Greater than relation (‘>>’).
Definition: version.h:74
@ DPKG_RELATION_LE
Less than or equal to relation (‘<=’).
Definition: version.h:72
Data structure representing a Debian version.
Definition: version.h:42
unsigned int epoch
The epoch.
Definition: version.h:44
const char * version
The upstream part of the version.
Definition: version.h:46
const char * revision
The Debian revision part of the version.
Definition: version.h:48