Debian Codegraph @

lib/version.h

raw
1 /* dctrl-tools - Debian control file inspection tools
2 Copyright © 2005 Antti-Juhani Kaijanaho
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 // Marked portions of this file are covered by the following
20 // copyright:
21 /*
22 * libdpkg - Debian packaging suite library routines
23 * vercmp.c - comparison of version numbers
24 *
25 * Copyright © 1995 Ian Jackson <[email protected]>
26 *
27 * This is free software; you can redistribute it and/or modify
28 * it under the terms of the GNU General Public License as
29 * published by the Free Software Foundation; either version 2,
30 * or (at your option) any later version.
31 *
32 * This is distributed in the hope that it will be useful, but
33 * WITHOUT ANY WARRANTY; without even the implied warranty of
34 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 * GNU General Public License for more details.
36 *
37 * You should have received a copy of the GNU General Public License along
38 * with this program; if not, write to the Free Software Foundation, Inc.,
39 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
40 */
41
42 #ifndef VERSION_H
43 #define VERSION_H
44
45 #include <stdbool.h>
46 #include <stddef.h>
47
48 struct versionrevision { // from dpkg
49 unsigned long epoch;
50 char *version;
51 char *revision;
52 };
53
54 // from dpkg
55 int versioncompare(const struct versionrevision *version,
56 const struct versionrevision *refversion);
57
58 /* warning: modifies ver by adding nul chars; return pointers point
59 * inside ver. */
60 bool parse_version(struct versionrevision *rv, char *ver, size_t len);
61
62 #endif /* VERSION_H */