Skip to main content

libxml_rs/abi/
types.rs

1//! C ABI type definitions — matching upstream libxml2/libxslt (§14).
2//!
3//! This module defines all public C-compatible types with exact layout,
4//! size, and alignment matching the upstream headers.
5//!
6//! # Layout verification
7//!
8//! Every struct in this module must be verified against the oracle using
9//! `offsetof` and `sizeof` probes compiled from the upstream headers.
10//! See courts/abi-struct-*.json for verification receipts.
11//!
12//! # Phase 1 status
13//!
14//! All core types are defined. Verification against oracle is pending
15//! Docker oracle build.
16//!
17//! # Source provenance
18//!
19//! All types derived from SRC-LIBXML2-2.15.3-TREE-H and related headers.
20//! See atlas/SOURCES.md and atlas/api/ for the complete declaration inventory.
21
22use std::ffi::CStr;
23use std::os::raw::{c_char, c_int, c_ulong, c_void};
24
25// ── Fundamental libxml2 types ───────────────────────────────────────────
26
27/// Basic type for all xmlChars (UTF-8 encoded bytes).
28pub type xmlChar = u8;
29
30/// Pointer to xmlChar.
31pub type xmlCharPtr = *mut xmlChar;
32
33/// Const pointer to xmlChar.
34pub type xmlConstCharPtr = *const xmlChar;
35
36// ── Character encoding (xmlCharEncoding) ──────────────────────────────
37//
38// Source: encoding.h lines 18-60
39
40/// Character encoding identifiers.
41#[repr(C)]
42#[derive(Debug, Clone, Copy, PartialEq, Eq)]
43pub enum xmlCharEncoding {
44    XML_CHAR_ENCODING_ERROR = -1,
45    XML_CHAR_ENCODING_NONE = 0,
46    XML_CHAR_ENCODING_UTF8 = 1,
47    XML_CHAR_ENCODING_UTF16LE = 2,
48    XML_CHAR_ENCODING_UTF16BE = 3,
49    XML_CHAR_ENCODING_UCS4LE = 4,
50    XML_CHAR_ENCODING_UCS4BE = 5,
51    XML_CHAR_ENCODING_EBCDIC = 6,
52    XML_CHAR_ENCODING_UCS4_2143 = 7,
53    XML_CHAR_ENCODING_UCS4_3412 = 8,
54    XML_CHAR_ENCODING_UCS2 = 9,
55    XML_CHAR_ENCODING_8859_1 = 10,
56    XML_CHAR_ENCODING_8859_2 = 11,
57    XML_CHAR_ENCODING_8859_3 = 12,
58    XML_CHAR_ENCODING_8859_4 = 13,
59    XML_CHAR_ENCODING_8859_5 = 14,
60    XML_CHAR_ENCODING_8859_6 = 15,
61    XML_CHAR_ENCODING_8859_7 = 16,
62    XML_CHAR_ENCODING_8859_8 = 17,
63    XML_CHAR_ENCODING_8859_9 = 18,
64    XML_CHAR_ENCODING_2022_JP = 19,
65    XML_CHAR_ENCODING_SHIFT_JIS = 20,
66    XML_CHAR_ENCODING_EUC_JP = 21,
67    XML_CHAR_ENCODING_ASCII = 22,
68}
69
70// ── Node types (xmlElementType) ─────────────────────────────────────────
71//
72// Source: tree.h lines 162-184
73// Provenance: SRC-LIBXML2-2.15.3-TREE-H
74
75/// Type of an XML element or node.
76///
77/// These values are part of the ABI and MUST NOT be changed.
78#[repr(C)]
79#[derive(Debug, Clone, Copy, PartialEq, Eq)]
80pub enum xmlElementType {
81    XML_ELEMENT_NODE = 1,
82    XML_ATTRIBUTE_NODE = 2,
83    XML_TEXT_NODE = 3,
84    XML_CDATA_SECTION_NODE = 4,
85    XML_ENTITY_REF_NODE = 5,
86    XML_ENTITY_NODE = 6,
87    XML_PI_NODE = 7,
88    XML_COMMENT_NODE = 8,
89    XML_DOCUMENT_NODE = 9,
90    XML_DOCUMENT_TYPE_NODE = 10,
91    XML_DOCUMENT_FRAG_NODE = 11,
92    XML_NOTATION_NODE = 12,
93    XML_HTML_DOCUMENT_NODE = 13,
94    XML_DTD_NODE = 14,
95    XML_ELEMENT_DECL = 15,
96    XML_ATTRIBUTE_DECL = 16,
97    XML_ENTITY_DECL = 17,
98    XML_NAMESPACE_DECL = 18,
99    XML_XINCLUDE_START = 19,
100    XML_XINCLUDE_END = 20,
101}
102
103/// Namespace type is typedef'd to xmlElementType in upstream.
104pub type xmlNsType = xmlElementType;
105
106/// XML_LOCAL_NAMESPACE macro equals XML_NAMESPACE_DECL.
107pub const XML_LOCAL_NAMESPACE: xmlElementType = xmlElementType::XML_NAMESPACE_DECL;
108
109// ── Document properties ─────────────────────────────────────────────────
110//
111// Source: tree.h lines 762-770
112
113/// Document properties flags.
114#[repr(C)]
115#[derive(Debug, Clone, Copy, PartialEq, Eq)]
116pub enum xmlDocProperties {
117    XML_DOC_WELLFORMED = 1 << 0,
118    XML_DOC_NSVALID = 1 << 1,
119    XML_DOC_OLD10 = 1 << 2,
120    XML_DOC_DTDVALID = 1 << 3,
121    XML_DOC_XINCLUDE = 1 << 4,
122    XML_DOC_USERBUILT = 1 << 5,
123    XML_DOC_INTERNAL = 1 << 6,
124    XML_DOC_HTML = 1 << 7,
125}
126
127// ── Buffer allocation scheme ────────────────────────────────────────────
128//
129// Source: tree.h lines 93-100
130
131#[repr(C)]
132#[derive(Debug, Clone, Copy, PartialEq, Eq)]
133pub enum xmlBufferAllocationScheme {
134    XML_BUFFER_ALLOC_DOUBLEIT = 0,
135    XML_BUFFER_ALLOC_EXACT = 1,
136    XML_BUFFER_ALLOC_IMMUTABLE = 2,
137    XML_BUFFER_ALLOC_IO = 3,
138    XML_BUFFER_ALLOC_HYBRID = 4,
139    XML_BUFFER_ALLOC_BOUNDED = 5,
140}
141
142// ── Attribute types ─────────────────────────────────────────────────────
143//
144// Source: tree.h lines 309-319
145
146#[repr(C)]
147#[derive(Debug, Clone, Copy, PartialEq, Eq)]
148pub enum xmlAttributeType {
149    XML_ATTRIBUTE_CDATA = 1,
150    XML_ATTRIBUTE_ID = 2,
151    XML_ATTRIBUTE_IDREF = 3,
152    XML_ATTRIBUTE_IDREFS = 4,
153    XML_ATTRIBUTE_ENTITY = 5,
154    XML_ATTRIBUTE_ENTITIES = 6,
155    XML_ATTRIBUTE_NMTOKEN = 7,
156    XML_ATTRIBUTE_NMTOKENS = 8,
157    XML_ATTRIBUTE_ENUMERATION = 9,
158    XML_ATTRIBUTE_NOTATION = 10,
159}
160
161// ── Attribute default modes ─────────────────────────────────────────────
162//
163// Source: tree.h lines 325-330
164
165#[repr(C)]
166#[derive(Debug, Clone, Copy, PartialEq, Eq)]
167pub enum xmlAttributeDefault {
168    XML_ATTRIBUTE_NONE = 1,
169    XML_ATTRIBUTE_REQUIRED = 2,
170    XML_ATTRIBUTE_IMPLIED = 3,
171    XML_ATTRIBUTE_FIXED = 4,
172}
173
174// ── Entity types ────────────────────────────────────────────────────────
175//
176// Source: entities.h lines 28-35
177
178#[repr(C)]
179#[derive(Debug, Clone, Copy, PartialEq, Eq)]
180pub enum xmlEntityType {
181    XML_INTERNAL_GENERAL_ENTITY = 1,
182    XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
183    XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
184    XML_INTERNAL_PARAMETER_ENTITY = 4,
185    XML_EXTERNAL_PARAMETER_ENTITY = 5,
186    XML_INTERNAL_PREDEFINED_ENTITY = 6,
187}
188
189// ── Element content types ───────────────────────────────────────────────
190//
191// Source: tree.h lines 396-401
192
193#[repr(C)]
194#[derive(Debug, Clone, Copy, PartialEq, Eq)]
195pub enum xmlElementContentType {
196    XML_ELEMENT_CONTENT_PCDATA = 1,
197    XML_ELEMENT_CONTENT_ELEMENT = 2,
198    XML_ELEMENT_CONTENT_SEQ = 3,
199    XML_ELEMENT_CONTENT_OR = 4,
200}
201
202// ── Element content occurrence ──────────────────────────────────────────
203//
204// Source: tree.h lines 406-410
205
206#[repr(C)]
207#[derive(Debug, Clone, Copy, PartialEq, Eq)]
208pub enum xmlElementContentOccur {
209    XML_ELEMENT_CONTENT_ONCE = 1,
210    XML_ELEMENT_CONTENT_OPT = 2,
211    XML_ELEMENT_CONTENT_MULT = 3,
212    XML_ELEMENT_CONTENT_PLUS = 4,
213}
214
215// ── Element type values ─────────────────────────────────────────────────
216//
217// Source: tree.h lines 443-450
218
219#[repr(C)]
220#[derive(Debug, Clone, Copy, PartialEq, Eq)]
221pub enum xmlElementTypeVal {
222    XML_ELEMENT_TYPE_UNDEFINED = 0,
223    XML_ELEMENT_TYPE_EMPTY = 1,
224    XML_ELEMENT_TYPE_ANY = 2,
225    XML_ELEMENT_TYPE_MIXED = 3,
226    XML_ELEMENT_TYPE_ELEMENT = 4,
227}
228
229// ── Error levels ────────────────────────────────────────────────────────
230//
231// Source: xmlerror.h
232
233#[repr(C)]
234#[derive(Debug, Clone, Copy, PartialEq, Eq)]
235pub enum xmlErrorLevel {
236    XML_ERR_NONE = 0,
237    XML_ERR_WARNING = 1,
238    XML_ERR_ERROR = 2,
239    XML_ERR_FATAL = 3,
240}
241
242// ── Parser modes ────────────────────────────────────────────────────────
243
244#[repr(C)]
245#[derive(Debug, Clone, Copy, PartialEq, Eq)]
246pub enum xmlParserMode {
247    XML_PARSE_UNKNOWN = 0,
248    XML_PARSE_DOM = 1,
249    XML_PARSE_SAX = 2,
250    XML_PARSE_PUSH_DOM = 3,
251    XML_PARSE_PUSH_SAX = 4,
252    XML_PARSE_READER = 5,
253}
254
255// ── Parser input state ──────────────────────────────────────────────────
256
257#[repr(C)]
258#[derive(Debug, Clone, Copy, PartialEq, Eq)]
259pub enum xmlParserInputState {
260    XML_PARSER_EOF = -1,
261    XML_PARSER_START = 0,
262    XML_PARSER_MISC = 1,
263    XML_PARSER_DTD = 2,
264    XML_PARSER_PROLOG = 3,
265    XML_PARSER_CONTENT = 4,
266    XML_PARSER_CDATA_SECTION = 5,
267    XML_PARSER_ENTITY_REF = 6,
268    XML_PARSER_ENTITY_VALUE = 7,
269    XML_PARSER_ATTRIBUTE_VALUE = 8,
270    XML_PARSER_SYSTEM_LITERAL = 9,
271    XML_PARSER_EPILOG = 10,
272    XML_PARSER_IGNORE = 11,
273    XML_PARSER_PUBLIC_LITERAL = 12,
274}
275
276// ── XPath object types ──────────────────────────────────────────────────
277
278#[repr(C)]
279#[derive(Debug, Clone, Copy, PartialEq, Eq)]
280pub enum xmlXPathObjectType {
281    XPATH_UNDEFINED = 0,
282    XPATH_NODESET = 1,
283    XPATH_BOOLEAN = 2,
284    XPATH_NUMBER = 3,
285    XPATH_STRING = 4,
286    XPATH_POINT = 5,
287    XPATH_RANGE = 6,
288    XPATH_LOCATIONSET = 7,
289    XPATH_USERS = 8,
290    XPATH_XSLT_TREE = 9,
291}
292
293// ── Parser option flags ─────────────────────────────────────────────────
294//
295// Source: parser.h
296
297pub const XML_PARSE_RECOVER: c_int = 1 << 0;
298pub const XML_PARSE_NOENT: c_int = 1 << 1;
299pub const XML_PARSE_DTDLOAD: c_int = 1 << 2;
300pub const XML_PARSE_DTDATTR: c_int = 1 << 3;
301pub const XML_PARSE_DTDVALID: c_int = 1 << 4;
302pub const XML_PARSE_NOERROR: c_int = 1 << 5;
303pub const XML_PARSE_NOWARNING: c_int = 1 << 6;
304pub const XML_PARSE_PEDANTIC: c_int = 1 << 7;
305pub const XML_PARSE_NOBLANKS: c_int = 1 << 8;
306pub const XML_PARSE_SAX1: c_int = 1 << 9;
307pub const XML_PARSE_XINCLUDE: c_int = 1 << 10;
308pub const XML_PARSE_NONET: c_int = 1 << 11;
309pub const XML_PARSE_NODICT: c_int = 1 << 12;
310pub const XML_PARSE_NSCLEAN: c_int = 1 << 13;
311pub const XML_PARSE_NOCDATA: c_int = 1 << 14;
312pub const XML_PARSE_NOXINCNODE: c_int = 1 << 15;
313pub const XML_PARSE_COMPACT: c_int = 1 << 16;
314pub const XML_PARSE_OLD10: c_int = 1 << 17;
315pub const XML_PARSE_NOBASEFIX: c_int = 1 << 18;
316pub const XML_PARSE_HUGE: c_int = 1 << 19;
317pub const XML_PARSE_OLDSAX: c_int = 1 << 20;
318pub const XML_PARSE_IGNORE_ENC: c_int = 1 << 21;
319pub const XML_PARSE_BIG_LINES: c_int = 1 << 22;
320
321// ── Error domains ───────────────────────────────────────────────────────
322//
323// Source: xmlerror.h
324
325pub const XML_FROM_NONE: c_int = 0;
326pub const XML_FROM_PARSER: c_int = 1;
327pub const XML_FROM_TREE: c_int = 2;
328pub const XML_FROM_NAMESPACE: c_int = 3;
329pub const XML_FROM_DTD: c_int = 4;
330pub const XML_FROM_HTML: c_int = 5;
331pub const XML_FROM_MEMORY: c_int = 6;
332pub const XML_FROM_OUTPUT: c_int = 7;
333pub const XML_FROM_IO: c_int = 8;
334pub const XML_FROM_FTP: c_int = 9;
335pub const XML_FROM_HTTP: c_int = 10;
336pub const XML_FROM_XINCLUDE: c_int = 11;
337pub const XML_FROM_XPATH: c_int = 12;
338pub const XML_FROM_XPOINTER: c_int = 13;
339pub const XML_FROM_REGEXP: c_int = 14;
340pub const XML_FROM_DATATYPE: c_int = 15;
341pub const XML_FROM_SCHEMASP: c_int = 16;
342pub const XML_FROM_SCHEMASV: c_int = 17;
343pub const XML_FROM_RELAXNGP: c_int = 18;
344pub const XML_FROM_RELAXNGV: c_int = 19;
345pub const XML_FROM_CATALOG: c_int = 20;
346pub const XML_FROM_C14N: c_int = 21;
347pub const XML_FROM_XSLT: c_int = 22;
348pub const XML_FROM_VALID: c_int = 23;
349pub const XML_FROM_CHECK: c_int = 24;
350pub const XML_FROM_WRITER: c_int = 25;
351pub const XML_FROM_MODULE: c_int = 26;
352pub const XML_FROM_I18N: c_int = 27;
353pub const XML_FROM_SCHEMATRONV: c_int = 28;
354pub const XML_FROM_BUFFER: c_int = 29;
355pub const XML_FROM_URI: c_int = 30;
356
357// ── Parser error codes ──────────────────────────────────────────────────
358//
359// Source: xmlerror.h (xmlParserErrors enum)
360
361pub const XML_ERR_OK: c_int = 0;
362pub const XML_ERR_INTERNAL_ERROR: c_int = 1;
363pub const XML_ERR_NO_MEMORY: c_int = 2;
364pub const XML_ERR_DOCUMENT_START: c_int = 3;
365pub const XML_ERR_DOCUMENT_EMPTY: c_int = 4;
366pub const XML_ERR_DOCUMENT_END: c_int = 5;
367pub const XML_ERR_INVALID_HEX_CHARREF: c_int = 6;
368pub const XML_ERR_INVALID_DEC_CHARREF: c_int = 7;
369pub const XML_ERR_INVALID_CHARREF: c_int = 8;
370pub const XML_ERR_INVALID_CHAR: c_int = 9;
371pub const XML_ERR_CHARREF_AT_EOF: c_int = 10;
372pub const XML_ERR_CHARREF_IN_PROLOG: c_int = 11;
373pub const XML_ERR_CHARREF_IN_EPILOG: c_int = 12;
374pub const XML_ERR_CHARREF_IN_DTD: c_int = 13;
375pub const XML_ERR_ENTITYREF_AT_EOF: c_int = 14;
376pub const XML_ERR_ENTITYREF_IN_PROLOG: c_int = 15;
377pub const XML_ERR_ENTITYREF_IN_EPILOG: c_int = 16;
378pub const XML_ERR_ENTITYREF_IN_DTD: c_int = 17;
379pub const XML_ERR_PEREF_AT_EOF: c_int = 18;
380pub const XML_ERR_PEREF_IN_PROLOG: c_int = 19;
381pub const XML_ERR_PEREF_IN_EPILOG: c_int = 20;
382pub const XML_ERR_PEREF_IN_INT_SUBSET: c_int = 21;
383pub const XML_ERR_ENTITYREF_NO_NAME: c_int = 22;
384pub const XML_ERR_ENTITYREF_SEMICOL_MISSING: c_int = 23;
385pub const XML_ERR_PEREF_NO_NAME: c_int = 24;
386pub const XML_ERR_PEREF_SEMICOL_MISSING: c_int = 25;
387pub const XML_ERR_UNDECLARED_ENTITY: c_int = 26;
388pub const XML_WAR_UNDECLARED_ENTITY: c_int = 27;
389pub const XML_ERR_UNPARSED_ENTITY: c_int = 28;
390pub const XML_ERR_ENTITY_IS_EXTERNAL: c_int = 29;
391pub const XML_ERR_ENTITY_IS_PARAMETER: c_int = 30;
392pub const XML_ERR_UNKNOWN_ENCODING: c_int = 31;
393pub const XML_ERR_UNSUPPORTED_ENCODING: c_int = 32;
394pub const XML_ERR_STRING_NOT_STARTED: c_int = 33;
395pub const XML_ERR_STRING_NOT_CLOSED: c_int = 34;
396pub const XML_ERR_NS_DECL_ERROR: c_int = 35;
397pub const XML_ERR_ENTITY_NOT_STARTED: c_int = 36;
398pub const XML_ERR_ENTITY_NOT_FINISHED: c_int = 37;
399pub const XML_ERR_LT_IN_ATTRIBUTE: c_int = 38;
400pub const XML_ERR_ATTRIBUTE_NOT_STARTED: c_int = 39;
401pub const XML_ERR_ATTRIBUTE_NOT_FINISHED: c_int = 40;
402pub const XML_ERR_ATTRIBUTE_WITHOUT_VALUE: c_int = 41;
403pub const XML_ERR_ATTRIBUTE_REDEFINED: c_int = 42;
404pub const XML_ERR_LITERAL_NOT_STARTED: c_int = 43;
405pub const XML_ERR_LITERAL_NOT_FINISHED: c_int = 44;
406pub const XML_ERR_COMMENT_NOT_FINISHED: c_int = 45;
407pub const XML_ERR_PI_NOT_STARTED: c_int = 46;
408pub const XML_ERR_PI_NOT_FINISHED: c_int = 47;
409pub const XML_ERR_NOTATION_NOT_STARTED: c_int = 48;
410pub const XML_ERR_NOTATION_NOT_FINISHED: c_int = 49;
411pub const XML_ERR_ATTLIST_NOT_STARTED: c_int = 50;
412pub const XML_ERR_ATTLIST_NOT_FINISHED: c_int = 51;
413pub const XML_ERR_MIXED_NOT_STARTED: c_int = 52;
414pub const XML_ERR_MIXED_NOT_FINISHED: c_int = 53;
415pub const XML_ERR_ELEMCONTENT_NOT_STARTED: c_int = 54;
416pub const XML_ERR_ELEMCONTENT_NOT_FINISHED: c_int = 55;
417pub const XML_ERR_XMLDECL_NOT_STARTED: c_int = 56;
418pub const XML_ERR_XMLDECL_NOT_FINISHED: c_int = 57;
419pub const XML_ERR_CONDSEC_NOT_STARTED: c_int = 58;
420pub const XML_ERR_CONDSEC_NOT_FINISHED: c_int = 59;
421pub const XML_ERR_EXT_SUBSET_NOT_FINISHED: c_int = 60;
422pub const XML_ERR_DOCTYPE_NOT_FINISHED: c_int = 61;
423pub const XML_ERR_MISPLACED_CDATA_END: c_int = 62;
424pub const XML_ERR_CDATA_NOT_FINISHED: c_int = 63;
425pub const XML_ERR_MISPLACED_XML_PI: c_int = 64;
426pub const XML_ERR_XML_DECL_AT_EOF: c_int = 65;
427pub const XML_ERR_XML_DECL_IN_PROLOG: c_int = 66;
428pub const XML_ERR_XML_DECL_IN_EPILOG: c_int = 67;
429pub const XML_ERR_XML_DECL_IN_DTD: c_int = 68;
430pub const XML_ERR_NOT_WELL_BALANCED: c_int = 69;
431pub const XML_ERR_EXTRA_CONTENT: c_int = 70;
432pub const XML_ERR_INVALID_ENCODING: c_int = 71;
433pub const XML_ERR_ENTITY_CHAR_ERROR: c_int = 72;
434pub const XML_ERR_ENTITY_PE_INTERNAL: c_int = 73;
435pub const XML_ERR_ENTITY_LOOP: c_int = 74;
436pub const XML_ERR_ENTITY_BOUNDARY: c_int = 75;
437pub const XML_ERR_INVALID_URI: c_int = 76;
438pub const XML_ERR_URI_FRAGMENT: c_int = 77;
439pub const XML_WAR_CATALOG_PI: c_int = 78;
440pub const XML_ERR_NO_DTD: c_int = 79;
441pub const XML_ERR_CONDSEC_INVALID: c_int = 80;
442pub const XML_ERR_CONDSEC_INVALID_KEYWORD: c_int = 81;
443pub const XML_ERR_INVALID_DECIMAL: c_int = 82;
444pub const XML_ERR_INVALID_HEXIDECIMAL: c_int = 83;
445pub const XML_ERR_INVALID_UNICODE: c_int = 84;
446pub const XML_ERR_INVALID_NMTOKEN: c_int = 85;
447pub const XML_ERR_INVALID_NAME: c_int = 86;
448pub const XML_ERR_NAME_TOO_LONG: c_int = 87;
449pub const XML_ERR_INVALID_ENUM: c_int = 88;
450pub const XML_ERR_SPACE_REQUIRED: c_int = 89;
451pub const XML_ERR_NAME_REQUIRED: c_int = 90;
452pub const XML_ERR_NMTOKEN_REQUIRED: c_int = 91;
453pub const XML_ERR_ATTRIBUTE_NOT_RESOLVED: c_int = 92;
454pub const XML_ERR_LT_REQUIRED: c_int = 93;
455pub const XML_ERR_GT_REQUIRED: c_int = 94;
456pub const XML_ERR_TAG_NAME_MISMATCH: c_int = 95;
457pub const XML_ERR_TAG_NOT_FINISHED: c_int = 96;
458pub const XML_ERR_STANDALONE_VALUE: c_int = 97;
459pub const XML_ERR_VERSION_MISSING: c_int = 98;
460// Removed: duplicate of XML_ERR_NAME_TOO_LONG at line 414
461
462// ── Parser limits ──────────────────────────────────────────────────────
463//
464// Source: parserInternals.h
465
466pub const XML_MAX_TEXT_LENGTH: c_int = 10_000_000;
467pub const XML_MAX_NAME_LENGTH: c_int = 50_000;
468pub const XML_MAX_DICTIONARY_LIMIT: c_int = 1_000_000;
469pub const XML_MAX_LOOKUP_LIMIT: c_int = 1_000_000;
470pub const XML_MAX_HUGE_LENGTH: c_int = 100_000_000;
471pub const XML_MAX_NAMELEN: c_int = 100;
472pub const XML_MAX_ATTRIBUTE_LENGTH: c_int = 500_000;
473
474// ── Version constants ──────────────────────────────────────────────────
475
476pub const LIBXML2_VERSION: &str = "2.15.3";
477pub const LIBXML2_VERSION_MAJOR: c_int = 2;
478pub const LIBXML2_VERSION_MINOR: c_int = 15;
479pub const LIBXML2_VERSION_MICRO: c_int = 3;
480pub const LIBXML2_VERSION_NUMBER: c_int = 21503;
481pub const LIBXML2_VERSION_EXTRA: &str = "";
482
483pub const LIBXSLT_VERSION: &str = "1.1.45";
484pub const LIBXSLT_VERSION_MAJOR: c_int = 1;
485pub const LIBXSLT_VERSION_MINOR: c_int = 1;
486pub const LIBXSLT_VERSION_MICRO: c_int = 45;
487pub const LIBXSLT_VERSION_NUMBER: c_int = 10145;
488pub const LIBXSLT_VERSION_EXTRA: &str = "";
489
490// ── SAX2 magic value ───────────────────────────────────────────────────
491
492pub const XML_SAX2_MAGIC: c_int = 0xDEEDBEAFu32 as i32;