.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH STRVERSCMP 3 2017-03-13 "GNU" "Linux Programmer's Manual"
+.TH STRVERSCMP 3 2017-09-15 "GNU" "Linux Programmer's Manual"
.SH NAME
strverscmp \- compare two version strings
.SH SYNOPSIS
.nf
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
-.br
.B #include <string.h>
-.sp
+.PP
.BI "int strverscmp(const char *" s1 ", const char *" s2 );
.fi
.SH DESCRIPTION
.BR versionsort (3),
which again uses
.BR strverscmp ().
-
+.PP
Thus, the task of
.BR strverscmp ()
is to compare two strings and find the "right" order, while
.BR LC_COLLATE ,
so is meant mostly for situations
where the strings are expected to be in ASCII.
-
+.PP
What this function does is the following.
If both strings are equal, return 0.
Otherwise, find the position
.BR strverscmp ()
to compare the two strings given as its command-line arguments.
An example of its use is the following:
-
-.in
+.PP
.in +4n
-.nf
-$ i\fB./a.out jan1 jan10\fP
+.EX
+$ \fB./a.out jan1 jan10\fP
jan1 < jan10
-.fi
+.EE
.in
.SS Program source
\&
-.nf
+.EX
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR rename (1),
.BR strcasecmp (3),