*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: strverscmp | Section: 3 | Source: FreeBSD | File: strverscmp.3.gz
STRVERSCMP(3) FreeBSD Library Functions Manual STRVERSCMP(3) NAME strverscmp - compare strings according to natural order LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include <string.h> int strverscmp(const char *s1, const char *s2); DESCRIPTION The strverscmp() function compares the null-terminated strings s1 and s2 according to their natural order and returns an integer greater than, equal to, or less than 0, depending on whether s1 is greater than, equal to, or less than s2. More specifically, this natural order is found by iterating over both strings until a difference is found. If the difference is between non- decimal characters, strverscmp() acts like strcmp(3) (thus, the ordering would be "a", "b", "train"). If a decimal digit is found, the whole number is read and compared (thus, the ordering would be "9", "10", "420" which is different to lexicographic order, what strcmp(3) would have done). Numbers with leading zeroes are interpreted as fractional parts (even without a decimal point), and numbers with more leading zeroes are placed before numbers with fewer leading zeroes (thus, the ordering would be "000", "00", "01", "010", "09", "0", "1", "9", "10"). SEE ALSO strcmp(3), versionsort(3) STANDARDS The strverscmp() function is a GNU extension and conforms to no standard. HISTORY The strverscmp() function was added in FreeBSD 13.2. FreeBSD 14.1-RELEASE-p8 August 31, 2023 FreeBSD 14.1-RELEASE-p8

Navigation Options