Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

rpmio/rpmurl.h

Go to the documentation of this file.
00001 #ifndef H_RPMURL
00002 #define H_RPMURL
00003 
00008 #include <assert.h>
00009 
00013 typedef enum {
00014     URL_IS_UNKNOWN      = 0,    
00015     URL_IS_DASH         = 1,    
00016     URL_IS_PATH         = 2,    
00017     URL_IS_FTP          = 3,    
00018     URL_IS_HTTP         = 4     
00019 } urltype;
00020 
00021 #define URLMAGIC        0xd00b1ed0
00022 #define URLSANE(u)      assert(u && u->magic == URLMAGIC)
00023 
00027 typedef /*@abstract@*/ /*@refcounted@*/ struct urlinfo {
00028 /*@refs@*/ int nrefs;           
00029     const char * url;           
00030     const char * service;
00031     const char * user;
00032     const char * password;
00033     const char * host;
00034     const char * portstr;
00035     const char * proxyu;        
00036     const char * proxyh;        
00037     int proxyp;                 
00038     int port;
00039     int urltype;
00040     FD_t ctrl;                  
00041     FD_t data;                  
00042     int bufAlloced;             
00043     char *buf;                  
00044     int openError;              
00045     int httpVersion;
00046     int httpHasRange;
00047     int magic;
00048 } *urlinfo;
00049 
00050 #ifdef __cplusplus
00051 extern "C" {
00052 #endif
00053 
00054 extern int url_iobuf_size;
00055 
00061 urlinfo urlNew(const char * msg);
00062 urlinfo XurlNew(const char * msg, const char * file, unsigned line);
00063 #define urlNew(_msg) XurlNew(_msg, __FILE__, __LINE__)
00064 
00071 urlinfo urlLink(urlinfo u, const char * msg);
00072 urlinfo XurlLink(urlinfo u, const char * msg, const char * file, unsigned line);
00073 #define urlLink(_u, _msg) XurlLink(_u, _msg, __FILE__, __LINE__)
00074 
00081 urlinfo urlFree( /*@killref@*/ urlinfo u, const char * msg);
00082 urlinfo XurlFree( /*@killref@*/ urlinfo u, const char * msg, const char * file, unsigned line);
00083 #define urlFree(_u, _msg) XurlFree(_u, _msg, __FILE__, __LINE__)
00084 
00088 void    urlFreeCache(void);
00089 
00095 urltype urlIsURL(const char * url)      /*@*/;
00096 
00103 urltype urlPath(const char * url, /*@out@*/ const char ** pathp)
00104         /*@modifies *pathp@*/;
00105 
00112 int     urlSplit(const char * url, /*@out@*/ urlinfo * u)
00113                 /*@modifies *u @*/;
00114 
00121 int     urlGetFile(const char * url, const char * dest);
00122 
00123 #ifdef __cplusplus
00124 }
00125 #endif
00126 
00127 #endif  /* H_RPMURL */

Generated at Sun Apr 8 18:43:02 2001 for rpm by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000