Added some stubs.
[wine] / dlls / wininet / internet.h
1 /*
2  * Wininet
3  *
4  * Copyright 1999 Corel Corporation
5  *
6  * Ulrich Czekalla
7  *
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.
12  *
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.
17  *
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
21  */
22
23 #ifndef _WINE_INTERNET_H_
24 #define _WINE_INTERNET_H_
25
26 #include <time.h>
27 #ifdef HAVE_NETDB_H
28 # include <netdb.h>
29 #endif
30 #ifdef HAVE_NETINET_IN_H
31 # include <sys/types.h>
32 # include <netinet/in.h>
33 #endif
34
35 typedef enum
36 {
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,
44 } WH_TYPE;
45
46 typedef struct _WININETHANDLEHEADER
47 {
48     WH_TYPE htype;
49     DWORD  dwFlags;
50     DWORD  dwContext;
51     DWORD  dwError;
52     struct _WININETHANDLEHEADER *lpwhparent;
53 } WININETHANDLEHEADER, *LPWININETHANDLEHEADER;
54
55
56 typedef struct
57 {
58     WININETHANDLEHEADER hdr;
59     LPSTR  lpszAgent;
60     LPSTR  lpszProxy;
61     LPSTR  lpszProxyBypass;
62     DWORD   dwAccessType;
63     INTERNET_STATUS_CALLBACK lpfnStatusCB;
64 } WININETAPPINFOA, *LPWININETAPPINFOA;
65
66
67 typedef struct
68 {
69     WININETHANDLEHEADER hdr;
70     LPSTR  lpszServerName;
71     LPSTR  lpszUserName;
72     INTERNET_PORT nServerPort;
73     struct sockaddr_in socketAddress;
74     struct hostent *phostent;
75 } WININETHTTPSESSIONA, *LPWININETHTTPSESSIONA;
76
77 #define HDR_ISREQUEST           0x0001
78 #define HDR_COMMADELIMITED      0x0002
79 #define HDR_SEMIDELIMITED       0x0004
80
81 typedef struct
82 {
83     LPSTR lpszField;
84     LPSTR lpszValue;
85     WORD wFlags;
86     WORD wCount;
87 } HTTPHEADERA, *LPHTTPHEADERA;
88
89
90 typedef struct
91 {
92     WININETHANDLEHEADER hdr;
93     LPSTR lpszPath;
94     LPSTR lpszVerb;
95     LPSTR lpszHostName;
96     INT nSocketFD;
97     HTTPHEADERA StdHeaders[HTTP_QUERY_MAX+1];
98     HTTPHEADERA *pCustHeaders;
99     INT nCustHeaders;
100 } WININETHTTPREQA, *LPWININETHTTPREQA;
101
102
103 typedef struct
104 {
105     WININETHANDLEHEADER hdr;
106     int sndSocket;
107     int lstnSocket;
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;
112     LPSTR  lpszPassword;
113     LPSTR  lpszUserName;
114 } WININETFTPSESSIONA, *LPWININETFTPSESSIONA;
115
116
117 typedef struct
118 {
119     WININETHANDLEHEADER hdr;
120     int nDataSocket;
121 } WININETFILE, *LPWININETFILE;
122
123
124 typedef struct
125 {
126     BOOL bIsDirectory;
127     LPSTR lpszName;
128     DWORD nSize;
129     struct tm tmLastModified;
130     unsigned short permissions;
131 } FILEPROPERTIESA, *LPFILEPROPERTIESA;
132
133
134 typedef struct
135 {
136     WININETHANDLEHEADER hdr;
137     int index;
138     DWORD size;
139     LPFILEPROPERTIESA lpafp;
140 } WININETFINDNEXTA, *LPWININETFINDNEXTA;
141
142 typedef enum
143 {
144     FTPPUTFILEA,
145     FTPSETCURRENTDIRECTORYA,
146     FTPCREATEDIRECTORYA,
147     FTPFINDFIRSTFILEA,
148     FTPGETCURRENTDIRECTORYA,
149     FTPOPENFILEA,
150     FTPGETFILEA,
151     FTPDELETEFILEA,
152     FTPREMOVEDIRECTORYA,
153     FTPRENAMEFILEA,
154     INTERNETFINDNEXTA,
155     HTTPSENDREQUESTA,
156     HTTPOPENREQUESTA,
157 } ASYNC_FUNC;
158
159 typedef struct WORKREQ
160 {
161     ASYNC_FUNC asyncall;
162     DWORD param1;
163 #define HFTPSESSION       param1
164
165     DWORD param2;
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
174
175     DWORD param3;
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
184
185     DWORD param4;
186 #define DWFLAGS           param4
187 #define LPOPTIONAL        param4
188
189     DWORD param5;
190 #define DWCONTEXT         param5
191 #define DWOPTIONALLENGTH  param5
192
193     DWORD param6;
194 #define FFAILIFEXISTS     param6
195 #define LPSZVERSION       param6
196
197     DWORD param7;
198 #define DWLOCALFLAGSATTRIBUTE param7
199 #define LPSZREFERRER          param7
200
201     DWORD param8;
202 #define LPSZACCEPTTYPES       param8
203
204     struct WORKREQ *next;
205     struct WORKREQ *prev;
206
207 } WORKREQUEST, *LPWORKREQUEST;
208
209
210 time_t ConvertTimeString(LPCSTR asctime);
211
212 HINTERNET FTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, 
213         INTERNET_PORT nServerPort, LPCSTR lpszUserName,
214         LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
215
216 HINTERNET HTTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, 
217         INTERNET_PORT nServerPort, LPCSTR lpszUserName,
218         LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
219
220 BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort,
221         struct hostent **phe, struct sockaddr_in *psa);
222
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);
230
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,
249         DWORD dwContext);
250
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);
259
260
261 #define MAX_REPLY_LEN           0x5B4
262
263
264 #endif /* _WINE_INTERNET_H_ */