rpm  5.2.1
Macros | Functions | Variables
tagname.c File Reference
#include "system.h"
#include <rpmio_internal.h>
#include <rpmmacro.h>
#include <argv.h>
#include <rpmtag.h>
#include "debug.h"
Include dependency graph for tagname.c:

Go to the source code of this file.

Macros

#define _RPMTAG_INTERNAL
 

Functions

static int tagLoadATags (ARGV_t *argvp, int(*cmp)(const void *avp, const void *bvp))
 Load/sort arbitrary tags. More...
 
static int tagCmpName (const void *avp, const void *bvp)
 Compare tag table entries by name. More...
 
static int tagCmpValue (const void *avp, const void *bvp)
 Compare tag table entries by value. More...
 
static int tagLoadIndex (headerTagTableEntry **ipp, size_t *np, int(*cmp)(const void *avp, const void *bvp))
 Load/sort a tag index. More...
 
static char * _tagCanonicalize (const char *s)
 
static rpmTag _tagGenerate (const char *s)
 
static const char * _tagName (rpmTag tag)
 
static unsigned int _tagType (rpmTag tag)
 
static rpmTag _tagValue (const char *tagstr)
 
const char * tagName (rpmTag tag)
 Return tag name from value. More...
 
unsigned int tagType (rpmTag tag)
 Return tag data type from value. More...
 
rpmTag tagValue (const char *tagstr)
 Return tag value from name. More...
 
char * tagCanonicalize (const char *s)
 Canonicalize a rpmTag string. More...
 
rpmTag tagGenerate (const char *s)
 Generate a tag from arbitrary string. More...
 
void tagClean (headerTagIndices _rpmTags)
 Free memory in header tag indices. More...
 
tagStore_t tagStoreFree (tagStore_t dbiTags, size_t dbiNTags)
 Destroy tagStore array. More...
 

Variables

static struct headerTagIndices_s _rpmTags
 
headerTagIndices rpmTags = &_rpmTags
 

Macro Definition Documentation

#define _RPMTAG_INTERNAL

Definition at line 10 of file tagname.c.

Function Documentation

static char* _tagCanonicalize ( const char *  s)
static

Definition at line 110 of file tagname.c.

References xisalnum(), xmalloc(), xtolower(), and xtoupper().

Referenced by _tagValue().

static rpmTag _tagGenerate ( const char *  s)
static

Definition at line 137 of file tagname.c.

References _free(), PGPHASHALGO_SHA1, RPMDIGEST_NONE, rpmDigestFinal(), rpmDigestInit(), and rpmDigestUpdate().

Referenced by _tagValue().

static const char * _tagName ( rpmTag  tag)
static
static unsigned int _tagType ( rpmTag  tag)
static
static rpmTag _tagValue ( const char *  tagstr)
static
char* tagCanonicalize ( const char *  s)

Canonicalize a rpmTag string.

Parameters
sstring
Returns
canonicalized string

Definition at line 410 of file tagname.c.

Referenced by fillOutMainPackage(), findPreambleTag(), and isPart().

void tagClean ( headerTagIndices  _rpmTags)

Free memory in header tag indices.

Parameters
_rpmTagsheader tag indices (NULL uses rpmTags)

Definition at line 420 of file tagname.c.

References _free(), argvFree(), and rpmTags.

Referenced by main(), and rpmcliFini().

static int tagCmpName ( const void *  avp,
const void *  bvp 
)
static

Compare tag table entries by name.

Parameters
*avptag table entry a
*bvptag table entry b
Returns
comparison

Definition at line 53 of file tagname.c.

Referenced by _tagValue().

static int tagCmpValue ( const void *  avp,
const void *  bvp 
)
static

Compare tag table entries by value.

Parameters
*avptag table entry a
*bvptag table entry b
Returns
comparison

Definition at line 67 of file tagname.c.

Referenced by _tagName(), and _tagType().

rpmTag tagGenerate ( const char *  s)

Generate a tag from arbitrary string.

Parameters
sstring
Returns
generated tag value

Definition at line 415 of file tagname.c.

Referenced by fillOutMainPackage(), findPreambleTag(), and isPart().

static int tagLoadATags ( ARGV_t argvp,
int(*)(const void *avp, const void *bvp)  cmp 
)
static

Load/sort arbitrary tags.

Return values
*argvparbitrary tag array
Returns
0 always

Definition at line 22 of file tagname.c.

References _free(), argvFree(), argvSort(), argvSplit(), rpmExpand(), and xcalloc().

Referenced by _tagName(), _tagType(), and _tagValue().

static int tagLoadIndex ( headerTagTableEntry **  ipp,
size_t *  np,
int(*)(const void *avp, const void *bvp)  cmp 
)
static

Load/sort a tag index.

Return values
*ipptag index
*npno. of tags
Parameters
cmpsort compare routine
Returns
0 always

Definition at line 86 of file tagname.c.

References rpmTagTable, rpmTagTableSize, and xcalloc().

Referenced by _tagName(), _tagType(), and _tagValue().

const char* tagName ( rpmTag  tag)
tagStore_t tagStoreFree ( tagStore_t  dbiTags,
size_t  dbiNTags 
)

Destroy tagStore array.

Parameters
dbiTagsdbi tag storage
dbiNTagsno. of dbi tags
Returns
NULL always

Definition at line 432 of file tagname.c.

References _free(), and rpmiobFree().

Referenced by dbiTagsInit(), freeSpec(), rpmdbClose(), and rpmdbRebuild().

unsigned int tagType ( rpmTag  tag)

Return tag data type from value.

Todo:
Return rpmTagType-like, not unsigned int. There's no clear typedef yet.
Parameters
tagtag value
Returns
tag data type, 0 on not found.

Definition at line 400 of file tagname.c.

Referenced by formatValue(), myTagName(), sql_bind_key(), sql_copen(), and sql_initDB().

rpmTag tagValue ( const char *  tagstr)

Return tag value from name.

Parameters
tagstrname of tag
Returns
tag value, 0xffffffff on not found

Definition at line 405 of file tagname.c.

Referenced by dbiTagsInit(), debconflictsTag(), debdependsTag(), debmd5sumsTag(), debobsoletesTag(), debprovidesTag(), doIcon(), filenamesTag(), findTag(), initSourceHeader(), initSourceHeaderScriptlets(), myTagValue(), rpmDisplayQueryTags(), rpmdsSysinfo(), rpmgiInitFilter(), and tagNumFromPyObject().

Variable Documentation

struct headerTagIndices_s _rpmTags
static
Initial value:

Definition at line 170 of file tagname.c.

Definition at line 179 of file tagname.c.

Referenced by findPreambleTag(), isPart(), and tagClean().