2 .TH versioncmp 3 "6 January 2007" "Straylight/Edgeware" "mLib utilities library"
4 versioncmp \- compare Debian-format version numbers
8 .B "#include <mLib/versioncmp.h>"
10 .BI "int versioncmp(const char *" va ", const char *" vb ");"
15 function compares version strings.
17 The format of version numbers considered is
27 part may contain colons or hyphens if there is an
31 respectively. Version strings are compared componentwise: first epochs,
32 then main parts, and finally subparts.
34 The component comparison is done as follows. First, the initial
35 subsequence of nondigit characters is extracted from each string, and
36 these are compared lexicographically, using ASCII ordering, except that
37 letters precede non-letters. If both are the same, an initial sequence
38 of digits is extracted from the remaining parts of the version strings,
39 and these are compared numerically (an empty sequence being considered
40 to have the value zero). This process is repeated until we have a
41 winner or until both strings are exhausted.
43 The return value is 0 if the two strings are equal, \-1 if
54 .IR "Debian Policy Manual" .
56 Mark Wooding, <mdw@distorted.org.uk>