1 #ifndef _WINE_INTERNET_H_
2 #define _WINE_INTERNET_H_
8 #ifdef HAVE_NETINET_IN_H
9 # include <sys/types.h>
10 # include <netinet/in.h>
15 WH_HINIT = INTERNET_HANDLE_TYPE_INTERNET,
16 WH_HFTPSESSION = INTERNET_HANDLE_TYPE_CONNECT_FTP,
17 WH_HGOPHERSESSION = INTERNET_HANDLE_TYPE_CONNECT_GOPHER,
18 WH_HHTTPSESSION = INTERNET_HANDLE_TYPE_CONNECT_HTTP,
19 WH_HFILE = INTERNET_HANDLE_TYPE_FTP_FILE,
20 WH_HFINDNEXT = INTERNET_HANDLE_TYPE_FTP_FIND,
21 WH_HHTTPREQ = INTERNET_HANDLE_TYPE_HTTP_REQUEST,
24 typedef struct _WININETHANDLEHEADER
30 struct _WININETHANDLEHEADER *lpwhparent;
31 } WININETHANDLEHEADER, *LPWININETHANDLEHEADER;
36 WININETHANDLEHEADER hdr;
39 LPSTR lpszProxyBypass;
41 INTERNET_STATUS_CALLBACK lpfnStatusCB;
42 } WININETAPPINFOA, *LPWININETAPPINFOA;
47 WININETHANDLEHEADER hdr;
50 INTERNET_PORT nServerPort;
51 struct sockaddr_in socketAddress;
52 struct hostent *phostent;
53 } WININETHTTPSESSIONA, *LPWININETHTTPSESSIONA;
55 #define HDR_ISREQUEST 0x0001
56 #define HDR_COMMADELIMITED 0x0002
57 #define HDR_SEMIDELIMITED 0x0004
65 } HTTPHEADERA, *LPHTTPHEADERA;
70 WININETHANDLEHEADER hdr;
75 HTTPHEADERA StdHeaders[HTTP_QUERY_MAX+1];
76 HTTPHEADERA *pCustHeaders;
78 } WININETHTTPREQA, *LPWININETHTTPREQA;
83 WININETHANDLEHEADER hdr;
86 int pasvSocket; /* data socket connected by us in case of passive FTP */
87 struct sockaddr_in socketAddress;
88 struct sockaddr_in lstnSocketAddress;
89 struct hostent *phostent;
92 } WININETFTPSESSIONA, *LPWININETFTPSESSIONA;
97 WININETHANDLEHEADER hdr;
99 } WININETFILE, *LPWININETFILE;
107 struct tm tmLastModified;
108 unsigned short permissions;
109 } FILEPROPERTIESA, *LPFILEPROPERTIESA;
114 WININETHANDLEHEADER hdr;
117 LPFILEPROPERTIESA lpafp;
118 } WININETFINDNEXTA, *LPWININETFINDNEXTA;
123 FTPSETCURRENTDIRECTORYA,
126 FTPGETCURRENTDIRECTORYA,
137 typedef struct WORKREQ
141 #define HFTPSESSION param1
144 #define LPSZLOCALFILE param2
145 #define LPSZREMOTEFILE param2
146 #define LPSZFILENAME param2
147 #define LPSZSRCFILE param2
148 #define LPSZDIRECTORY param2
149 #define LPSZSEARCHFILE param2
150 #define LPSZHEADER param2
151 #define LPSZVERB param2
154 #define LPSZNEWREMOTEFILE param3
155 #define LPSZNEWFILE param3
156 #define LPFINDFILEDATA param3
157 #define LPDWDIRECTORY param3
158 #define FDWACCESS param3
159 #define LPSZDESTFILE param3
160 #define DWHEADERLENGTH param3
161 #define LPSZOBJECTNAME param3
164 #define DWFLAGS param4
165 #define LPOPTIONAL param4
168 #define DWCONTEXT param5
169 #define DWOPTIONALLENGTH param5
172 #define FFAILIFEXISTS param6
173 #define LPSZVERSION param6
176 #define DWLOCALFLAGSATTRIBUTE param7
177 #define LPSZREFERRER param7
180 #define LPSZACCEPTTYPES param8
182 struct WORKREQ *next;
183 struct WORKREQ *prev;
185 } WORKREQUEST, *LPWORKREQUEST;
188 time_t ConvertTimeString(LPCSTR asctime);
190 HINTERNET FTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName,
191 INTERNET_PORT nServerPort, LPCSTR lpszUserName,
192 LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
194 HINTERNET HTTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName,
195 INTERNET_PORT nServerPort, LPCSTR lpszUserName,
196 LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
198 BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort,
199 struct hostent **phe, struct sockaddr_in *psa);
201 int INTERNET_WriteDataToStream(int nDataSocket, LPCVOID Buffer, DWORD BytesToWrite);
202 int INTERNET_ReadDataFromStream(int nDataSocket, LPVOID Buffer, DWORD BytesToRead);
203 void INTERNET_SetLastError(DWORD dwError);
204 DWORD INTERNET_GetLastError();
205 BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest);
206 LPSTR INTERNET_GetResponseBuffer();
207 LPSTR INTERNET_GetNextLine(INT nSocket, LPSTR lpszBuffer, LPDWORD dwBuffer);
209 BOOL FTP_CloseSessionHandle(LPWININETFTPSESSIONA lpwfs);
210 BOOL FTP_CloseFindNextHandle(LPWININETFINDNEXTA lpwfn);
211 BOOLAPI FTP_FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
212 LPCSTR lpszNewRemoteFile, DWORD dwFlags, DWORD dwContext);
213 BOOLAPI FTP_FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory);
214 BOOLAPI FTP_FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory);
215 INTERNETAPI HINTERNET WINAPI FTP_FtpFindFirstFileA(HINTERNET hConnect,
216 LPCSTR lpszSearchFile, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwFlags, DWORD dwContext);
217 BOOLAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory,
218 LPDWORD lpdwCurrentDirectory);
219 BOOL FTP_ConvertFileProp(LPFILEPROPERTIESA lpafp, LPWIN32_FIND_DATAA lpFindFileData);
220 BOOL FTP_FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest);
221 BOOL FTP_FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory);
222 BOOL FTP_FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName);
223 HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, LPCSTR lpszFileName,
224 DWORD fdwAccess, DWORD dwFlags, DWORD dwContext);
225 BOOLAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszNewFile,
226 BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags,
229 BOOLAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
230 DWORD dwHeaderLength, LPVOID lpOptional ,DWORD dwOptionalLength);
231 INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
232 LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion,
233 LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes,
234 DWORD dwFlags, DWORD dwContext);
235 void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONA lpwhs);
236 void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr);
239 #define MAX_REPLY_LEN 0x5B4
242 #endif /* _WINE_INTERNET_H_ */