# rpmio/rpmio.c File Reference

More...

`#include "system.h"`
`#include <stdarg.h>`
`#include <netinet/in.h>`
`#include <arpa/inet.h>`
`#include <rpmio_internal.h>`
`#include "ugid.h"`
`#include "rpmmessages.h"`
`#include "debug.h"`

Go to the source code of this file.

## Defines

#define | IPPORT_FTP 21
#define | IPPORT_HTTP 80
#define | FDNREFS(fd) (fd ? ((FD_t)fd)->nrefs : -9)
#define | FDTO(fd) (fd ? ((FD_t)fd)->rd_timeoutsecs : -99)
#define | FDCPIOPOS(fd) (fd ? ((FD_t)fd)->fd_cpioPos : -99)
#define | FDONLY(fd) assert(fdGetIo(fd) == fdio)
#define | GZDONLY(fd) assert(fdGetIo(fd) == gzdio)
#define | BZDONLY(fd) assert(fdGetIo(fd) == bzdio)
#define | UFDONLY(fd) /* assert(fdGetIo(fd) == ufdio) */
#define | fdGetFILE(_fd) ((FILE *)fdGetFp(_fd))
#define | TIMEOUT_SECS 60
#define | IAC 255 /* interpret as command: */
#define | IP 244 /* interrupt process--permanently */
#define | DM 242 /* data mark--for connect. cleaning */
#define | SHUT_RDWR 1+1
#define | FDIOVEC(_fd, _vec) ((fdGetIo(_fd) && fdGetIo(_fd)->_vec) ? fdGetIo(_fd)->_vec : NULL)

## Functions

int | inet_aton (const char *cp, struct in_addr *inp)
void * | _free (const void *p)
| Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
const char * | fdbg (FD_t fd)
off_t | fdSize (FD_t fd)
FD_t | fdDup (int fdno)
int | fdSeekNot (void *cookie, _libio_pos_t pos, int whence)
FD_t | XfdLink (void *cookie, const char *msg, const char *file, unsigned line)
FD_t | XfdFree (FD_t fd, const char *msg, const char *file, unsigned line)
FD_t | XfdNew (const char *msg, const char *file, unsigned line)
ssize_t | fdRead (void *cookie, char *buf, size_t count)
ssize_t | fdWrite (void *cookie, const char *buf, size_t count)
int | fdSeek (void *cookie, _libio_pos_t pos, int whence)
int | fdClose (void *cookie)
FD_t | fdOpen (const char *path, int flags, mode_t mode)
int | fdWritable (FD_t fd, int secs)
int | fdReadable (FD_t fd, int secs)
int | fdFgets (FD_t fd, char *buf, size_t len)
const char *const | ftpStrerror (int errorNumber)
const char * | urlStrerror (const char *url)
int | mygethostbyname (const char *host, struct in_addr *address)
int | getHostAddress (const char *host, struct in_addr *address)
int | tcpConnect (FD_t ctrl, const char *host, int port)
int | checkResponse (void *uu, FD_t ctrl, int *ecp, char **str)
int | ftpCheckResponse (urlinfo u, char **str)
int | ftpCommand (urlinfo u, char **str,...)
int | ftpLogin (urlinfo u)
int | ftpReq (FD_t data, const char *ftpCmd, const char *ftpArg)
void | urlSetCallback (rpmCallbackFunction notify, void *notifyData, int notifyCount)
int | ufdCopy (FD_t sfd, FD_t tfd)
int | urlConnect (const char *url, urlinfo *uret)
int | ufdGetFile (FD_t sfd, FD_t tfd)
int | ftpCmd (const char *cmd, const char *url, const char *arg2)
int | ftpAbort (urlinfo u, FD_t data)
int | ftpFileDone (urlinfo u, FD_t data)
int | httpResp (urlinfo u, FD_t ctrl, char **str)
int | httpReq (FD_t ctrl, const char *httpCmd, const char *httpArg)
void * | ufdGetUrlinfo (FD_t fd)
ssize_t | ufdRead (void *cookie, char *buf, size_t count)
ssize_t | ufdWrite (void *cookie, const char *buf, size_t count)
int | ufdSeek (void *cookie, _libio_pos_t pos, int whence)
int | ufdClose (void *cookie)
FD_t | ftpOpen (const char *url, int flags, mode_t mode, urlinfo *uret)
FD_t | httpOpen (const char *url, int flags, mode_t mode, urlinfo *uret)
FD_t | ufdOpen (const char *url, int flags, mode_t mode)
const char * | getFdErrstr (FD_t fd)
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.
void | cvtfmode (const char *m, char *stdio, size_t nstdio, char *other, size_t nother, const char **end, int *f)
| Convert stdio fmode to open(2) mode, filtering out zlib/bzlib flags.
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.
int | rpmioSlurp (const char *fn, const byte **bp, ssize_t *blenp)

## Variables

int | noLibio = 1
int | ftpTimeoutSecs = 60
int | httpTimeoutSecs = 60
int | _ftp_debug = 0
int | _rpmio_debug = 0
FDIO_s | fdio_s
FDIO_t | fdio = &fdio_s
FDIO_t | fadio
rpmCallbackFunction | urlNotify = NULL
void * | urlNotifyData = NULL
int | urlNotifyCount = -1
FDIO_s | ufdio_s
FDIO_t | ufdio = &ufdio_s
FDIO_s | fpio_s
FDIO_t | fpio = &fpio_s

## Detailed Description

Definition in file rpmio.c.

## Define Documentation

#define BZDONLY | ( | fd |  | ) | assert(fdGetIo(fd) == bzdio)

| Definition at line 88 of file rpmio.c.

#define DM 242 /* data mark--for connect. cleaning */

| Definition at line 1442 of file rpmio.c.

#define FDCPIOPOS | ( | fd |  | ) | (fd ? ((FD_t)fd)->fd_cpioPos : -99)

| Definition at line 84 of file rpmio.c.

#define fdGetFILE | ( | _fd |  | ) | ((FILE *)fdGetFp(_fd))

| Definition at line 93 of file rpmio.c. Referenced by Ferror(), Fwrite(), and rdcl().

#define FDIOVEC | ( | _fd,
|  | _vec |  | ) | ((fdGetIo(_fd) && fdGetIo(_fd)->_vec) ? fdGetIo(_fd)->_vec : NULL)

| Definition at line 2614 of file rpmio.c.

#define FDNREFS | ( | fd |  | ) | (fd ? ((FD_t)fd)->nrefs : -9)

| Definition at line 82 of file rpmio.c. Referenced by XfdFree(), and XfdLink().

#define FDONLY | ( | fd |  | ) | assert(fdGetIo(fd) == fdio)

| Definition at line 86 of file rpmio.c.

#define FDTO | ( | fd |  | ) | (fd ? ((FD_t)fd)->rd_timeoutsecs : -99)

| Definition at line 83 of file rpmio.c.

#define GZDONLY | ( | fd |  | ) | assert(fdGetIo(fd) == gzdio)

| Definition at line 87 of file rpmio.c.

#define IAC 255 /* interpret as command: */

| Definition at line 1434 of file rpmio.c.

#define IP 244 /* interrupt process--permanently */

| Definition at line 1438 of file rpmio.c.

#define IPPORT_FTP 21

| Definition at line 43 of file rpmio.c. Referenced by ftpLogin().

#define IPPORT_HTTP 80

| Definition at line 46 of file rpmio.c.

#define SHUT_RDWR 1+1

| Definition at line 1446 of file rpmio.c.

#define TIMEOUT_SECS 60

| Definition at line 104 of file rpmio.c.

#define UFDONLY | ( | fd |  | ) | /* assert(fdGetIo(fd) == ufdio) */

| Definition at line 90 of file rpmio.c.

## Function Documentation

void* _free | ( | const void * | p | ) | `[inline, static]`

Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.

Parameters:

  p | memory to free

Return values:

  NULL | always

Definition at line 132 of file rpmio.c.

int checkResponse | ( | void * | uu,
|  | FD_t | ctrl,
|  | int * | ecp,
|  | char ** | str
| ) | `[static]`

| Definition at line 834 of file rpmio.c. References _ftp_debug, _url_iobuf_size, urlinfo_s::buf, urlinfo_s::bufAlloced, _FD_s::contentLength, fdFgets(), fdWritable(), FTPERR_BAD_SERVER_RESPONSE, urlinfo_s::httpHasRange, urlinfo_s::httpVersion, _FD_s::persist, urlinfo, URLSANE, _FD_s::wr_chunked, and xcalloc(). Referenced by ftpCheckResponse().

void cvtfmode | ( | const char * | m,
|  | char * | stdio,
|  | size_t | nstdio,
|  | char * | other,
|  | size_t | nother,
|  | const char ** | end,
|  | int * | f
| ) | `[inline, static]`

Convert stdio fmode to open(2) mode, filtering out zlib/bzlib flags.

returns stdio[0] = '' on error.

- gzopen: [0-9] is compession level
- gzopen: 'f' is filtered (Z_FILTERED)
- gzopen: 'h' is Huffman encoding (Z_HUFFMAN_ONLY)
- bzopen: [1-9] is block size (modulo 100K)
- bzopen: 's' is smallmode
- HACK: '.' terminates, rest is type of I/O

Definition at line 2784 of file rpmio.c.

int Fclose | ( | FD_t | fd | ) |

fclose(3) clone.

Definition at line 2703 of file rpmio.c.

References FDSTACK_t, fpio, noLibio, and ufdio.

Referenced by addFileToTagAux(), closeCallback(), closeSpec(), cpio_doio(), db1close(), defaultMachine(), domd5(), doReadRC(), doScript(), fadOpen(), fsmStage(), IDTXglob(), isCompressed(), isSpecFile(), main(), makeGPGSignature(), makePGPSignature(), makeTempFile(), manageFile(), processPackageFiles(), psmStage(), readIcon(), readLine(), readRPM(), rewriteRPM(), rpmHeaderFromFD(), rpmHeaderFromFile(), rpmHeaderFromPackage(), rpmInitMacros(), rpmInstall(), rpmInstallSource(), rpmMergeHeadersFromFD(), rpmQueryVerify(), rpmShowProgress(), rpmtransDealloc(), runScript(), showVerifyPackage(), tsCallback(), verifyGPGSignature(), verifyPGPSignature(), writeRPM(), and XurlFree().

int Fcntl | ( | FD_t | fd,
|  | int | op,
|  | void * | lip
| ) |

| fcntl(2) clone. Definition at line 3112 of file rpmio.c. References FD_t. Referenced by db1open().

const char* fdbg | ( | FD_t | fd | ) | `[static]`

| Definition at line 142 of file rpmio.c. References _FD_s::bytesRemain, bzdio, fadio, fdio, _FDSTACK_s::fdno, FDSTACK_t, _FDSTACK_s::fp, fpio, _FD_s::fps, gzdio, _FDSTACK_s::io, _FD_s::nfps, _FD_s::rd_timeoutsecs, ufdio, and _FD_s::wr_chunked. Referenced by fdClose(), fdDup(), fdOpen(), fdRead(), fdSeek(), fdWrite(), XfdFree(), and XfdLink().

int fdClose | ( | void * | cookie | ) |

| Definition at line 457 of file rpmio.c. References c2f(), DBGIO, FD_t, fdbg(), fdFileno, fdFree, fdSetFdno(), FDSTAT_CLOSE, fdstat_enter(), and fdstat_exit(). Referenced by ftpLogin().

FD_t fdDup | ( | int | fdno | ) |

| Definition at line 230 of file rpmio.c. References DBGIO, FD_t, fdbg(), fdNew, and fdSetFdno(). Referenced by cpio_doio(), main(), psmStage(), readRPM(), rpmHeaderFromFD(), rpmHeaderFromPackage(), rpmMergeHeadersFromFD(), rpmtransSetAttr(), runScript(), showVerifyPackage(), and tsCallback().

FD_t Fdopen | ( | FD_t | ofd,
|  | const char * | fmode
| ) |

| Definition at line 2854 of file rpmio.c. References fdio. Referenced by cpio_doio(), doScript(), main(), and psmStage().

FD_t fdOpen | ( | const char * | path,
|  | int | flags,
|  | mode_t | mode
| ) |

| Definition at line 483 of file rpmio.c. References DBGIO, FD_t, fdbg(), fdNew, fdSetFdno(), and _FD_s::flags.

ssize_t fdRead | ( | void * | cookie,
|  | char * | buf,
|  | size_t | count
| ) |

| Definition at line 374 of file rpmio.c. References _FD_s::bytesRemain, c2f(), DBGIO, FD_t, fdbg(), fdFileno, fdstat_enter(), fdstat_exit(), FDSTAT_READ, fdUpdateDigests(), and _FD_s::ndigests.

int fdReadable | ( | FD_t | fd,
|  | int | secs
| ) |

| Definition at line 568 of file rpmio.c. References errno, and fdFileno. Referenced by fdFgets().

int fdSeek | ( | void * | cookie,
|  | _libio_pos_t | pos,
|  | int | whence
| ) | `[inline, static]`

| Definition at line 432 of file rpmio.c. References _FD_s::bytesRemain, c2f(), DBGIO, FD_t, fdbg(), fdFileno, fdstat_enter(), fdstat_exit(), and FDSTAT_SEEK.

int fdSeekNot | ( | void * | cookie,
|  | _libio_pos_t | pos,
|  | int | whence
| ) | `[inline, static]`

| Definition at line 245 of file rpmio.c. References _libio_pos_t, c2f(), FD_t, and FDSANE.

int fdWritable | ( | FD_t | fd,
|  | int | secs
| ) |

| Definition at line 528 of file rpmio.c. References _rpmio_debug, errno, fdFileno, and strerror(). Referenced by checkResponse(), and ftpLogin().

ssize_t fdWrite | ( | void * | cookie,
|  | const char * | buf,
|  | size_t | count
| ) |

| Definition at line 396 of file rpmio.c. References _FD_s::bytesRemain, c2f(), DBGIO, errno, FD_t, fdbg(), fdFileno, fdstat_enter(), fdstat_exit(), FDSTAT_WRITE, fdUpdateDigests(), _FD_s::ndigests, _FD_s::syserrno, and _FD_s::wr_chunked.

int Ferror | ( | FD_t | fd | ) |

ferror(3) clone.

Definition at line 3063 of file rpmio.c.

References fdGetFILE, and fpio.

Referenced by addFileToTagAux(), cpio_copy(), db1open(), defaultMachine(), doFopen(), domd5(), doReadRC(), doScript(), fadOpen(), fsmStage(), IDTXglob(), isCompressed(), isSpecFile(), main(), makeGPGSignature(), makePGPSignature(), makeTempFile(), manageFile(), processPackageFiles(), psmStage(), readIcon(), readLine(), readRPM(), rpmInitMacros(), rpmInstall(), rpmInstallSource(), rpmQueryVerify(), rpmReadRC(), runScript(), verifyGPGSignature(), verifyPGPSignature(), and writeRPM().

int Fflush | ( | FD_t | fd | ) |

| fflush(3) clone. Definition at line 3043 of file rpmio.c. References bzdio, and gzdio. Referenced by cpio_doio(), expandRegular(), psmStage(), and writeRPM().

int Fileno | ( | FD_t | fd | ) |

| fileno(3) clone. Definition at line 3098 of file rpmio.c. Referenced by checkSize(), cpio_doio(), db1sync(), doScript(), fdSize(), makeTempFile(), psmStage(), readPackageHeaders(), runScript(), writeFile(), and writeRPM().

FD_t Fopen | ( | const char * | path,
|  | const char * | fmode
| ) |

fopen(3) clone.

Definition at line 2966 of file rpmio.c.

References _rpmio_debug.

Referenced by addFileToTagAux(), defaultMachine(), doFopen(), domd5(), doReadRC(), fsmStage(), IDTXglob(), isCompressed(), isSpecFile(), main(), makeGPGSignature(), makePGPSignature(), makeTempFile(), manageFile(), processPackageFiles(), psmStage(), readIcon(), readLine(), readRPM(), rpmHeaderFromFile(), rpmInitMacros(), rpmInstall(), rpmInstallSource(), rpmQueryVerify(), rpmReadRC(), rpmShowProgress(), runScript(), verifyGPGSignature(), verifyPGPSignature(), and writeRPM().

size_t Fread | ( | void * | buf,
|  | size_t | size,
|  | size_t | nmemb,
|  | FD_t | fd
| ) |

| fread(3) clone. Definition at line 2617 of file rpmio.c. References fpio. Referenced by copyFile(), cpio_copy(), defaultMachine(), domd5(), doReadRC(), fsmStage(), isCompressed(), isSpecFile(), main(), Pread(), readIcon(), readRPM(), and writeRPM().

int Fseek | ( | FD_t | fd,
|  | _libio_off_t | offset,
|  | int | whence
| ) |

| fseek(3) clone. Definition at line 2669 of file rpmio.c. References fpio. Referenced by db1cput(), doGetRecord(), fadOpen(), Pread(), Pwrite(), readRPM(), and writeRPM().

int ftpAbort | ( | urlinfo | u,
|  | FD_t | data
| ) | `[static]`

| Definition at line 1449 of file rpmio.c.

int ftpCheckResponse | ( | urlinfo | u,
|  | char ** | str
| ) | `[static]`

| Definition at line 997 of file rpmio.c. References checkResponse(), urlinfo_s::ctrl, FTPERR_BAD_SERVER_RESPONSE, FTPERR_FILE_NOT_FOUND, FTPERR_NIC_ABORT_IN_PROGRESS, and URLSANE. Referenced by ftpCommand(), ftpFileDone(), and ftpLogin().

int ftpCommand | ( | urlinfo | u,
|  | char ** | str,
|  | ... |
| ) | `[static]`

| Definition at line 1023 of file rpmio.c. References _ftp_debug, alloca(), urlinfo_s::ctrl, fdWrite, ftpCheckResponse(), FTPERR_SERVER_IO_ERROR, stpcpy(), and URLSANE. Referenced by ftpLogin().

int ftpFileDone | ( | urlinfo | u,
|  | FD_t | data
| ) | `[static]`

| Definition at line 1512 of file rpmio.c. References urlinfo_s::ctrl, fdFree, ftpCheckResponse(), and _FD_s::ftpFileDoneNeeded.

int ftpLogin | ( | urlinfo | u | ) | `[static]`

Definition at line 1061 of file rpmio.c.

References alloca(), urlinfo_s::ctrl, errno, fdClose(), fdFileno, fdLink, fdSetSyserrno(), fdWritable(), ftpCheckResponse(), ftpCommand(), FTPERR_BAD_HOSTNAME, ftpStrerror(), urlinfo_s::host, IPPORT_FTP, urlinfo_s::password, urlinfo_s::port, urlinfo_s::proxyh, urlinfo_s::proxyp, urlinfo_s::proxyu, tcpConnect(), URLSANE, and urlinfo_s::user.

Referenced by urlConnect().

const char* const ftpStrerror | ( | int | errorNumber | ) |

Definition at line 672 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 doUntar(), ftpLogin(), rpmInstall(), tcpConnect(), and urlStrerror().

size_t Fwrite | ( | const void * | buf,
|  | size_t | size,
|  | size_t | nmemb,
|  | FD_t | fd
| ) |

| fwrite(3) clone. Definition at line 2644 of file rpmio.c. References fdGetFILE, and fpio. Referenced by copyFile(), cpio_copy(), fadOpen(), fsmStage(), main(), Pwrite(), rpmWriteSignature(), runScript(), verifyGPGSignature(), verifyPGPSignature(), writeLead(), and writeRPM().

const char* getFdErrstr | ( | FD_t | fd | ) | `[static]`

| Definition at line 2580 of file rpmio.c. References bzdio, and _FD_s::errcookie.

int getHostAddress | ( | const char * | host,
|  | struct in_addr * | address
| ) | `[static]`

| Definition at line 760 of file rpmio.c. References errno, FTPERR_BAD_HOST_ADDR, FTPERR_BAD_HOSTNAME, inet_aton(), mygethostbyname(), and xisdigit(). Referenced by tcpConnect().

FD_t httpOpen | ( | const char * | url,
|  | int | flags,
|  | mode_t | mode,
|  | urlinfo * | uret
| ) | `[static]`

| Definition at line 1990 of file rpmio.c. References httpTimeoutSecs, and URL_IS_HTTP.

int httpReq | ( | FD_t | ctrl,
|  | const char * | httpCmd,
|  | const char * | httpArg
| ) | `[static]`

| Definition at line 1554 of file rpmio.c. References FTPERR_BAD_HOSTNAME.

int httpResp | ( | urlinfo | u,
|  | FD_t | ctrl,
|  | char ** | str
| ) | `[static]`

| Definition at line 1530 of file rpmio.c. References _ftp_debug, and FTPERR_FILE_NOT_FOUND.

int inet_aton | ( | const char * | cp,
|  | struct in_addr * | inp
| ) | `[static]`

| Definition at line 50 of file rpmio.c. Referenced by getHostAddress().

int mygethostbyname | ( | const char * | host,
|  | struct in_addr * | address
| ) | `[static]`

| Definition at line 739 of file rpmio.c. Referenced by getHostAddress().

int rpmioSlurp | ( | const char * | fn,
|  | const byte ** | bp,
|  | ssize_t * | blenp
| ) |

| Definition at line 3121 of file rpmio.c. Referenced by pgpReadPkts().

int tcpConnect | ( | FD_t | ctrl,
|  | const char * | host,
|  | int | port
| ) | `[static]`

| Definition at line 782 of file rpmio.c. References _ftp_debug, errno, fdSetFdno(), fdSetSyserrno(), FTPERR_FAILED_CONNECT, ftpStrerror(), and getHostAddress(). Referenced by ftpLogin().

int ufdCopy | ( | FD_t | sfd,
|  | FD_t | tfd
| ) |

| Definition at line 1299 of file rpmio.c. References RPMCALLBACK_INST_OPEN_FILE, urlNotify, and urlNotifyData. Referenced by main().

int ufdGetFile | ( | FD_t | sfd,
|  | FD_t | tfd
| ) |

| Definition at line 1403 of file rpmio.c.

void* ufdGetUrlinfo | ( | FD_t | fd | ) |

| Definition at line 1669 of file rpmio.c. References c2f(), and FD_t.

FD_t ufdOpen | ( | const char * | url,
|  | int | flags,
|  | mode_t | mode
| ) | `[static]`

| Definition at line 2034 of file rpmio.c. References _rpmio_debug, and URL_IS_FTP.

ssize_t ufdRead | ( | void * | cookie,
|  | char * | buf,
|  | size_t | count
| ) | `[static]`

| Definition at line 1678 of file rpmio.c. References fdFileno, fdio, and fdRead.

int ufdSeek | ( | void * | cookie,
|  | _libio_pos_t | pos,
|  | int | whence
| ) | `[inline, static]`

| Definition at line 1807 of file rpmio.c. References URL_IS_DASH, URL_IS_FTP, and URL_IS_HTTP.

ssize_t ufdWrite | ( | void * | cookie,
|  | const char * | buf,
|  | size_t | count
| ) | `[static]`

| Definition at line 1742 of file rpmio.c. References fdGetFdno(), fdio, and fdWrite.

int urlConnect | ( | const char * | url,
|  | urlinfo * | uret
| ) | `[static]`

| Definition at line 1359 of file rpmio.c. References _, _FD_s::bytesRemain, _FD_s::contentLength, urlinfo_s::ctrl, FD_t, fdFileno, fdFree, fdLink, fdNew, fdSetIo(), _FD_s::ftpFileDoneNeeded, ftpLogin(), ftpTimeoutSecs, urlinfo_s::host, urlinfo_s::openError, urlinfo_s::password, _FD_s::rd_timeoutsecs, RPMMESS_DEBUG, rpmMessage, ufdio, _FD_s::url, URL_IS_FTP, and urlinfo_s::user.

void urlSetCallback | ( | rpmCallbackFunction | notify,
|  | void * | notifyData,
|  | int | notifyCount
| ) |

| Definition at line 1293 of file rpmio.c. References FD_t.

const char* urlStrerror | ( | const char * | url | ) |

| Definition at line 716 of file rpmio.c. References errno, ftpStrerror(), urlinfo_s::openError, strerror(), URL_IS_FTP, URL_IS_HTTP, urlinfo, urlIsURL(), and urlSplit().

FD_t XfdFree | ( | FD_t | fd,
|  | const char * | msg,
|  | const char * | file,
|  | unsigned | line
| ) | `[inline, static]`

| Definition at line 302 of file rpmio.c. References _free(), DBGREFS, _FD_s::digests, fdbg(), FDDIGEST_t, FDNREFS, FDSANE, _FDDIGEST_s::hashctx, _FD_s::ndigests, _FD_s::nrefs, rpmDigestFinal(), and _FD_s::stats.

FD_t XfdLink | ( | void * | cookie,
|  | const char * | msg,
|  | const char * | file,
|  | unsigned | line
| ) | `[inline, static]`

| Definition at line 282 of file rpmio.c. References c2f(), DBGREFS, FD_t, fdbg(), FDNREFS, and _FD_s::nrefs. Referenced by XfdNew().

FD_t XfdNew | ( | const char * | msg,
|  | const char * | file,
|  | unsigned | line
| ) | `[inline, static]`

| Definition at line 330 of file rpmio.c. References FD_t, fdio, FDMAGIC, URL_IS_UNKNOWN, xcalloc(), and XfdLink().

## Variable Documentation

int _ftp_debug = 0

| Definition at line 119 of file rpmio.c. Referenced by checkResponse(), ftpCommand(), httpResp(), main(), and tcpConnect().

int _rpmio_debug = 0

| Definition at line 124 of file rpmio.c.

FDIO_t fadio

| Definition at line 525 of file rpmio.c.

FDIO_t fdio = &fdio_s

| Definition at line 522 of file rpmio.c. Referenced by fadOpen(), fdbg(), Fdopen(), ufdRead(), ufdWrite(), XfdNew(), and XurlFree().

struct FDIO_s fdio_s `[static]`

Initial value:

     {
      fdRead, fdWrite, fdSeek, fdClose, XfdLink, XfdFree, XfdNew, fdFileno,
      fdOpen, NULL, fdGetFp, NULL,  mkdir, chdir, rmdir, rename, unlink
    }

Definition at line 518 of file rpmio.c.

FDIO_t fpio = &fpio_s

| Definition at line 3177 of file rpmio.c. Referenced by Fclose(), fdbg(), Ferror(), Fread(), Fseek(), Fwrite(), and XurlFree().

struct FDIO_s fpio_s `[static]`

Initial value:

     {
      ufdRead, ufdWrite, fdSeek, ufdClose, XfdLink, XfdFree, XfdNew, fdFileno,
      ufdOpen, NULL, fdGetFp, NULL, Mkdir, Chdir, Rmdir, Rename, Unlink
    }

Definition at line 3173 of file rpmio.c.

int ftpTimeoutSecs = 60`[static]`

| Definition at line 109 of file rpmio.c. Referenced by ftpOpen(), and urlConnect().

int httpTimeoutSecs = 60`[static]`

| Definition at line 114 of file rpmio.c. Referenced by httpOpen().

int noLibio = 1

| Definition at line 101 of file rpmio.c. Referenced by Fclose(), main(), and ufdClose().

FDIO_t ufdio = &ufdio_s

| Definition at line 2128 of file rpmio.c. Referenced by fadOpen(), Fclose(), fdbg(), and urlConnect().

struct FDIO_s ufdio_s `[static]`

Initial value:

     {
      ufdRead, ufdWrite, ufdSeek, ufdClose, XfdLink, XfdFree, XfdNew, fdFileno,
      ufdOpen, NULL, fdGetFp, NULL, Mkdir, Chdir, Rmdir, Rename, Unlink
    }

Definition at line 2124 of file rpmio.c.

rpmCallbackFunction urlNotify = NULL`[static]`

| Definition at line 1285 of file rpmio.c. Referenced by ufdCopy().

int urlNotifyCount = -1`[static]`

| Definition at line 1291 of file rpmio.c.

void* urlNotifyData = NULL`[static]`

| Definition at line 1288 of file rpmio.c. Referenced by ufdCopy().