#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <glob.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
| struct | FDIO_s |
RPMIO Utilities. | |
| #define | fdFileno(_fd) fdio->_fileno(_fd) |
| #define | fdOpen(_path, _flags, _mode) fdio->_open((_path), (_flags), (_mode)) |
| #define | fdRead(_fd, _buf, _count) fdio->read((_fd), (_buf), (_count)) |
| #define | fdWrite(_fd, _buf, _count) fdio->write((_fd), (_buf), (_count)) |
| #define | fdCLose(_fd) fdio->close(_fd) |
| #define | fdLink(_fd, _msg) fdio->_fdref(_fd, _msg, __FILE__, __LINE__) |
| #define | fdFree(_fd, _msg) fdio->_fdderef(_fd, _msg, __FILE__, __LINE__) |
| #define | fdNew(_msg) fdio->_fdnew(_msg, __FILE__, __LINE__) |
| #define | timedRead ufdio->read |
| typedef enum ftperrCode_e | ftperrCode |
| FTP and HTTP error codes. | |
| enum | ftperrCode_e { FTPERR_BAD_SERVER_RESPONSE = -1, FTPERR_SERVER_IO_ERROR = -2, FTPERR_SERVER_TIMEOUT = -3, FTPERR_BAD_HOST_ADDR = -4, FTPERR_BAD_HOSTNAME = -5, FTPERR_FAILED_CONNECT = -6, FTPERR_FILE_IO_ERROR = -7, FTPERR_PASSIVE_ERROR = -8, FTPERR_FAILED_DATA_CONNECT = -9, FTPERR_FILE_NOT_FOUND = -10, FTPERR_NIC_ABORT_IN_PROGRESS = -11, FTPERR_UNKNOWN = -100 } |
| FTP and HTTP error codes. More... | |
| off_t | fdSize (FD_t fd) |
| FD_t | fdDup (int fdno) |
| int | fdFileno (void *cookie) |
| FD_t | fdOpen (const char *path, int flags, mode_t mode) |
| ssize_t | fdRead (void *cookie, char *buf, size_t count) |
| ssize_t | fdWrite (void *cookie, const char *buf, size_t count) |
| int | fdClose (void *cookie) |
| FD_t | fdLink (void *cookie, const char *msg) |
| FD_t | fdFree (FD_t fd, const char *msg) |
| FD_t | fdNew (const char *msg) |
| int | fdWritable (FD_t fd, int secs) |
| int | fdReadable (FD_t fd, int secs) |
| const char *const | ftpStrerror (int errorNumber) |
| void * | ufdGetUrlinfo (FD_t fd) |
| const char * | urlStrerror (const char *url) |
| int | ufdCopy (FD_t sfd, FD_t tfd) |
| int | ufdGetFile (FD_t sfd, FD_t tfd) |
| int | timedRead (FD_t fd, void *bufptr, int length) |
| FDIO_t | fdio |
| FDIO_t | fpio |
| FDIO_t | ufdio |
| FDIO_t | gzdio |
| FDIO_t | bzdio |
| FDIO_t | fadio |
RPMIO Vectors. | |
| typedef ssize_t(* | fdio_read_function_t )(void *cookie, char *buf, size_t nbytes) |
| typedef ssize_t(* | fdio_write_function_t )(void *cookie, const char *buf, size_t nbytes) |
| typedef int(* | fdio_seek_function_t )(void *cookie, _libio_pos_t pos, int whence) |
| typedef int(* | fdio_close_function_t )(void *cookie) |
| typedef FD_t(* | fdio_ref_function_t )(void *cookie, const char *msg, const char *file, unsigned line) |
| typedef FD_t(* | fdio_deref_function_t )(FD_t fd, const char *msg, const char *file, unsigned line) |
| typedef FD_t(* | fdio_new_function_t )(const char *msg, const char *file, unsigned line) |
| typedef int(* | fdio_fileno_function_t )(void *cookie) |
| typedef FD_t(* | fdio_open_function_t )(const char *path, int flags, mode_t mode) |
| typedef FD_t(* | fdio_fopen_function_t )(const char *path, const char *fmode) |
| typedef void *(* | fdio_ffileno_function_t )(FD_t fd) |
| typedef int(* | fdio_fflush_function_t )(FD_t fd) |
RPMRPC Vectors. | |
| typedef int(* | fdio_mkdir_function_t )(const char *path, mode_t mode) |
| typedef int(* | fdio_chdir_function_t )(const char *path) |
| typedef int(* | fdio_rmdir_function_t )(const char *path) |
| typedef int(* | fdio_rename_function_t )(const char *oldpath, const char *newpath) |
| typedef int(* | fdio_unlink_function_t )(const char *path) |
| typedef int(* | fdio_stat_function_t )(const char *path, struct stat *st) |
| typedef int(* | fdio_lstat_function_t )(const char *path, struct stat *st) |
| typedef int(* | fdio_access_function_t )(const char *path, int amode) |
RPMIO Interface. | |
| const char * | Fstrerror (FD_t fd) |
| strerror(3) clone. | |
| size_t | Fread (void *buf, size_t size, size_t nmemb, FD_t fd) |
| fread(3) clone. | |
| size_t | Fwrite (const void *buf, size_t size, size_t nmemb, FD_t fd) |
| fwrite(3) clone. | |
| int | Fseek (FD_t fd, _libio_off_t offset, int whence) |
| fseek(3) clone. | |
| int | Fclose (FD_t fd) |
| fclose(3) clone. | |
| FD_t | Fdopen (FD_t ofd, const char *fmode) |
| FD_t | Fopen (const char *path, const char *fmode) |
| fopen(3) clone. | |
| int | Fflush (FD_t fd) |
| fflush(3) clone. | |
| int | Ferror (FD_t fd) |
| ferror(3) clone. | |
| int | Fileno (FD_t fd) |
| fileno(3) clone. | |
| int | Fcntl (FD_t fd, int op, void *lip) |
| fcntl(2) clone. | |
RPMRPC Interface. | |
| int | Mkdir (const char *path, mode_t mode) |
| mkdir(2) clone. | |
| int | MkdirP (const char *path, mode_t mode) |
| mkdir -p. | |
| int | Chdir (const char *path) |
| chdir(2) clone. | |
| int | Rmdir (const char *path) |
| rmdir(2) clone. | |
| int | Rename (const char *oldpath, const char *newpath) |
| rename(2) clone. | |
| int | Link (const char *oldpath, const char *newpath) |
| link(2) clone. | |
| int | Unlink (const char *path) |
| unlink(2) clone. | |
| int | Readlink (const char *path, char *buf, size_t bufsiz) |
| readlink(2) clone. | |
| int | Stat (const char *path, struct stat *st) |
| stat(2) clone. | |
| int | Lstat (const char *path, struct stat *st) |
| lstat(2) clone. | |
| int | Access (const char *path, int amode) |
| access(2) clone. | |
| int | Glob (const char *pattern, int flags, int errfunc(const char *epath, int eerrno), glob_t *pglob) |
| glob(3) clone. | |
| void | Globfree (glob_t *pglob) |
| globfree(3) clone. | |
| DIR * | Opendir (const char *path) |
| opendir(3) clone. | |
| dirent * | Readdir (DIR *dir) |
| readdir(3) clone. | |
| int | Closedir (DIR *dir) |
| closedir(3) clone. | |
Typedefs | |
| typedef pgpDig_s * | pgpDig |
| typedef _FD_s * | FD_t |
| typedef FDIO_s * | FDIO_t |
Functions | |
| int | xislower (int c) |
| int | xisupper (int c) |
| int | xisalpha (int c) |
| int | xisdigit (int c) |
| int | xisalnum (int c) |
| int | xisblank (int c) |
| int | xisspace (int c) |
| int | xtolower (int c) |
| int | xtoupper (int c) |
| int | xstrcasecmp (const char *s1, const char *s2) |
| int | xstrncasecmp (const char *s1, const char *s2, size_t n) |
Definition in file rpmio.h.
|
|
|
|
|
Definition at line 467 of file rpmio.h. Referenced by fdClose(), fdFgets(), fdRead(), fdReadable(), fdSeek(), fdWritable(), fdWrite(), Ferror(), Fopen(), ftpAbort(), ftpLogin(), ftpReq(), httpReq(), ufdRead(), and urlConnect(). |
|
|
Definition at line 516 of file rpmio.h. Referenced by alFree(), closeCallback(), Fclose(), fdClose(), fsmTeardown(), ftpAbort(), ftpCmd(), ftpFileDone(), manageFile(), packageBinaries(), packageSources(), rpmShowProgress(), rpmtransFree(), ufdClose(), and urlConnect(). |
|
|
Definition at line 507 of file rpmio.h. Referenced by alAddPackage(), closeCallback(), doFopen(), Fclose(), Fdopen(), fsmSetup(), ftpLogin(), ftpNLST(), ftpOpen(), ftpReq(), httpOpen(), httpReq(), manageFile(), rpmShowProgress(), rpmtransSetScriptFd(), rpmVerifyScript(), runScript(), ufdOpen(), and urlConnect(). |
|
|
Definition at line 525 of file rpmio.h. Referenced by fdDup(), fdOpen(), ftpOpen(), httpOpen(), packageBinaries(), packageSources(), rewriteRPM(), and urlConnect(). |
|
|
|
|
|
|
|
|
Definition at line 491 of file rpmio.h. Referenced by ftpAbort(), ftpCommand(), ftpReq(), httpReq(), ufdClose(), and ufdWrite(). |
|
|
Definition at line 598 of file rpmio.h. Referenced by ftpAbort(), headerRead(), makeGPGSignature(), makePGPSignature(), readLead(), and rpmReadSignature(). |
|
|
FTP and HTTP error codes.
|
|
|
|
|
|
|
fclose(3) clone.
Definition at line 2680 of file rpmio.c. References DBGIO, fdbg(), fdFree, fdGetFdno(), fdGetFILE, fdio_close_function_t, FDIOVEC, fdLink, fdPop(), FDSANE, fdSetFp(), fpio, _FD_s::fps, _FDSTACK_s::io, _FD_s::nfps, and ufdClose(). Referenced by addFileToTagAux(), closeCallback(), closeSpec(), cpio_doio(), db1close(), defaultMachine(), domd5(), doReadRC(), doScript(), fadOpen(), fsmStage(), generateDepends(), IDTXglob(), isCompressed(), isSpecFile(), main(), makeGPGSignature(), makePGPSignature(), makeTempFile(), manageFile(), processPackageFiles(), psmStage(), readIcon(), readLine(), readRPM(), rewriteRPM(), rpmInitMacrofile(), rpmInstall(), rpmInstallSource(), rpmioSlurp(), rpmQueryVerify(), rpmShowProgress(), rpmtransDealloc(), runScript(), showVerifyPackage(), tsCallback(), ufdGetFile(), urlGetFile(), verifyGPGSignature(), verifyPGPSignature(), writeRPM(), and XurlFree(). |
|
||||||||||||||||
|
fcntl(2) clone.
Definition at line 3089 of file rpmio.c. References Fileno(). Referenced by db1open(). |
|
|
Definition at line 450 of file rpmio.c. References c2f(), DBGIO, fdbg(), fdFileno, fdFree, fdSetFdno(), FDSTAT_CLOSE, fdstat_enter(), and fdstat_exit(). Referenced by Fopen(), ftpAbort(), ftpLogin(), ftpReq(), httpReq(), and ufdClose(). |
|
|
Definition at line 229 of file rpmio.c. References DBGIO, fdbg(), fdNew, and fdSetFdno(). Referenced by cpio_doio(), main(), psmStage(), readRPM(), rpmtransSetAttr(), runScript(), showVerifyPackage(), tsCallback(), and ufdOpen(). |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||||||
|
Definition at line 476 of file rpmio.c. References DBGIO, fdbg(), fdNew, fdSetFdno(), and _FD_s::flags. |
|
||||||||||||
|
Definition at line 2831 of file rpmio.c. References FDIO_s::close, cvtfmode(), DBGIO, fdbg(), fdGetFp(), fdLink, fdPush(), FDSANE, fdSetFp(), Fileno(), fpio, noLibio, FDIO_s::read, FDIO_s::seek, and FDIO_s::write. Referenced by cpio_doio(), doScript(), Fopen(), generateDepends(), main(), and psmStage(). |
|
||||||||||||||||
|
Definition at line 367 of file rpmio.c. References _FD_s::bytesRemain, c2f(), DBGIO, fdbg(), fdFileno, fdstat_enter(), fdstat_exit(), FDSTAT_READ, fdUpdateDigests(), and _FD_s::ndigests. |
|
||||||||||||
|
Definition at line 547 of file rpmio.c. References errno, and fdFileno. Referenced by fdFgets(), ftpAbort(), ufdClose(), and ufdRead(). |
|
|
Definition at line 204 of file rpmio.c. References _FD_s::contentLength, DBGIO, FDSANE, Fileno(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and _FD_s::urlType. Referenced by doReadRC(), readIcon(), and rpmioSlurp(). |
|
||||||||||||
|
Definition at line 507 of file rpmio.c. References _rpmio_debug, errno, and fdFileno. Referenced by checkResponse(), ftpLogin(), httpReq(), and ufdWrite(). |
|
||||||||||||||||
|
Definition at line 389 of file rpmio.c. References _FD_s::bytesRemain, c2f(), DBGIO, errno, fdbg(), fdFileno, fdstat_enter(), fdstat_exit(), FDSTAT_WRITE, fdUpdateDigests(), _FD_s::ndigests, _FD_s::syserrno, and _FD_s::wr_chunked. |
|
|
ferror(3) clone.
Definition at line 3040 of file rpmio.c. References DBGIO, _FD_s::errcookie, fdbg(), fdFileno, fdGetFILE, fpio, _FD_s::fps, _FDSTACK_s::io, _FD_s::nfps, and _FD_s::syserrno. Referenced by addFileToTagAux(), cpio_copy(), db1open(), defaultMachine(), doFopen(), domd5(), doReadRC(), doScript(), fadOpen(), fsmStage(), generateDepends(), IDTXglob(), isCompressed(), isSpecFile(), main(), makeGPGSignature(), makePGPSignature(), makeTempFile(), manageFile(), processPackageFiles(), psmStage(), readIcon(), readLine(), readRPM(), rpmInitMacrofile(), rpmInstall(), rpmInstallSource(), rpmioSlurp(), rpmQueryVerify(), rpmReadRC(), runScript(), urlGetFile(), verifyPGPSignature(), and writeRPM(). |
|
|
fflush(3) clone.
Definition at line 3020 of file rpmio.c. References fdGetFILE, fdGetFp(), fdGetIo(), and fpio. Referenced by cpio_doio(), expandRegular(), psmStage(), and writeRPM(). |
|
|
fileno(3) clone.
Definition at line 3075 of file rpmio.c. References DBGIO, fdbg(), _FDSTACK_s::fdno, _FD_s::fps, and _FD_s::nfps. Referenced by checkSize(), cpio_doio(), db1sync(), doScript(), Fcntl(), Fdopen(), fdSize(), generateDepends(), makeTempFile(), psmStage(), readPackageHeaders(), runScript(), ufdOpen(), and writeRPM(). |
|
||||||||||||
|
fopen(3) clone.
Definition at line 2943 of file rpmio.c. References FDIO_s::_open, cvtfmode(), fdClose(), fdFileno, fdGetFdno(), fdGetFp(), Fdopen(), fdOpen, fdPush(), fpio, ufdOpen(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlIsURL(). Referenced by addFileToTagAux(), defaultMachine(), doFopen(), domd5(), doReadRC(), fsmStage(), IDTXglob(), isCompressed(), isSpecFile(), main(), makeGPGSignature(), makePGPSignature(), makeTempFile(), manageFile(), processPackageFiles(), psmStage(), readIcon(), readLine(), readRPM(), rpmInitMacrofile(), rpmInstall(), rpmInstallSource(), rpmioSlurp(), rpmQueryVerify(), rpmReadRC(), rpmShowProgress(), runScript(), urlGetFile(), verifyPGPSignature(), and writeRPM(). |
|
||||||||||||||||||||
|
fread(3) clone.
Definition at line 2594 of file rpmio.c. References DBGIO, fdbg(), fdGetFILE, fdGetIo(), fdio_read_function_t, FDIOVEC, FDSANE, and fpio. Referenced by copyFile(), cpio_copy(), defaultMachine(), domd5(), doReadRC(), fsmStage(), isCompressed(), isSpecFile(), main(), Pread(), readIcon(), readRPM(), rpmioSlurp(), ufdCopy(), and writeRPM(). |
|
||||||||||||||||
|
fseek(3) clone.
Definition at line 2646 of file rpmio.c. References _libio_off_t, _libio_pos_t, DBGIO, fdbg(), fdGetFILE, fdGetIo(), fdio_seek_function_t, FDIOVEC, FDSANE, and fpio. Referenced by db1cput(), doGetRecord(), fadOpen(), Pread(), Pwrite(), readRPM(), and writeRPM(). |
|
|
strerror(3) clone.
Definition at line 2583 of file rpmio.c. References errno, FDSANE, and getFdErrstr(). Referenced by copyFile(), cpio_copy(), doFopen(), doReadRC(), IDTXglob(), isCompressed(), isSpecFile(), main(), manageFile(), processPackageFiles(), psmStage(), readIcon(), readLead(), readRPM(), rpmInstallSource(), rpmQueryVerify(), rpmReadRC(), rpmReSign(), urlGetFile(), and writeRPM(). |
|
|
Definition at line 651 of file rpmio.c. References _, FTPERR_BAD_HOST_ADDR, FTPERR_BAD_HOSTNAME, FTPERR_BAD_SERVER_RESPONSE, FTPERR_FAILED_CONNECT, FTPERR_FAILED_DATA_CONNECT, FTPERR_FILE_IO_ERROR, FTPERR_FILE_NOT_FOUND, FTPERR_NIC_ABORT_IN_PROGRESS, FTPERR_PASSIVE_ERROR, FTPERR_SERVER_IO_ERROR, FTPERR_SERVER_TIMEOUT, and FTPERR_UNKNOWN. Referenced by ftpLogin(), ftpReq(), httpReq(), rpmInstall(), tcpConnect(), ufdCopy(), and urlStrerror(). |
|
||||||||||||||||||||
|
fwrite(3) clone.
Definition at line 2621 of file rpmio.c. References DBGIO, fdbg(), fdGetFILE, fdGetIo(), fdio_write_function_t, FDIOVEC, FDSANE, and fpio. Referenced by copyFile(), cpio_copy(), fadOpen(), fsmStage(), headerWrite(), main(), Pwrite(), rpmWriteSignature(), runScript(), ufdCopy(), verifyGPGSignature(), verifyPGPSignature(), writeLead(), and writeRPM(). |
|
||||||||||||||||
|
|
|
||||||||||||
|
Definition at line 1278 of file rpmio.c. References DBGIO, Fread(), FTPERR_FILE_IO_ERROR, ftpStrerror(), Fwrite(), RPMCALLBACK_INST_OPEN_FILE, RPMCALLBACK_INST_PROGRESS, urlNotify, urlNotifyCount, and urlNotifyData. Referenced by main(), and ufdGetFile(). |
|
||||||||||||
|
Definition at line 1382 of file rpmio.c. References Fclose(), FDSANE, and ufdCopy(). Referenced by urlGetFile(). |
|
|
Definition at line 1645 of file rpmio.c. References FDSANE, _FD_s::url, and urlLink. |
|
|
Definition at line 695 of file rpmio.c. References errno, ftpStrerror(), urlinfo_s::openError, URL_IS_FTP, URL_IS_HTTP, urlIsURL(), and urlSplit(). |
|
|
Definition at line 639 of file rpmio.h. References xisalpha(), and xisdigit(). Referenced by expandMacro(), parseRCPOT(), rdToken(), rpmInitMacrofileGlob(), and rpmvercmp(). |
|
|
Definition at line 633 of file rpmio.h. References xislower(), and xisupper(). Referenced by doDefine(), doUndefine(), parseBits(), rdToken(), rpmvercmp(), and xisalnum(). |
|
|
Definition at line 642 of file rpmio.h. Referenced by xisspace(). |
|
|
Definition at line 636 of file rpmio.h. Referenced by defaultMachine(), doFoo(), getHostAddress(), parseEVR(), parseForDev(), parseFormat(), rdToken(), rpmvercmp(), and xisalnum(). |
|
|
Definition at line 627 of file rpmio.h. Referenced by xisalpha(), and xtoupper(). |
|
|
Definition at line 645 of file rpmio.h. References xisblank(). Referenced by addChangelog(), copyNextLine(), dbiTagsInit(), doReadRC(), findLastChar(), findPreambleTag(), isChangeNameMoreFresh(), isPart(), machCompatCacheAdd(), parseBits(), rdToken(), readLine(), stripTrailingBlanksStringBuf(), and unsatisfiedDepend(). |
|
|
Definition at line 630 of file rpmio.h. Referenced by xisalpha(), and xtolower(). |
|
|
Definition at line 649 of file rpmio.h. References xisupper(). Referenced by rpmRebuildTargetVars(), tagName(), xstrcasecmp(), and xstrncasecmp(). |
|
|
Definition at line 652 of file rpmio.h. References xislower(). |
|
|
Definition at line 619 of file rpmio.h. Referenced by fdbg(). |
|
|
Definition at line 623 of file rpmio.h. Referenced by fdbg(). |
|
|
|
|
|
Definition at line 607 of file rpmio.h. Referenced by Fclose(), fdbg(), Fdopen(), Ferror(), Fflush(), Fopen(), Fread(), Fseek(), and Fwrite(). |
|
|
Definition at line 615 of file rpmio.h. Referenced by fdbg(). |
|
|
Definition at line 611 of file rpmio.h. Referenced by fdbg(), ftpOpen(), httpOpen(), ufdOpen(), and urlConnect(). |
1.2.18