4 * Copyright 1999 Corel Corporation
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef _WINE_INTERNET_H_
24 #define _WINE_INTERNET_H_
30 #ifdef HAVE_NETINET_IN_H
31 # include <sys/types.h>
32 # include <netinet/in.h>
37 WH_HINIT = INTERNET_HANDLE_TYPE_INTERNET,
38 WH_HFTPSESSION = INTERNET_HANDLE_TYPE_CONNECT_FTP,
39 WH_HGOPHERSESSION = INTERNET_HANDLE_TYPE_CONNECT_GOPHER,
40 WH_HHTTPSESSION = INTERNET_HANDLE_TYPE_CONNECT_HTTP,
41 WH_HFILE = INTERNET_HANDLE_TYPE_FTP_FILE,
42 WH_HFINDNEXT = INTERNET_HANDLE_TYPE_FTP_FIND,
43 WH_HHTTPREQ = INTERNET_HANDLE_TYPE_HTTP_REQUEST,
46 typedef struct _WININETHANDLEHEADER
52 struct _WININETHANDLEHEADER *lpwhparent;
53 } WININETHANDLEHEADER, *LPWININETHANDLEHEADER;
58 WININETHANDLEHEADER hdr;
61 LPSTR lpszProxyBypass;
63 INTERNET_STATUS_CALLBACK lpfnStatusCB;
64 } WININETAPPINFOA, *LPWININETAPPINFOA;
69 WININETHANDLEHEADER hdr;
72 INTERNET_PORT nServerPort;
73 struct sockaddr_in socketAddress;
74 struct hostent *phostent;
75 } WININETHTTPSESSIONA, *LPWININETHTTPSESSIONA;
77 #define HDR_ISREQUEST 0x0001
78 #define HDR_COMMADELIMITED 0x0002
79 #define HDR_SEMIDELIMITED 0x0004
87 } HTTPHEADERA, *LPHTTPHEADERA;
92 WININETHANDLEHEADER hdr;
97 HTTPHEADERA StdHeaders[HTTP_QUERY_MAX+1];
98 HTTPHEADERA *pCustHeaders;
100 } WININETHTTPREQA, *LPWININETHTTPREQA;
105 WININETHANDLEHEADER hdr;
108 int pasvSocket; /* data socket connected by us in case of passive FTP */
109 struct sockaddr_in socketAddress;
110 struct sockaddr_in lstnSocketAddress;
111 struct hostent *phostent;
114 } WININETFTPSESSIONA, *LPWININETFTPSESSIONA;
119 WININETHANDLEHEADER hdr;
121 } WININETFILE, *LPWININETFILE;
129 struct tm tmLastModified;
130 unsigned short permissions;
131 } FILEPROPERTIESA, *LPFILEPROPERTIESA;
136 WININETHANDLEHEADER hdr;
139 LPFILEPROPERTIESA lpafp;
140 } WININETFINDNEXTA, *LPWININETFINDNEXTA;
145 FTPSETCURRENTDIRECTORYA,
148 FTPGETCURRENTDIRECTORYA,
159 typedef struct WORKREQ
163 #define HFTPSESSION param1
166 #define LPSZLOCALFILE param2
167 #define LPSZREMOTEFILE param2
168 #define LPSZFILENAME param2
169 #define LPSZSRCFILE param2
170 #define LPSZDIRECTORY param2
171 #define LPSZSEARCHFILE param2
172 #define LPSZHEADER param2
173 #define LPSZVERB param2
176 #define LPSZNEWREMOTEFILE param3
177 #define LPSZNEWFILE param3
178 #define LPFINDFILEDATA param3
179 #define LPDWDIRECTORY param3
180 #define FDWACCESS param3
181 #define LPSZDESTFILE param3
182 #define DWHEADERLENGTH param3
183 #define LPSZOBJECTNAME param3
186 #define DWFLAGS param4
187 #define LPOPTIONAL param4
190 #define DWCONTEXT param5
191 #define DWOPTIONALLENGTH param5
194 #define FFAILIFEXISTS param6
195 #define LPSZVERSION param6
198 #define DWLOCALFLAGSATTRIBUTE param7
199 #define LPSZREFERRER param7
202 #define LPSZACCEPTTYPES param8
204 struct WORKREQ *next;
205 struct WORKREQ *prev;
207 } WORKREQUEST, *LPWORKREQUEST;
210 time_t ConvertTimeString(LPCSTR asctime);
212 HINTERNET FTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName,
213 INTERNET_PORT nServerPort, LPCSTR lpszUserName,
214 LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
216 HINTERNET HTTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName,
217 INTERNET_PORT nServerPort, LPCSTR lpszUserName,
218 LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
220 BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort,
221 struct hostent **phe, struct sockaddr_in *psa);
223 int INTERNET_WriteDataToStream(int nDataSocket, LPCVOID Buffer, DWORD BytesToWrite);
224 int INTERNET_ReadDataFromStream(int nDataSocket, LPVOID Buffer, DWORD BytesToRead);
225 void INTERNET_SetLastError(DWORD dwError);
226 DWORD INTERNET_GetLastError();
227 BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest);
228 LPSTR INTERNET_GetResponseBuffer();
229 LPSTR INTERNET_GetNextLine(INT nSocket, LPSTR lpszBuffer, LPDWORD dwBuffer);
231 BOOL FTP_CloseSessionHandle(LPWININETFTPSESSIONA lpwfs);
232 BOOL FTP_CloseFindNextHandle(LPWININETFINDNEXTA lpwfn);
233 BOOLAPI FTP_FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
234 LPCSTR lpszNewRemoteFile, DWORD dwFlags, DWORD dwContext);
235 BOOLAPI FTP_FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory);
236 BOOLAPI FTP_FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory);
237 INTERNETAPI HINTERNET WINAPI FTP_FtpFindFirstFileA(HINTERNET hConnect,
238 LPCSTR lpszSearchFile, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwFlags, DWORD dwContext);
239 BOOLAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory,
240 LPDWORD lpdwCurrentDirectory);
241 BOOL FTP_ConvertFileProp(LPFILEPROPERTIESA lpafp, LPWIN32_FIND_DATAA lpFindFileData);
242 BOOL FTP_FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest);
243 BOOL FTP_FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory);
244 BOOL FTP_FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName);
245 HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, LPCSTR lpszFileName,
246 DWORD fdwAccess, DWORD dwFlags, DWORD dwContext);
247 BOOLAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszNewFile,
248 BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags,
251 BOOLAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
252 DWORD dwHeaderLength, LPVOID lpOptional ,DWORD dwOptionalLength);
253 INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
254 LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion,
255 LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes,
256 DWORD dwFlags, DWORD dwContext);
257 void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONA lpwhs);
258 void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr);
261 #define MAX_REPLY_LEN 0x5B4
264 #endif /* _WINE_INTERNET_H_ */