rpm  4.5
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
rpmio_internal.h File Reference
#include <rpmio.h>
#include <rpmurl.h>
#include <beecrypt/beecrypt.api.h>
#include <rpmpgp.h>
#include <rpmsw.h>
#include <beecrypt/beecrypt.h>
#include <beecrypt/base64.h>
#include <beecrypt/dsa.h>
#include <beecrypt/endianness.h>
#include <beecrypt/md5.h>
#include <beecrypt/mp.h>
#include <beecrypt/rsa.h>
#include <beecrypt/rsapk.h>
#include <beecrypt/sha1.h>
Include dependency graph for rpmio_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pgpDigParams_s
 Values parsed from OpenPGP signature/pubkey packet(s). More...
 
struct  pgpDig_s
 Container for values parsed from an OpenPGP signature and public key. More...
 
struct  _FDSTACK_s
 
struct  _FDDIGEST_s
 
struct  _FD_s
 The FD_t File Handle data structure. More...
 

Macros

#define PGPDIG_SAVED_TIME   (1 << 0)
 
#define PGPDIG_SAVED_ID   (1 << 1)
 
#define RPMIO_DEBUG_IO   0x40000000
 
#define RPMIO_DEBUG_REFS   0x20000000
 
#define FDMAGIC   0x04463138
 
#define FDDIGEST_MAX   32
 
#define FDSANE(fd)   assert(fd && fd->magic == FDMAGIC)
 
#define DBG(_f, _m, _x)
 
#define DBGIO(_f, _x)   DBG((_f), RPMIO_DEBUG_IO, _x)
 
#define DBGREFS(_f, _x)   DBG((_f), RPMIO_DEBUG_REFS, _x)
 

Typedefs

typedef struct _FDSTACK_s FDSTACK_t
 
typedef enum fdOpX_e fdOpX
 Identify per-desciptor I/O operation statistics.
 
struct {
   struct rpmop_s   ops [FDSTAT_MAX]
 
FDSTAT_t
 
typedef struct _FDDIGEST_sFDDIGEST_t
 

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...
 

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 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.
 
static void fdUpdateDigests (FD_t fd, const unsigned char *buf, ssize_t buflen)
 Update digest(s) attached to fd.
 
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 unsigned char **bp, ssize_t *blenp)
 Read an entire file into a buffer.
 

Variables

int _rpmio_debug
 
int _av_debug
 
int _ftp_debug
 
int _dav_debug
 

Macro Definition Documentation

#define DBG (   _f,
  _m,
  _x 
)
Value:
/*@-modfilesys@*/ \
if ((_rpmio_debug | ((_f) ? ((FD_t)(_f))->flags : 0)) & (_m)) fprintf _x \
/*@=modfilesys@*/

Definition at line 234 of file rpmio_internal.h.

#define DBGIO (   _f,
  _x 
)    DBG((_f), RPMIO_DEBUG_IO, _x)
#define DBGREFS (   _f,
  _x 
)    DBG((_f), RPMIO_DEBUG_REFS, _x)

Definition at line 244 of file rpmio_internal.h.

Referenced by XfdFree(), and XfdLink().

#define FDDIGEST_MAX   32

Definition at line 204 of file rpmio_internal.h.

Referenced by fdInitDigest().

#define FDMAGIC   0x04463138

Definition at line 177 of file rpmio_internal.h.

Referenced by XfdNew().

#define FDSANE (   fd)    assert(fd && fd->magic == FDMAGIC)
#define PGPDIG_SAVED_ID   (1 << 1)

Definition at line 84 of file rpmio_internal.h.

Referenced by pgpPrtPkt(), and pgpPrtSubType().

#define PGPDIG_SAVED_TIME   (1 << 0)

Definition at line 83 of file rpmio_internal.h.

Referenced by pgpPrtSubType().

#define RPMIO_DEBUG_IO   0x40000000

Definition at line 174 of file rpmio_internal.h.

#define RPMIO_DEBUG_REFS   0x20000000

Definition at line 175 of file rpmio_internal.h.

Function Documentation

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

Read an entire file into a buffer.

Parameters
fnfile name to read
Return values
*bp(malloc'd) buffer address
*blenp(malloc'd) buffer length
Returns
0 on success

Definition at line 3457 of file rpmio.c.

References Fclose(), fdSize(), Ferror(), Fopen(), Fread(), xmalloc(), and xrealloc().

Referenced by pgpReadPkts(), processMetadataFile(), and rpmPlatform().

Variable Documentation

int _av_debug

Definition at line 151 of file rpmio.c.

int _dav_debug
int _ftp_debug

Definition at line 156 of file rpmio.c.

int _rpmio_debug

Definition at line 146 of file rpmio.c.

struct rpmop_s ops[FDSTAT_MAX]

Cumulative statistics.

Definition at line 157 of file rpmio_internal.h.

Referenced by codebinop().