Skip to main content

libxml_rs/abi/
types.rs

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