rpm  4.5
Data Structures | Macros | Functions | Variables
rpmevr.c File Reference
#include "system.h"
#include <rpmio.h>
#include <rpmevr.h>
#include "debug.h"
Include dependency graph for rpmevr.c:

Go to the source code of this file.

Data Structures

struct  EVRop_s
 

Macros

#define _RPMEVR_INTERNAL
 
#define MAX(x, y)   ( ((x)>(y))?(x):(y) )
 

Functions

static int xisrpmalpha (int c)
 Return rpm's analogue of xisalpha. More...
 
int rpmEVRcmp (const char *a, const char *b)
 Segmented string compare. More...
 
int rpmEVRparse (const char *evrstr, EVR_t evr)
 Split EVR string into epoch, version, and release components. More...
 
static int compare_values (const char *a, const char *b)
 Dressed rpmEVRcmp, handling missing values. More...
 
int rpmEVRcompare (const EVR_t a, const EVR_t b)
 Compare EVR containers. More...
 
rpmsenseFlags rpmEVRflags (const char *op, const char **end)
 Return comparison operator sense flags. More...
 

Variables

int _rpmevr_debug = 0
 
static int _invert_digits_alphas_comparison = -1
 
static const char * _rpmnotalpha = ".:-"
 
int(* rpmvercmp )(const char *a, const char *b) = rpmEVRcmp
 Segmented string compare vector. More...
 
static struct EVRop_s cops []
 

Macro Definition Documentation

#define _RPMEVR_INTERNAL

Definition at line 8 of file rpmevr.c.

#define MAX (   x,
 
)    ( ((x)>(y))?(x):(y) )

Definition at line 17 of file rpmevr.c.

Referenced by rpmEVRcmp().

Function Documentation

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

Dressed rpmEVRcmp, handling missing values.

Parameters
a1st string
b2nd string
Returns
+1 if a is "newer", 0 if equal, -1 if b is "newer"

Definition at line 139 of file rpmevr.c.

References rpmvercmp.

Referenced by rpmEVRcompare().

rpmsenseFlags rpmEVRflags ( const char *  op,
const char **  end 
)

Return comparison operator sense flags.

Parameters
opoperator string (NULL or "" uses RPMSENSE_EQUAL)
*endpointer to 1st character after operator (or NULL)
Returns
sense flags

Definition at line 184 of file rpmevr.c.

References cops, EVRop_s::operator, RPMSENSE_EQUAL, and EVRop_s::sense.

Referenced by parseRCPOT(), rpmdsPipe(), and rpmdsSysinfoFile().

static int xisrpmalpha ( int  c)
inlinestatic

Return rpm's analogue of xisalpha.

Parameters
ccharacter to test
Returns
is this an alpha character?

Definition at line 38 of file rpmevr.c.

References _rpmnotalpha, xisalpha(), and xispunct().

Referenced by rpmEVRcmp().

Variable Documentation

int _invert_digits_alphas_comparison = -1
static

Definition at line 26 of file rpmevr.c.

Referenced by rpmEVRcmp().

int _rpmevr_debug = 0

Definition at line 14 of file rpmevr.c.

const char* _rpmnotalpha = ".:-"
static

Definition at line 31 of file rpmevr.c.

Referenced by xisrpmalpha().

struct EVRop_s cops[]
static
Initial value:
= {
{ "==", RPMSENSE_EQUAL},
{ "!=", (RPMSENSE_EQUAL ^ 0x0e ) },
{ "<", RPMSENSE_LESS},
{ "=", RPMSENSE_EQUAL},
{ NULL, 0 },
}

Referenced by rpmEVRflags().