summaryrefslogtreecommitdiff
path: root/rpmdb
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-09-20 15:09:52 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-09-20 15:09:52 +0300
commit3b8da4ed118c6da6dab1cb7c0ecd0933c6d14f14 (patch)
treef1e29034af384acc2a63ab7cd5e7fcf423c6d6a5 /rpmdb
parentbbf7574d7f368e8d11600b54dfd24a0dafd555fb (diff)
downloadrpm-3b8da4ed118c6da6dab1cb7c0ecd0933c6d14f14.tar.gz
rpm-3b8da4ed118c6da6dab1cb7c0ecd0933c6d14f14.tar.bz2
rpm-3b8da4ed118c6da6dab1cb7c0ecd0933c6d14f14.zip
Rename tagName/Value/Type() to rpmTagGet*()
- namespacing - avoid collisions with tagtype definitions
Diffstat (limited to 'rpmdb')
-rw-r--r--rpmdb/db3.c16
-rw-r--r--rpmdb/dbconfig.c2
-rw-r--r--rpmdb/rpmdb.c44
-rw-r--r--rpmdb/sqlite.c10
4 files changed, 36 insertions, 36 deletions
diff --git a/rpmdb/db3.c b/rpmdb/db3.c
index e0231862c..92d23af02 100644
--- a/rpmdb/db3.c
+++ b/rpmdb/db3.c
@@ -663,9 +663,9 @@ static int db3close(dbiIndex dbi, unsigned int flags)
} else {
#ifdef HACK /* XXX necessary to support dbsubfile */
dbfile = (dbi->dbi_file ? dbi->dbi_file : db3basename);
- dbsubfile = (dbi->dbi_subfile ? dbi->dbi_subfile : tagName(dbi->dbi_rpmtag));
+ dbsubfile = (dbi->dbi_subfile ? dbi->dbi_subfile : rpmTagGetName(dbi->dbi_rpmtag));
#else
- dbfile = (dbi->dbi_file ? dbi->dbi_file : tagName(dbi->dbi_rpmtag));
+ dbfile = (dbi->dbi_file ? dbi->dbi_file : rpmTagGetName(dbi->dbi_rpmtag));
dbsubfile = NULL;
#endif
}
@@ -678,7 +678,7 @@ static int db3close(dbiIndex dbi, unsigned int flags)
db = dbi->dbi_db = NULL;
rpmMessage(RPMMESS_DEBUG, _("closed db index %s/%s\n"),
- dbhome, (dbfile ? dbfile : tagName(dbi->dbi_rpmtag)));
+ dbhome, (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag)));
}
@@ -736,7 +736,7 @@ static int db3close(dbiIndex dbi, unsigned int flags)
rpmMessage(RPMMESS_DEBUG, _("verified db index %s/%s\n"),
(dbhome ? dbhome : ""),
- (dbfile ? dbfile : tagName(dbi->dbi_rpmtag)));
+ (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag)));
/*
* The DB handle may not be accessed again after
@@ -809,9 +809,9 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
} else {
#ifdef HACK /* XXX necessary to support dbsubfile */
dbfile = (dbi->dbi_file ? dbi->dbi_file : db3basename);
- dbsubfile = (dbi->dbi_subfile ? dbi->dbi_subfile : tagName(dbi->dbi_rpmtag));
+ dbsubfile = (dbi->dbi_subfile ? dbi->dbi_subfile : rpmTagGetName(dbi->dbi_rpmtag));
#else
- dbfile = (dbi->dbi_file ? dbi->dbi_file : tagName(dbi->dbi_rpmtag));
+ dbfile = (dbi->dbi_file ? dbi->dbi_file : rpmTagGetName(dbi->dbi_rpmtag));
dbsubfile = NULL;
#endif
}
@@ -906,7 +906,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
*/
if ((oflags & DB_CREATE) && (oflags & DB_RDONLY)) {
/* dbhome is writable, and DB->open flags may conflict. */
- const char * dbfn = (dbfile ? dbfile : tagName(dbi->dbi_rpmtag));
+ const char * dbfn = (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag));
const char * dbf = rpmGetPath(dbhome, "/", dbfn, NULL);
if (access(dbf, F_OK) == -1) {
@@ -946,7 +946,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
}
rpmMessage(RPMMESS_DEBUG, _("opening db index %s/%s %s mode=0x%x\n"),
- dbhome, (dbfile ? dbfile : tagName(dbi->dbi_rpmtag)),
+ dbhome, (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag)),
prDbiOpenFlags(oflags, 0), dbi->dbi_mode);
if (rc == 0) {
diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c
index 63ec6941a..93ad1e817 100644
--- a/rpmdb/dbconfig.c
+++ b/rpmdb/dbconfig.c
@@ -267,7 +267,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
char dbiTagMacro[128];
char * dbOpts;
- sprintf(dbiTagMacro, "%%{_dbi_config_%s}", tagName(rpmtag));
+ sprintf(dbiTagMacro, "%%{_dbi_config_%s}", rpmTagGetName(rpmtag));
dbOpts = rpmExpand(dbiTagMacro, NULL);
if (!(dbOpts && *dbOpts && *dbOpts != '%')) {
dbOpts = _free(dbOpts);
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index 8f5182c23..7f2ded765 100644
--- a/rpmdb/rpmdb.c
+++ b/rpmdb/rpmdb.c
@@ -168,7 +168,7 @@ static void dbiTagsInit(void)
}
if (oe && *oe)
*oe++ = '\0';
- rpmtag = tagValue(o);
+ rpmtag = rpmTagGetValue(o);
if (rpmtag < 0) {
rpmMessage(RPMMESS_WARNING,
_("dbiTagsInit: unrecognized tag name: \"%s\" ignored\n"), o);
@@ -245,7 +245,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags)
if (!_printed[dbix & 0x1f]++)
rpmError(RPMERR_DBOPEN,
_("cannot open %s index using db%d - %s (%d)\n"),
- tagName(rpmtag), _dbapi,
+ rpmTagGetName(rpmtag), _dbapi,
(rc > 0 ? strerror(rc) : ""), rc);
_dbapi = -1;
}
@@ -265,7 +265,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags)
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
rpmError(RPMERR_DBOPEN, _("cannot open %s index\n"),
- tagName(rpmtag));
+ rpmTagGetName(rpmtag));
rc = 1;
goto exit;
}
@@ -1138,7 +1138,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
if (rc > 0) {
rpmError(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
}
if (rc == 0)
@@ -1263,7 +1263,7 @@ key->size = strlen(name);
} else { /* error */
rpmError(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
rc = -1;
}
@@ -1313,7 +1313,7 @@ key->size = strlen(name);
} else { /* error */
rpmError(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
return RPMRC_FAIL;
}
@@ -1498,7 +1498,7 @@ static int miFreeHeader(rpmdbMatchIterator mi, dbiIndex dbi)
if (rc) {
rpmError(RPMERR_DBPUTINDEX,
_("error(%d) storing record #%d into %s\n"),
- rc, mi->mi_prevoffset, tagName(dbi->dbi_rpmtag));
+ rc, mi->mi_prevoffset, rpmTagGetName(dbi->dbi_rpmtag));
}
xx = dbiSync(dbi, 0);
(void) unblockSignals(dbi->dbi_rpmdb, &signalMask);
@@ -1925,7 +1925,7 @@ static int mireSkip (const rpmdbMatchIterator mi)
break;
}
- if ((tagType(mire->tag) & RPM_MASK_RETURN_TYPE) ==
+ if ((rpmTagGetType(mire->tag) & RPM_MASK_RETURN_TYPE) ==
RPM_ARRAY_RETURN_TYPE) {
u.ptr = hfd(u.ptr, t);
}
@@ -2217,7 +2217,7 @@ static int rpmdbGrowIterator(rpmdbMatchIterator mi, int fpNum)
if (rc != DB_NOTFOUND)
rpmError(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
#ifdef SQLITE_HACK
xx = dbiCclose(dbi, dbcursor, 0);
dbcursor = NULL;
@@ -2336,7 +2336,7 @@ if (key->data && key->size == 0) key->size++; /* XXX "/" fixup. */
if (rc > 0) {
rpmError(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
- rc, (key->data ? key->data : "???"), tagName(dbi->dbi_rpmtag));
+ rc, (key->data ? key->data : "???"), rpmTagGetName(dbi->dbi_rpmtag));
}
/* Join keys need to be native endian internally. */
@@ -2495,7 +2495,7 @@ if (dbiByteSwapped(dbi) == 1)
if (rc) {
rpmError(RPMERR_DBGETINDEX,
_("error(%d) setting header #%d record for %s removal\n"),
- rc, hdrNum, tagName(dbi->dbi_rpmtag));
+ rc, hdrNum, rpmTagGetName(dbi->dbi_rpmtag));
} else
rc = dbiDel(dbi, dbcursor, key, data, 0);
xx = dbiCclose(dbi, dbcursor, DB_WRITECURSOR);
@@ -2602,11 +2602,11 @@ if (dbiByteSwapped(dbi) == 1)
if (rpmcnt == 1 && stringvalued) {
rpmMessage(RPMMESS_DEBUG,
_("removing \"%s\" from %s index.\n"),
- (char *)key->data, tagName(dbi->dbi_rpmtag));
+ (char *)key->data, rpmTagGetName(dbi->dbi_rpmtag));
} else {
rpmMessage(RPMMESS_DEBUG,
_("removing %d entries from %s index.\n"),
- rpmcnt, tagName(dbi->dbi_rpmtag));
+ rpmcnt, rpmTagGetName(dbi->dbi_rpmtag));
}
printed++;
}
@@ -2633,7 +2633,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
} else { /* error */
rpmError(RPMERR_DBGETINDEX,
_("error(%d) setting \"%s\" records from %s index\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
continue;
}
@@ -2652,7 +2652,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
if (rc) {
rpmError(RPMERR_DBPUTINDEX,
_("error(%d) storing record \"%s\" into %s\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
}
data->data = _free(data->data);
@@ -2662,7 +2662,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
if (rc) {
rpmError(RPMERR_DBPUTINDEX,
_("error(%d) removing record \"%s\" from %s\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
}
}
@@ -3024,11 +3024,11 @@ data->size = 0;
if (rpmcnt == 1 && stringvalued) {
rpmMessage(RPMMESS_DEBUG,
_("adding \"%s\" to %s index.\n"),
- (char *)key->data, tagName(dbi->dbi_rpmtag));
+ (char *)key->data, rpmTagGetName(dbi->dbi_rpmtag));
} else {
rpmMessage(RPMMESS_DEBUG,
_("adding %d entries to %s index.\n"),
- rpmcnt, tagName(dbi->dbi_rpmtag));
+ rpmcnt, rpmTagGetName(dbi->dbi_rpmtag));
}
printed++;
}
@@ -3048,7 +3048,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
} else if (rc != DB_NOTFOUND) { /* error */
rpmError(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
continue;
}
@@ -3064,7 +3064,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
if (rc) {
rpmError(RPMERR_DBPUTINDEX,
_("error(%d) storing record %s into %s\n"),
- rc, key->data, tagName(dbi->dbi_rpmtag));
+ rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
}
data->data = _free(data->data);
@@ -3290,7 +3290,7 @@ static int rpmdbRemoveDatabase(const char * prefix,
case 3:
if (dbiTags != NULL)
for (i = 0; i < dbiTagsMax; i++) {
- const char * base = tagName(dbiTags[i]);
+ const char * base = rpmTagGetName(dbiTags[i]);
sprintf(filename, "%s/%s/%s", prefix, dbpath, base);
(void)rpmCleanPath(filename);
if (!rpmioFileExists(filename))
@@ -3362,7 +3362,7 @@ static int rpmdbMoveDatabase(const char * prefix,
if (isTemporaryDB((rpmtag = dbiTags[i])))
continue;
- base = tagName(rpmtag);
+ base = rpmTagGetName(rpmtag);
sprintf(ofilename, "%s/%s/%s", prefix, olddbpath, base);
(void)rpmCleanPath(ofilename);
if (!rpmioFileExists(ofilename))
diff --git a/rpmdb/sqlite.c b/rpmdb/sqlite.c
index f34cea647..b57278a8a 100644
--- a/rpmdb/sqlite.c
+++ b/rpmdb/sqlite.c
@@ -460,7 +460,7 @@ if (dbiByteSwapped(dbi) == 1)
rc = sqlite3_bind_int(scp->pStmt, pos, hnum);
} break;
default:
- switch (tagType(dbi->dbi_rpmtag)) {
+ switch (rpmTagGetType(dbi->dbi_rpmtag)) {
case RPM_NULL_TYPE:
case RPM_BIN_TYPE:
rc = sqlite3_bind_blob(scp->pStmt, pos, key->data, key->size, SQLITE_STATIC);
@@ -632,7 +632,7 @@ static int sql_initDB(dbiIndex dbi)
valtype = "blob";
break;
default:
- switch (tagType(dbi->dbi_rpmtag)) {
+ switch (rpmTagGetType(dbi->dbi_rpmtag)) {
case RPM_NULL_TYPE:
case RPM_BIN_TYPE:
default:
@@ -653,7 +653,7 @@ static int sql_initDB(dbiIndex dbi)
}
}
if (_debug)
-fprintf(stderr, "\t%s(%d) type(%d) keytype %s\n", tagName(dbi->dbi_rpmtag), dbi->dbi_rpmtag, tagType(dbi->dbi_rpmtag), keytype);
+fprintf(stderr, "\t%s(%d) type(%d) keytype %s\n", rpmTagGetName(dbi->dbi_rpmtag), dbi->dbi_rpmtag, rpmTagGetType(dbi->dbi_rpmtag), keytype);
sprintf(cmd, "CREATE TABLE '%s' (key %s, value %s)",
dbi->dbi_subfile, keytype, valtype);
rc = sqlite3_exec(sqldb->db, cmd, NULL, NULL, (char **)&scp->pzErrmsg);
@@ -798,7 +798,7 @@ static int sql_open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
dbi->dbi_root = root;
dbi->dbi_home = home;
- dbfile = tagName(dbi->dbi_rpmtag);
+ dbfile = rpmTagGetName(dbi->dbi_rpmtag);
enterChroot(dbi);
@@ -907,7 +907,7 @@ static int sql_copen (dbiIndex dbi, DB_TXN * txnid,
int rc = 0;
if (_debug)
-fprintf(stderr, "==> %s(%s) tag %d type %d scp %p\n", __FUNCTION__, tagName(dbi->dbi_rpmtag), dbi->dbi_rpmtag, tagType(dbi->dbi_rpmtag), scp);
+fprintf(stderr, "==> %s(%s) tag %d type %d scp %p\n", __FUNCTION__, rpmTagGetName(dbi->dbi_rpmtag), dbi->dbi_rpmtag, rpmTagGetType(dbi->dbi_rpmtag), scp);
enterChroot(dbi);