2 * Copyright 2015 Hans Leidekker 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
21 extern _locale_t c_locale
;
23 #define STREAM_BUFSIZE 4096
30 unsigned int encoding
;
32 const WS_XML_DICTIONARY
*dict_static
;
33 WS_XML_DICTIONARY
*dict
;
36 void *ws_alloc( WS_HEAP
*, SIZE_T
);
37 void *ws_alloc_zero( WS_HEAP
*, SIZE_T
);
38 void *ws_realloc( WS_HEAP
*, void *, SIZE_T
, SIZE_T
);
39 void *ws_realloc_zero( WS_HEAP
*, void *, SIZE_T
, SIZE_T
);
40 void ws_free( WS_HEAP
*, void *, SIZE_T
);
41 struct xmlbuf
*alloc_xmlbuf( WS_HEAP
*, SIZE_T
, unsigned int, WS_CHARSET
,
42 const WS_XML_DICTIONARY
*, WS_XML_DICTIONARY
* );
43 void free_xmlbuf( struct xmlbuf
* );
47 WS_XML_DICTIONARY dict
;
50 ULONG current_sequence
;
55 extern struct dictionary dict_builtin
;
56 extern const struct dictionary dict_builtin_static
;
58 int find_string( const struct dictionary
*, const unsigned char *, ULONG
, ULONG
* );
59 HRESULT
insert_string( struct dictionary
*, unsigned char *, ULONG
, int, ULONG
* );
60 void init_dict( struct dictionary
*, ULONG
);
61 HRESULT
writer_set_lookup( WS_XML_WRITER
*, BOOL
);
62 HRESULT
writer_set_dict_callback( WS_XML_WRITER
*, WS_DYNAMIC_STRING_CALLBACK
, void * );
64 const char *debugstr_xmlstr( const WS_XML_STRING
* );
65 WS_XML_STRING
*alloc_xml_string( const unsigned char *, ULONG
);
66 WS_XML_STRING
*dup_xml_string( const WS_XML_STRING
*, BOOL
);
67 HRESULT
add_xml_string( WS_XML_STRING
* );
68 void free_xml_string( WS_XML_STRING
* );
69 HRESULT
append_attribute( WS_XML_ELEMENT_NODE
*, WS_XML_ATTRIBUTE
* );
70 void free_attribute( WS_XML_ATTRIBUTE
* );
71 WS_TYPE
map_value_type( WS_VALUE_TYPE
);
72 ULONG
get_type_size( WS_TYPE
, const void * );
73 HRESULT
read_header( WS_XML_READER
*, const WS_XML_STRING
*, const WS_XML_STRING
*, WS_TYPE
,
74 const void *, WS_READ_OPTION
, WS_HEAP
*, void *, ULONG
);
75 HRESULT
create_header_buffer( WS_XML_READER
*, WS_HEAP
*, WS_XML_BUFFER
** );
76 HRESULT
text_to_text( const WS_XML_TEXT
*, const WS_XML_TEXT
*, ULONG
*, WS_XML_TEXT
** );
77 HRESULT
text_to_utf8text( const WS_XML_TEXT
*, const WS_XML_UTF8_TEXT
*, ULONG
*, WS_XML_UTF8_TEXT
** );
78 HRESULT
str_to_guid( const unsigned char *, ULONG
, GUID
* );
79 WS_XML_UTF8_TEXT
*alloc_utf8_text( const BYTE
*, ULONG
);
80 WS_XML_UTF16_TEXT
*alloc_utf16_text( const BYTE
*, ULONG
);
81 WS_XML_BASE64_TEXT
*alloc_base64_text( const BYTE
*, ULONG
);
82 WS_XML_BOOL_TEXT
*alloc_bool_text( BOOL
);
83 WS_XML_INT32_TEXT
*alloc_int32_text( INT32
);
84 WS_XML_INT64_TEXT
*alloc_int64_text( INT64
);
85 WS_XML_UINT64_TEXT
*alloc_uint64_text( UINT64
);
86 WS_XML_DOUBLE_TEXT
*alloc_double_text( double );
87 WS_XML_GUID_TEXT
*alloc_guid_text( const GUID
* );
88 WS_XML_UNIQUE_ID_TEXT
*alloc_unique_id_text( const GUID
* );
89 WS_XML_DATETIME_TEXT
*alloc_datetime_text( const WS_DATETIME
* );
91 #define INVALID_PARAMETER_INDEX 0xffff
92 HRESULT
get_param_desc( const WS_STRUCT_DESCRIPTION
*, USHORT
, const WS_FIELD_DESCRIPTION
** );
93 HRESULT
write_input_params( WS_XML_WRITER
*, const WS_ELEMENT_DESCRIPTION
*,
94 const WS_PARAMETER_DESCRIPTION
*, ULONG
, const void ** );
95 HRESULT
read_output_params( WS_XML_READER
*, WS_HEAP
*, const WS_ELEMENT_DESCRIPTION
*,
96 const WS_PARAMETER_DESCRIPTION
*, ULONG
, const void ** );
100 NODE_FLAG_IGNORE_TRAILING_ELEMENT_CONTENT
= 0x1,
101 NODE_FLAG_TEXT_WITH_IMPLICIT_END_ELEMENT
= 0x2,
106 WS_XML_ELEMENT_NODE hdr
;
109 struct list children
;
113 struct node
*alloc_node( WS_XML_NODE_TYPE
);
114 void free_node( struct node
* );
115 void destroy_nodes( struct node
* );
116 HRESULT
copy_node( WS_XML_READER
*, WS_XML_WRITER_ENCODING_TYPE
, struct node
** );
118 static inline WS_XML_NODE_TYPE
node_type( const struct node
*node
)
120 return node
->hdr
.node
.nodeType
;
123 BOOL
move_to_root_element( struct node
*, struct node
** );
124 BOOL
move_to_next_element( struct node
** );
125 BOOL
move_to_prev_element( struct node
** );
126 BOOL
move_to_child_element( struct node
** );
127 BOOL
move_to_end_element( struct node
** );
128 BOOL
move_to_parent_element( struct node
** );
129 BOOL
move_to_first_node( struct node
** );
130 BOOL
move_to_next_node( struct node
** );
131 BOOL
move_to_prev_node( struct node
** );
132 BOOL
move_to_bof( struct node
*, struct node
** );
133 BOOL
move_to_eof( struct node
*, struct node
** );
134 BOOL
move_to_child_node( struct node
** );
135 BOOL
move_to_parent_node( struct node
** );
152 ULONG
prop_size( const struct prop_desc
*, ULONG
);
153 void prop_init( const struct prop_desc
*, ULONG
, struct prop
*, void * );
154 HRESULT
prop_set( const struct prop
*, ULONG
, ULONG
, const void *, ULONG
);
155 HRESULT
prop_get( const struct prop
*, ULONG
, ULONG
, void *, ULONG
);
157 HRESULT
message_set_action( WS_MESSAGE
*, const WS_XML_STRING
* );
158 HRESULT
message_get_id( WS_MESSAGE
*, GUID
* );
159 HRESULT
message_set_request_id( WS_MESSAGE
*, const GUID
* );
160 void message_set_send_context( WS_MESSAGE
*, const WS_PROXY_MESSAGE_CALLBACK_CONTEXT
* );
161 void message_set_receive_context( WS_MESSAGE
*, const WS_PROXY_MESSAGE_CALLBACK_CONTEXT
* );
162 void message_do_send_callback( WS_MESSAGE
* );
163 void message_do_receive_callback( WS_MESSAGE
* );
164 HRESULT
message_insert_http_headers( WS_MESSAGE
*, HINTERNET
);
165 HRESULT
message_map_http_response_headers( WS_MESSAGE
*, HINTERNET
, const WS_HTTP_MESSAGE_MAPPING
* );
166 HRESULT
message_read_fault( WS_MESSAGE
*, WS_HEAP
*, WS_ERROR
* );
168 HRESULT
channel_send_message( WS_CHANNEL
*, WS_MESSAGE
* );
169 HRESULT
channel_receive_message( WS_CHANNEL
*, WS_MESSAGE
* );
170 HRESULT
channel_get_reader( WS_CHANNEL
*, WS_XML_READER
** );
171 HRESULT
channel_address_message( WS_CHANNEL
*, WS_MESSAGE
* );
173 HRESULT
parse_url( const WS_STRING
*, WS_URL_SCHEME_TYPE
*, WCHAR
**, USHORT
* );
175 void free_fault_fields( WS_HEAP
*, WS_FAULT
* );
180 RECORD_ENDELEMENT
= 0x01,
181 RECORD_COMMENT
= 0x02,
183 RECORD_SHORT_ATTRIBUTE
= 0x04,
184 RECORD_ATTRIBUTE
= 0x05,
185 RECORD_SHORT_DICTIONARY_ATTRIBUTE
= 0x06,
186 RECORD_DICTIONARY_ATTRIBUTE
= 0x07,
187 RECORD_SHORT_XMLNS_ATTRIBUTE
= 0x08,
188 RECORD_XMLNS_ATTRIBUTE
= 0x09,
189 RECORD_SHORT_DICTIONARY_XMLNS_ATTRIBUTE
= 0x0a,
190 RECORD_DICTIONARY_XMLNS_ATTRIBUTE
= 0x0b,
191 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_A
= 0x0c,
192 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_B
= 0x0d,
193 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_C
= 0x0e,
194 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_D
= 0x0f,
195 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_E
= 0x10,
196 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_F
= 0x11,
197 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_G
= 0x12,
198 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_H
= 0x13,
199 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_I
= 0x14,
200 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_J
= 0x15,
201 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_K
= 0x16,
202 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_L
= 0x17,
203 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_M
= 0x18,
204 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_N
= 0x19,
205 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_O
= 0x1a,
206 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_P
= 0x1b,
207 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_Q
= 0x1c,
208 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_R
= 0x1d,
209 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_S
= 0x1e,
210 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_T
= 0x1f,
211 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_U
= 0x20,
212 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_V
= 0x21,
213 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_W
= 0x22,
214 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_X
= 0x23,
215 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_Y
= 0x24,
216 RECORD_PREFIX_DICTIONARY_ATTRIBUTE_Z
= 0x25,
217 RECORD_PREFIX_ATTRIBUTE_A
= 0x26,
218 RECORD_PREFIX_ATTRIBUTE_B
= 0x27,
219 RECORD_PREFIX_ATTRIBUTE_C
= 0x28,
220 RECORD_PREFIX_ATTRIBUTE_D
= 0x29,
221 RECORD_PREFIX_ATTRIBUTE_E
= 0x2a,
222 RECORD_PREFIX_ATTRIBUTE_F
= 0x2b,
223 RECORD_PREFIX_ATTRIBUTE_G
= 0x2c,
224 RECORD_PREFIX_ATTRIBUTE_H
= 0x2d,
225 RECORD_PREFIX_ATTRIBUTE_I
= 0x2e,
226 RECORD_PREFIX_ATTRIBUTE_J
= 0x2f,
227 RECORD_PREFIX_ATTRIBUTE_K
= 0x30,
228 RECORD_PREFIX_ATTRIBUTE_L
= 0x31,
229 RECORD_PREFIX_ATTRIBUTE_M
= 0x32,
230 RECORD_PREFIX_ATTRIBUTE_N
= 0x33,
231 RECORD_PREFIX_ATTRIBUTE_O
= 0x34,
232 RECORD_PREFIX_ATTRIBUTE_P
= 0x35,
233 RECORD_PREFIX_ATTRIBUTE_Q
= 0x36,
234 RECORD_PREFIX_ATTRIBUTE_R
= 0x37,
235 RECORD_PREFIX_ATTRIBUTE_S
= 0x38,
236 RECORD_PREFIX_ATTRIBUTE_T
= 0x39,
237 RECORD_PREFIX_ATTRIBUTE_U
= 0x3a,
238 RECORD_PREFIX_ATTRIBUTE_V
= 0x3b,
239 RECORD_PREFIX_ATTRIBUTE_W
= 0x3c,
240 RECORD_PREFIX_ATTRIBUTE_X
= 0x3d,
241 RECORD_PREFIX_ATTRIBUTE_Y
= 0x3e,
242 RECORD_PREFIX_ATTRIBUTE_Z
= 0x3f,
243 RECORD_SHORT_ELEMENT
= 0x40,
244 RECORD_ELEMENT
= 0x41,
245 RECORD_SHORT_DICTIONARY_ELEMENT
= 0x42,
246 RECORD_DICTIONARY_ELEMENT
= 0x43,
247 RECORD_PREFIX_DICTIONARY_ELEMENT_A
= 0x44,
248 RECORD_PREFIX_DICTIONARY_ELEMENT_B
= 0x45,
249 RECORD_PREFIX_DICTIONARY_ELEMENT_C
= 0x46,
250 RECORD_PREFIX_DICTIONARY_ELEMENT_D
= 0x47,
251 RECORD_PREFIX_DICTIONARY_ELEMENT_E
= 0x48,
252 RECORD_PREFIX_DICTIONARY_ELEMENT_F
= 0x49,
253 RECORD_PREFIX_DICTIONARY_ELEMENT_G
= 0x4a,
254 RECORD_PREFIX_DICTIONARY_ELEMENT_H
= 0x4b,
255 RECORD_PREFIX_DICTIONARY_ELEMENT_I
= 0x4c,
256 RECORD_PREFIX_DICTIONARY_ELEMENT_J
= 0x4d,
257 RECORD_PREFIX_DICTIONARY_ELEMENT_K
= 0x4e,
258 RECORD_PREFIX_DICTIONARY_ELEMENT_L
= 0x4f,
259 RECORD_PREFIX_DICTIONARY_ELEMENT_M
= 0x50,
260 RECORD_PREFIX_DICTIONARY_ELEMENT_N
= 0x51,
261 RECORD_PREFIX_DICTIONARY_ELEMENT_O
= 0x52,
262 RECORD_PREFIX_DICTIONARY_ELEMENT_P
= 0x53,
263 RECORD_PREFIX_DICTIONARY_ELEMENT_Q
= 0x54,
264 RECORD_PREFIX_DICTIONARY_ELEMENT_R
= 0x55,
265 RECORD_PREFIX_DICTIONARY_ELEMENT_S
= 0x56,
266 RECORD_PREFIX_DICTIONARY_ELEMENT_T
= 0x57,
267 RECORD_PREFIX_DICTIONARY_ELEMENT_U
= 0x58,
268 RECORD_PREFIX_DICTIONARY_ELEMENT_V
= 0x59,
269 RECORD_PREFIX_DICTIONARY_ELEMENT_W
= 0x5a,
270 RECORD_PREFIX_DICTIONARY_ELEMENT_X
= 0x5b,
271 RECORD_PREFIX_DICTIONARY_ELEMENT_Y
= 0x5c,
272 RECORD_PREFIX_DICTIONARY_ELEMENT_Z
= 0x5d,
273 RECORD_PREFIX_ELEMENT_A
= 0x5e,
274 RECORD_PREFIX_ELEMENT_B
= 0x5f,
275 RECORD_PREFIX_ELEMENT_C
= 0x60,
276 RECORD_PREFIX_ELEMENT_D
= 0x61,
277 RECORD_PREFIX_ELEMENT_E
= 0x62,
278 RECORD_PREFIX_ELEMENT_F
= 0x63,
279 RECORD_PREFIX_ELEMENT_G
= 0x64,
280 RECORD_PREFIX_ELEMENT_H
= 0x65,
281 RECORD_PREFIX_ELEMENT_I
= 0x66,
282 RECORD_PREFIX_ELEMENT_J
= 0x67,
283 RECORD_PREFIX_ELEMENT_K
= 0x68,
284 RECORD_PREFIX_ELEMENT_L
= 0x69,
285 RECORD_PREFIX_ELEMENT_M
= 0x6a,
286 RECORD_PREFIX_ELEMENT_N
= 0x6b,
287 RECORD_PREFIX_ELEMENT_O
= 0x6c,
288 RECORD_PREFIX_ELEMENT_P
= 0x6d,
289 RECORD_PREFIX_ELEMENT_Q
= 0x6e,
290 RECORD_PREFIX_ELEMENT_R
= 0x6f,
291 RECORD_PREFIX_ELEMENT_S
= 0x70,
292 RECORD_PREFIX_ELEMENT_T
= 0x71,
293 RECORD_PREFIX_ELEMENT_U
= 0x72,
294 RECORD_PREFIX_ELEMENT_V
= 0x73,
295 RECORD_PREFIX_ELEMENT_W
= 0x74,
296 RECORD_PREFIX_ELEMENT_X
= 0x75,
297 RECORD_PREFIX_ELEMENT_Y
= 0x76,
298 RECORD_PREFIX_ELEMENT_Z
= 0x77,
299 /* 0x78 ... 0x7f reserved */
300 RECORD_ZERO_TEXT
= 0x80,
301 RECORD_ZERO_TEXT_WITH_ENDELEMENT
= 0x81,
302 RECORD_ONE_TEXT
= 0x82,
303 RECORD_ONE_TEXT_WITH_ENDELEMENT
= 0x83,
304 RECORD_FALSE_TEXT
= 0x84,
305 RECORD_FALSE_TEXT_WITH_ENDELEMENT
= 0x85,
306 RECORD_TRUE_TEXT
= 0x86,
307 RECORD_TRUE_TEXT_WITH_ENDELEMENT
= 0x87,
308 RECORD_INT8_TEXT
= 0x88,
309 RECORD_INT8_TEXT_WITH_ENDELEMENT
= 0x89,
310 RECORD_INT16_TEXT
= 0x8a,
311 RECORD_INT16_TEXT_WITH_ENDELEMENT
= 0x8b,
312 RECORD_INT32_TEXT
= 0x8c,
313 RECORD_INT32_TEXT_WITH_ENDELEMENT
= 0x8d,
314 RECORD_INT64_TEXT
= 0x8e,
315 RECORD_INT64_TEXT_WITH_ENDELEMENT
= 0x8f,
316 RECORD_FLOAT_TEXT
= 0x90,
317 RECORD_FLOAT_TEXT_WITH_ENDELEMENT
= 0x91,
318 RECORD_DOUBLE_TEXT
= 0x92,
319 RECORD_DOUBLE_TEXT_WITH_ENDELEMENT
= 0x93,
320 RECORD_DECIMAL_TEXT
= 0x94,
321 RECORD_DECIMAL_TEXT_WITH_ENDELEMENT
= 0x95,
322 RECORD_DATETIME_TEXT
= 0x96,
323 RECORD_DATETIME_TEXT_WITH_ENDELEMENT
= 0x97,
324 RECORD_CHARS8_TEXT
= 0x98,
325 RECORD_CHARS8_TEXT_WITH_ENDELEMENT
= 0x99,
326 RECORD_CHARS16_TEXT
= 0x9a,
327 RECORD_CHARS16_TEXT_WITH_ENDELEMENT
= 0x9b,
328 RECORD_CHARS32_TEXT
= 0x9c,
329 RECORD_CHARS32_TEXT_WITH_ENDELEMENT
= 0x9d,
330 RECORD_BYTES8_TEXT
= 0x9e,
331 RECORD_BYTES8_TEXT_WITH_ENDELEMENT
= 0x9f,
332 RECORD_BYTES16_TEXT
= 0xa0,
333 RECORD_BYTES16_TEXT_WITH_ENDELEMENT
= 0xa1,
334 RECORD_BYTES32_TEXT
= 0xa2,
335 RECORD_BYTES32_TEXT_WITH_ENDELEMENT
= 0xa3,
336 RECORD_STARTLIST_TEXT
= 0xa4,
338 RECORD_ENDLIST_TEXT
= 0xa6,
340 RECORD_EMPTY_TEXT
= 0xa8,
341 RECORD_EMPTY_TEXT_WITH_ENDELEMENT
= 0xa9,
342 RECORD_DICTIONARY_TEXT
= 0xaa,
343 RECORD_DICTIONARY_TEXT_WITH_ENDELEMENT
= 0xab,
344 RECORD_UNIQUE_ID_TEXT
= 0xac,
345 RECORD_UNIQUE_ID_TEXT_WITH_ENDELEMENT
= 0xad,
346 RECORD_TIMESPAN_TEXT
= 0xae,
347 RECORD_TIMESPAN_TEXT_WITH_ENDELEMENT
= 0xaf,
348 RECORD_GUID_TEXT
= 0xb0,
349 RECORD_GUID_TEXT_WITH_ENDELEMENT
= 0xb1,
350 RECORD_UINT64_TEXT
= 0xb2,
351 RECORD_UINT64_TEXT_WITH_ENDELEMENT
= 0xb3,
352 RECORD_BOOL_TEXT
= 0xb4,
353 RECORD_BOOL_TEXT_WITH_ENDELEMENT
= 0xb5,
354 RECORD_UNICODE_CHARS8_TEXT
= 0xb6,
355 RECORD_UNICODE_CHARS8_TEXT_WITH_ENDELEMENT
= 0xb7,
356 RECORD_UNICODE_CHARS16_TEXT
= 0xb8,
357 RECORD_UNICODE_CHARS16_TEXT_WITH_ENDELEMENT
= 0xb9,
358 RECORD_UNICODE_CHARS32_TEXT
= 0xba,
359 RECORD_UNICODE_CHARS32_TEXT_WITH_ENDELEMENT
= 0xbb,
360 RECORD_QNAME_DICTIONARY_TEXT
= 0xbc,
361 RECORD_QNAME_DICTIONARY_TEXT_WITH_ENDELEMENT
= 0xbd,
362 /* 0xbe ... 0xff reserved */
365 #define MAX_INT8 0x7f
366 #define MIN_INT8 (-MAX_INT8 - 1)
367 #define MAX_INT16 0x7fff
368 #define MIN_INT16 (-MAX_INT16 - 1)
369 #define MAX_INT32 0x7fffffff
370 #define MIN_INT32 (-MAX_INT32 - 1)
371 #define MAX_INT64 (((INT64)0x7fffffff << 32) | 0xffffffff)
372 #define MIN_INT64 (-MAX_INT64 - 1)
373 #define MAX_UINT8 0xff
374 #define MAX_UINT16 0xffff
375 #define MAX_UINT32 0xffffffff
376 #define MAX_UINT64 (((UINT64)0xffffffff << 32) | 0xffffffff)
378 #define TICKS_PER_SEC 10000000
379 #define TICKS_PER_MIN (60 * (ULONGLONG)TICKS_PER_SEC)
380 #define TICKS_PER_HOUR (3600 * (ULONGLONG)TICKS_PER_SEC)
381 #define TICKS_PER_DAY (86400 * (ULONGLONG)TICKS_PER_SEC)
382 #define TICKS_MAX 3155378975999999999
383 #define TICKS_1601_01_01 504911232000000000
385 static const int month_days
[2][12] =
387 {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
388 {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
391 static inline int leap_year( int year
)
393 return !(year
% 4) && (year
% 100 || !(year
% 400));
396 static inline BOOL
is_nil_value( const char *value
, ULONG size
)
399 for (i
= 0; i
< size
; i
++) if (value
[i
]) return FALSE
;
403 static inline BOOL
is_valid_parent( const struct node
*node
)
405 if (!node
) return FALSE
;
406 return (node_type( node
) == WS_XML_NODE_TYPE_ELEMENT
|| node_type( node
) == WS_XML_NODE_TYPE_BOF
);