Changeset 607 for trunk/zoo-project/zoo-kernel/ulinet.h
- Timestamp:
- Mar 12, 2015, 3:14:52 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/ulinet.h
r579 r607 66 66 #endif 67 67 68 struct MemoryStruct {69 char *memory; //!< the memory space to store data70 size_t size; //!< side of the memory space71 };68 struct MemoryStruct { 69 char *memory; //!< the memory space to store data 70 size_t size; //!< size of the memory space 71 }; 72 72 73 73 /** 74 74 * Individual CURL handler 75 75 */ 76 typedef struct { 77 CURL *handle; //!< the CURL handler 78 struct curl_slist *header; //!< the headers to send 79 char* filename; //!< the cached file name 80 FILE* file; //!< the file pointer 81 unsigned char *pabyData; //!< the downloaded content 82 char *mimeType; //!< the mimeType returned by the server 83 int hasCacheFile; //!< 1 if we used a cache file 84 int nDataLen; //!< the length of the downloaded content 85 int nDataAlloc; //!< 86 int id; //!< The position of the element in the queue 87 } _HINTERNET; 76 typedef struct { 77 CURL *handle; //!< the CURL handler 78 struct curl_slist *header; //!< the headers to send 79 char* filename; //!< the cached file name 80 FILE* file; //!< the file pointer 81 unsigned char *pabyData; //!< the downloaded content 82 char *mimeType; //!< the mimeType returned by the server 83 int hasCacheFile; //!< 1 if we used a cache file 84 int nDataLen; //!< the length of the downloaded content 85 int nDataAlloc; //!< 86 long code; //!< the last received response code 87 int id; //!< The position of the element in the queue 88 } _HINTERNET; 88 89 89 90 /** 90 91 * Multiple CURL handlers 91 92 */ 92 typedef struct {93 CURLM *handle; //!< the CURLM handler94 _HINTERNET ihandle[MAX_REQ]; //!< individual handlers in the queue95 char *waitingRequests[MAX_REQ]; //!< request in the queue96 char *agent; //!< The User-Agent to use for HTTP request97 int nb; //!< number of element in the queue98 } HINTERNET;93 typedef struct { 94 CURLM *handle; //!< the CURLM handler 95 _HINTERNET ihandle[MAX_REQ]; //!< individual handlers in the queue 96 char *waitingRequests[MAX_REQ]; //!< request in the queue 97 char *agent; //!< The User-Agent to use for HTTP request 98 int nb; //!< number of element in the queue 99 } HINTERNET; 99 100 100 size_t write_data_into(void *buffer, size_t size, size_t nmemb, void *data);101 size_t write_data_into(void*,size_t,size_t,void*); 101 102 102 size_t header_write_data(void *buffer, size_t size, size_t nmemb, void *data);103 size_t header_write_data(void*,size_t,size_t,void*); 103 104 104 void setProxy(CURL* handle,char* host,long port);105 void setProxy(CURL*,char*,long); 105 106 106 107 #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) … … 108 109 #include <CoreServices/CoreServices.h> 109 110 #include <SystemConfiguration/SystemConfiguration.h> 110 char* CFStringToCString(CFStringRef dest,char * buffer);111 OSStatus setProxiesForProtcol(CURL* handle,const char *proto);111 char* CFStringToCString(CFStringRef,char*); 112 OSStatus setProxiesForProtcol(CURL*,const char*); 112 113 113 114 #else 114 115 115 116 //#include <gconf/gconf-client.h> 116 int setProxiesForProtcol(CURL* handle,const char *proto);117 int setProxiesForProtcol(CURL*,const char*); 117 118 118 119 #endif … … 126 127 typedef char* LPCTSTR; 127 128 #endif 128 HINTERNET InternetOpen(char* lpszAgent,int dwAccessType,char* lpszProxyName,char* lpszProxyBypass,int dwFlags);129 HINTERNET InternetOpen(char*,int,char*,char*,int); 129 130 130 void InternetCloseHandle(HINTERNET* handle);131 void InternetCloseHandle(HINTERNET*); 131 132 132 133 #define INTERNET_FLAG_EXISTING_CONNECT 0 … … 143 144 //typedef char* LPVOID; 144 145 #ifndef WIN32 145 typedef void* LPVOID;146 typedef void* LPTSTR;147 typedef size_t* LPDWORD;146 typedef void* LPVOID; 147 typedef void* LPTSTR; 148 typedef size_t* LPDWORD; 148 149 #endif 149 150 #ifndef bool … … 153 154 # define CHECK_INET_HANDLE(h) (h.handle != 0) 154 155 155 HINTERNET InternetOpenUrl(HINTERNET* hInternet,LPCTSTR lpszUrl,LPCTSTR lpszHeaders,size_t dwHeadersLength,size_t dwFlags,size_t dwContext);156 HINTERNET InternetOpenUrl(HINTERNET*,LPCTSTR,LPCTSTR,size_t,size_t,size_t); 156 157 157 int processDownloads(HINTERNET* hInternet);158 int processDownloads(HINTERNET*); 158 159 159 int freeCookieList(HINTERNET hInternet);160 int freeCookieList(HINTERNET); 160 161 161 int InternetReadFile(_HINTERNET hInternet,LPVOID lpBuffer,int dwNumberOfBytesToRead,size_t *lpdwNumberOfBytesRead); 162 int InternetReadFile(_HINTERNET,LPVOID,int,size_t*); 163 164 int setBasicAuth(HINTERNET,char*,char*); 162 165 163 166 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.