tools/rpmtool.c File Reference

#include "system.h"
#include <rpmcli.h>
#include <rpmxp.h>
#include <rpmlead.h>
#include <signature.h>
#include "header_internal.h"
#include "misc.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  rpmavi_s
struct  iobits_s

Defines

#define _RPMIOBITS_PKGMASK   (RPMIOBITS_LEAD|RPMIOBITS_SHEADER|RPMIOBITS_HEADER|RPMIOBITS_PAYLOAD)
#define _RPMIOBITS_MODEMASK   (RPMIOBITS_FDIO|RPMIOBITS_UFDIO|RPMIOBITS_GZDIO|RPMIOBITS_BZDIO)

Typedefs

typedef rpmavi_srpmavi
typedef enum rpmtoolIOBits_e rpmtoolIOBits

Enumerations

enum  rpmtoolIOBits_e {
  RPMIOBITS_NONE = 0, RPMIOBITS_LEAD = (1 << 0), RPMIOBITS_SHEADER = (1 << 1), RPMIOBITS_HEADER = (1 << 2),
  RPMIOBITS_PAYLOAD = (1 << 3), RPMIOBITS_FDIO = (1 << 4), RPMIOBITS_UFDIO = (1 << 5), RPMIOBITS_GZDIO = (1 << 6),
  RPMIOBITS_BZDIO = (1 << 7), RPMIOBITS_UNCOMPRESS = (1 << 8), RPMIOBITS_BINARY = (1 << 9), RPMIOBITS_DUMP = (1 << 10),
  RPMIOBITS_XML = (1 << 11)
}

Functions

static rpmavi rpmaviFree (rpmavi avi)
static rpmavi rpmaviNew (const char **av, int flags)
static const char * rpmaviNext (rpmavi avi)
static int parseFmt (const char *fmt, rpmtoolIOBits *bits, const char **mode)
static void initTool (const char *argv0)
static void spewHeader (FD_t fdo, Header h)
int main (int argc, char *const argv[])

Variables

const char * program_name
static int _rpmtool_debug = 0
static struct headerTagTableEntry_s rpmSTagTbl []
headerTagTableEntry_srpmSTagTable = rpmSTagTbl
static const char * iav [] = { "-", NULL }
static const char * ifmt = NULL
static const char * ipath = NULL
static const char * imode = NULL
static rpmtoolIOBits ibits = RPMIOBITS_NONE
static const char * oav [] = { "-", NULL }
static const char * ofmt = NULL
static const char * opath = NULL
static const char * omode = NULL
static rpmtoolIOBits obits = RPMIOBITS_NONE
static struct iobits_s iobits []
static struct poptOption optionsTable []


Define Documentation

#define _RPMIOBITS_MODEMASK   (RPMIOBITS_FDIO|RPMIOBITS_UFDIO|RPMIOBITS_GZDIO|RPMIOBITS_BZDIO)

Referenced by parseFmt().

#define _RPMIOBITS_PKGMASK   (RPMIOBITS_LEAD|RPMIOBITS_SHEADER|RPMIOBITS_HEADER|RPMIOBITS_PAYLOAD)

Referenced by initTool(), and main().


Typedef Documentation

typedef struct rpmavi_s* rpmavi

Definition at line 15 of file rpmtool.c.

typedef enum rpmtoolIOBits_e rpmtoolIOBits


Enumeration Type Documentation

enum rpmtoolIOBits_e

Enumerator:
RPMIOBITS_NONE 
RPMIOBITS_LEAD 
RPMIOBITS_SHEADER 
RPMIOBITS_HEADER 
RPMIOBITS_PAYLOAD 
RPMIOBITS_FDIO 
RPMIOBITS_UFDIO 
RPMIOBITS_GZDIO 
RPMIOBITS_BZDIO 
RPMIOBITS_UNCOMPRESS 
RPMIOBITS_BINARY 
RPMIOBITS_DUMP 
RPMIOBITS_XML 

Definition at line 77 of file rpmtool.c.


Function Documentation

static void initTool ( const char *  argv0  )  [static]

Definition at line 211 of file rpmtool.c.

References __progname, _RPMIOBITS_PKGMASK, ibits, obits, RPMIOBITS_DUMP, RPMIOBITS_HEADER, RPMIOBITS_LEAD, RPMIOBITS_PAYLOAD, RPMIOBITS_SHEADER, RPMIOBITS_UNCOMPRESS, and setprogname.

Referenced by main().

int main ( int  argc,
char *const   argv[] 
)

Definition at line 275 of file rpmtool.c.

References _, __progname, _free(), _RPMIOBITS_PKGMASK, _rpmtool_debug, alloca(), EXIT_FAILURE, Fclose(), fdDup(), Fdopen(), Ferror(), Fileno(), Fopen(), Fread(), Fstrerror(), Fwrite(), HEADER_MAGIC_YES, headerFree(), headerGetEntry(), headerRead(), headerSprintf(), iav, ibits, ifmt, imode, initTool(), obits, ofmt, omode, opath, parseFmt(), readLead(), rpmaviFree(), rpmaviNew(), rpmaviNext(), rpmcliFini(), rpmcliInit(), rpmGetPath(), rpmHeaderFormats, RPMIOBITS_HEADER, RPMIOBITS_LEAD, RPMIOBITS_PAYLOAD, RPMIOBITS_SHEADER, RPMIOBITS_UNCOMPRESS, rpmMkdirPath(), RPMRC_OK, rpmReadSignature(), RPMSIGTYPE_HEADERSIG, RPMTAG_PAYLOADCOMPRESSOR, rpmTagTable, spewHeader(), stpcpy(), ufdCopy(), urlPath(), writeLead(), and xstrdup().

static int parseFmt ( const char *  fmt,
rpmtoolIOBits bits,
const char **  mode 
) [static]

Definition at line 130 of file rpmtool.c.

References _, __progname, _free(), _RPMIOBITS_MODEMASK, iobits, iobits_s::name, stpcpy(), and xmalloc().

Referenced by main().

static rpmavi rpmaviFree ( rpmavi  avi  )  [static]

Definition at line 22 of file rpmtool.c.

References _free().

Referenced by main().

static rpmavi rpmaviNew ( const char **  av,
int  flags 
) [static]

Definition at line 31 of file rpmtool.c.

References xcalloc().

Referenced by main().

static const char* rpmaviNext ( rpmavi  avi  )  [static]

Definition at line 41 of file rpmtool.c.

References rpmavi_s::av.

Referenced by main().

static void spewHeader ( FD_t  fdo,
Header  h 
) [static]

Definition at line 250 of file rpmtool.c.

References _free(), Fwrite(), HEADER_DUMP_INLINE, HEADER_MAGIC_YES, headerDump(), headerIsEntry(), headerSprintf(), headerWrite(), obits, rpmHeaderFormats, RPMIOBITS_DUMP, RPMIOBITS_XML, rpmSTagTable, RPMTAG_HEADERI18NTABLE, rpmTagTable, and rpmxpDTD.

Referenced by main().


Variable Documentation

int _rpmtool_debug = 0 [static]

Definition at line 13 of file rpmtool.c.

Referenced by main().

const char* iav[] = { "-", NULL } [static]

Definition at line 93 of file rpmtool.c.

Referenced by main().

rpmtoolIOBits ibits = RPMIOBITS_NONE [static]

Definition at line 97 of file rpmtool.c.

Referenced by getOutputFrom(), initTool(), and main().

const char* ifmt = NULL [static]

Definition at line 94 of file rpmtool.c.

Referenced by main().

const char* imode = NULL [static]

Definition at line 96 of file rpmtool.c.

Referenced by main().

struct iobits_s iobits[] [static]

Referenced by parseFmt().

const char* ipath = NULL [static]

Definition at line 95 of file rpmtool.c.

Referenced by runScript().

const char* oav[] = { "-", NULL } [static]

Definition at line 99 of file rpmtool.c.

rpmtoolIOBits obits = RPMIOBITS_NONE [static]

Definition at line 103 of file rpmtool.c.

Referenced by getOutputFrom(), initTool(), main(), and spewHeader().

const char* ofmt = NULL [static]

Definition at line 100 of file rpmtool.c.

Referenced by main().

const char* omode = NULL [static]

Definition at line 102 of file rpmtool.c.

Referenced by handleInstInstalledFiles(), and main().

const char* opath = NULL [static]

Definition at line 101 of file rpmtool.c.

Referenced by fsmMakeLinks(), fsmStage(), main(), and writeFile().

struct poptOption optionsTable[] [static]

Definition at line 169 of file rpmtool.c.

const char* program_name

Definition at line 2 of file rpmtool.c.

struct headerTagTableEntry_s* rpmSTagTable = rpmSTagTbl

Definition at line 74 of file rpmtool.c.

Referenced by spewHeader().

struct headerTagTableEntry_s rpmSTagTbl[] [static]

Initial value:

 {
        { "RPMTAG_HEADERIMAGE", HEADER_IMAGE, RPM_BIN_TYPE },
        { "RPMTAG_HEADERSIGNATURES", HEADER_SIGNATURES, RPM_BIN_TYPE },
        { "RPMTAG_HEADERIMMUTABLE", HEADER_IMMUTABLE, RPM_BIN_TYPE },
        { "RPMTAG_HEADERREGIONS", HEADER_REGIONS, RPM_BIN_TYPE },
        { "RPMTAG_SIGSIZE", 999+1, RPM_INT32_TYPE },
        { "RPMTAG_SIGLEMD5_1", 999+2, RPM_BIN_TYPE },
        { "RPMTAG_SIGPGP", 999+3, RPM_BIN_TYPE },
        { "RPMTAG_SIGLEMD5_2", 999+4, RPM_BIN_TYPE },
        { "RPMTAG_SIGMD5", 999+5, RPM_BIN_TYPE },
        { "RPMTAG_SIGGPG", 999+6, RPM_BIN_TYPE },
        { "RPMTAG_SIGPGP5", 999+7, RPM_BIN_TYPE },
        { "RPMTAG_SIGPAYLOADSIZE", 999+8, RPM_INT32_TYPE },
        { "RPMTAG_BADSHA1_1", HEADER_SIGBASE+8, RPM_STRING_TYPE },
        { "RPMTAG_BADSHA1_2", HEADER_SIGBASE+9, RPM_STRING_TYPE },
        { "RPMTAG_PUBKEYS", HEADER_SIGBASE+10, RPM_STRING_ARRAY_TYPE },
        { "RPMTAG_DSAHEADER", HEADER_SIGBASE+11, RPM_BIN_TYPE },
        { "RPMTAG_RSAHEADER", HEADER_SIGBASE+12, RPM_BIN_TYPE },
        { "RPMTAG_SHA1HEADER", HEADER_SIGBASE+13, RPM_STRING_TYPE },
        { NULL, 0 }
}

Definition at line 51 of file rpmtool.c.


Generated on Fri Oct 12 08:44:56 2007 for rpm by  doxygen 1.5.2