Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

rpmio/rpmurl.h File Reference

More...

#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. More...

typedef struct urlinfo_surlinfo

Enumerations

enum  urltype_e {
  URL_IS_UNKNOWN = 0, URL_IS_DASH = 1, URL_IS_PATH = 2, URL_IS_FTP = 3,
  URL_IS_HTTP = 4
}
 Supported URL types. More...


Functions

urlinfo urlNew (const char *msg)
 Create a URL control structure instance. More...

urlinfo XurlNew (const char *msg, const char *file, unsigned line)
urlinfo urlLink (urlinfo u, const char *msg)
 Reference a URL control structure instance. More...

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. More...

urlinfo XurlFree (urlinfo u, const char *msg, const char *file, unsigned line)
void urlFreeCache (void)
 Free cached URL control structures. More...

urltype urlIsURL (const char *url)
 Return type of URL. More...

urltype urlPath (const char *url, const char **pathp)
 Return path component of URL. More...

int urlSplit (const char *url, urlinfo *uret)
 Parse URL string into a control structure. More...

int urlGetFile (const char *url, const char *dest)
 Copy data from URL to local file. More...


Variables

int _url_count = 0
urlinfo_url_cache = NULL
int _url_iobuf_size = RPMURL_IOBUF_SIZE
int _url_debug


Detailed Description

Definition in file rpmurl.h.


Define Documentation

#define RPMURL_DEBUG_IO   0x40000000
 

Definition at line 76 of file rpmurl.h.

#define RPMURL_DEBUG_REFS   0x20000000
 

Definition at line 77 of file rpmurl.h.

#define RPMURL_IOBUF_SIZE   4096
 

Definition at line 72 of file rpmurl.h.

#define URLMAGIC   0xd00b1ed0
 

Definition at line 21 of file rpmurl.h.

#define URLSANE( u )   assert(u && u->magic == URLMAGIC)
 

Definition at line 22 of file rpmurl.h.

Referenced by XurlFree(), XurlLink(), checkResponse(), ftpAbort(), ftpCheckResponse(), ftpCommand(), ftpFileDone(), ftpLogin(), ftpReq(), httpReq(), httpResp(), and urlFind().

#define urlFree( _u, _msg )   XurlFree(_u, _msg, __FILE__, __LINE__)
 

Definition at line 119 of file rpmurl.h.

Referenced by ufdClose(), urlConnect(), urlFind(), urlFreeCache(), and urlSplit().

#define urlLink( _u, _msg )   XurlLink(_u, _msg, __FILE__, __LINE__)
 

Definition at line 103 of file rpmurl.h.

Referenced by ftpOpen(), httpOpen(), ufdGetUrlinfo(), urlConnect(), and urlFind().

#define urlNew( _msg )   XurlNew(_msg, __FILE__, __LINE__)
 

Definition at line 89 of file rpmurl.h.

Referenced by urlSplit().


Typedef Documentation

typedef struct urlinfo_s * urlinfo
 

Definition at line 24 of file rpmurl.h.

typedef enum urltype_e urltype
 

Supported URL types.


Enumeration Type Documentation

enum urltype_e
 

Supported URL types.

Enumeration values:
URL_IS_UNKNOWN   unknown (aka a file)
URL_IS_DASH   stdin/stdout
URL_IS_PATH   file://...
URL_IS_FTP   ftp://...
URL_IS_HTTP   http://...

Definition at line 13 of file rpmurl.h.


Function Documentation

urlinfo XurlFree ( urlinfo u,
const char * msg,
const char * file,
unsigned line )
 

Todo:
Remove debugging entry from the ABI.

Definition at line 94 of file url.c.

urlinfo XurlLink ( urlinfo u,
const char * msg,
const char * file,
unsigned line )
 

Todo:
Remove debugging entry from the ABI.

Definition at line 64 of file url.c.

urlinfo XurlNew ( const char * msg,
const char * file,
unsigned line )
 

Todo:
Remove debugging entry from the ABI.

Definition at line 74 of file url.c.

urlinfo urlFree ( urlinfo u,
const char * msg )
 

Dereference a URL control structure instance.

Parameters:
u   URL control structure
msg   debugging identifier (unused)
Returns:
dereferenced instance (NULL if freed)

void urlFreeCache ( void )
 

Free cached URL control structures.

Definition at line 158 of file url.c.

Referenced by main().

int urlGetFile ( const char * url,
const char * dest )
 

Copy data from URL to local file.

Parameters:
url   url string of source
dest   file name of destination
Returns:
0 on success, otherwise FTPERR_* code

Definition at line 496 of file url.c.

urltype urlIsURL ( const char * url )
 

Return type of URL.

Parameters:
url   url string
Returns:
type of url

Definition at line 344 of file url.c.

urlinfo urlLink ( urlinfo u,
const char * msg )
 

Reference a URL control structure instance.

Parameters:
u   URL control structure
msg   debugging identifier (unused)
Returns:
referenced instance

urlinfo urlNew ( const char * msg )
 

Create a URL control structure instance.

Parameters:
msg   debugging identifier (unused)
Returns:
new instance

urltype urlPath ( const char * url,
const char ** pathp )
 

Return path component of URL.

Parameters:
url   url string
Return values:
pathp   pointer to path component of url
Returns:
type of url

Definition at line 360 of file url.c.

int urlSplit ( const char * url,
urlinfo * uret )
 

Parse URL string into a control structure.

Parameters:
url   url string
Return values:
uret   address of new control instance pointer
Returns:
0 on success, -1 on error

Definition at line 400 of file url.c.


Variable Documentation

urlinfo * _url_cache = NULL
 

URL cache.

Definition at line 45 of file url.c.

int _url_count = 0
 

No. of cached URL's.

Definition at line 50 of file url.c.

int _url_debug
 

Definition at line 75 of file rpmurl.h.

int _url_iobuf_size = RPMURL_IOBUF_SIZE
 

Initial size of URL I/O buffer.

Definition at line 29 of file url.c.


Generated at Tue Dec 23 04:54:14 2003 for rpm by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001