msvcp: Add _Exp implementation.
[wine/multimedia.git] / include / webservices.h
blob0a8b2065ddae580df52f270c0bb130c88b680f78
1 /*
2 * Copyright 2015 Nikolay Sivov for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_WEBSERVICES_H
20 #define __WINE_WEBSERVICES_H
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
26 typedef struct _WS_ERROR WS_ERROR;
27 typedef struct _WS_HEAP WS_HEAP;
28 typedef struct _WS_XML_BUFFER WS_XML_BUFFER;
29 typedef struct _WS_XML_READER WS_XML_READER;
31 struct _WS_STRUCT_DESCRIPTION;
32 struct _WS_XML_STRING;
34 typedef enum {
35 WS_ERROR_PROPERTY_STRING_COUNT,
36 WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE,
37 WS_ERROR_PROPERTY_LANGID
38 } WS_ERROR_PROPERTY_ID;
40 typedef struct _WS_ERROR_PROPERTY {
41 WS_ERROR_PROPERTY_ID id;
42 void *value;
43 ULONG valueSize;
44 } WS_ERROR_PROPERTY;
46 typedef enum {
47 WS_HEAP_PROPERTY_MAX_SIZE,
48 WS_HEAP_PROPERTY_TRIM_SIZE,
49 WS_HEAP_PROPERTY_REQUESTED_SIZE,
50 WS_HEAP_PROPERTY_ACTUAL_SIZE
51 } WS_HEAP_PROPERTY_ID;
53 typedef struct _WS_HEAP_PROPERTY {
54 WS_HEAP_PROPERTY_ID id;
55 void *value;
56 ULONG valueSize;
57 } WS_HEAP_PROPERTY;
59 typedef enum {
60 WS_XML_READER_PROPERTY_MAX_DEPTH,
61 WS_XML_READER_PROPERTY_ALLOW_FRAGMENT,
62 WS_XML_READER_PROPERTY_MAX_ATTRIBUTES,
63 WS_XML_READER_PROPERTY_READ_DECLARATION,
64 WS_XML_READER_PROPERTY_CHARSET,
65 WS_XML_READER_PROPERTY_ROW,
66 WS_XML_READER_PROPERTY_COLUMN,
67 WS_XML_READER_PROPERTY_UTF8_TRIM_SIZE,
68 WS_XML_READER_PROPERTY_STREAM_BUFFER_SIZE,
69 WS_XML_READER_PROPERTY_IN_ATTRIBUTE,
70 WS_XML_READER_PROPERTY_STREAM_MAX_ROOT_MIME_PART_SIZE,
71 WS_XML_READER_PROPERTY_STREAM_MAX_MIME_HEADERS_SIZE,
72 WS_XML_READER_PROPERTY_MAX_MIME_PARTS,
73 WS_XML_READER_PROPERTY_ALLOW_INVALID_CHARACTER_REFERENCES,
74 WS_XML_READER_PROPERTY_MAX_NAMESPACES
75 } WS_XML_READER_PROPERTY_ID;
77 typedef struct _WS_XML_READER_PROPERTY {
78 WS_XML_READER_PROPERTY_ID id;
79 void *value;
80 ULONG valueSize;
81 } WS_XML_READER_PROPERTY;
83 typedef enum {
84 WS_XML_READER_ENCODING_TYPE_TEXT = 1,
85 WS_XML_READER_ENCODING_TYPE_BINARY = 2,
86 WS_XML_READER_ENCODING_TYPE_MTOM = 3,
87 WS_XML_READER_ENCODING_TYPE_RAW = 4
88 } WS_XML_READER_ENCODING_TYPE;
90 typedef struct _WS_XML_READER_ENCODING {
91 WS_XML_READER_ENCODING_TYPE encodingType;
92 } WS_XML_READER_ENCODING;
94 typedef enum {
95 WS_CHARSET_AUTO,
96 WS_CHARSET_UTF8,
97 WS_CHARSET_UTF16LE,
98 WS_CHARSET_UTF16BE
99 } WS_CHARSET;
101 typedef struct _WS_XML_READER_TEXT_ENCODING {
102 WS_XML_READER_ENCODING encoding;
103 WS_CHARSET charSet;
104 } WS_XML_READER_TEXT_ENCODING;
106 typedef enum {
107 WS_XML_READER_INPUT_TYPE_BUFFER = 1,
108 WS_XML_READER_INPUT_TYPE_STREAM = 2
109 } WS_XML_READER_INPUT_TYPE;
111 typedef struct _WS_XML_READER_INPUT {
112 WS_XML_READER_INPUT_TYPE inputType;
113 } WS_XML_READER_INPUT;
115 typedef struct _WS_XML_READER_BUFFER_INPUT {
116 WS_XML_READER_INPUT input;
117 void *encodedData;
118 ULONG encodedDataSize;
119 } WS_XML_READER_BUFFER_INPUT;
121 typedef enum {
122 WS_SHORT_CALLBACK,
123 WS_LONG_CALLBACK
124 } WS_CALLBACK_MODEL;
126 typedef void (CALLBACK *WS_ASYNC_CALLBACK)
127 (HRESULT, WS_CALLBACK_MODEL, void *);
129 typedef struct _WS_ASYNC_CONTEXT {
130 WS_ASYNC_CALLBACK callback;
131 void *callbackState;
132 } WS_ASYNC_CONTEXT;
134 typedef HRESULT (CALLBACK *WS_READ_CALLBACK)
135 (void*, void*, ULONG, ULONG*, const WS_ASYNC_CONTEXT*, WS_ERROR*);
137 typedef struct _WS_XML_READER_STREAM_INPUT {
138 WS_XML_READER_INPUT input;
139 WS_READ_CALLBACK readCallback;
140 void *readCallbackState;
141 } WS_XML_READER_STREAM_INPUT;
143 typedef struct _WS_XML_DICTIONARY {
144 GUID guid;
145 struct _WS_XML_STRING *strings;
146 ULONG stringCount;
147 BOOL isConst;
148 } WS_XML_DICTIONARY;
150 typedef struct _WS_XML_STRING {
151 ULONG length;
152 BYTE *bytes;
153 WS_XML_DICTIONARY *dictionary;
154 ULONG id;
155 } WS_XML_STRING;
157 typedef enum {
158 WS_ELEMENT_TYPE_MAPPING = 1,
159 WS_ATTRIBUTE_TYPE_MAPPING = 2,
160 WS_ELEMENT_CONTENT_TYPE_MAPPING = 3,
161 WS_ANY_ELEMENT_TYPE_MAPPING = 4
162 } WS_TYPE_MAPPING;
164 typedef enum {
165 WS_BOOL_TYPE,
166 WS_INT8_TYPE,
167 WS_INT16_TYPE,
168 WS_INT32_TYPE,
169 WS_INT64_TYPE,
170 WS_UINT8_TYPE,
171 WS_UINT16_TYPE,
172 WS_UINT32_TYPE,
173 WS_UINT64_TYPE,
174 WS_FLOAT_TYPE,
175 WS_DOUBLE_TYPE,
176 WS_DECIMAL_TYPE,
177 WS_DATETIME_TYPE,
178 WS_TIMESPAN_TYPE,
179 WS_GUID_TYPE,
180 WS_UNIQUE_ID_TYPE,
181 WS_STRING_TYPE,
182 WS_WSZ_TYPE,
183 WS_BYTES_TYPE,
184 WS_XML_STRING_TYPE,
185 WS_XML_QNAME_TYPE,
186 WS_XML_BUFFER_TYPE,
187 WS_CHAR_ARRAY_TYPE,
188 WS_UTF8_ARRAY_TYPE,
189 WS_BYTE_ARRAY_TYPE,
190 WS_DESCRIPTION_TYPE,
191 WS_STRUCT_TYPE,
192 WS_CUSTOM_TYPE,
193 WS_ENDPOINT_ADDRESS_TYPE,
194 WS_FAULT_TYPE,
195 WS_VOID_TYPE,
196 WS_ENUM_TYPE,
197 WS_DURATION_TYPE,
198 WS_UNION_TYPE,
199 WS_ANY_ATTRIBUTES_TYPE
200 } WS_TYPE;
202 typedef enum {
203 WS_READ_REQUIRED_VALUE = 1,
204 WS_READ_REQUIRED_POINTER = 2,
205 WS_READ_OPTIONAL_POINTER = 3,
206 WS_READ_NILLABLE_POINTER = 4,
207 WS_READ_NILLABLE_VALUE = 5
208 } WS_READ_OPTION;
210 typedef enum {
211 WS_TYPE_ATTRIBUTE_FIELD_MAPPING,
212 WS_ATTRIBUTE_FIELD_MAPPING,
213 WS_ELEMENT_FIELD_MAPPING,
214 WS_REPEATING_ELEMENT_FIELD_MAPPING,
215 WS_TEXT_FIELD_MAPPING,
216 WS_NO_FIELD_MAPPING,
217 WS_XML_ATTRIBUTE_FIELD_MAPPING,
218 WS_ELEMENT_CHOICE_FIELD_MAPPING,
219 WS_REPEATING_ELEMENT_CHOICE_FIELD_MAPPING,
220 WS_ANY_ELEMENT_FIELD_MAPPING,
221 WS_REPEATING_ANY_ELEMENT_FIELD_MAPPING,
222 WS_ANY_CONTENT_FIELD_MAPPING,
223 WS_ANY_ATTRIBUTES_FIELD_MAPPING
224 } WS_FIELD_MAPPING;
226 typedef struct _WS_DEFAULT_VALUE {
227 void *value;
228 ULONG valueSize;
229 } WS_DEFAULT_VALUE;
231 typedef struct _WS_ITEM_RANGE {
232 ULONG minItemCount;
233 ULONG maxItemCount;
234 } WS_ITEM_RANGE;
236 typedef struct _WS_FIELD_DESCRIPTION {
237 WS_FIELD_MAPPING mapping;
238 WS_XML_STRING *localName;
239 WS_XML_STRING *ns;
240 WS_TYPE type;
241 void *typeDescription;
242 ULONG offset;
243 ULONG options;
244 WS_DEFAULT_VALUE *defaultValue;
245 ULONG countOffset;
246 WS_XML_STRING *itemLocalName;
247 WS_XML_STRING *itemNs;
248 WS_ITEM_RANGE *itemRange;
249 } WS_FIELD_DESCRIPTION;
251 typedef struct _WS_STRUCT_DESCRIPTION {
252 ULONG size;
253 ULONG alignment;
254 WS_FIELD_DESCRIPTION **fields;
255 ULONG fieldCount;
256 WS_XML_STRING *typeLocalName;
257 WS_XML_STRING *typeNs;
258 struct _WS_STRUCT_DESCRIPTION *parentType;
259 struct _WS_STRUCT_DESCRIPTION **subTypes;
260 ULONG subTypeCount;
261 ULONG structOptions;
262 } WS_STRUCT_DESCRIPTION;
264 typedef struct _WS_ATTRIBUTE_DESCRIPTION {
265 WS_XML_STRING *attributeLocalName;
266 WS_XML_STRING *attributeNs;
267 WS_TYPE type;
268 void *typeDescription;
269 } WS_ATTRIBUTE_DESCRIPTION;
271 typedef struct _WS_STRING {
272 ULONG length;
273 WCHAR *chars;
274 } WS_STRING;
276 typedef enum {
277 WS_XML_NODE_TYPE_ELEMENT = 1,
278 WS_XML_NODE_TYPE_TEXT = 2,
279 WS_XML_NODE_TYPE_END_ELEMENT = 3,
280 WS_XML_NODE_TYPE_COMMENT = 4,
281 WS_XML_NODE_TYPE_CDATA = 6,
282 WS_XML_NODE_TYPE_END_CDATA = 7,
283 WS_XML_NODE_TYPE_EOF = 8,
284 WS_XML_NODE_TYPE_BOF = 9
285 } WS_XML_NODE_TYPE;
287 typedef struct _WS_XML_NODE {
288 WS_XML_NODE_TYPE nodeType;
289 } WS_XML_NODE;
291 typedef enum {
292 WS_XML_TEXT_TYPE_UTF8 = 1,
293 WS_XML_TEXT_TYPE_UTF16 = 2,
294 WS_XML_TEXT_TYPE_BASE64 = 3,
295 WS_XML_TEXT_TYPE_BOOL = 4,
296 WS_XML_TEXT_TYPE_INT32 = 5,
297 WS_XML_TEXT_TYPE_INT64 = 6,
298 WS_XML_TEXT_TYPE_UINT64 = 7,
299 WS_XML_TEXT_TYPE_FLOAT = 8,
300 WS_XML_TEXT_TYPE_DOUBLE = 9,
301 WS_XML_TEXT_TYPE_DECIMAL = 10,
302 WS_XML_TEXT_TYPE_GUID = 11,
303 WS_XML_TEXT_TYPE_UNIQUE_ID = 12,
304 WS_XML_TEXT_TYPE_DATETIME = 13,
305 WS_XML_TEXT_TYPE_TIMESPAN = 14,
306 WS_XML_TEXT_TYPE_QNAME = 15,
307 WS_XML_TEXT_TYPE_LIST = 16
308 } WS_XML_TEXT_TYPE;
310 typedef struct _WS_XML_TEXT {
311 WS_XML_TEXT_TYPE textType;
312 } WS_XML_TEXT;
314 typedef struct _WS_XML_UTF8_TEXT {
315 WS_XML_TEXT text;
316 WS_XML_STRING value;
317 } WS_XML_UTF8_TEXT;
319 typedef struct _WS_XML_ATTRIBUTE {
320 BYTE singleQuote;
321 BYTE isXmlNs;
322 WS_XML_STRING *prefix;
323 WS_XML_STRING *localName;
324 WS_XML_STRING *ns;
325 WS_XML_TEXT *value;
326 } WS_XML_ATTRIBUTE;
328 typedef struct _WS_XML_ELEMENT_NODE {
329 WS_XML_NODE node;
330 WS_XML_STRING *prefix;
331 WS_XML_STRING *localName;
332 WS_XML_STRING *ns;
333 ULONG attributeCount;
334 WS_XML_ATTRIBUTE **attributes;
335 BOOL isEmpty;
336 } WS_XML_ELEMENT_NODE;
338 typedef struct _WS_XML_TEXT_NODE {
339 WS_XML_NODE node;
340 WS_XML_TEXT *text;
341 } WS_XML_TEXT_NODE;
343 typedef struct _WS_XML_COMMENT_NODE {
344 WS_XML_NODE node;
345 WS_XML_STRING value;
346 } WS_XML_COMMENT_NODE;
348 typedef struct _WS_XML_NODE_POSITION {
349 WS_XML_BUFFER *buffer;
350 void *node;
351 } WS_XML_NODE_POSITION;
353 HRESULT WINAPI WsCreateError(const WS_ERROR_PROPERTY*, ULONG, WS_ERROR**);
354 HRESULT WINAPI WsCreateHeap(SIZE_T, SIZE_T, const WS_HEAP_PROPERTY*, ULONG, WS_HEAP**, WS_ERROR*);
355 HRESULT WINAPI WsCreateReader(const WS_XML_READER_PROPERTY*, ULONG, WS_XML_READER**, WS_ERROR*);
356 HRESULT WINAPI WsFillReader(WS_XML_READER*, ULONG, const WS_ASYNC_CONTEXT*, WS_ERROR*);
357 HRESULT WINAPI WsFindAttribute(WS_XML_READER*, const WS_XML_STRING*, const WS_XML_STRING*, BOOL,
358 ULONG*, WS_ERROR*);
359 void WINAPI WsFreeError(WS_ERROR*);
360 void WINAPI WsFreeHeap(WS_HEAP*);
361 void WINAPI WsFreeReader(WS_XML_READER*);
362 HRESULT WINAPI WsGetErrorProperty(WS_ERROR*, WS_ERROR_PROPERTY_ID, void*, ULONG);
363 HRESULT WINAPI WsGetErrorString(WS_ERROR*, ULONG, WS_STRING**);
364 HRESULT WINAPI WsGetHeapProperty(WS_HEAP*, WS_HEAP_PROPERTY_ID, void*, ULONG, WS_ERROR*);
365 HRESULT WINAPI WsGetReaderNode(WS_XML_READER*, const WS_XML_NODE**, WS_ERROR*);
366 HRESULT WINAPI WsGetReaderPosition(WS_XML_READER*, WS_XML_NODE_POSITION*, WS_ERROR*);
367 HRESULT WINAPI WsGetReaderProperty(WS_XML_READER*, WS_XML_READER_PROPERTY_ID, void*, ULONG, WS_ERROR*);
368 HRESULT WINAPI WsGetXmlAttribute(WS_XML_READER*, const WS_XML_STRING*, WS_HEAP*, WCHAR**,
369 ULONG*, WS_ERROR*);
370 HRESULT WINAPI WsReadAttribute(WS_XML_READER*, const WS_ATTRIBUTE_DESCRIPTION*, WS_READ_OPTION,
371 WS_HEAP*, void*, ULONG, WS_ERROR*);
372 HRESULT WINAPI WsReadEndElement(WS_XML_READER*, WS_ERROR*);
373 HRESULT WINAPI WsReadNode(WS_XML_READER*, WS_ERROR*);
374 HRESULT WINAPI WsReadStartAttribute(WS_XML_READER*, ULONG, WS_ERROR*);
375 HRESULT WINAPI WsReadStartElement(WS_XML_READER*, WS_ERROR*);
376 HRESULT WINAPI WsReadToStartElement(WS_XML_READER*, const WS_XML_STRING*, const WS_XML_STRING*,
377 BOOL*, WS_ERROR*);
378 HRESULT WINAPI WsReadType(WS_XML_READER*, WS_TYPE_MAPPING, WS_TYPE, const void*, WS_READ_OPTION,
379 WS_HEAP*, void*, ULONG, WS_ERROR*);
380 HRESULT WINAPI WsSetErrorProperty(WS_ERROR*, WS_ERROR_PROPERTY_ID, const void*, ULONG);
381 HRESULT WINAPI WsSetInput(WS_XML_READER*, const WS_XML_READER_ENCODING*, const WS_XML_READER_INPUT*,
382 const WS_XML_READER_PROPERTY*, ULONG, WS_ERROR*);
385 #define WS_S_ASYNC 0x003d0000
386 #define WS_S_END 0x003d0001
387 #define WS_E_INVALID_FORMAT 0x803d0000
388 #define WS_E_OBJECT_FAULTED 0x803d0001
389 #define WS_E_NUMERIC_OVERFLOW 0x803d0002
390 #define WS_E_INVALID_OPERATION 0x803d0003
391 #define WS_E_OPERATION_ABORTED 0x803d0004
392 #define WS_E_ENDPOINT_ACCESS_DENIED 0x803d0005
393 #define WS_E_OPERATION_TIMED_OUT 0x803d0006
394 #define WS_E_OPERATION_ABANDONED 0x803d0007
395 #define WS_E_QUOTA_EXCEEDED 0x803d0008
396 #define WS_E_NO_TRANSLATION_AVAILABLE 0x803d0009
397 #define WS_E_SECURITY_VERIFICATION_FAILURE 0x803d000a
398 #define WS_E_ADDRESS_IN_USE 0x803d000b
399 #define WS_E_ADDRESS_NOT_AVAILABLE 0x803d000c
400 #define WS_E_ENDPOINT_NOT_FOUND 0x803d000d
401 #define WS_E_ENDPOINT_NOT_AVAILABLE 0x803d000e
402 #define WS_E_ENDPOINT_FAILURE 0x803d000f
403 #define WS_E_ENDPOINT_UNREACHABLE 0x803d0010
404 #define WS_E_ENDPOINT_ACTION_NOT_SUPPORTED 0x803d0011
405 #define WS_E_ENDPOINT_TOO_BUSY 0x803d0012
406 #define WS_E_ENDPOINT_FAULT_RECEIVED 0x803d0013
407 #define WS_E_ENDPOINT_DISCONNECTED 0x803d0014
408 #define WS_E_PROXY_FAILURE 0x803d0015
409 #define WS_E_PROXY_ACCESS_DENIED 0x803d0016
410 #define WS_E_NOT_SUPPORTED 0x803d0017
411 #define WS_E_PROXY_REQUIRES_BASIC_AUTH 0x803d0018
412 #define WS_E_PROXY_REQUIRES_DIGEST_AUTH 0x803d0019
413 #define WS_E_PROXY_REQUIRES_NTLM_AUTH 0x803d001a
414 #define WS_E_PROXY_REQUIRES_NEGOTIATE_AUTH 0x803d001b
415 #define WS_E_SERVER_REQUIRES_BASIC_AUTH 0x803d001c
416 #define WS_E_SERVER_REQUIRES_DIGEST_AUTH 0x803d001d
417 #define WS_E_SERVER_REQUIRES_NTLM_AUTH 0x803d001e
418 #define WS_E_SERVER_REQUIRES_NEGOTIATE_AUTH 0x803d001f
419 #define WS_E_INVALID_ENDPOINT_URL 0x803d0020
420 #define WS_E_OTHER 0x803d0021
421 #define WS_E_SECURITY_TOKEN_EXPIRED 0x803d0022
422 #define WS_E_SECURITY_SYSTEM_FAILURE 0x803d0023
424 #ifdef __cplusplus
426 #endif /* __cplusplus */
428 #endif /* __WINE_WEBSERVICES_H */