rpm 4.19.0
The RPM Package Manager
|
The RPM IO API (Fd_t is RPM equivalent to libc's FILE). More...
Files | |
file | rpmbase64.h |
file | rpmfileutil.h |
file | rpmio.h |
file | rpmlog.h |
file | rpmmacro.h |
file | rpmsq.h |
file | rpmsw.h |
file | rpmurl.h |
Typedefs | |
typedef const struct FDIO_s * | FDIO_t |
RPMIO Utilities. | |
enum | fdOpX_e { FDSTAT_READ = 0 , FDSTAT_WRITE = 1 , FDSTAT_SEEK = 2 , FDSTAT_CLOSE = 3 , FDSTAT_DIGEST = 4 , FDSTAT_MAX = 5 } |
typedef enum fdOpX_e | fdOpX |
off_t | fdSize (FD_t fd) |
FD_t | fdDup (int fdno) |
FD_t | fdLink (FD_t fd) |
FD_t | fdFree (FD_t fd) |
rpmop | fdOp (FD_t fd, fdOpX opx) |
off_t | ufdCopy (FD_t sfd, FD_t tfd) |
RPMIO Interface. | |
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) |
The RPM IO API (Fd_t is RPM equivalent to libc's FILE).
enum fdOpX_e |
int Fclose | ( | FD_t | fd | ) |
fclose(3) clone.
int Fcntl | ( | FD_t | fd, |
int | op, | ||
void * | lip | ||
) |
fcntl(2) clone.
const char * Fdescr | ( | FD_t | fd | ) |
Get informative description (eg file name) from fd for diagnostic output.
int Ferror | ( | FD_t | fd | ) |
ferror(3) clone.
int Fflush | ( | FD_t | fd | ) |
fflush(3) clone.
int Fileno | ( | FD_t | fd | ) |
fileno(3) clone.
FD_t Fopen | ( | const char * | path, |
const char * | fmode | ||
) |
fopen(3) clone.
Supports compression.
The fmode
parameter is based on that of fopen(3)
, but may also include a compression method (type
and flags
) to use when opening the stream, and has the following format:
The compression type
(compressor) is mandatory, determines the supported mode
chars (also mandatory), and can be one of the following:
Type | Description | Mode chars |
---|---|---|
ufdio | uncompressed | r,w,a,b,+,x |
gzdio | gzip | r,w,a |
bzdio | bzip2 | r,w,a |
xzdio | xz | r,w,a |
lzdio | lzma (legacy) | r,w,a |
zstdio | zstd | r,w,a |
Compression flags
must be listed in the following order and can be any of:
Flag | Description | Types |
---|---|---|
0-9 | compression level | all except ufdio |
T<0-N> | no. of threads (0 = autodetect) | xzdio and zstdio |
L<0-9> | window size (see --long in zstd(1) ) | zstdio |
If a flag is omitted, the compressor's default value will be used.
Mode | Description |
---|---|
w9.gzdio | gzip level 9, default for package payload |
w9.bzdio | bzip2 level 9, bzip2's default |
w6.xzdio | xz level 6, xz's default |
w.xzdio | xz level 6, xz's default |
w7T16.xzdio | xz level 7 using 16 threads |
w7T0.xzdio | xz level 7, autodetect no. of threads |
w6.lzdio | lzma (legacy) level 6, lzma's default |
w3.zstdio | zstd level 3, zstd's default |
w19T8.zstdio | zstd level 19 using 8 threads |
w7T0.zstdio | zstd level 7, autodetect no. of threads |
w.ufdio | uncompressed |
ssize_t Fread | ( | void * | buf, |
size_t | size, | ||
size_t | nmemb, | ||
FD_t | fd | ||
) |
Like fread(3) but with read(3)-style return values.
int Fseek | ( | FD_t | fd, |
off_t | offset, | ||
int | whence | ||
) |
fseek(3) clone.
const char * Fstrerror | ( | FD_t | fd | ) |
strerror(3) clone.
off_t Ftell | ( | FD_t | fd | ) |
ftell(3) clone.
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.