rpm  4.8.1
Typedefs
rpmio.h File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmsw.h>
Include dependency graph for rpmio.h:

Go to the source code of this file.

Typedefs

typedef off_t _libio_off_t
 Hide libio API lossage. More...
 
typedef off_t _libio_pos_t
 
typedef const struct FDIO_s * FDIO_t
 

Functions

RPMIO Interface.
const char * Fstrerror (FD_t fd)
 strerror(3) clone. More...
 
ssize_t Fread (void *buf, size_t size, size_t nmemb, FD_t fd)
 fread(3) clone. More...
 
ssize_t Fwrite (const void *buf, size_t size, size_t nmemb, FD_t fd)
 fwrite(3) clone. More...
 
int Fseek (FD_t fd, _libio_off_t offset, int whence)
 fseek(3) clone. More...
 
off_t Ftell (FD_t fd)
 ftell(3) clone. More...
 
int Fclose (FD_t fd)
 fclose(3) clone. More...
 
FD_t Fdopen (FD_t ofd, const char *fmode)
 
FD_t Fopen (const char *path, const char *fmode)
 fopen(3) clone. More...
 
int Fflush (FD_t fd)
 fflush(3) clone. More...
 
int Ferror (FD_t fd)
 ferror(3) clone. More...
 
int Fileno (FD_t fd)
 fileno(3) clone. More...
 
int Fcntl (FD_t fd, int op, void *lip)
 fcntl(2) clone. More...
 

RPMIO Utilities.

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...
 
typedef enum fdOpX_e fdOpX
 Identify per-desciptor I/O operation statistics. More...
 
off_t fdSize (FD_t fd)
 
FD_t fdDup (int fdno)
 
FILE * fdGetFILE (FD_t fd)
 Get associated FILE stream from fd (if any) More...
 
FD_t fdLink (void *cookie, const char *msg)
 
FD_t fdFree (FD_t fd, const char *msg)
 
FD_t fdNew (const char *msg)
 
int fdWritable (FD_t fd, int secs)
 
int fdReadable (FD_t fd, int secs)
 
int ufdCopy (FD_t sfd, FD_t tfd)
 
ssize_t timedRead (FD_t fd, void *bufptr, size_t length)
 XXX the name is misleading, this is a legacy wrapper that ensures only S_ISREG() files are read, nothing to do with timed... More...
 
rpmop fdOp (FD_t fd, fdOpX opx)
 

Typedef Documentation

◆ _libio_off_t

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 34 of file rpmio.h.

◆ _libio_pos_t

typedef off_t _libio_pos_t

Definition at line 35 of file rpmio.h.

◆ FDIO_t

typedef const struct FDIO_s* FDIO_t

Definition at line 40 of file rpmio.h.

◆ fdOpX

typedef enum fdOpX_e fdOpX

Identify per-desciptor I/O operation statistics.

Enumeration Type Documentation

◆ fdOpX_e

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 159 of file rpmio.h.

Function Documentation

◆ Fclose()

int Fclose ( FD_t  fd)

fclose(3) clone.

Referenced by main().

◆ Fcntl()

int Fcntl ( FD_t  fd,
int  op,
void *  lip 
)

fcntl(2) clone.

◆ fdDup()

FD_t fdDup ( int  fdno)

Referenced by main().

◆ fdFree()

FD_t fdFree ( FD_t  fd,
const char *  msg 
)

◆ fdGetFILE()

FILE* fdGetFILE ( FD_t  fd)

Get associated FILE stream from fd (if any)

◆ fdLink()

FD_t fdLink ( void *  cookie,
const char *  msg 
)

◆ fdNew()

FD_t fdNew ( const char *  msg)

◆ fdOp()

rpmop fdOp ( FD_t  fd,
fdOpX  opx 
)

◆ Fdopen()

FD_t Fdopen ( FD_t  ofd,
const char *  fmode 
)

Referenced by main().

◆ fdReadable()

int fdReadable ( FD_t  fd,
int  secs 
)

◆ fdSize()

off_t fdSize ( FD_t  fd)

◆ fdWritable()

int fdWritable ( FD_t  fd,
int  secs 
)

◆ Ferror()

int Ferror ( FD_t  fd)

ferror(3) clone.

Referenced by main().

◆ Fflush()

int Fflush ( FD_t  fd)

fflush(3) clone.

◆ Fileno()

int Fileno ( FD_t  fd)

fileno(3) clone.

◆ Fopen()

FD_t Fopen ( const char *  path,
const char *  fmode 
)

fopen(3) clone.

Referenced by main().

◆ Fread()

ssize_t Fread ( void *  buf,
size_t  size,
size_t  nmemb,
FD_t  fd 
)

fread(3) clone.

◆ Fseek()

int Fseek ( FD_t  fd,
_libio_off_t  offset,
int  whence 
)

fseek(3) clone.

◆ Fstrerror()

const char* Fstrerror ( FD_t  fd)

strerror(3) clone.

Referenced by main().

◆ Ftell()

off_t Ftell ( FD_t  fd)

ftell(3) clone.

◆ Fwrite()

ssize_t Fwrite ( const void *  buf,
size_t  size,
size_t  nmemb,
FD_t  fd 
)

fwrite(3) clone.

◆ timedRead()

ssize_t timedRead ( FD_t  fd,
void *  bufptr,
size_t  length 
)

XXX the name is misleading, this is a legacy wrapper that ensures only S_ISREG() files are read, nothing to do with timed...

TODO: get this out of the API

◆ ufdCopy()

int ufdCopy ( FD_t  sfd,
FD_t  tfd 
)

Referenced by main().