- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

# rpmio.h

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, const char * msg);
    00128
    00131 FD_t fdFree(FD_t fd, const char * msg);
    00132
    00135 FD_t fdNew (const char * msg);
    00136
    00139 int fdWritable(FD_t fd, int secs);
    00140
    00143 int fdReadable(FD_t fd, int secs);
    00144
    00147 int ufdCopy(FD_t sfd, FD_t tfd);
    00148
    00154 ssize_t timedRead(FD_t fd, void * bufptr, size_t length);
    00155
    00159 typedef enum fdOpX_e {
    00160     FDSTAT_READ         = 0,
    00161     FDSTAT_WRITE        = 1,
    00162     FDSTAT_SEEK         = 2,
    00163     FDSTAT_CLOSE        = 3,
    00164     FDSTAT_DIGEST       = 4,
    00165     FDSTAT_MAX          = 5
    00166 } fdOpX;
    00167
    00171 rpmop fdOp(FD_t fd, fdOpX opx);
    00172
    00173 #ifdef __cplusplus
    00174 }
    00175 #endif
    00176
    00177 #endif  /* H_RPMIO */