Go to the documentation of this file.00001 #ifndef H_RPMIO
00002 #define H_RPMIO
00003
00009 #include <sys/types.h>
00010 #include <sys/stat.h>
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 #include <unistd.h>
00014
00015 #include <rpm/rpmtypes.h>
00016 #include <rpm/rpmsw.h>
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00028 #if defined(__GLIBC__) && \
00029 (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
00030 #define USE_COOKIE_SEEK_POINTER 1
00031 typedef _IO_off64_t _libio_off_t;
00032 typedef _libio_off_t * _libio_pos_t;
00033 #else
00034 typedef off_t _libio_off_t;
00035 typedef off_t _libio_pos_t;
00036 #endif
00037
00040 typedef const struct FDIO_s * FDIO_t;
00041
00042
00050 const char * Fstrerror(FD_t fd);
00051
00055 ssize_t Fread(void * buf, size_t size, size_t nmemb, FD_t fd);
00056
00060 ssize_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd);
00061
00065 int Fseek(FD_t fd, _libio_off_t offset, int whence);
00066
00070 off_t Ftell(FD_t fd);
00071
00075 int Fclose( FD_t fd);
00076
00079 FD_t Fdopen(FD_t ofd, const char * fmode);
00080
00084 FD_t Fopen(const char * path,
00085 const char * fmode);
00086
00087
00091 int Fflush(FD_t fd);
00092
00096 int Ferror(FD_t fd);
00097
00101 int Fileno(FD_t fd);
00102
00106 int Fcntl(FD_t fd, int op, void *lip);
00107
00114 off_t fdSize(FD_t fd);
00115
00118 FD_t fdDup(int fdno);
00119
00123 FILE * fdGetFILE(FD_t fd);
00124
00127 FD_t fdLink(void * cookie);
00128
00131 FD_t fdFree(FD_t fd);
00132
00135 FD_t fdNew (void);
00136
00139 int ufdCopy(FD_t sfd, FD_t tfd);
00140
00146 ssize_t timedRead(FD_t fd, void * bufptr, size_t length);
00147
00151 typedef enum fdOpX_e {
00152 FDSTAT_READ = 0,
00153 FDSTAT_WRITE = 1,
00154 FDSTAT_SEEK = 2,
00155 FDSTAT_CLOSE = 3,
00156 FDSTAT_DIGEST = 4,
00157 FDSTAT_MAX = 5
00158 } fdOpX;
00159
00163 rpmop fdOp(FD_t fd, fdOpX opx);
00164
00165 #ifdef __cplusplus
00166 }
00167 #endif
00168
00169 #endif