diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-09-10 14:14:49 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-09-10 14:14:49 +0300 |
commit | 5327ac46e53205bf5f5adc83d2487e77d6e44851 (patch) | |
tree | 0c931d4c8bd24fea1b7e7f12f15ca35c572330b8 /lib | |
parent | ec8f057f64cc119ed57a1aad9dc72f56da313a07 (diff) | |
download | librpm-tizen-5327ac46e53205bf5f5adc83d2487e77d6e44851.tar.gz librpm-tizen-5327ac46e53205bf5f5adc83d2487e77d6e44851.tar.bz2 librpm-tizen-5327ac46e53205bf5f5adc83d2487e77d6e44851.zip |
Rip unnecessary headerDump() and the last ancient artifacts using it
- xml format dump gives an output that can actually be further processed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/header_internal.c | 132 | ||||
-rw-r--r-- | lib/header_internal.h | 9 |
2 files changed, 0 insertions, 141 deletions
diff --git a/lib/header_internal.c b/lib/header_internal.c index 44673ede4..382d8988a 100644 --- a/lib/header_internal.c +++ b/lib/header_internal.c @@ -17,138 +17,6 @@ uint64_t htonll( uint64_t n ) { return n; } -void headerDump(Header h, FILE *f, int flags) -{ - int i; - indexEntry p; - const char * tag; - const char * type; - - /* First write out the length of the index (count of index entries) */ - fprintf(f, "Entry count: %d\n", h->indexUsed); - - /* Now write the index */ - p = h->index; - fprintf(f, "\n CT TAG TYPE " - " OFSET COUNT\n"); - for (i = 0; i < h->indexUsed; i++) { - switch (p->info.type) { - case RPM_NULL_TYPE: - type = "NULL"; - break; - case RPM_CHAR_TYPE: - type = "CHAR"; - break; - case RPM_BIN_TYPE: - type = "BIN"; - break; - case RPM_INT8_TYPE: - type = "INT8"; - break; - case RPM_INT16_TYPE: - type = "INT16"; - break; - case RPM_INT32_TYPE: - type = "INT32"; - break; - case RPM_INT64_TYPE: - type = "INT64"; - break; - case RPM_STRING_TYPE: - type = "STRING"; - break; - case RPM_STRING_ARRAY_TYPE: - type = "STRING_ARRAY"; - break; - case RPM_I18NSTRING_TYPE: - type = "I18N_STRING"; - break; - default: - type = "(unknown)"; - break; - } - - tag = rpmTagGetName(p->info.tag); - - fprintf(f, "Entry : %3.3d (%d)%-14s %-18s 0x%.8x %.8d\n", i, - p->info.tag, tag, type, (unsigned) p->info.offset, - (int) p->info.count); - - if (flags & HEADER_DUMP_INLINE) { - char *dp = p->data; - int c = p->info.count; - int ct = 0; - - /* Print the data inline */ - switch (p->info.type) { - case RPM_INT32_TYPE: - while (c--) { - fprintf(f, " Data: %.3d 0x%08x (%d)\n", ct++, - (unsigned) *((int32_t *) dp), - (int) *((int32_t *) dp)); - dp += sizeof(int32_t); - } - break; - - case RPM_INT16_TYPE: - while (c--) { - fprintf(f, " Data: %.3d 0x%04x (%d)\n", ct++, - (unsigned) (*((int16_t *) dp) & 0xffff), - (int) *((int16_t *) dp)); - dp += sizeof(int16_t); - } - break; - case RPM_INT8_TYPE: - while (c--) { - fprintf(f, " Data: %.3d 0x%02x (%d)\n", ct++, - (unsigned) (*((int8_t *) dp) & 0xff), - (int) *((int8_t *) dp)); - dp += sizeof(int8_t); - } - break; - case RPM_BIN_TYPE: - while (c > 0) { - fprintf(f, " Data: %.3d ", ct); - while (c--) { - fprintf(f, "%02x ", (unsigned) (*(int8_t *)dp & 0xff)); - ct++; - dp += sizeof(int8_t); - if (! (ct % 8)) { - break; - } - } - fprintf(f, "\n"); - } - break; - case RPM_CHAR_TYPE: - while (c--) { - char ch = (char) *((char *) dp); - fprintf(f, " Data: %.3d 0x%2x %c (%d)\n", ct++, - (unsigned)(ch & 0xff), - (isprint(ch) ? ch : ' '), - (int) *((char *) dp)); - dp += sizeof(char); - } - break; - case RPM_STRING_TYPE: - case RPM_STRING_ARRAY_TYPE: - case RPM_I18NSTRING_TYPE: - while (c--) { - fprintf(f, " Data: %.3d %s\n", ct++, (char *) dp); - dp = strchr(dp, 0); - dp++; - } - break; - default: - fprintf(stderr, _("Data type %d not supported\n"), - (int) p->info.type); - break; - } - } - p++; - } -} - /* * Backwards compatibility wrappers for legacy interfaces. * Remove these some day... diff --git a/lib/header_internal.h b/lib/header_internal.h index c9cecf120..8223e30ea 100644 --- a/lib/header_internal.h +++ b/lib/header_internal.h @@ -124,15 +124,6 @@ int headerGetRawEntry(Header h, rpmTag tag, rpm_data_t * p, rpm_count_t * c); -/** \ingroup header - * Dump a header in human readable format (for debugging). - * @param h header - * @param f file handle - * @param flags 0 or HEADER_DUMP_INLINE - */ -void headerDump(Header h, FILE *f, int flags); -#define HEADER_DUMP_INLINE 1 - #ifdef __cplusplus } #endif |