Greenbone Vulnerability Management Libraries: util/versionutils.h File Reference

Greenbone Vulnerability Management Libraries 23.1.2

Functions
versionutils.h File Reference

Headers for version utils. More...

`#include <glib.h>`
`#include <stdio.h>`

Go to the source code of this file.

## Functions
int | cmp_versions (const char *, const char *)
| Compare two version strings representing a software version to decide which version is newer.

## Detailed Description

Headers for version utils.

## Function Documentation

## ◆ cmp_versions()

int cmp_versions | ( | const char * | version1,
|  | const char * | version2 )

Compare two version strings representing a software version to decide which version is newer.

Parameters

  [in] | version1 | The first version string to compare.
  [in] | version2 | The second version string to compare.

Returns
  Returns a value > 0 if version1 is newer than version2. Returns 0 if version1 is the same than version2. Returns a value between -1 and -4 if version2 is newer than version1. Returns -5 if the result is undefined.