rpmio.h
Go to the documentation of this file.
#ifndef H_RPMIO
#define H_RPMIO
#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>
#ifdef __cplusplus
extern "C" {
#endif
typedef const struct FDIO_s * FDIO_t;
const char * Fstrerror(FD_t fd);
ssize_t Fread(void * buf, size_t size, size_t nmemb, FD_t fd);
ssize_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd);
int Fseek(FD_t fd, off_t offset, int whence);
off_t Ftell(FD_t fd);
int Fclose( FD_t fd);
FD_t Fdopen(FD_t ofd, const char * fmode);
FD_t Fopen(const char * path,
const char * fmode);
int Fflush(FD_t fd);
int Ferror(FD_t fd);
int Fileno(FD_t fd);
int Fcntl(FD_t fd, int op, void *lip);
const char * Fdescr(FD_t fd);
off_t fdSize(FD_t fd);
FD_t fdDup(int fdno);
FD_t fdLink(FD_t fd);
FD_t fdFree(FD_t fd);
off_t ufdCopy(FD_t sfd, FD_t tfd);
typedef enum fdOpX_e {
FDSTAT_READ = 0,
FDSTAT_WRITE = 1,
FDSTAT_SEEK = 2,
FDSTAT_CLOSE = 3,
FDSTAT_DIGEST = 4,
FDSTAT_MAX = 5
} fdOpX;
rpmop fdOp(FD_t fd, fdOpX opx);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMIO */
Fdescr
const char * Fdescr(FD_t fd)
Get informative description (eg file name) from fd for diagnostic output.
fdSize
off_t fdSize(FD_t fd)
FDSTAT_SEEK
Definition: rpmio.h:128
FDSTAT_MAX
Definition: rpmio.h:131
Fileno
int Fileno(FD_t fd)
fileno(3) clone.
fdOpX
enum fdOpX_e fdOpX
Identify per-desciptor I/O operation statistics.
fdOp
rpmop fdOp(FD_t fd, fdOpX opx)
fdFree
FD_t fdFree(FD_t fd)
Fread
ssize_t Fread(void *buf, size_t size, size_t nmemb, FD_t fd)
Like fread(3) but with read(3)-style return values.
Fflush
int Fflush(FD_t fd)
fflush(3) clone.
FDIO_t
const struct FDIO_s * FDIO_t
Definition: rpmio.h:25
FD_t
struct _FD_s * FD_t
RPM IO file descriptor type.
Definition: rpmtypes.h:98
Fseek
int Fseek(FD_t fd, off_t offset, int whence)
fseek(3) clone.
Fwrite
ssize_t Fwrite(const void *buf, size_t size, size_t nmemb, FD_t fd)
Like fwrite(3) but with write(3)-style return values.
Fdopen
FD_t Fdopen(FD_t ofd, const char *fmode)
ufdCopy
off_t ufdCopy(FD_t sfd, FD_t tfd)
rpmop_s
Cumulative statistics for an operation.
Definition: rpmsw.h:42
Ftell
off_t Ftell(FD_t fd)
ftell(3) clone.
FDSTAT_WRITE
Definition: rpmio.h:127
fdLink
FD_t fdLink(FD_t fd)
Fstrerror
const char * Fstrerror(FD_t fd)
strerror(3) clone.
fdOpX_e
fdOpX_e
Identify per-desciptor I/O operation statistics.
Definition: rpmio.h:125
fdDup
FD_t fdDup(int fdno)
FDSTAT_READ
Definition: rpmio.h:126
Fopen
FD_t Fopen(const char *path, const char *fmode)
fopen(3) clone.
FDSTAT_CLOSE
Definition: rpmio.h:129
Fcntl
int Fcntl(FD_t fd, int op, void *lip)
fcntl(2) clone.
FDSTAT_DIGEST
Definition: rpmio.h:130
Ferror
int Ferror(FD_t fd)
ferror(3) clone.
Fclose
int Fclose(FD_t fd)
fclose(3) clone.