STRVERSCMP(3)

NAME
strverscmp - version string compare

SYNOPSIS

#define _GNU_SOURCE

#include <string.h>

int strverscmp(const char *a, const char *b);

DESCRIPTION

strverscmp compares the string at a to the string at b in a version-logical order.

RETURNS

If *a version-sorts after *b, strverscmp returns a number greater than zero. If the two strings match, strverscmp returns zero. If *a version-sorts before *b, strverscmp returns a number less than zero.

PORTABILITY

strverscmp is a GNU extension.

strverscmp requires no supporting OS subroutines. It uses isdigit() from elsewhere in this library.