Function

FwupdPluginversion_compare

since: 1.8.2

Declaration [src]

gint
fu_version_compare (
  const gchar* version_a,
  const gchar* version_b,
  FwupdVersionFormat fmt
)

Description [src]

Compares version numbers for sorting taking into account the version format if required.

Available since: 1.8.2

Parameters

version_a

Type: const gchar*

The semver release version, e.g. 1.2.3.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
version_b

Type: const gchar*

The semver release version, e.g. 1.2.3.1.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
fmt

Type: FwupdVersionFormat

A version format, e.g. FWUPD_VERSION_FORMAT_PLAIN.

Return value

Type: gint

-1 if a < b, +1 if a > b, 0 if they are equal, and G_MAXINT on error.