libalpm
Arch Linux Package Manager Library
version.c File Reference
#include <string.h>
#include <ctype.h>
#include "util.h"
Include dependency graph for version.c:

Functions

static void parseEVR (char *evr, const char **ep, const char **vp, const char **rp)
 Some functions in this file have been adopted from the rpm source, notably 'rpmvercmp' located at lib/rpmvercmp.c and 'parseEVR' located at lib/rpmds.c.
 
static int rpmvercmp (const char *a, const char *b)
 Compare alpha and numeric segments of two versions.
 
int alpm_pkg_vercmp (const char *a, const char *b)
 Compare two version strings and determine which one is 'newer'.
 

Function Documentation

◆ parseEVR()

static void parseEVR ( char * evr,
const char ** ep,
const char ** vp,
const char ** rp )
static

Some functions in this file have been adopted from the rpm source, notably 'rpmvercmp' located at lib/rpmvercmp.c and 'parseEVR' located at lib/rpmds.c.

It was most recently updated against rpm version 4.8.1. Small modifications have been made to make it more consistent with the libalpm coding style. Split EVR into epoch, version, and release components.

Parameters
evr[epoch:]version[-release] string
Return values
*eppointer to epoch
*vppointer to version
*rppointer to release

Referenced by alpm_pkg_vercmp().

◆ rpmvercmp()

static int rpmvercmp ( const char * a,
const char * b )
static

Compare alpha and numeric segments of two versions.

return 1: a is newer than b 0: a and b are the same version -1: b is newer than a

Referenced by alpm_pkg_vercmp().