# rpmcli.h File Reference

`#include <popt.h>`
`#include <rpm/rpmlib.h>`
`#include <rpm/rpmurl.h>`
`#include <rpm/rpmmacro.h>`
`#include <rpm/rpmcallback.h>`
`#include <rpm/rpmts.h>`
`#include <rpm/rpmfi.h>`
`#include <rpm/rpmvf.h>`
`#include <rpm/argv.h>`

Include dependency graph for rpmcli.h:

Go to the source code of this file.

## Data Structures

struct | rpmQVKArguments_s
| Describe query/verify/signature command line operation. More...
struct | rpmBuildArguments_s
| Describe build command line request. More...
struct | rpmInstallArguments_s
| Describe database command line requests. More...
struct | rpmDatabaseArguments_s
| Describe database command line requests. More...

## RPMQV

#define | _QUERY_FOR_BITS
enum | rpmQVSources_e { RPMQV_PACKAGE = 0, RPMQV_PATH, RPMQV_ALL, RPMQV_RPM, RPMQV_GROUP, RPMQV_WHATPROVIDES, RPMQV_WHATREQUIRES, RPMQV_TRIGGEREDBY, RPMQV_DBOFFSET, RPMQV_SPECFILE, RPMQV_PKGID, RPMQV_HDRID, RPMQV_FILEID, RPMQV_TID, RPMQV_HDLIST, RPMQV_FTSWALK }
| Query/Verify argument qualifiers. More...

enum

rpmQueryFlags_e {
QUERY_FOR_DEFAULT = 0, QUERY_MD5 = (1 << 0), QUERY_SIZE = (1 << 1), QUERY_LINKTO = (1 << 2),
QUERY_USER = (1 << 3), QUERY_GROUP = (1 << 4), QUERY_MTIME = (1 << 5), QUERY_MODE = (1 << 6),
QUERY_RDEV = (1 << 7), QUERY_CONTEXTS = (1 << 15), QUERY_FILES = (1 << 16), QUERY_DEPS = (1 << 17),
QUERY_SCRIPT = (1 << 18), QUERY_DIGEST = (1 << 19), QUERY_SIGNATURE = (1 << 20), QUERY_PATCHES = (1 << 21),
QUERY_HDRCHK = (1 << 22), QUERY_FOR_LIST = (1 << 23), QUERY_FOR_STATE = (1 << 24), QUERY_FOR_DOCS = (1 << 25),
QUERY_FOR_CONFIG = (1 << 26), QUERY_FOR_DUMPFILES = (1 << 27)
}

| Bit(s) to control rpmQuery() operation, stored in qva_flags. More...
rpmQueryFlags | rpmcliQueryFlags
| Bit(s) from common command line options.
struct rpmQVKArguments_s | rpmQVKArgs
struct poptOption | rpmQVSourcePoptTable []
struct poptOption | rpmQueryPoptTable []
struct poptOption | rpmVerifyPoptTable []
typedef enum rpmQVSources_e | rpmQVSources
| Query/Verify argument qualifiers.
typedef enum rpmQueryFlags_e | rpmQueryFlags
| Bit(s) to control rpmQuery() operation, stored in qva_flags.
typedef struct rpmQVKArguments_s * | QVA_t
typedef int(* | QVF_t )(QVA_t qva, rpmts ts, Header h)
| Function to display iterator matches.
typedef int(* | QSpecF_t )(rpmts ts, QVA_t qva, const char *arg)
| Function to query spec file.
int | rpmcliShowMatches (QVA_t qva, rpmts ts)
| Display query/verify information for each header in iterator.
void | rpmDisplayQueryTags (FILE *fp)
| Display list of tags that can be used in --queryformat.
int | rpmQueryVerify (QVA_t qva, rpmts ts, const char *arg)
| Common query/verify source interface, called once for each CLI arg.
int | showQueryPackage (QVA_t qva, rpmts ts, Header h)
| Display results of package query.
int | rpmcliArgIter (rpmts ts, QVA_t qva, ARGV_const_t argv)
| Iterate over query/verify arg list.
int | rpmcliQuery (rpmts ts, QVA_t qva, ARGV_const_t argv)
| Display package information.
int | showVerifyPackage (QVA_t qva, rpmts ts, Header h)
| Display results of package verify.
int | rpmVerifySignatures (QVA_t qva, rpmts ts, FD_t fd, const char *fn)
| Check package and header signatures.
int | rpmcliVerify (rpmts ts, QVA_t qva, ARGV_const_t argv)
| Verify package install.

## RPMEIU

enum | rpmInstallInterfaceFlags_e { INSTALL_NONE = 0, INSTALL_PERCENT = (1 << 0), INSTALL_HASH = (1 << 1), INSTALL_NODEPS = (1 << 2), INSTALL_NOORDER = (1 << 3), INSTALL_LABEL = (1 << 4), INSTALL_UPGRADE = (1 << 5), INSTALL_FRESHEN = (1 << 6), INSTALL_INSTALL = (1 << 7), INSTALL_ERASE = (1 << 8) }
| Bit(s) to control rpmInstall() operation. More...
enum | rpmEraseInterfaceFlags_e { UNINSTALL_NONE = 0, UNINSTALL_NODEPS = (1 << 0), UNINSTALL_ALLMATCHES = (1 << 1) }
| Bit(s) to control rpmErase() operation. More...
int | rpmcliPackagesTotal
int | rpmcliHashesCurrent
int | rpmcliHashesTotal
int | rpmcliProgressCurrent
int | rpmcliProgressTotal
struct rpmInstallArguments_s | rpmIArgs
struct poptOption | rpmInstallPoptTable []
typedef enum rpmInstallInterfaceFlags_e | rpmInstallInterfaceFlags
| Bit(s) to control rpmInstall() operation.
typedef enum rpmEraseInterfaceFlags_e | rpmEraseInterfaceFlags
| Bit(s) to control rpmErase() operation.
void * | rpmShowProgress (const void *arg, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, void *data)
| The rpm CLI generic transaction callback handler.
int | rpmInstallSource (rpmts ts, const char *arg, char **specFilePtr, char **cookie)
| Install source rpm package.
int | rpmInstall (rpmts ts, struct rpmInstallArguments_s *ia, ARGV_t fileArgv)
| Install/upgrade/freshen binary rpm package.
int | rpmErase (rpmts ts, struct rpmInstallArguments_s *ia, ARGV_const_t argv)
| Erase binary rpm package.

## RPMK

enum | rpmSignFlags_e { RPMSIGN_NONE = 0, RPMSIGN_CHK_SIGNATURE = 'K', RPMSIGN_NEW_SIGNATURE = 'R', RPMSIGN_ADD_SIGNATURE = 'A', RPMSIGN_DEL_SIGNATURE = 'D', RPMSIGN_IMPORT_PUBKEY = 'I' }
| Bit(s) to control rpmReSign() operation. More...
struct poptOption | rpmSignPoptTable []
typedef enum rpmSignFlags_e | rpmSignFlags
| Bit(s) to control rpmReSign() operation.
int | rpmcliSign (rpmts ts, QVA_t qva, ARGV_const_t argv)
| Create/Modify/Check elements from signature header.

## RPMBT

struct rpmBuildArguments_s | rpmBTArgs
struct poptOption | rpmBuildPoptTable []
typedef struct rpmBuildArguments_s * | BTA_t

## Defines

#define | RPMCLI_POPT_NODEPS -1025
| Common/global popt tokens used for command line option tables.
#define | RPMCLI_POPT_FORCE -1026
#define | RPMCLI_POPT_NOMD5 -1027
#define | RPMCLI_POPT_NOSCRIPTS -1028
#define | RPMCLI_POPT_NOSIGNATURE -1029
#define | RPMCLI_POPT_NODIGEST -1030
#define | RPMCLI_POPT_NOHDRCHK -1031
#define | RPMCLI_POPT_NOCONTEXTS -1032

## Functions

poptContext | rpmcliInit (int argc, char *const argv[], struct poptOption *optionsTable)
| Initialize most everything needed by an rpm CLI executable context.
void | rpmcliConfigured (void)
| Make sure that rpm configuration has been read.
poptContext | rpmcliFini (poptContext optCon)
| Destroy most everything needed by an rpm CLI executable context.

## Variables

int | _noDirTokens
| Should version 3 packages be produced?
struct poptOption | rpmcliAllPoptTable []
| Popt option table for options shared by all modes and executables.
int | ftsOpts
struct poptOption | rpmcliFtsPoptTable []
const char * | rpmcliPipeOutput
const char * | rpmcliRcfile
const char * | rpmcliRootDir
RPMDB
struct rpmDatabaseArguments_s | rpmDBArgs
struct poptOption | rpmDatabasePoptTable []

## Detailed Description

Definition in file rpmcli.h.

## Define Documentation

#define _QUERY_FOR_BITS

Value:

    (QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DOCS|QUERY_FOR_CONFIG|\
        QUERY_FOR_DUMPFILES)

Definition at line 135 of file rpmcli.h.

#define RPMCLI_POPT_FORCE -1026

Definition at line 71 of file rpmcli.h.

#define RPMCLI_POPT_NOCONTEXTS -1032

Definition at line 77 of file rpmcli.h.

#define RPMCLI_POPT_NODEPS -1025

Common/global popt tokens used for command line option tables.

Definition at line 70 of file rpmcli.h.

#define RPMCLI_POPT_NODIGEST -1030

Definition at line 75 of file rpmcli.h.

#define RPMCLI_POPT_NOHDRCHK -1031

Definition at line 76 of file rpmcli.h.

#define RPMCLI_POPT_NOMD5 -1027

Definition at line 72 of file rpmcli.h.

#define RPMCLI_POPT_NOSCRIPTS -1028

Definition at line 73 of file rpmcli.h.

#define RPMCLI_POPT_NOSIGNATURE -1029

Definition at line 74 of file rpmcli.h.

## Function Documentation

int rpmVerifySignatures | ( | QVA_t | qva,
|  | rpmts | ts,
|  | FD_t | fd,
|  | const char * | fn |
| ) |  |  |

Check package and header signatures.

Parameters:

  | qva | parsed query/verify options
  | ts | transaction set
  | fd | package file handle
  | fn | package file name

Returns:
  0 on success, 1 on failure

## Variable Documentation

int ftsOpts

struct poptOption rpmcliFtsPoptTable[]

const char* rpmcliPipeOutput

Referenced by main().

const char* rpmcliRcfile

Referenced by main().

const char* rpmcliRootDir

Referenced by main().