diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-06-18 14:59:13 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-06-18 14:59:13 +0300 |
commit | b6577f0e6de7f7888823eeaa396c6d2bae369f20 (patch) | |
tree | 47e1aa7d6433f6577a3fcdc3b2b5dd20f4db93ab /lib/header.c | |
parent | a8f23a461958479a773c482260899522b76efa81 (diff) | |
download | rpm-b6577f0e6de7f7888823eeaa396c6d2bae369f20.tar.gz rpm-b6577f0e6de7f7888823eeaa396c6d2bae369f20.tar.bz2 rpm-b6577f0e6de7f7888823eeaa396c6d2bae369f20.zip |
Switch around headerMod() and headerModifyEntry()
- headerModifyEntry() is the legacy interface going away, make it
use headerMod() and deprecate it
Diffstat (limited to 'lib/header.c')
-rw-r--r-- | lib/header.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/header.c b/lib/header.c index e04957a90..b6f37caba 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1716,8 +1716,7 @@ int headerAddI18NString(Header h, rpmTag tag, const char * string, return 0; } -int headerModifyEntry(Header h, rpmTag tag, rpmTagType type, - rpm_constdata_t p, rpm_count_t c) +int headerMod(Header h, rpmtd td) { indexEntry entry; rpm_data_t oldData; @@ -1725,25 +1724,25 @@ int headerModifyEntry(Header h, rpmTag tag, rpmTagType type, int length; /* First find the tag */ - entry = findEntry(h, tag, type); + entry = findEntry(h, td->tag, td->type); if (!entry) return 0; length = 0; - data = grabData(type, p, c, &length); + data = grabData(td->type, td->data, td->count, &length); if (data == NULL || length <= 0) return 0; /* make sure entry points to the first occurence of this tag */ - while (entry > h->index && (entry - 1)->info.tag == tag) + while (entry > h->index && (entry - 1)->info.tag == td->tag) entry--; /* free after we've grabbed the new data in case the two are intertwined; that's a bad idea but at least we won't break */ oldData = entry->data; - entry->info.count = c; - entry->info.type = type; + entry->info.count = td->count; + entry->info.type = td->type; entry->data = data; entry->length = length; @@ -1755,11 +1754,6 @@ int headerModifyEntry(Header h, rpmTag tag, rpmTagType type, return 1; } -int headerMod(Header h, rpmtd td) -{ - return headerModifyEntry(h, td->tag, td->type, td->data, td->count); -} - /** * Header tag iterator data structure. */ |