Main Page   Modules   Data Structures   File List   Data Fields   Globals   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 /*@owned@*//*@null@*/ const char * url;         
00030 /*@owned@*//*@null@*/ const char * service;
00031 /*@owned@*//*@null@*/ const char * user;
00032 /*@owned@*//*@null@*/ const char * password;
00033 /*@owned@*//*@null@*/ const char * host;
00034 /*@owned@*//*@null@*/ const char * portstr;
00035 /*@owned@*//*@null@*/ const char * proxyu;      
00036 /*@owned@*//*@null@*/ const char * proxyh;      
00037     int proxyp;                 
00038     int port;
00039     int urltype;
00040     FD_t ctrl;                  
00041     FD_t data;                  
00042     int bufAlloced;             
00043 /*@owned@*/ 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 
00064 urlinfo XurlNew(const char * msg, const char * file, unsigned line)     /*@*/;
00065 #define urlNew(_msg) XurlNew(_msg, __FILE__, __LINE__)
00066 
00073 urlinfo urlLink(urlinfo u, const char * msg)
00074         /*@modifies u @*/;
00075 
00077 urlinfo XurlLink(urlinfo u, const char * msg, const char * file, unsigned line)
00078         /*@modifies u @*/;
00079 #define urlLink(_u, _msg) XurlLink(_u, _msg, __FILE__, __LINE__)
00080 
00087 urlinfo urlFree( /*@killref@*/ urlinfo u, const char * msg)
00088         /*@modifies u @*/;
00089 
00091 urlinfo XurlFree( /*@killref@*/ urlinfo u, const char * msg,
00092                 const char * file, unsigned line)
00093         /*@modifies u @*/;
00094 #define urlFree(_u, _msg) XurlFree(_u, _msg, __FILE__, __LINE__)
00095 
00099 void urlFreeCache(void)
00100         /*@modifies internalState @*/;
00101 
00107 urltype urlIsURL(const char * url)
00108         /*@*/;
00109 
00116 urltype urlPath(const char * url, /*@out@*/ const char ** pathp)
00117         /*@modifies *pathp@*/;
00118 
00125 int urlSplit(const char * url, /*@out@*/ urlinfo * u)
00126         /*@modifies *u @*/;
00127 
00134 int urlGetFile(const char * url, /*@null@*/ const char * dest)
00135         /*@modifies fileSystem @*/;
00136 
00137 #ifdef __cplusplus
00138 }
00139 #endif
00140 
00141 #endif  /* H_RPMURL */

Generated at Thu Sep 6 11:25:44 2001 for rpm by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001