Added some MAPI stubs.
[wine] / dlls / wininet / internet.h
1 #ifndef _WINE_INTERNET_H_
2 #define _WINE_INTERNET_H_
3
4 #include <time.h>
5 #ifdef HAVE_NETDB_H
6 # include <netdb.h>
7 #endif
8 #ifdef HAVE_NETINET_IN_H
9 # include <sys/types.h>
10 # include <netinet/in.h>
11 #endif
12
13 typedef enum
14 {
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,
22 } WH_TYPE;
23
24 typedef struct _WININETHANDLEHEADER
25 {
26     WH_TYPE htype;
27     DWORD  dwFlags;
28     DWORD  dwContext;
29     DWORD  dwError;
30     struct _WININETHANDLEHEADER *lpwhparent;
31 } WININETHANDLEHEADER, *LPWININETHANDLEHEADER;
32
33
34 typedef struct
35 {
36     WININETHANDLEHEADER hdr;
37     LPSTR  lpszAgent;
38     LPSTR  lpszProxy;
39     LPSTR  lpszProxyBypass;
40     DWORD   dwAccessType;
41     INTERNET_STATUS_CALLBACK lpfnStatusCB;
42 } WININETAPPINFOA, *LPWININETAPPINFOA;
43
44
45 typedef struct
46 {
47     WININETHANDLEHEADER hdr;
48     LPSTR  lpszServerName;
49     LPSTR  lpszUserName;
50     INTERNET_PORT nServerPort;
51     struct sockaddr_in socketAddress;
52     struct hostent *phostent;
53 } WININETHTTPSESSIONA, *LPWININETHTTPSESSIONA;
54
55 #define HDR_ISREQUEST           0x0001
56 #define HDR_COMMADELIMITED      0x0002
57 #define HDR_SEMIDELIMITED       0x0004
58
59 typedef struct
60 {
61     LPSTR lpszField;
62     LPSTR lpszValue;
63     WORD wFlags;
64     WORD wCount;
65 } HTTPHEADERA, *LPHTTPHEADERA;
66
67
68 typedef struct
69 {
70     WININETHANDLEHEADER hdr;
71     LPSTR lpszPath;
72     LPSTR lpszVerb;
73     LPSTR lpszHostName;
74     INT nSocketFD;
75     HTTPHEADERA StdHeaders[HTTP_QUERY_MAX+1];
76     HTTPHEADERA *pCustHeaders;
77     INT nCustHeaders;
78 } WININETHTTPREQA, *LPWININETHTTPREQA;
79
80
81 typedef struct
82 {
83     WININETHANDLEHEADER hdr;
84     int sndSocket;
85     int lstnSocket;
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;
90     LPSTR  lpszPassword;
91     LPSTR  lpszUserName;
92 } WININETFTPSESSIONA, *LPWININETFTPSESSIONA;
93
94
95 typedef struct
96 {
97     WININETHANDLEHEADER hdr;
98     int nDataSocket;
99 } WININETFILE, *LPWININETFILE;
100
101
102 typedef struct
103 {
104     BOOL bIsDirectory;
105     LPSTR lpszName;
106     DWORD nSize;
107     struct tm tmLastModified;
108     unsigned short permissions;
109 } FILEPROPERTIESA, *LPFILEPROPERTIESA;
110
111
112 typedef struct
113 {
114     WININETHANDLEHEADER hdr;
115     int index;
116     DWORD size;
117     LPFILEPROPERTIESA lpafp;
118 } WININETFINDNEXTA, *LPWININETFINDNEXTA;
119
120 typedef enum
121 {
122     FTPPUTFILEA,
123     FTPSETCURRENTDIRECTORYA,
124     FTPCREATEDIRECTORYA,
125     FTPFINDFIRSTFILEA,
126     FTPGETCURRENTDIRECTORYA,
127     FTPOPENFILEA,
128     FTPGETFILEA,
129     FTPDELETEFILEA,
130     FTPREMOVEDIRECTORYA,
131     FTPRENAMEFILEA,
132     INTERNETFINDNEXTA,
133     HTTPSENDREQUESTA,
134     HTTPOPENREQUESTA,
135 } ASYNC_FUNC;
136
137 typedef struct WORKREQ
138 {
139     ASYNC_FUNC asyncall;
140     DWORD param1;
141 #define HFTPSESSION       param1
142
143     DWORD param2;
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
152
153     DWORD param3;
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
162
163     DWORD param4;
164 #define DWFLAGS           param4
165 #define LPOPTIONAL        param4
166
167     DWORD param5;
168 #define DWCONTEXT         param5
169 #define DWOPTIONALLENGTH  param5
170
171     DWORD param6;
172 #define FFAILIFEXISTS     param6
173 #define LPSZVERSION       param6
174
175     DWORD param7;
176 #define DWLOCALFLAGSATTRIBUTE param7
177 #define LPSZREFERRER          param7
178
179     DWORD param8;
180 #define LPSZACCEPTTYPES       param8
181
182     struct WORKREQ *next;
183     struct WORKREQ *prev;
184
185 } WORKREQUEST, *LPWORKREQUEST;
186
187
188 time_t ConvertTimeString(LPCSTR asctime);
189
190 HINTERNET FTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, 
191         INTERNET_PORT nServerPort, LPCSTR lpszUserName,
192         LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
193
194 HINTERNET HTTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, 
195         INTERNET_PORT nServerPort, LPCSTR lpszUserName,
196         LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext);
197
198 BOOL GetAddress(LPCSTR lpszServerName, INTERNET_PORT nServerPort,
199         struct hostent **phe, struct sockaddr_in *psa);
200
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);
208
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,
227         DWORD dwContext);
228
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);
237
238
239 #define MAX_REPLY_LEN           0x5B4
240
241
242 #endif /* _WINE_INTERNET_H_ */