Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# rpmio_internal.h File Reference

`#include <rpmio.h>`
`#include <rpmurl.h>`
`#include <rpmpgp.h>`

Go to the source code of this file.

## Defines
#define | RPMIO_DEBUG_IO 0x40000000
#define | RPMIO_DEBUG_REFS 0x20000000
#define | FDMAGIC 0x04463138
#define | FDDIGEST_MAX 4
#define | FDSANE(fd) assert(fd && fd->magic == FDMAGIC)
#define | DBG(_f, _m, _x) if ((_rpmio_debug | ((_f) ? ((FD_t)(_f))->flags : 0)) & (_m)) fprintf _x
#define | DBGIO(_f, _x) DBG((_f), RPMIO_DEBUG_IO, _x)
#define | DBGREFS(_f, _x) DBG((_f), RPMIO_DEBUG_REFS, _x)
## Typedefs
typedef _FDSTACK_s | FDSTACK_t
struct {
timeval create
timeval begin
OPSTAT_t ops [4]
} | FDSTAT_t
typedef enum rpmDigestFlags_e | rpmDigestFlags
typedef _FDDIGEST_s * | FDDIGEST_t
## Enumerations
enum | FDSTAT_e { FDSTAT_READ = 0, FDSTAT_WRITE = 1, FDSTAT_SEEK = 2, FDSTAT_CLOSE = 3 }
enum | rpmDigestFlags_e { RPMDIGEST_NONE = 0 }
## Functions
DIGEST_CTX | rpmDigestDup (DIGEST_CTX octx)
DIGEST_CTX | rpmDigestInit (pgpHashAlgo hashalgo, rpmDigestFlags flags)
int | rpmDigestUpdate (DIGEST_CTX ctx, const void *data, size_t len)
int | rpmDigestFinal (DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii)
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 const 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 void | fdstat_enter (FD_t fd, int opx)
static time_t | tvsub (const struct timeval *etv, const struct timeval *btv)
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 long int | 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)
static void | fdUpdateDigests (FD_t fd, const byte *buf, ssize_t buflen)
static void | fdFiniDigest (FD_t fd, pgpHashAlgo hashalgo, void **datap, size_t *lenp, int asAscii)
static int | fdFileno (void *cookie)
int | rpmioSlurp (const char *fn, const byte **bp, ssize_t *blenp)
## Variables
int | _rpmio_debug

## Detailed Description

Definition in file rpmio_internal.h.

## Define Documentation

#define DBG | ( | _f,
|  | _m,
|  | _x |  | ) | if ((_rpmio_debug | ((_f) ? ((FD_t)(_f))->flags : 0)) & (_m)) fprintf _x

| Definition at line 152 of file rpmio_internal.h.

#define DBGIO | ( | _f,
|  | _x |  | ) | DBG((_f), RPMIO_DEBUG_IO, _x)

| Definition at line 155 of file rpmio_internal.h. Referenced by Fclose(), fdClose(), fdDup(), Fdopen(), fdOpen(), fdRead(), fdSeek(), fdSize(), fdWrite(), Ferror(), Fileno(), Fread(), Fseek(), ftpAbort(), Fwrite(), ufdCopy(), and ufdOpen().

#define DBGREFS | ( | _f,
|  | _x |  | ) | DBG((_f), RPMIO_DEBUG_REFS, _x)

| Definition at line 156 of file rpmio_internal.h. Referenced by XfdFree(), and XfdLink().

#define FDDIGEST_MAX 4

| Definition at line 135 of file rpmio_internal.h. Referenced by fdInitDigest().

#define FDMAGIC 0x04463138

| Definition at line 117 of file rpmio_internal.h. Referenced by XfdNew().

#define FDSANE | ( | fd |  | ) | assert(fd && fd->magic == FDMAGIC)

| Definition at line 145 of file rpmio_internal.h. Referenced by c2f(), Fclose(), fdGetCpioPos(), fdGetFdno(), fdGetFILE(), fdGetFp(), fdGetIo(), fdGetRdTimeoutSecs(), Fdopen(), fdPop(), fdPush(), fdSeekNot(), fdSetContentLength(), fdSetCpioPos(), fdSetFdno(), fdSetFp(), fdSetIo(), fdSetSyserrno(), fdSize(), Fread(), Fseek(), Fstrerror(), Fwrite(), ufdGetFile(), ufdGetUrlinfo(), and XfdFree().

#define RPMIO_DEBUG_IO 0x40000000

| Definition at line 114 of file rpmio_internal.h.

#define RPMIO_DEBUG_REFS 0x20000000

| Definition at line 115 of file rpmio_internal.h.

## Function Documentation

int rpmioSlurp | ( | const char * | fn,
|  | const byte ** | bp,
|  | ssize_t * | blenp
| ) |

| Definition at line 3117 of file rpmio.c. References Fclose(), fdSize(), Ferror(), Fopen(), Fread(), xmalloc(), and xrealloc(). Referenced by pgpReadPkts().

## Variable Documentation

int _rpmio_debug

| Definition at line 123 of file rpmio.c.

struct timeval begin

| Operation start time. Definition at line 45 of file rpmio_internal.h. Referenced by rpmCleanPath().

struct timeval create

| Structure creation time. Definition at line 44 of file rpmio_internal.h.

OPSTAT_t ops[4]

| Cumulative statistics. Definition at line 46 of file rpmio_internal.h. Referenced by fdstat_print(), and singleOptionHelp().