Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

tools/dump.c

Go to the documentation of this file.
00001 #include "system.h"
00002 
00003 #include <rpmlib.h>
00004 #include "debug.h"
00005 
00006 int main(int argc, char ** argv)
00007 {
00008     Header h;
00009     FD_t fdi;
00010 
00011     setprogname(argv[0]);       /* Retrofit glibc __progname */
00012     if (argc == 1) {
00013         fdi = Fopen("-", "r.ufdio");
00014     } else {
00015         fdi = Fopen(argv[1], "r.ufdio");
00016     }
00017 
00018     if (fdi == NULL || Ferror(fdi)) {
00019         fprintf(stderr, _("cannot open %s: %s\n"), argv[1], strerror(errno));
00020         exit(EXIT_FAILURE);
00021     }
00022 
00023     h = headerRead(fdi, HEADER_MAGIC_YES);
00024     if (!h) {
00025         fprintf(stderr, _("headerRead error: %s\n"), strerror(errno));
00026         exit(EXIT_FAILURE);
00027     }
00028     Fclose(fdi);
00029   
00030     headerDump(h, stdout, HEADER_DUMP_INLINE, rpmTagTable);
00031     headerFree(h);
00032 
00033     return 0;
00034 }

Generated at Sun Apr 8 18:43:02 2001 for rpm by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000