Added LGPL standard comment, and copyright notices where necessary.
[wine/multimedia.git] / dlls / wininet / internet.h
blobd45d8bb18f216fc6a04dceca3bd90a421dc0a36c
1 /*
2 * Wininet
4 * Copyright 1999 Corel Corporation
6 * Ulrich Czekalla
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_
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
35 typedef enum
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;
46 typedef struct _WININETHANDLEHEADER
48 WH_TYPE htype;
49 DWORD dwFlags;
50 DWORD dwContext;
51 DWORD dwError;
52 struct _WININETHANDLEHEADER *lpwhparent;
53 } WININETHANDLEHEADER, *LPWININETHANDLEHEADER;
56 typedef struct
58 WININETHANDLEHEADER hdr;
59 LPSTR lpszAgent;
60 LPSTR lpszProxy;
61 LPSTR lpszProxyBypass;
62 DWORD dwAccessType;
63 INTERNET_STATUS_CALLBACK lpfnStatusCB;
64 } WININETAPPINFOA, *LPWININETAPPINFOA;
67 typedef struct
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;
77 #define HDR_ISREQUEST 0x0001
78 #define HDR_COMMADELIMITED 0x0002
79 #define HDR_SEMIDELIMITED 0x0004
81 typedef struct
83 LPSTR lpszField;
84 LPSTR lpszValue;
85 WORD wFlags;
86 WORD wCount;
87 } HTTPHEADERA, *LPHTTPHEADERA;
90 typedef struct
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;
103 typedef struct
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;
117 typedef struct
119 WININETHANDLEHEADER hdr;
120 int nDataSocket;
121 } WININETFILE, *LPWININETFILE;
124 typedef struct
126 BOOL bIsDirectory;
127 LPSTR lpszName;
128 DWORD nSize;
129 struct tm tmLastModified;
130 unsigned short permissions;
131 } FILEPROPERTIESA, *LPFILEPROPERTIESA;
134 typedef struct
136 WININETHANDLEHEADER hdr;
137 int index;
138 DWORD size;
139 LPFILEPROPERTIESA lpafp;
140 } WININETFINDNEXTA, *LPWININETFINDNEXTA;
142 typedef enum
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;
159 typedef struct WORKREQ
161 ASYNC_FUNC asyncall;
162 DWORD param1;
163 #define HFTPSESSION param1
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
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
185 DWORD param4;
186 #define DWFLAGS param4
187 #define LPOPTIONAL param4
189 DWORD param5;
190 #define DWCONTEXT param5
191 #define DWOPTIONALLENGTH param5
193 DWORD param6;
194 #define FFAILIFEXISTS param6
195 #define LPSZVERSION param6
197 DWORD param7;
198 #define DWLOCALFLAGSATTRIBUTE param7
199 #define LPSZREFERRER param7
201 DWORD param8;
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,
249 DWORD dwContext);
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_ */