#include <assert.h>Go to the source code of this file.
Data Structures | |
| struct | urlinfo_s |
| URL control structure. More... | |
Defines | |
| #define | URLMAGIC 0xd00b1ed0 |
| #define | URLSANE(u) assert(u && u->magic == URLMAGIC) |
| #define | RPMURL_IOBUF_SIZE 4096 |
| #define | RPMURL_DEBUG_IO 0x40000000 |
| #define | RPMURL_DEBUG_REFS 0x20000000 |
| #define | urlNew(_msg) XurlNew(_msg, __FILE__, __LINE__) |
| #define | urlLink(_u, _msg) XurlLink(_u, _msg, __FILE__, __LINE__) |
| #define | urlFree(_u, _msg) XurlFree(_u, _msg, __FILE__, __LINE__) |
Typedefs | |
| typedef enum urltype_e | urltype |
| Supported URL types. | |
| typedef urlinfo_s * | urlinfo |
Enumerations | |
| enum | urltype_e { URL_IS_UNKNOWN = 0, URL_IS_DASH = 1, URL_IS_PATH = 2, URL_IS_FTP = 3, URL_IS_HTTP = 4, URL_IS_HTTPS = 5, URL_IS_HKP = 6 } |
| Supported URL types. More... | |
Functions | |
| urlinfo | urlNew (const char *msg) |
| Create a URL control structure instance. | |
| urlinfo | XurlNew (const char *msg, const char *file, unsigned line) |
| urlinfo | urlLink (urlinfo u, const char *msg) |
| Reference a URL control structure instance. | |
| urlinfo | XurlLink (urlinfo u, const char *msg, const char *file, unsigned line) |
| urlinfo | urlFree (urlinfo u, const char *msg) |
| Dereference a URL control structure instance. | |
| urlinfo | XurlFree (urlinfo u, const char *msg, const char *file, unsigned line) |
| void | urlFreeCache (void) |
| Free cached URL control structures. | |
| urltype | urlIsURL (const char *url) |
| Return type of URL. | |
| urltype | urlPath (const char *url, const char **pathp) |
| Return path component of URL. | |
| int | urlSplit (const char *url, urlinfo *uret) |
| Parse URL string into a control structure. | |
| int | urlGetFile (const char *url, const char *dest) |
| Copy data from URL to local file. | |
Variables | |
| int | _url_count |
| urlinfo * | _url_cache |
| int | _url_iobuf_size |
| int | _url_debug |
Definition in file rpmurl.h.
| #define urlFree | ( | _u, | |||
| _msg | ) | XurlFree(_u, _msg, __FILE__, __LINE__) |
Definition at line 143 of file rpmurl.h.
Referenced by ufdClose(), urlConnect(), urlFind(), urlFreeCache(), and urlSplit().
| #define urlLink | ( | _u, | |||
| _msg | ) | XurlLink(_u, _msg, __FILE__, __LINE__) |
Definition at line 126 of file rpmurl.h.
Referenced by ftpOpen(), httpOpen(), ufdGetUrlinfo(), urlConnect(), and urlFind().
| #define urlNew | ( | _msg | ) | XurlNew(_msg, __FILE__, __LINE__) |
| #define URLSANE | ( | u | ) | assert(u && u->magic == URLMAGIC) |
Definition at line 24 of file rpmurl.h.
Referenced by checkResponse(), ftpAbort(), ftpCheckResponse(), ftpCommand(), ftpFileDone(), ftpLogin(), ftpReq(), httpReq(), httpResp(), urlFind(), XurlFree(), and XurlLink().
| enum urltype_e |
Supported URL types.
| URL_IS_UNKNOWN | unknown (aka a file) |
| URL_IS_DASH | stdin/stdout |
| URL_IS_PATH | file://... |
| URL_IS_FTP | ftp://... |
| URL_IS_HTTP | http://... |
| URL_IS_HTTPS | https://... |
| URL_IS_HKP | hkp://... |
Dereference a URL control structure instance.
| u | URL control structure | |
| msg | debugging identifier (unused) |
| void urlFreeCache | ( | void | ) |
Free cached URL control structures.
Definition at line 171 of file url.c.
References _, _free(), _url_cache, _url_count, and urlFree.
Referenced by main().
| int urlGetFile | ( | const char * | url, | |
| const char * | dest | |||
| ) |
Copy data from URL to local file.
| url | url string of source | |
| dest | file name of destination |
Definition at line 549 of file url.c.
References _, _url_debug, Fclose(), Ferror(), Fopen(), Fstrerror(), FTPERR_UNKNOWN, RPMMESS_DEBUG, rpmMessage, ufdGetFile(), Unlink(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by doUntar(), and rpmInstall().
| urltype urlIsURL | ( | const char * | url | ) |
Return type of URL.
| url | url string |
Definition at line 364 of file url.c.
References urlstring::leadin, urlstring::ret, URL_IS_UNKNOWN, and urlstrings.
Referenced by Fopen(), Fts_open(), main(), rpmInstall(), runScript(), urlPath(), urlSplit(), and urlStrerror().
Reference a URL control structure instance.
| u | URL control structure | |
| msg | debugging identifier (unused) |
| urlinfo urlNew | ( | const char * | msg | ) |
Create a URL control structure instance.
| msg | debugging identifier (unused) |
| urltype urlPath | ( | const char * | url, | |
| const char ** | pathp | |||
| ) |
Return path component of URL.
| url | url string |
| pathp | pointer to path component of url |
Definition at line 383 of file url.c.
References URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlIsURL().
Referenced by Access(), addFile(), buildForTarget(), Chdir(), db3close(), db3open(), doFoo(), domd5(), doPatch(), doScript(), doSetupMacro(), doUntar(), ftpCmd(), ftpNLST(), genCpioListAndHeader(), Glob(), Glob_pattern_p(), handlePreambleTag(), Link(), Lstat(), main(), makeTempFile(), Mkdir(), newRpmdb(), Opendir(), parseSpec(), processBinaryFile(), processMetadataFile(), processSourceFiles(), Readlink(), Rename(), Rmdir(), rpmGenPath(), rpmGlob(), rpmGraph(), rpmInstall(), rpmioFileExists(), rpmMkdirPath(), rpmpsmStage(), rpmtsRootDir(), Stat(), ufdOpen(), Unlink(), and urlGetFile().
| int urlSplit | ( | const char * | url, | |
| urlinfo * | uret | |||
| ) |
Parse URL string into a control structure.
| url | url string |
| uret | address of new control instance pointer |
Definition at line 441 of file url.c.
References _, _free(), urlinfo_s::host, IPPORT_FTP, IPPORT_HTTP, IPPORT_HTTPS, IPPORT_PGPKEYSERVER, urlinfo_s::password, urlinfo_s::port, urlinfo_s::portstr, RPMMESS_ERROR, rpmMessage, urlinfo_s::scheme, urlinfo_s::url, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, urlFind(), urlFree, urlIsURL(), urlNew, urlinfo_s::urltype, urlinfo_s::user, and xstrdup().
Referenced by doScript(), httpOpen(), urlConnect(), and urlStrerror().
Definition at line 99 of file url.c.
References _, FDIO_s::_fdderef, FDIO_s::_fileno, _free(), urlinfo_s::buf, FDIO_s::close, urlinfo_s::ctrl, urlinfo_s::data, Fclose(), fdGetFp(), fdio, fdPush(), fpio, urlinfo_s::host, urlinfo_s::nrefs, urlinfo_s::password, urlinfo_s::portstr, urlinfo_s::proxyh, urlinfo_s::proxyu, urlinfo_s::scheme, urlinfo_s::sess, urlinfo_s::url, URLDBGREFS, URLSANE, and urlinfo_s::user.
Definition at line 69 of file url.c.
References urlinfo_s::nrefs, URLDBGREFS, and URLSANE.
Referenced by XurlNew().
| urlinfo XurlNew | ( | const char * | msg, | |
| const char * | file, | |||
| unsigned | line | |||
| ) |
Definition at line 79 of file url.c.
References URL_IS_UNKNOWN, URLMAGIC, xmalloc(), and XurlLink().
| int _url_count |
No. of cached URL's.
Definition at line 55 of file url.c.
Referenced by urlFind(), and urlFreeCache().
| int _url_debug |
| int _url_iobuf_size |
Initial size of URL I/O buffer.
Definition at line 34 of file url.c.
Referenced by checkResponse(), and ftpNLST().
1.5.2