The versionrevision structure is used to store a Debian version
specification
2.2 Functions
2.2.1 Parsing translation tables
Each of these tables is used to associate a set of strings with a corresponding
set of integers. Current tables are:
const struct namevalue booleaninfos[];
Maps boolean strings ("yes","no") to
their binary values.
2.2.1.1 priorityinfos[]
const struct namevalue priorityinfos[];
Maps priority strings to and from values of type enum pkgpriority.
Current priority values are:
required - required
important - important
standard - standard
recommended - recommended
optional - optional
extra - extra
contrib - contrib
other - other
unknown - unknown
base - This is obsolete, but is accepted as an alias for
required.
2.2.1.2 statusinfos[]
const struct namevalue statusinfos[];
Maps package status strings to values of type enum ???. Package
status strings are: "not-installed" "unpacked"
"half-configured" "installed" "half-installed"
"config-files" "postinst-failed" "removal-failed"
2.2.1.3 eflaginfos[]
const struct namevalue eflaginfos[];
2.2.1.4 wantinfos[]
const struct namevalue wantinfos[];
2.2.1.5 nicknames[]
const struct nickname nicknames[];
Maps obsolete control fields to their current versions.
2.2.2 Parsing functions
2.2.2.1 parseerr()
void parseerr
(FILE *file, const char *filename, int lno,
FILE *warnto, int *warncount, const struct pkginfo *pigp,
int warnonly, const char *fmt, ...);
Report an error parsing a control data stream. Checks file for
error status on file, printing an error message to stderr and
exiting with error status if an error is present on the stream. Formats the
variable arguments according to the printf-style string in
fmt, preceding the result with filename, lno,
and pigp (if not NULL). If warnonly is 0, writes the
result to stderr and exits with error status. Otherwise, increments
warncount and returns normally.
2.2.2.2 illegal_packagename()
const char *illegal_packagename (const char *p, const char **ep)
Checks the package name at p for proper syntax. Returns NULL in
case of success, setting *ep to point after the last character in
the package name, including any trailing whitespace (as defined by isspace()).
In case of error, returns the error message as a pointer to a static buffer.
2.2.2.3 informativeversion()
int informativeversion(const struct versionrevision *version)
Returns true if and only if the versionrevision is non-empty;
otherwise returns false.
Return a human-readable representation of version as a pointer to a
static buffer. If the version structure is empty, return
"<none>". Static buffers are allocated from a set of
10 in round-robin fashion (they will be re-used after 10 successive calls to
versiondescribe).