RPMIO.
Collaboration diagram for RPMIO.:

## Files

file | argv.c
file | argv.h
file | bzdio.c
| Support for BZIP2 compression library.
file | gzdio.c
| Support for ZLIB compression library.
file | macro.c
file | mount.c
file | poptIO.c
| Popt tables for all rpmio-only executables.
file | rpmcb.h
file | rpmdav.c
file | rpmdav.h
file | rpmio.c
file | rpmio.h
file | rpmio_internal.h
file | rpmiob.c
file | rpmiotypes.h
file | rpmku.c
file | rpmku.h
file | rpmlog.c
file | rpmlog.h
| Yet Another syslog(3) API clone.
file | rpmmacro.h
file | rpmmalloc.c
file | rpmmg.c
file | rpmmg.h
file | rpmpgp.c
| Routines to handle RFC-2440 detached signatures.
file | rpmrpc.c
file | rpmsq.c
file | rpmsq.h
file | rpmsw.c
file | rpmsw.h
file | rpmurl.h
file | rpmuuid.c
file | strcasecmp.c
file | strtolocale.c
file | ugid.c
file | ugid.h
file | url.c

## Data Structures

struct | FDIO_s
struct | _FDSTACK_s
struct | _FDDIGEST_s
struct | _FD_s
| The FD_t File Handle data structure. More...
struct | rpmsw_s
struct | rpmop_s
| Cumulative statistics for an operation. More...

## Typedefs

typedef struct _FD_s * | FD_t
typedef struct FDIO_s * | FDIO_t
typedef struct _FDSTACK_s | FDSTACK_t
typedef enum fdOpX_e | fdOpX
| Identify per-desciptor I/O operation statistics. More...
struct {
struct rpmop_s ops [FDSTAT_MAX]
} | FDSTAT_t
typedef struct _FDDIGEST_s * | FDDIGEST_t
typedef enum rpmRC_e | rpmRC
| RPM return codes. More...
typedef unsigned char | rpmuint8_t
| Private int typedefs to avoid C99 portability issues. More...
typedef int | rpmint32_t
typedef struct rpmiob_s * | rpmiob
typedef void *(* | rpmCallbackFunction )(const void *h, const rpmCallbackType what, const rpmuint64_t amount, const rpmuint64_t total, fnpyKey key, rpmCallbackData data)
typedef struct rpmmg_s * | rpmmg
typedef unsigned long int | rpmtime_t
typedef struct rpmsw_s * | rpmsw
typedef struct rpmop_s * | rpmop
typedef enum rpmswOpX_e | rpmswOpX
| Indices for timestamps. More...

## Enumerations

enum | fdOpX_e { FDSTAT_READ = 0, FDSTAT_WRITE = 1, FDSTAT_SEEK = 2, FDSTAT_CLOSE = 3, FDSTAT_DIGEST = 4, FDSTAT_MAX = 5 }
| Identify per-desciptor I/O operation statistics. More...
enum | rpmRC_e { RPMRC_OK = 0, RPMRC_NOTFOUND = 1, RPMRC_FAIL = 2, RPMRC_NOTTRUSTED = 3, RPMRC_NOKEY = 4 }
| RPM return codes. More...

enum

rpmswOpX_e {
RPMSW_OP_TOTAL = 0, RPMSW_OP_CHECK = 1, RPMSW_OP_ORDER = 2, RPMSW_OP_FINGERPRINT = 3,
RPMSW_OP_REPACKAGE = 4, RPMSW_OP_INSTALL = 5, RPMSW_OP_ERASE = 6, RPMSW_OP_SCRIPTLETS = 7,
RPMSW_OP_COMPRESS = 8, RPMSW_OP_UNCOMPRESS = 9, RPMSW_OP_DIGEST = 10, RPMSW_OP_SIGNATURE = 11,
RPMSW_OP_DBADD = 12, RPMSW_OP_DBREMOVE = 13, RPMSW_OP_DBGET = 14, RPMSW_OP_DBPUT = 15,
RPMSW_OP_DBDEL = 16, RPMSW_OP_READHDR = 17, RPMSW_OP_HDRLOAD = 18, RPMSW_OP_HDRGET = 19,
RPMSW_OP_DEBUG = 20, RPMSW_OP_MAX = 20
}

| Indices for timestamps. More...

## Functions

const char * | fdbg (FD_t fd)
int | fdFgets (FD_t fd, char *buf, size_t len)
FD_t | ftpOpen (const char *url, int flags, mode_t mode, urlinfo *uret)
int | ftpReq (FD_t data, const char *ftpCmd, const char *ftpArg)
int | ftpCmd (const char *cmd, const char *url, const char *arg2)
int | ufdClose (void *cookie)
static void | fdSetOpen (FD_t fd, const char *path, int flags, mode_t mode)
static const char * | fdGetOPath (FD_t fd)
static int | fdGetOFlags (FD_t fd)
static mode_t | fdGetOMode (FD_t fd)
static void | fdSetDig (FD_t fd, pgpDig dig)
static pgpDig | fdGetDig (FD_t fd)
static void | fdSetXAR (FD_t fd, rpmxar xar)
static rpmxar | fdGetXAR (FD_t fd)
static FDIO_t | fdGetIo (FD_t fd)
static void | fdSetIo (FD_t fd, FDIO_t io)
static FILE * | fdGetFILE (FD_t fd)
static void * | fdGetFp (FD_t fd)
static void | fdSetFp (FD_t fd, void *fp)
static int | fdGetFdno (FD_t fd)
static void | fdSetFdno (FD_t fd, int fdno)
static void | fdSetContentLength (FD_t fd, ssize_t contentLength)
static void | fdPush (FD_t fd, FDIO_t io, void *fp, int fdno)
static void | fdPop (FD_t fd)
static rpmop | fdstat_op (FD_t fd, fdOpX opx)
static void | fdstat_enter (FD_t fd, int opx)
static void | fdstat_exit (FD_t fd, int opx, ssize_t rc)
static void | fdstat_print (FD_t fd, const char *msg, FILE *fp)
static void | fdSetSyserrno (FD_t fd, int syserrno, const void *errcookie)
static int | fdGetRdTimeoutSecs (FD_t fd)
static unsigned long long | fdGetCpioPos (FD_t fd)
static void | fdSetCpioPos (FD_t fd, long int cpioPos)
static FD_t | c2f (void *cookie)
static void | fdInitDigest (FD_t fd, pgpHashAlgo hashalgo, int flags)
| Attach digest to fd. More...
static void | fdUpdateDigests (FD_t fd, const unsigned char *buf, ssize_t buflen)
| Update digest(s) attached to fd. More...
static void | fdFiniDigest (FD_t fd, pgpHashAlgo hashalgo, void *datap, size_t *lenp, int asAscii)
static void | fdStealDigest (FD_t fd, pgpDig dig)
static int | fdFileno (void *cookie)
static void * | _free (const void *p)
| Wrapper to free(3), hides const compilation noise, permit NULL, return NULL. More...
int | xstrcasecmp (const char *s1, const char *s2)
| Locale insensitive strcasecmp(3). More...
int | xstrncasecmp (const char *s1, const char *s2, size_t n)
| Locale insensitive strncasecmp(3). More...
const char * | xstrtolocale (const char *str)
| Force encoding of string. More...
static rpmtime_t | tvsub (const struct timeval *etv, const struct timeval *btv)
| Return difference of 2 timeval stamps in micro-seconds. More...
int | rpmswEnter (rpmop op, ssize_t rc)
| Enter timed operation. More...
rpmtime_t | rpmswExit (rpmop op, ssize_t rc)
| Exit timed operation. More...
rpmtime_t | rpmswAdd (rpmop to, rpmop from)
| Sum statistic counters. More...
rpmtime_t | rpmswSub (rpmop to, rpmop from)
| Subtract statistic counters. More...
void | rpmswPrint (const char *name, rpmop op)
| Print operation statistics. More...

## Variables

size_t | _rpmiob_chunk
int | _rpmmg_debug
typedef off_t | _libio_off_t
| Hide libio API lossage. More...
typedef off_t | _libio_pos_t

## Detailed Description

## Typedef Documentation

typedef off_t _libio_off_t

Hide libio API lossage.

The libio interface changed after glibc-2.1.3 to pass the seek offset argument as a pointer rather than as an off_t. The snarl below defines typedefs to isolate the lossage.

Definition at line 32 of file rpmio.h.

typedef off_t _libio_pos_t

Definition at line 33 of file rpmio.h.

typedef struct _FD_s* FD_t

Definition at line 39 of file rpmio.h.

typedef struct _FDDIGEST_s * FDDIGEST_t

typedef struct FDIO_s* FDIO_t

Definition at line 43 of file rpmio.h.

typedef enum fdOpX_e fdOpX

Identify per-desciptor I/O operation statistics.

typedef struct _FDSTACK_s FDSTACK_t

typedef { ... } * FDSTAT_t

typedef void*(* rpmCallbackFunction)(const void *h, const rpmCallbackType what, const rpmuint64_t amount, const rpmuint64_t total,fnpyKey key,rpmCallbackData data)

Definition at line 308 of file rpmiotypes.h.

typedef int rpmint32_t

Definition at line 29 of file rpmiotypes.h.

typedef struct rpmiob_s* rpmiob

Definition at line 51 of file rpmiotypes.h.

typedef struct rpmmg_s* rpmmg

Definition at line 15 of file rpmmg.h.

typedef struct rpmop_s* rpmop

Definition at line 18 of file rpmsw.h.

typedef enum rpmRC_e rpmRC

RPM return codes.

typedef struct rpmsw_s* rpmsw

Definition at line 14 of file rpmsw.h.

typedef enum rpmswOpX_e rpmswOpX

Indices for timestamps.

typedef unsigned long int rpmtime_t

Definition at line 10 of file rpmsw.h.

typedef unsigned char rpmuint8_t

Private int typedefs to avoid C99 portability issues.

Definition at line 22 of file rpmiotypes.h.

## Enumeration Type Documentation

enum fdOpX_e

Identify per-desciptor I/O operation statistics.

Enumerator
FDSTAT_READ | Read statistics index.
FDSTAT_WRITE | Write statistics index.
FDSTAT_SEEK | Seek statistics index.
FDSTAT_CLOSE | Close statistics index
FDSTAT_DIGEST | Digest statistics index.
FDSTAT_MAX |

Definition at line 34 of file rpmio_internal.h.

enum rpmRC_e

RPM return codes.

Enumerator
RPMRC_OK | Generic success code
RPMRC_NOTFOUND | Generic not found code.
RPMRC_FAIL | Generic failure code.
RPMRC_NOTTRUSTED | Signature is OK, but key is not trusted.
RPMRC_NOKEY | Public key is unavailable.

Definition at line 11 of file rpmiotypes.h.

enum rpmswOpX_e

Indices for timestamps.

Enumerator
RPMSW_OP_TOTAL |
RPMSW_OP_CHECK |
RPMSW_OP_ORDER |
RPMSW_OP_FINGERPRINT |
RPMSW_OP_REPACKAGE |
RPMSW_OP_INSTALL |
RPMSW_OP_ERASE |
RPMSW_OP_SCRIPTLETS |
RPMSW_OP_COMPRESS |
RPMSW_OP_UNCOMPRESS |
RPMSW_OP_DIGEST |
RPMSW_OP_SIGNATURE |
RPMSW_OP_DBADD |
RPMSW_OP_DBREMOVE |
RPMSW_OP_DBGET |
RPMSW_OP_DBPUT |
RPMSW_OP_DBDEL |
RPMSW_OP_READHDR |
RPMSW_OP_HDRLOAD |
RPMSW_OP_HDRGET |
RPMSW_OP_DEBUG |
RPMSW_OP_MAX |

Definition at line 46 of file rpmsw.h.

## Function Documentation

static void* _free | ( | const void * | p | ) |

inline static

Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.

Parameters

  p | memory to free

Returns
  NULL always

Definition at line 327 of file rpmiotypes.h.

Referenced by _GetPass(), _tagGenerate(), _tagName(), _tagValue(), addChangelog(), addFile(), addFileToTag(), addFileToTagAux(), addOrAppendListEntry(), addReqProv(), addSource(), addTE(), archScore(), argiFree(), argvFree(), argvSplit(), armorFormat(), avClosedir(), avContextDestroy(), base64Format(), bncdataFormat(), buildSpec(), cdataFormat(), checkForDuplicates(), checkForValidArchitectures(), checkPackageSet(), checkSpec(), checkUnpackagedFiles(), Chroot(), closeCallback(), closeSpec(), compare(), compressFilelist(), cpio_doio(), cpioHeaderRead(), createDir(), db3close(), db3open(), db3stat(), db_init(), dbiFreeIndexSet(), dbiTagsInit(), debevrfmtTag(), debevrTag(), debmd5sumsTag(), defaultMachine(), delTE(), dnlFreeIterator(), dodigest(), doIcon(), doPatch(), doSetupMacro(), doUntar(), ensureOlder(), expandMacro(), extractRegular(), fdFini(), FDGsqlTag(), FDGxmlTag(), FDGyamlTag(), fiIntersect(), filestatTag(), fillOutMainPackage(), findErases(), findPreambleTag(), Fopen(), formatValue(), freeAttrRec(), freeBadDeps(), freeFileList(), freeFormat(), freeFSM(), freeGlobs(), freeHardLink(), freeIOSM(), freeItem(), freeItems(), freeNames(), freePackage(), freeSl(), freeSources(), freeSpec(), freeSt(), freeTriggerFiles(), fsmCommitLinks(), fsmMakeLinks(), fsmMapPath(), fsmMkdirs(), fsmStage(), fsmTeardown(), fssizesTag(), ftsCacheUpdate(), genCpioListAndHeader(), genSourceRpmName(), getFilesystemList(), getMachineInfo(), getOutputFrom(), getSignid(), grabArgs(), grabData(), handleInstInstalledFiles(), handleOneTrigger(), handleOverlappedFiles(), handlePreambleTag(), handleRmvdInstalledFiles(), hCopyTag(), hdr_subscript(), hdrKeyList(), hdrSprintf(), hdrUnload(), headerAddI18NString(), headerCheck(), headerCopy(), headerCopyTags(), headerFini(), headerLoad(), headerMacrosLoad(), headerMacrosUnload(), headerMap(), headerMergeLegacySigs(), headerModifyEntry(), headerNEVRA(), headerRegenSigHeader(), headerReload(), headerRemoveEntry(), headerScrub(), headerSetBaseURL(), headerSetDigest(), headerSetOrigin(), headerSprintf(), headerUnload(), hGetColor(), hGetNVRA(), hLoadTID(), htFini(), i18nTag(), IDTXfree(), IDTXglob(), IDTXload(), ignoreDep(), initGlobs(), initSourceHeader(), installArgCallback(), instprefixTag(), iosmCommitLinks(), iosmMakeLinks(), iosmMapPath(), iosmMkdirs(), iosmStage(), iosmTeardown(), isMemberInEntry(), isPart(), isSpecFile(), leaveChroot(), localeTag(), lookupPackage(), main(), makeGPGSignature(), makeHDRSignature(), mapFreeIterator(), markReplacedFiles(), miFreeHeader(), mireClean(), mireFreeAll(), mireSkip(), mtreeVisitD(), mtreeVisitF(), needswhatTag(), nwlookupTag(), packageBinaries(), packageSources(), parseBuildInstallClean(), parseChangelog(), parseCVOG(), parseDescription(), parseExpressionBoolean(), parseExpressionString(), parseFiles(), parseForRegexLang(), parseForSimple(), parsePreamble(), parseRCPOT(), parseScript(), parseSimplePart(), parseSpec(), pgpArmorWrap(), pgpDigClean(), pgpDigFini(), pgpExtractPubkeyFingerprint(), pgpGrabPkts(), pgpMpiSet(), pgpPrtPkts(), pgpPrtUserID(), pgpPubkeyFingerprint(), pgpReadPkts(), pkgUnpackagedSubdirs(), pointRpmEVR(), popMacro(), populateInstallHeader(), PRCOsqlTag(), PRCOxmlTag(), PRCOyamlTag(), prepFetch(), prepFetchVerbose(), printFileInfo(), printNewSpecfile(), processBinaryFile(), processBinaryFiles(), processMetadataFile(), processPackageFiles(), providePackageNVR(), pushMacro(), queryArgCallback(), rdLead(), rdSignature(), readFile(), readLine(), readLineFromOFI(), Realpath(), rebuildCompatTables(), relocateFileList(), repoCloseMDFile(), repoDoFinalMove(), repoDoPkgMetadata(), repoDoRepoMetadata(), repoMkdir(), repoOpenMDFile(), repoReadHeader(), repoRfileDigest(), repoTestSetupDirs(), rfileXMLWrite(), rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmalDel(), rpmalFree(), rpmalFreeIndex(), rpmbcFree(), rpmbcSetRSA(), rpmCheckPassPhrase(), rpmcliAllArgCallback(), rpmcliConfigured(), rpmcliFini(), rpmcliImportPubkey(), rpmcliImportPubkeys(), rpmcliInit(), rpmcliInstall(), rpmcliInstallElementPath(), rpmcliInstallSuggests(), rpmcliQuery(), rpmdbAdd(), rpmdbClose(), rpmdbExportInfo(), rpmdbFindByFile(), rpmdbFindFpList(), rpmdbMireApply(), rpmdbMoveDatabase(), rpmdbNew(), rpmdbRebuild(), rpmdbRemove(), rpmdbRemoveDatabase(), rpmdbURIPath(), rpmdcParseZeroInstall(), rpmdcPrintFile(), rpmds_compare(), rpmdsCompare(), rpmdsCpuinfo(), rpmdsELF(), rpmdsFini(), rpmdsFreePRCO(), rpmdsGetconf(), rpmdsLdconfig(), rpmdsMerge(), rpmdsNew(), rpmdsNext(), rpmdsNVRMatchesDep(), rpmdsPipe(), rpmdsSysinfo(), rpmdsThis(), rpmecFree(), rpmEVRfree(), rpmExpandNumeric(), rpmfcClassify(), rpmfcExec(), rpmfcExpandRegexps(), rpmfcGenerateDepends(), rpmfcGenerateDependsHelper(), rpmfcGenerateScriptletDeps(), rpmfd_Fopen(), rpmfiBuildFClasses(), rpmfiBuildFContexts(), rpmfiBuildFDeps(), rpmfiBuildFNames(), rpmfiBuildFSContexts(), rpmfiBuildREContexts(), rpmfiFini(), rpmfiFreeRelocations(), rpmfiNew(), rpmfiOpendir(), rpmFreeFilesystems(), rpmFreeMacros(), rpmFreeRpmrc(), rpmfts_dealloc(), rpmfts_initialize(), rpmGenPath(), rpmGetFilesystemUsage(), rpmgiFini(), rpmgiGlobArgv(), rpmgiInitFilter(), rpmgiLoadReadHeader(), rpmgiNext(), rpmgiOpen(), rpmGlob(), rpmHeadersIdentical(), rpmheClean(), rpmheRealloc(), rpmInitMacros(), rpmInstallSource(), rpmInstallSourcePackage(), rpmioAllArgCallback(), rpmiobFini(), rpmiobSlurp(), rpmioFreePool(), rpmioInit(), rpmioPutPool(), rpmlibMarkers(), rpmmgFini(), rpmmiAddPattern(), rpmmiNext(), rpmnsArch(), rpmnsClean(), rpmnsProbeSignature(), rpmPlatform(), rpmps_ass_sub(), rpmpsFree(), rpmpsFreeIterator(), rpmpsmFini(), rpmpsmStage(), rpmpsPrint(), rpmQueryVerify(), rpmReadConfigFiles(), rpmReadHeader(), rpmReadHeaders(), rpmReadPackageFile(), rpmReadPackageManifest(), rpmReadRC(), rpmRebuildTargetVars(), rpmReSign(), rpmRollback(), rpmSetMachine(), rpmShowProgress(), rpmShowRC(), rpmSingleHeaderFromFD(), rpmsxFini(), rpmsxParse(), rpmsxSort(), rpmteChain(), rpmteFreeTSI(), rpmTempFile(), rpmteNew(), rpmts_Check(), rpmts_HdrCheck(), rpmts_IDTXglob(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), rpmtsAvailable(), rpmtsCallback(), rpmtsCheck(), rpmtsClean(), rpmtsEraseDebuginfo(), rpmtsFindPubkey(), rpmtsFini(), rpmtsInitDSI(), rpmtsOpenDB(), rpmtsOpenSDB(), rpmtsOrder(), rpmtsPRCO(), rpmtsRollback(), rpmtsRun(), rpmtsSetCurrDir(), rpmtsSetRootDir(), rpmtsSolve(), rpmVerifySignatures(), rpmVersionCompare(), rpmWriteHeader(), rpmWriteHeaders(), rpmxarFini(), rpmxarPull(), rpmxarSwapBuf(), runImmedTriggers(), runInstScript(), runScript(), runTriggers(), runTriggersLoop(), saveHardLink(), scpFree(), scpResetAv(), scpResetKeys(), showQueryPackage(), skipFiles(), spec_get_buildroot(), sql_cclose(), sql_cget(), sql_close(), sql_initDB(), sql_open(), sql_stat(), sqlescapeFormat(), stashSt(), statFormat(), str2uuid(), strsubFormat(), tag2uuidv1(), tag2uuidv5(), tagClean(), tagLoadATags(), tagStoreFree(), tagValidate(), tarHeaderReadName(), timeCheck(), triggercondsTag(), triggertypeTag(), tv2uuidv1(), unsatisfiedDepend(), urlFind(), urlFini(), urlFreeCache(), urlGetFile(), urlSplit(), uuidFormat(), valueFree(), verifyMD5(), verifySHA1(), whatneedsTag(), wnlookupTag(), writeLinkedFile(), writeRPM(), xmlFormat(), yamlFormat(), and zapRelation().

static FD_t c2f | ( | void * | cookie | ) |

inline static

Definition at line 536 of file rpmio_internal.h.

References FDSANE.

Referenced by __fdClose(), __fdRead(), __fdWrite(), fdFileno(), fdSeek(), fdSeekNot(), ftpReq(), ufdClose(), ufdRead(), ufdSeek(), and ufdWrite().

const char* fdbg | ( | FD_t | fd | ) |

Definition at line 182 of file rpmio.c.

References _FD_s::bytesRemain, bzdio, fdio, _FDSTACK_s::fdno, _FDSTACK_s::fp, fpio, _FD_s::fps, gzdio, _FDSTACK_s::io, lzdio, _FD_s::nfps, _FD_s::rd_timeoutsecs, ufdio, _FD_s::wr_chunked, and xzdio.

Referenced by __fdClose(), __fdOpen(), __fdRead(), __fdWrite(), Fclose(), fdDup(), fdGetPool(), Fdopen(), fdSeek(), Ferror(), Fileno(), Fread(), Fseek(), Fwrite(), and ufdOpen().

int fdFgets | ( | FD_t | fd,
|  | char * | buf,
|  | size_t | len
| ) |  |

Definition at line 657 of file rpmio.c.

References _rpmio_debug, errno, fdFileno(), fdRead, fdReadable(), _FD_s::rd_timeoutsecs, and _FD_s::syserrno.

Referenced by checkResponse(), and ftpNLST().

static int fdFileno | ( | void * | cookie | ) |

inline static

Definition at line 666 of file rpmio_internal.h.

References c2f(), _FDSTACK_s::fdno, and _FD_s::fps.

Referenced by __fdClose(), __fdRead(), __fdWrite(), fdFgets(), fdReadable(), fdSeek(), fdWritable(), Ferror(), Fopen(), ftpAbort(), ftpLogin(), ftpReq(), httpReq(), ufdRead(), urlConnect(), and urlFini().

static void fdFiniDigest | ( | FD_t | fd,
|  | pgpHashAlgo | hashalgo,
|  | void * | datap,
|  | size_t * | lenp,
|  | int | asAscii
| ) |  |

inline static

Definition at line 588 of file rpmio_internal.h.

References _FD_s::digests, FDSTAT_DIGEST, fdstat_enter(), fdstat_exit(), _FDDIGEST_s::hashalgo, _FDDIGEST_s::hashctx, _FD_s::ndigests, and rpmDigestFinal().

Referenced by compare(), dodigest(), extractRegular(), main(), mtreeVisitF(), repoCloseMDFile(), repoReadHeader(), repoRfileDigest(), rpmdcPrintFile(), statFormat(), and writeRPM().

static unsigned long long fdGetCpioPos | ( | FD_t | fd | ) |

inline static

Definition at line 516 of file rpmio_internal.h.

References _FD_s::fd_cpioPos, and FDSANE.

Referenced by arHeaderRead(), arHeaderWrite(), fsmSetup(), fsmStage(), iosmSetup(), and iosmStage().

static pgpDig fdGetDig | ( | FD_t | fd | ) |

inline static

Definition at line 254 of file rpmio_internal.h.

References _FD_s::dig, and FDSANE.

Referenced by readFile(), and rpmReadHeader().

static int fdGetFdno | ( | FD_t | fd | ) |

inline static

Definition at line 351 of file rpmio_internal.h.

References _FDSTACK_s::fdno, FDSANE, _FD_s::fps, and _FD_s::nfps.

Referenced by Fclose(), Fopen(), and ufdWrite().

static FILE* fdGetFILE | ( | FD_t | fd | ) |

inline static

Definition at line 315 of file rpmio_internal.h.

References FDSANE, _FDSTACK_s::fp, _FD_s::fps, and _FD_s::nfps.

static void* fdGetFp | ( | FD_t | fd | ) |

inline static

Definition at line 327 of file rpmio_internal.h.

References FDSANE, _FDSTACK_s::fp, _FD_s::fps, and _FD_s::nfps.

Referenced by addFileToTagAux(), Fdopen(), Fflush(), Fopen(), processPackageFiles(), readLineFromOFI(), rpmfd_Fopen(), rpmReadPackageManifest(), and urlFini().

static FDIO_t fdGetIo | ( | FD_t | fd | ) |

inline static

Definition at line 291 of file rpmio_internal.h.

References FDSANE, _FD_s::fps, _FDSTACK_s::io, and _FD_s::nfps.

Referenced by Fflush(), Fread(), Fseek(), Fwrite(), getFdErrstr(), ufdRead(), and ufdWrite().

static int fdGetOFlags | ( | FD_t | fd | ) |

inline static

Definition at line 220 of file rpmio_internal.h.

References FDSANE, and _FD_s::oflags.

static mode_t fdGetOMode | ( | FD_t | fd | ) |

inline static

Definition at line 230 of file rpmio_internal.h.

References FDSANE, and _FD_s::omode.

static const char* fdGetOPath | ( | FD_t | fd | ) |

inline static

Definition at line 210 of file rpmio_internal.h.

References FDSANE, and _FD_s::opath.

Referenced by Fchmod(), Fchown(), Fstat(), rdLead(), repoCloseMDFile(), rpmReadHeader(), and rpmReadPackageManifest().

static int fdGetRdTimeoutSecs | ( | FD_t | fd | ) |

inline static

Definition at line 506 of file rpmio_internal.h.

References FDSANE, and _FD_s::rd_timeoutsecs.

static rpmxar fdGetXAR | ( | FD_t | fd | ) |

inline static

Definition at line 279 of file rpmio_internal.h.

References FDSANE, and _FD_s::xar.

Referenced by rdLead(), rdSignature(), readFile(), rpmReadHeader(), and xarRead().

static void fdInitDigest | ( | FD_t | fd,
|  | pgpHashAlgo | hashalgo,
|  | int | flags
| ) |  |

inline static

Attach digest to fd.

Definition at line 550 of file rpmio_internal.h.

References _FD_s::digests, FDDIGEST_MAX, FDSTAT_DIGEST, fdstat_enter(), fdstat_exit(), _FDDIGEST_s::hashalgo, _FDDIGEST_s::hashctx, _FD_s::ndigests, and rpmDigestInit().

Referenced by compare(), dodigest(), extractRegular(), main(), mtreeVisitF(), repoOpenMDFile(), repoReadHeader(), repoRfileDigest(), rpmdcInitFile(), rpmReadPackageFile(), rpmVerifySignatures(), statFormat(), and writeRPM().

static void fdPop | ( | FD_t | fd | ) |

inline static

Definition at line 396 of file rpmio_internal.h.

References FDSANE, fdSetFdno(), fdSetFp(), fdSetIo(), and _FD_s::nfps.

Referenced by Fclose().

static void fdPush | ( | FD_t | fd,
|  | FDIO_t | io,
|  | void * | fp,
|  | int | fdno
| ) |  |

inline static

Definition at line 381 of file rpmio_internal.h.

References FDSANE, fdSetFdno(), fdSetFp(), fdSetIo(), _FD_s::fps, and _FD_s::nfps.

Referenced by Fdopen(), Fopen(), and urlFini().

static void fdSetContentLength | ( | FD_t | fd,
|  | ssize_t | contentLength
| ) |  |

inline static

Definition at line 371 of file rpmio_internal.h.

References _FD_s::bytesRemain, _FD_s::contentLength, and FDSANE.

static void fdSetCpioPos | ( | FD_t | fd,
|  | long int | cpioPos
| ) |  |

inline static

Definition at line 526 of file rpmio_internal.h.

References _FD_s::fd_cpioPos, and FDSANE.

Referenced by fsmSetup(), iosmSetup(), and iosmStage().

static void fdSetDig | ( | FD_t | fd,
|  | pgpDig | dig
| ) |  |

inline static

Definition at line 240 of file rpmio_internal.h.

References _FD_s::dig, FDSANE, pgpDigFree(), and pgpDigLink().

Referenced by rpmReadHeader(), rpmReadPackageFile(), and rpmVerifySignatures().

static void fdSetFdno | ( | FD_t | fd,
|  | int | fdno
| ) |  |

inline static

Definition at line 361 of file rpmio_internal.h.

References _FDSTACK_s::fdno, FDSANE, _FD_s::fps, and _FD_s::nfps.

Referenced by __fdClose(), __fdOpen(), fdDup(), fdPop(), fdPush(), ftpReq(), and tcpConnect().

static void fdSetFp | ( | FD_t | fd,
|  | void * | fp
| ) |  |

inline static

Definition at line 338 of file rpmio_internal.h.

References FDSANE, _FDSTACK_s::fp, _FD_s::fps, and _FD_s::nfps.

Referenced by Fclose(), Fdopen(), fdPop(), fdPush(), and ufdClose().

static void fdSetIo | ( | FD_t | fd,
|  | FDIO_t | io
| ) |  |

inline static

Definition at line 302 of file rpmio_internal.h.

References FDSANE, _FD_s::fps, _FDSTACK_s::io, and _FD_s::nfps.

Referenced by fdPop(), fdPush(), ftpOpen(), httpOpen(), ufdOpen(), and urlConnect().

static void fdSetOpen | ( | FD_t | fd,
|  | const char * | path,
|  | int | flags,
|  | mode_t | mode
| ) |  |

inline static

Definition at line 194 of file rpmio_internal.h.

References FDSANE, _FD_s::oflags, _FD_s::omode, _FD_s::opath, and xstrdup().

Referenced by __fdOpen(), fdDup(), ftpOpen(), rpmtsCallback(), ufdOpen(), and urlConnect().

static void fdSetSyserrno | ( | FD_t | fd,
|  | int | syserrno,
|  | const void * | errcookie
| ) |  |

inline static

Definition at line 493 of file rpmio_internal.h.

References _FD_s::errcookie, FDSANE, and _FD_s::syserrno.

Referenced by ftpLogin(), ftpReq(), httpReq(), and tcpConnect().

static void fdSetXAR | ( | FD_t | fd,
|  | rpmxar | xar
| ) |  |

inline static

Definition at line 266 of file rpmio_internal.h.

References FDSANE, rpmxarLink(), and _FD_s::xar.

Referenced by rdLead().

static void fdstat_enter | ( | FD_t | fd,
|  | int | opx
| ) |  |

inline static

Definition at line 423 of file rpmio_internal.h.

References fdstat_op(), rpmswEnter(), and _FD_s::stats.

Referenced by __fdClose(), __fdRead(), __fdWrite(), fdFiniDigest(), fdInitDigest(), fdSeek(), and fdUpdateDigests().

static void fdstat_exit | ( | FD_t | fd,
|  | int | opx,
|  | ssize_t | rc
| ) |  |

inline static

Definition at line 435 of file rpmio_internal.h.

References _FD_s::bytesRemain, errno, fdstat_op(), FDSTAT_READ, FDSTAT_WRITE, rpmswExit(), _FD_s::stats, and _FD_s::syserrno.

Referenced by __fdClose(), __fdRead(), __fdWrite(), fdFiniDigest(), fdInitDigest(), fdSeek(), and fdUpdateDigests().

static rpmop fdstat_op | ( | FD_t | fd,
|  | fdOpX | opx
| ) |  |

inline static

Definition at line 410 of file rpmio_internal.h.

References FDSTAT_MAX, and _FD_s::stats.

Referenced by compare(), fdstat_enter(), fdstat_exit(), iosmStage(), mtreeVisitF(), repoFclose(), rpmdcFiniFile(), rpmpsmStage(), and rpmReadPackageFile().

static void fdstat_print | ( | FD_t | fd,
|  | const char * | msg,
|  | FILE * | fp
| ) |  |

inline static

Definition at line 458 of file rpmio_internal.h.

References rpmop_s::bytes, rpmop_s::count, FDSTAT_CLOSE, FDSTAT_READ, FDSTAT_SEEK, FDSTAT_WRITE, _FD_s::stats, and rpmop_s::usecs.

static void fdStealDigest | ( | FD_t | fd,
|  | pgpDig | dig
| ) |  |

inline static

Definition at line 625 of file rpmio_internal.h.

References _FD_s::digests, _FDDIGEST_s::hashalgo, _FDDIGEST_s::hashctx, _FD_s::ndigests, PGPHASHALGO_MD5, PGPHASHALGO_RIPEMD160, PGPHASHALGO_SHA1, PGPHASHALGO_SHA256, PGPHASHALGO_SHA384, and PGPHASHALGO_SHA512.

Referenced by readFile(), and rpmReadPackageFile().

static void fdUpdateDigests | ( | FD_t | fd,
|  | const unsigned char * | buf,
|  | ssize_t | buflen
| ) |  |

inline static

Update digest(s) attached to fd.

Definition at line 568 of file rpmio_internal.h.

References _FD_s::digests, FDSTAT_DIGEST, fdstat_enter(), fdstat_exit(), _FDDIGEST_s::hashctx, _FD_s::ndigests, and rpmDigestUpdate().

Referenced by __fdRead(), and __fdWrite().

int ftpCmd | ( | const char * | cmd,
|  | const char * | url,
|  | const char * | arg2
| ) |  |

Definition at line 1639 of file rpmio.c.

References urlinfo_s::ctrl, fdFree(), ftpCommand(), urlConnect(), and urlPath().

Referenced by ftpChdir(), ftpMkdir(), ftpRename(), ftpRmdir(), and ftpUnlink().

FD_t ftpOpen | ( | const char * | url,
|  | int | flags,
|  | mode_t | mode,
|  | urlinfo * | uret
| ) |  |

Definition at line 2175 of file rpmio.c.

References _FD_s::bytesRemain, _FD_s::contentLength, urlinfo_s::data, fdLink(), fdNew(), fdSetIo(), fdSetOpen(), _FD_s::ftpFileDoneNeeded, ftpTimeoutSecs, _FD_s::rd_timeoutsecs, ufdio, _FD_s::url, URL_IS_FTP, urlConnect(), urlLink(), and _FD_s::urlType.

Referenced by ftpNLST(), and ufdOpen().

int ftpReq | ( | FD_t | data,
|  | const char * | ftpCmd,
|  | const char * | ftpArg
| ) |  |

Definition at line 1242 of file rpmio.c.

References _ftp_debug, alloca(), c2f(), _FD_s::contentLength, urlinfo_s::ctrl, errno, fdClose, fdFileno(), fdLink(), fdSetFdno(), fdSetSyserrno(), fdWrite, ftpCheckResponse(), ftpCommand(), FTPERR_BAD_SERVER_RESPONSE, FTPERR_FAILED_CONNECT, FTPERR_FAILED_DATA_CONNECT, FTPERR_PASSIVE_ERROR, FTPERR_SERVER_IO_ERROR, FTPERR_UNKNOWN, _FD_s::ftpFileDoneNeeded, ftpStrerror(), inet_aton, NI_MAXHOST, stpcpy(), _FD_s::url, and URLSANE.

Referenced by ftpNLST(), and ufdOpen().

rpmtime_t rpmswAdd | ( | rpmop | to,
|  | rpmop | from
| ) |  |

Sum statistic counters.

Parameters

  to | result statistics
  from | operation statistics

Returns
  cumulative usecs for operation

Definition at line 280 of file rpmsw.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

Referenced by compare(), fsmTeardown(), headerScrub(), iosmStage(), iosmTeardown(), mtreeVisitF(), psmWait(), repoFclose(), rpmdcFiniFile(), rpmpsmStage(), rpmReadPackageFile(), rpmtsCleanDig(), rpmtsCloseDB(), rpmtsCloseSDB(), and rpmtsPrintStats().

int rpmswEnter | ( | rpmop | op,
|  | ssize_t | rc
| ) |  |

Enter timed operation.

Parameters

  op | operation statistics
  rc | -1 clears usec counter

Returns
  0 always

Definition at line 248 of file rpmsw.c.

References rpmop_s::begin, rpmop_s::bytes, rpmop_s::count, rpmswNow(), and rpmop_s::usecs.

Referenced by fdstat_enter(), headerCheck(), headerGet(), headerLoad(), headerNext(), headerUnload(), main(), repoRfileDigest(), rpmpsmStage(), rpmReadPackageFile(), rpmsqWaitUnregister(), rpmtsCheck(), rpmtsCreate(), rpmtsOrder(), rpmtsRun(), verifyDSA(), verifyMD5(), verifyRSA(), and verifySHA1().

rpmtime_t rpmswExit | ( | rpmop | op,
|  | ssize_t | rc
| ) |  |

Exit timed operation.

Parameters

  op | operation statistics
  rc | per-operation data (e.g. bytes transferred)

Returns
  cumulative usecs for operation

Definition at line 264 of file rpmsw.c.

References rpmop_s::begin, rpmop_s::bytes, rpmswDiff(), rpmswNow(), and rpmop_s::usecs.

Referenced by fdstat_exit(), headerCheck(), headerGet(), headerLoad(), headerNext(), headerUnload(), main(), repoRfileDigest(), rpmpsmStage(), rpmReadPackageFile(), rpmsqWaitUnregister(), rpmtsCheck(), rpmtsOrder(), rpmtsPrintStats(), rpmtsRun(), verifyDSA(), verifyMD5(), verifyRSA(), and verifySHA1().

void rpmswPrint | ( | const char * | name,
|  | rpmop | op
| ) |  |

Print operation statistics.

Parameters

  name | operation name
  op | operation statistics

Definition at line 304 of file rpmsw.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

Referenced by main().

rpmtime_t rpmswSub | ( | rpmop | to,
|  | rpmop | from
| ) |  |

Subtract statistic counters.

Parameters

  to | result statistics
  from | operation statistics

Returns
  cumulative usecs for operation

Definition at line 292 of file rpmsw.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

Referenced by rpmReadPackageFile().

static rpmtime_t tvsub | ( | const struct timeval * | etv,
|  | const struct timeval * | btv
| ) |  |

inline static

Return difference of 2 timeval stamps in micro-seconds.

Parameters

  *etv | end timeval
  *btv | begin timeval

Returns
  difference in milli-seconds

Definition at line 111 of file rpmsw.c.

Referenced by rpmswDiff().

int ufdClose | ( | void * | cookie | ) |

Definition at line 2057 of file rpmio.c.

References _FD_s::bytesRemain, c2f(), _FD_s::contentLength, urlinfo_s::ctrl, urlinfo_s::data, fdClose, fdFree(), fdGetFILE, fdReadable(), fdSetFp(), ftpAbort(), ftpFileDone(), _FD_s::ftpFileDoneNeeded, noLibio, _FD_s::persist, urlinfo_s::scheme, UFDONLY, _FD_s::url, URL_IS_FTP, urlFree(), and urlinfo_s::urltype.

Referenced by Fclose(), ftpNLST(), and ufdOpen().

int xstrcasecmp | ( | const char * | s1,
|  | const char * | s2
| ) |  |

Locale insensitive strcasecmp(3).

Definition at line 9 of file strcasecmp.c.

References xtolower().

Referenced by _tagValue(), argvStrcasecmp(), buildForTarget(), findTag(), hdr_subscript(), headerGet(), initSourceHeader(), isMemberInEntry(), machAddEquiv(), myTagValue(), parseYesNo(), rpmioAllArgCallback(), and rpmRebuildTargetVars().

int xstrncasecmp | ( | const char * | s1,
|  | const char * | s2,
|  | size_t | n
| ) |  |

Locale insensitive strncasecmp(3).

Definition at line 30 of file strcasecmp.c.

References xtolower().

Referenced by findPreambleTag(), isPart(), Link(), matchTok(), pgpHashAlgoStringToNumber(), and Rename().

const char* xstrtolocale | ( | const char * | str | ) |

Force encoding of string.

Definition at line 15 of file strtolocale.c.

References errno, xmalloc(), and xrealloc().

Referenced by i18nTag(), localeTag(), parseChangelog(), xmlFormat(), and yamlFormat().

## Variable Documentation

size_t _rpmiob_chunk

Definition at line 11 of file rpmiob.c.

Referenced by rpmiobAppend(), and rpmiobNew().

int _rpmmg_debug

Definition at line 20 of file rpmmg.c.

Referenced by doUntar(), rpmmgBuffer(), rpmmgFile(), and rpmmgGetPool().