#include "system.h"
#include <rpmio_internal.h>
#include <rpmmacro.h>
#include <argv.h>
#include <rpmtag.h>
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | _RPMTAG_INTERNAL |
Functions | |
static int | tagLoadATags (ARGV_t *argvp, int(*cmp)(const void *avp, const void *bvp)) |
Load/sort arbitrary tags. | |
static int | tagCmpName (const void *avp, const void *bvp) |
Compare tag table entries by name. | |
static int | tagCmpValue (const void *avp, const void *bvp) |
Compare tag table entries by value. | |
static int | tagLoadIndex (headerTagTableEntry **ipp, size_t *np, int(*cmp)(const void *avp, const void *bvp)) |
Load/sort a tag index. | |
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. | |
unsigned int | tagType (rpmTag tag) |
Return tag data type from value. | |
rpmTag | tagValue (const char *tagstr) |
Return tag value from name. | |
char * | tagCanonicalize (const char *s) |
Canonicalize a rpmTag string. | |
rpmTag | tagGenerate (const char *s) |
Generate a tag from arbitrary string. | |
void | tagClean (headerTagIndices _rpmTags) |
Free memory in header tag indices. | |
tagStore_t | tagStoreFree (tagStore_t dbiTags, size_t dbiNTags) |
Destroy tagStore array. | |
Variables | |
static struct headerTagIndices_s | _rpmTags |
headerTagIndices | rpmTags = &_rpmTags |
Definition in file tagname.c.
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] |
Definition at line 183 of file tagname.c.
References _free(), RPMDBI_ADDED, RPMDBI_ARGLIST, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_FTSWALK, RPMDBI_HDLIST, RPMDBI_PACKAGES, RPMDBI_REMOVED, RPMTAG_CONFLICTS, RPMTAG_HDRID, snprintf(), tagCmpValue(), tagLoadATags(), tagLoadIndex(), and xcalloc().
static unsigned int _tagType | ( | rpmTag | tag | ) | [static] |
Definition at line 279 of file tagname.c.
References RPMDBI_ADDED, RPMDBI_ARGLIST, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_FTSWALK, RPMDBI_HDLIST, RPMDBI_PACKAGES, RPMDBI_REMOVED, tagCmpValue(), tagLoadATags(), and tagLoadIndex().
static rpmTag _tagValue | ( | const char * | tagstr | ) | [static] |
Definition at line 330 of file tagname.c.
References _free(), _tagCanonicalize(), _tagGenerate(), RPMDBI_ADDED, RPMDBI_ARGLIST, RPMDBI_AVAILABLE, RPMDBI_DEPENDS, RPMDBI_FTSWALK, RPMDBI_HDLIST, RPMDBI_PACKAGES, RPMDBI_REMOVED, tagCmpName(), tagLoadATags(), tagLoadIndex(), and xstrcasecmp().
char* tagCanonicalize | ( | const char * | s | ) |
Canonicalize a rpmTag string.
s | string |
Definition at line 406 of file tagname.c.
Referenced by fillOutMainPackage(), findPreambleTag(), and isPart().
void tagClean | ( | headerTagIndices | _rpmTags | ) |
Free memory in header tag indices.
_rpmTags | header tag indices (NULL uses rpmTags) |
Definition at line 416 of file tagname.c.
References _free(), and argvFree().
Referenced by rpmcliFini().
static int tagCmpName | ( | const void * | avp, | |
const void * | bvp | |||
) | [static] |
Compare tag table entries by name.
*avp | tag table entry a | |
*bvp | tag table entry b |
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.
*avp | tag table entry a | |
*bvp | tag table entry b |
Definition at line 67 of file tagname.c.
Referenced by _tagName(), and _tagType().
rpmTag tagGenerate | ( | const char * | s | ) |
Generate a tag from arbitrary string.
s | string |
Definition at line 411 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.
*argvp | arbitrary tag array |
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.
*ipp | tag index | |
*np | no. of tags |
cmp | sort compare routine |
Definition at line 86 of file tagname.c.
References rpmTagTable, rpmTagTableSize, and xcalloc().
Referenced by _tagName(), _tagType(), and _tagValue().
const char* tagName | ( | rpmTag | tag | ) |
Return tag name from value.
tag | tag value |
Definition at line 391 of file tagname.c.
Referenced by checkForDuplicates(), checkForRequired(), dbiFindMatches(), dbiOpen(), findPreambleTag(), handlePreambleTag(), headerGet(), i18nTag(), isPart(), mapTagName(), miFreeHeader(), myTagName(), printNewSpecfile(), rpmdbAdd(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbGrowIterator(), rpmdbInitIterator(), rpmdbMoveDatabase(), rpmdbRemove(), rpmdbRemoveDatabase(), rpmdsMergePRCO(), rpmdsTagName(), rpmfcMergePR(), rpmgiInitFilter(), rpmgiNext(), sql_copen(), sql_initDB(), sql_open(), stashSt(), XrpmgiLink(), and XrpmgiUnlink().
tagStore_t tagStoreFree | ( | tagStore_t | dbiTags, | |
size_t | dbiNTags | |||
) |
Destroy tagStore array.
dbiTags | dbi tag storage | |
dbiNTags | no. of dbi tags |
Definition at line 428 of file tagname.c.
References _free(), and freeStringBuf().
Referenced by dbiTagsInit(), freeSpec(), rpmdbClose(), and rpmdbRebuild().
unsigned int tagType | ( | rpmTag | tag | ) |
Return tag data type from value.
tag | tag value |
Definition at line 396 of file tagname.c.
Referenced by myTagName(), sql_bind_key(), sql_copen(), and sql_initDB().
rpmTag tagValue | ( | const char * | tagstr | ) |
Return tag value from name.
tagstr | name of tag |
Definition at line 401 of file tagname.c.
Referenced by dbiTagsInit(), initSourceHeader(), myTagValue(), rpmDisplayQueryTags(), rpmdsSysinfo(), and rpmgiInitFilter().
struct headerTagIndices_s _rpmTags [static] |
{ tagLoadIndex, NULL, 0, tagCmpName, _tagValue, NULL, 0, tagCmpValue, _tagName, _tagType, 256, NULL, NULL, _tagCanonicalize, _tagGenerate }
Definition at line 179 of file tagname.c.
Referenced by findPreambleTag(), and isPart().