|
Greenbone Vulnerability Management Libraries 22.32.0
|
Functions to handle version numbers / version strings. More...
#include "versionutils.h"#include <assert.h>#include <ctype.h>#include <errno.h>#include <glib.h>#include <string.h>

Go to the source code of this file.
Macros | |
| #define | G_LOG_DOMAIN "libgvm util" |
| GLib logging domain. | |
Functions | |
| static gchar * | prepare_version_string (const char *version) |
| Prepare the version string for comparison. | |
| static int | get_release_state (const char *version, int index) |
| Gets the release state of a specified part of the version string if any. | |
| static char * | get_part (const char *version, int index) |
| Gets the part of the version string that is specified by index. | |
| static gboolean | is_text (const char *part) |
| Checks if a given part of the version string is plain text. | |
| static char * | str_cpy (char *source, int size) |
| Copy size characters of a string to an newly allocated new string. | |
| int | cmp_versions (const char *version1, const char *version2) |
| Compare two version strings representing a software version to decide which version is newer. | |
Functions to handle version numbers / version strings.
Up to now this library provides a function to compare two version numbers / two version strings to decide which version is the newer one.
Definition in file versionutils.c.
| #define G_LOG_DOMAIN "libgvm util" |
GLib logging domain.
Definition at line 26 of file versionutils.c.
| int cmp_versions | ( | const char * | version1, |
| const char * | version2 ) |
Compare two version strings representing a software version to decide which version is newer.
| [in] | version1 | The first version string to compare. |
| [in] | version2 | The second version string to compare. |
Definition at line 57 of file versionutils.c.
References get_part(), get_release_state(), is_text(), and prepare_version_string().
Referenced by Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), and Ensure().


|
static |
Gets the part of the version string that is specified by index.
| [in] | version | The version string to get the part from. |
| [in] | index | The part of the version string to return. |
Definition at line 311 of file versionutils.c.
References str_cpy().
Referenced by cmp_versions(), and get_release_state().


|
static |
Gets the release state of a specified part of the version string if any.
| [in] | version | The version string to get the release state from. |
| [in] | index | The part of the version string to check. |
Definition at line 279 of file versionutils.c.
References get_part().
Referenced by cmp_versions().


|
static |
Checks if a given part of the version string is plain text.
| [in] | part | The part of the version string to check. |
Definition at line 340 of file versionutils.c.
Referenced by cmp_versions().

|
static |
Prepare the version string for comparison.
| [in] | version | The version string to generate the prepared version string from. |
Definition at line 182 of file versionutils.c.
Referenced by cmp_versions().

|
static |
Copy size characters of a string to an newly allocated new string.
| [in] | src | The string the first size characters are to be copied from. |
| [in] | size | The number of characters to copy. |
Definition at line 363 of file versionutils.c.
Referenced by get_part().
