7 * RPM I/O API (Fd_t is RPM equivalent to libc's FILE)
10 #include <sys/types.h>
16 #include <rpm/rpmtypes.h>
17 #include <rpm/rpmsw.h>
25 typedef const struct FDIO_s * FDIO_t;
29 * \name RPMIO Interface.
35 const char * Fstrerror(FD_t fd);
40 ssize_t Fread(void * buf, size_t size, size_t nmemb, FD_t fd);
45 ssize_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd);
50 int Fseek(FD_t fd, off_t offset, int whence);
64 FD_t Fdopen(FD_t ofd, const char * fmode);
69 FD_t Fopen(const char * path,
91 int Fcntl(FD_t fd, int op, void *lip);
94 * Get informative description (eg file name) from fd for diagnostic output.
96 const char * Fdescr(FD_t fd);
99 * \name RPMIO Utilities.
104 off_t fdSize(FD_t fd);
108 FD_t fdDup(int fdno);
112 FD_t fdLink(FD_t fd);
116 FD_t fdFree(FD_t fd);
120 off_t ufdCopy(FD_t sfd, FD_t tfd);
123 * Identify per-desciptor I/O operation statistics.
125 typedef enum fdOpX_e {
126 FDSTAT_READ = 0, /*!< Read statistics index. */
127 FDSTAT_WRITE = 1, /*!< Write statistics index. */
128 FDSTAT_SEEK = 2, /*!< Seek statistics index. */
129 FDSTAT_CLOSE = 3, /*!< Close statistics index */
130 FDSTAT_DIGEST = 4, /*!< Digest statistics index. */
137 rpmop fdOp(FD_t fd, fdOpX opx);