1use core::ffi::c_void;
22use std::os::raw::{c_char, c_int, c_uint};
23
24use crate::abi::callbacks::{xmlGenericErrorFunc, xmlStructuredErrorFunc};
25use crate::abi::types::xmlChar;
26
27#[no_mangle]
33pub static mut xmlDoValidityCheckingDefaultValue: c_int = 0;
34
35#[no_mangle]
37pub static mut xmlGetWarningsDefaultValue: c_int = 1;
38
39#[no_mangle]
41pub static mut xmlLoadExtDtdDefaultValue: c_int = 0;
42
43#[no_mangle]
45pub static mut xmlPedanticParserDefaultValue: c_int = 0;
46
47#[no_mangle]
50pub static mut xmlLineNumbersDefaultValue: c_int = 1;
51
52#[no_mangle]
54pub static mut xmlKeepBlanksDefaultValue: c_int = 1;
55
56#[no_mangle]
58pub static mut xmlSubstituteEntitiesDefaultValue: c_int = 0;
59
60#[no_mangle]
62pub static mut xmlParserDebugEntities: c_int = 0;
63
64#[no_mangle]
67pub static mut xmlIndentTreeOutput: c_int = 1;
68
69#[no_mangle]
72pub static mut xmlTreeIndentString: *const xmlChar = {
73 static S: [u8; 3] = *b" \0";
74 S.as_ptr()
75};
76
77#[no_mangle]
79pub static mut xmlSaveNoEmptyTags: c_int = 0;
80
81#[no_mangle]
83pub static mut xmlRegisterNodeDefaultValue: Option<
84 unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode),
85> = None;
86
87pub static XML_REGISTER_CALLBACKS: core::sync::atomic::AtomicBool =
90 core::sync::atomic::AtomicBool::new(false);
91
92pub fn register_node_hook(node: *mut crate::abi::structs::_xmlNode) {
99 if !XML_REGISTER_CALLBACKS.load(core::sync::atomic::Ordering::Relaxed) {
100 return;
101 }
102 let hook = unsafe { xmlRegisterNodeDefaultValue };
103 if let Some(h) = hook {
104 if !node.is_null() {
105 unsafe { h(node) };
107 }
108 }
109}
110
111pub fn deregister_node_hook(node: *mut crate::abi::structs::_xmlNode) {
118 if !XML_REGISTER_CALLBACKS.load(core::sync::atomic::Ordering::Relaxed) {
119 return;
120 }
121 let hook = unsafe { xmlDeregisterNodeDefaultValue };
122 if let Some(h) = hook {
123 if !node.is_null() {
124 unsafe { h(node) };
126 }
127 }
128}
129
130#[no_mangle]
132pub static mut xmlDeregisterNodeDefaultValue: Option<
133 unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode),
134> = None;
135
136#[no_mangle]
145pub static mut xmlParserVersion: *const c_char = {
146 static V: [u8; 17] = *b"21503-GITv2.15.3\0";
147 V.as_ptr() as *const c_char
148};
149
150#[no_mangle]
152pub static mut xmlParserMaxDepth: c_int = 256;
153
154#[no_mangle]
160pub static mut xmlDefaultBufferSize: c_int = 4096;
161
162#[no_mangle]
165pub static mut xmlBufferAllocScheme: c_int = 1;
166
167#[cfg(target_arch = "x86_64")]
177#[no_mangle]
178pub static mut xmlGenericError: Option<xmlGenericErrorFunc> = Some(XML_GENERIC_ERROR_DEFAULT);
179
180#[cfg(not(target_arch = "x86_64"))]
181#[no_mangle]
182pub static mut xmlGenericError: Option<xmlGenericErrorFunc> = None;
183
184#[no_mangle]
186pub static mut xmlGenericErrorContext: *mut c_void = core::ptr::null_mut();
187
188#[no_mangle]
190pub static mut xmlStructuredError: Option<xmlStructuredErrorFunc> = None;
191
192#[no_mangle]
194pub static mut xmlStructuredErrorContext: *mut c_void = core::ptr::null_mut();
195
196#[cfg(target_arch = "x86_64")]
213#[repr(C)]
214#[derive(Clone, Copy)]
215struct VaListTag {
216 gp_offset: c_uint,
217 fp_offset: c_uint,
218 overflow_arg_area: *mut c_void,
219 reg_save_area: *mut c_void,
220}
221
222#[cfg(target_arch = "x86_64")]
223unsafe extern "C" {
224 fn vfprintf(stream: *mut c_void, format: *const c_char, ap: *mut VaListTag) -> c_int;
225}
226
227#[cfg(target_arch = "x86_64")]
230unsafe fn stderr_file() -> *mut c_void {
231 static mut STDERR_FILE: *mut c_void = core::ptr::null_mut();
232 unsafe {
233 if STDERR_FILE.is_null() {
234 STDERR_FILE = libc::fdopen(2, b"w\0".as_ptr() as *const c_char) as *mut c_void;
235 }
236 STDERR_FILE
237 }
238}
239
240#[cfg(target_arch = "x86_64")]
243#[no_mangle]
244pub unsafe extern "C" fn xmlGenericErrorDefaultFuncV(
245 _ctx: *mut c_void,
246 msg: *const c_char,
247 ap: *mut VaListTag,
248) -> c_int {
249 unsafe {
250 if crate::abi::data_globals::xmlGenericErrorContext.is_null() {
251 crate::abi::data_globals::xmlGenericErrorContext = stderr_file();
252 }
253 let stream = crate::abi::data_globals::xmlGenericErrorContext;
254 if msg.is_null() || stream.is_null() {
255 return 0;
256 }
257 vfprintf(stream, msg, ap)
258 }
259}
260
261#[cfg(target_arch = "x86_64")]
268pub unsafe extern "C" fn xmlGenericErrorDefaultFunc() -> c_int {
269 unsafe {
270 core::arch::asm!(
271 "sub rsp, 240",
272 "mov [rsp+0], rdi",
273 "mov [rsp+8], rsi",
274 "mov [rsp+16], rdx",
275 "mov [rsp+24], rcx",
276 "mov [rsp+32], r8",
277 "mov [rsp+40], r9",
278 "movaps [rsp+48], xmm0",
279 "movaps [rsp+64], xmm1",
280 "movaps [rsp+80], xmm2",
281 "movaps [rsp+96], xmm3",
282 "movaps [rsp+112], xmm4",
283 "movaps [rsp+128], xmm5",
284 "movaps [rsp+144], xmm6",
285 "movaps [rsp+160], xmm7",
286 "mov dword ptr [rsp+176], 16",
287 "mov dword ptr [rsp+180], 48",
288 "lea rax, [rsp+256]",
289 "mov [rsp+184], rax",
290 "lea rax, [rsp]",
291 "mov [rsp+192], rax",
292 "lea rdx, [rsp+176]",
293 "call xmlGenericErrorDefaultFuncV",
294 "add rsp, 240",
295 "add rsp, 8",
296 "ret",
297 options(noreturn),
298 );
299 }
300}
301
302#[cfg(target_arch = "x86_64")]
304const XML_GENERIC_ERROR_DEFAULT: xmlGenericErrorFunc = unsafe {
305 core::mem::transmute::<
309 unsafe extern "C" fn() -> c_int,
310 unsafe extern "C" fn(*mut c_void, *const c_char),
311 >(xmlGenericErrorDefaultFunc)
312};
313
314#[cfg(target_arch = "x86_64")]
317#[no_mangle]
318pub unsafe extern "C" fn xsltGenericErrorDefaultFuncV(
319 _ctx: *mut c_void,
320 msg: *const c_char,
321 ap: *mut VaListTag,
322) -> c_int {
323 unsafe {
324 if crate::abi::data_globals::xsltGenericErrorContext.is_null() {
325 crate::abi::data_globals::xsltGenericErrorContext = stderr_file();
326 }
327 let stream = crate::abi::data_globals::xsltGenericErrorContext;
328 if msg.is_null() || stream.is_null() {
329 return 0;
330 }
331 vfprintf(stream, msg, ap)
332 }
333}
334
335#[cfg(target_arch = "x86_64")]
338pub unsafe extern "C" fn xsltGenericErrorDefaultFunc() -> c_int {
339 unsafe {
340 core::arch::asm!(
341 "sub rsp, 240",
342 "mov [rsp+0], rdi",
343 "mov [rsp+8], rsi",
344 "mov [rsp+16], rdx",
345 "mov [rsp+24], rcx",
346 "mov [rsp+32], r8",
347 "mov [rsp+40], r9",
348 "movaps [rsp+48], xmm0",
349 "movaps [rsp+64], xmm1",
350 "movaps [rsp+80], xmm2",
351 "movaps [rsp+96], xmm3",
352 "movaps [rsp+112], xmm4",
353 "movaps [rsp+128], xmm5",
354 "movaps [rsp+144], xmm6",
355 "movaps [rsp+160], xmm7",
356 "mov dword ptr [rsp+176], 16",
357 "mov dword ptr [rsp+180], 48",
358 "lea rax, [rsp+256]",
359 "mov [rsp+184], rax",
360 "lea rax, [rsp]",
361 "mov [rsp+192], rax",
362 "lea rdx, [rsp+176]",
363 "call xsltGenericErrorDefaultFuncV",
364 "add rsp, 240",
365 "add rsp, 8",
366 "ret",
367 options(noreturn),
368 );
369 }
370}
371
372#[cfg(target_arch = "x86_64")]
374const XSLT_GENERIC_ERROR_DEFAULT: xmlGenericErrorFunc = unsafe {
375 core::mem::transmute::<
377 unsafe extern "C" fn() -> c_int,
378 unsafe extern "C" fn(*mut c_void, *const c_char),
379 >(xsltGenericErrorDefaultFunc)
380};
381
382pub fn default_generic_error_func() -> Option<xmlGenericErrorFunc> {
387 #[cfg(target_arch = "x86_64")]
388 {
389 Some(XML_GENERIC_ERROR_DEFAULT)
390 }
391 #[cfg(not(target_arch = "x86_64"))]
392 {
393 None
394 }
395}
396
397#[no_mangle]
403pub static xmlStringText: [xmlChar; 5] = [b't', b'e', b'x', b't', 0];
404
405#[no_mangle]
407pub static xmlStringTextNoenc: [xmlChar; 9] =
408 [b't', b'e', b'x', b't', b'n', b'o', b'e', b'n', b'c'];
409
410#[no_mangle]
412pub static xmlStringComment: [xmlChar; 8] = [b'c', b'o', b'm', b'm', b'e', b'n', b't', 0];
413
414#[no_mangle]
420pub static xmlXPathNAN: f64 = f64::NAN;
421
422#[no_mangle]
424pub static xmlXPathPINF: f64 = f64::INFINITY;
425
426#[no_mangle]
428pub static xmlXPathNINF: f64 = f64::NEG_INFINITY;
429
430#[no_mangle]
439pub static xsltLibxmlVersion: c_int = 21503;
440
441#[cfg(target_arch = "x86_64")]
446#[no_mangle]
447pub static mut xsltGenericError: Option<xmlGenericErrorFunc> = Some(XSLT_GENERIC_ERROR_DEFAULT);
448
449#[cfg(not(target_arch = "x86_64"))]
450#[no_mangle]
451pub static mut xsltGenericError: Option<xmlGenericErrorFunc> = None;
452
453#[no_mangle]
455pub static mut xsltGenericErrorContext: *mut c_void = core::ptr::null_mut();
456
457#[no_mangle]
459pub static mut xsltGenericDebugContext: *mut c_void = core::ptr::null_mut();
460
461#[no_mangle]
464pub static xsltExtMarker: [xmlChar; 1] = [0];
465
466#[no_mangle]
471pub static mut xsltDocDefaultLoader: Option<
472 unsafe extern "C" fn(
473 *const xmlChar,
474 *mut c_void,
475 c_int,
476 *mut crate::abi::structs::_xsltStylesheet,
477 *mut crate::abi::structs::_xsltTransformContext,
478 ) -> *mut crate::abi::structs::_xmlDoc,
479> = None;
480
481#[no_mangle]
487pub static mut xmlParserInputBufferCreateFilenameValue: Option<
488 unsafe extern "C" fn(*const c_char, c_int) -> *mut crate::abi::structs::_xmlParserInputBuffer,
489> = None;
490
491#[no_mangle]
493pub static mut xmlOutputBufferCreateFilenameValue: Option<
494 unsafe extern "C" fn(
495 *const c_char,
496 crate::abi::structs::xmlCharEncodingHandlerPtr,
497 c_int,
498 ) -> *mut crate::abi::structs::_xmlOutputBuffer,
499> = None;
500
501#[no_mangle]
513pub static xmlDefaultSAXHandler: crate::abi::structs::_xmlSAXHandlerV1 =
514 crate::abi::structs::_xmlSAXHandlerV1 {
515 internalSubset: Some(crate::abi::exports_xml2::xmlSAX2InternalSubset),
516 isStandalone: Some(crate::abi::exports_xml2::xmlSAX2IsStandalone),
517 hasInternalSubset: Some(crate::abi::exports_xml2::xmlSAX2HasInternalSubset),
518 hasExternalSubset: Some(crate::abi::exports_xml2::xmlSAX2HasExternalSubset),
519 resolveEntity: Some(crate::abi::exports_xml2::xmlSAX2ResolveEntity),
520 getEntity: Some(crate::abi::exports_xml2::xmlSAX2GetEntity),
521 entityDecl: Some(crate::abi::exports_xml2::xmlSAX2EntityDecl),
522 notationDecl: Some(crate::abi::exports_xml2::xmlSAX2NotationDecl),
523 attributeDecl: Some(crate::abi::exports_xml2::xmlSAX2AttributeDecl),
524 elementDecl: Some(crate::abi::exports_xml2::xmlSAX2ElementDecl),
525 unparsedEntityDecl: Some(crate::abi::exports_xml2::xmlSAX2UnparsedEntityDecl),
526 setDocumentLocator: Some(crate::abi::exports_xml2::xmlSAX2SetDocumentLocator),
527 startDocument: Some(crate::abi::exports_xml2::xmlSAX2StartDocument),
528 endDocument: Some(crate::abi::exports_xml2::xmlSAX2EndDocument),
529 startElement: Some(crate::abi::exports_xml2::xmlSAX2StartElement),
530 endElement: Some(crate::abi::exports_xml2::xmlSAX2EndElement),
531 reference: Some(crate::abi::exports_xml2::xmlSAX2Reference),
532 characters: Some(crate::abi::exports_xml2::xmlSAX2Characters),
533 ignorableWhitespace: Some(crate::abi::exports_xml2::xmlSAX2IgnorableWhitespace),
534 processingInstruction: Some(crate::abi::exports_xml2::xmlSAX2ProcessingInstruction),
535 comment: Some(crate::abi::exports_xml2::xmlSAX2Comment),
536 warning: Some(crate::xml::errors::xmlParserWarning),
537 error: Some(crate::xml::errors::xmlParserError),
538 fatalError: Some(crate::xml::errors::xmlParserError),
539 getParameterEntity: Some(crate::abi::exports_xml2::xmlSAX2GetParameterEntity),
540 cdataBlock: Some(crate::abi::exports_xml2::xmlSAX2CDataBlock),
541 externalSubset: Some(crate::abi::exports_xml2::xmlSAX2ExternalSubset),
542 initialized: 1,
543 };
544
545#[no_mangle]
547pub static htmlDefaultSAXHandler: crate::abi::structs::_xmlSAXHandlerV1 =
548 crate::abi::structs::_xmlSAXHandlerV1 {
549 internalSubset: Some(crate::abi::exports_xml2::xmlSAX2InternalSubset),
550 isStandalone: None,
551 hasInternalSubset: None,
552 hasExternalSubset: None,
553 resolveEntity: None,
554 getEntity: Some(crate::abi::exports_xml2::xmlSAX2GetEntity),
555 entityDecl: None,
556 notationDecl: None,
557 attributeDecl: None,
558 elementDecl: None,
559 unparsedEntityDecl: None,
560 setDocumentLocator: Some(crate::abi::exports_xml2::xmlSAX2SetDocumentLocator),
561 startDocument: Some(crate::abi::exports_xml2::xmlSAX2StartDocument),
562 endDocument: Some(crate::abi::exports_xml2::xmlSAX2EndDocument),
563 startElement: Some(crate::abi::exports_xml2::xmlSAX2StartElement),
564 endElement: Some(crate::abi::exports_xml2::xmlSAX2EndElement),
565 reference: None,
566 characters: Some(crate::abi::exports_xml2::xmlSAX2Characters),
567 ignorableWhitespace: Some(crate::abi::exports_xml2::xmlSAX2IgnorableWhitespace),
568 processingInstruction: Some(crate::abi::exports_xml2::xmlSAX2ProcessingInstruction),
569 comment: Some(crate::abi::exports_xml2::xmlSAX2Comment),
570 warning: Some(crate::xml::errors::xmlParserWarning),
571 error: Some(crate::xml::errors::xmlParserError),
572 fatalError: Some(crate::xml::errors::xmlParserError),
573 getParameterEntity: None,
574 cdataBlock: Some(crate::abi::exports_xml2::xmlSAX2CDataBlock),
575 externalSubset: None,
576 initialized: 1,
577 };
578
579#[no_mangle]
581pub static xmlDefaultSAXLocator: crate::abi::callbacks::_xmlSAXLocator =
582 crate::abi::callbacks::_xmlSAXLocator {
583 getPublicId: Some(crate::abi::exports_xml2::xmlSAX2GetPublicId),
584 getSystemId: Some(crate::abi::exports_xml2::xmlSAX2GetSystemId),
585 getLineNumber: Some(crate::abi::exports_xml2::xmlSAX2GetLineNumber),
586 getColumnNumber: Some(crate::abi::exports_xml2::xmlSAX2GetColumnNumber),
587 };
588
589#[no_mangle]
601pub static mut xmlLastError: crate::abi::structs::_xmlError = crate::abi::structs::_xmlError {
602 domain: 0,
603 code: 0,
604 message: core::ptr::null_mut(),
605 level: 0,
606 file: core::ptr::null_mut(),
607 line: 0,
608 str1: core::ptr::null_mut(),
609 str2: core::ptr::null_mut(),
610 str3: core::ptr::null_mut(),
611 int1: 0,
612 int2: 0,
613 ctxt: core::ptr::null_mut(),
614 node: core::ptr::null_mut(),
615};
616
617pub unsafe fn sync_xml_last_error(err: *const crate::abi::structs::_xmlError) {
628 if err.is_null() {
629 return;
630 }
631 unsafe {
632 reset_xml_last_error();
633 let src = &*err;
634 let dst = core::ptr::addr_of_mut!(xmlLastError);
635 (*dst).domain = src.domain;
636 (*dst).code = src.code;
637 (*dst).level = src.level;
638 (*dst).line = src.line;
639 (*dst).int1 = src.int1;
640 (*dst).int2 = src.int2;
641 (*dst).ctxt = src.ctxt;
642 (*dst).node = src.node;
643 (*dst).message = dup_cstr(src.message as *const u8);
644 (*dst).file = dup_cstr(src.file as *const u8);
645 (*dst).str1 = dup_cstr(src.str1 as *const u8);
646 (*dst).str2 = dup_cstr(src.str2 as *const u8);
647 (*dst).str3 = dup_cstr(src.str3 as *const u8);
648 }
649}
650
651pub unsafe fn reset_xml_last_error() {
659 unsafe {
660 let dst = core::ptr::addr_of_mut!(xmlLastError);
661 if !(*dst).message.is_null() {
662 libc::free((*dst).message as *mut libc::c_void);
663 }
664 if !(*dst).file.is_null() {
665 libc::free((*dst).file as *mut libc::c_void);
666 }
667 if !(*dst).str1.is_null() {
668 libc::free((*dst).str1 as *mut libc::c_void);
669 }
670 if !(*dst).str2.is_null() {
671 libc::free((*dst).str2 as *mut libc::c_void);
672 }
673 if !(*dst).str3.is_null() {
674 libc::free((*dst).str3 as *mut libc::c_void);
675 }
676 *dst = crate::abi::structs::_xmlError {
677 domain: 0,
678 code: 0,
679 message: core::ptr::null_mut(),
680 level: 0,
681 file: core::ptr::null_mut(),
682 line: 0,
683 str1: core::ptr::null_mut(),
684 str2: core::ptr::null_mut(),
685 str3: core::ptr::null_mut(),
686 int1: 0,
687 int2: 0,
688 ctxt: core::ptr::null_mut(),
689 node: core::ptr::null_mut(),
690 };
691 }
692}
693
694unsafe fn dup_cstr(s: *const u8) -> *mut c_char {
696 if s.is_null() {
697 return core::ptr::null_mut();
698 }
699 unsafe {
700 let len = libc::strlen(s as *const libc::c_char) as usize;
701 let p = libc::malloc(len + 1) as *mut u8;
702 if p.is_null() {
703 return core::ptr::null_mut();
704 }
705 libc::memcpy(p as *mut libc::c_void, s as *const libc::c_void, len + 1);
706 p as *mut c_char
707 }
708}
709
710#[no_mangle]
721pub unsafe extern "C" fn xmlKeepBlanksDefault(v: c_int) -> c_int {
722 unsafe {
723 if v != 0 {
724 xmlKeepBlanksDefaultValue = v;
725 }
726 xmlKeepBlanksDefaultValue
727 }
728}
729
730#[no_mangle]
732pub unsafe extern "C" fn xmlLineNumbersDefault(v: c_int) -> c_int {
733 unsafe {
734 if v != 0 {
735 xmlLineNumbersDefaultValue = v;
736 }
737 xmlLineNumbersDefaultValue
738 }
739}
740
741#[no_mangle]
743pub unsafe extern "C" fn xmlSubstituteEntitiesDefault(v: c_int) -> c_int {
744 unsafe {
745 if v != 0 {
746 xmlSubstituteEntitiesDefaultValue = v;
747 }
748 xmlSubstituteEntitiesDefaultValue
749 }
750}
751
752#[no_mangle]
754pub unsafe extern "C" fn xmlPedanticParserDefault(v: c_int) -> c_int {
755 unsafe {
756 if v != 0 {
757 xmlPedanticParserDefaultValue = v;
758 }
759 xmlPedanticParserDefaultValue
760 }
761}
762
763#[no_mangle]
769pub unsafe extern "C" fn xmlRegisterNodeDefault(
770 func: Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)>,
771) -> Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
772 unsafe {
773 XML_REGISTER_CALLBACKS.store(true, core::sync::atomic::Ordering::Relaxed);
776 if func.is_some() {
777 xmlRegisterNodeDefaultValue = func;
778 }
779 xmlRegisterNodeDefaultValue
780 }
781}
782
783#[no_mangle]
785pub unsafe extern "C" fn xmlDeregisterNodeDefault(
786 func: Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)>,
787) -> Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
788 unsafe {
789 XML_REGISTER_CALLBACKS.store(true, core::sync::atomic::Ordering::Relaxed);
792 if func.is_some() {
793 xmlDeregisterNodeDefaultValue = func;
794 }
795 xmlDeregisterNodeDefaultValue
796 }
797}
798
799#[no_mangle]
802pub unsafe extern "C" fn __xmlIndentTreeOutput() -> *mut c_int {
803 unsafe { core::ptr::addr_of_mut!(xmlIndentTreeOutput) }
804}
805
806#[no_mangle]
809pub unsafe extern "C" fn __xmlSaveNoEmptyTags() -> *mut c_int {
810 unsafe { core::ptr::addr_of_mut!(xmlSaveNoEmptyTags) }
811}
812
813#[no_mangle]
816pub unsafe extern "C" fn __xmlTreeIndentString() -> *mut *const xmlChar {
817 unsafe { core::ptr::addr_of_mut!(xmlTreeIndentString) }
818}
819
820#[no_mangle]
832pub unsafe extern "C" fn xmlThrDefDoValidityCheckingDefaultValue(v: c_int) -> c_int {
833 unsafe {
834 if v != 0 {
835 xmlDoValidityCheckingDefaultValue = v;
836 }
837 xmlDoValidityCheckingDefaultValue
838 }
839}
840
841#[no_mangle]
843pub unsafe extern "C" fn xmlThrDefGetWarningsDefaultValue(v: c_int) -> c_int {
844 unsafe {
845 if v != 0 {
846 xmlGetWarningsDefaultValue = v;
847 }
848 xmlGetWarningsDefaultValue
849 }
850}
851
852#[no_mangle]
854pub unsafe extern "C" fn xmlThrDefLoadExtDtdDefaultValue(v: c_int) -> c_int {
855 unsafe {
856 if v != 0 {
857 xmlLoadExtDtdDefaultValue = v;
858 }
859 xmlLoadExtDtdDefaultValue
860 }
861}
862
863#[no_mangle]
865pub unsafe extern "C" fn xmlThrDefPedanticParserDefaultValue(v: c_int) -> c_int {
866 unsafe {
867 if v != 0 {
868 xmlPedanticParserDefaultValue = v;
869 }
870 xmlPedanticParserDefaultValue
871 }
872}
873
874#[no_mangle]
876pub unsafe extern "C" fn xmlThrDefLineNumbersDefaultValue(v: c_int) -> c_int {
877 unsafe {
878 if v != 0 {
879 xmlLineNumbersDefaultValue = v;
880 }
881 xmlLineNumbersDefaultValue
882 }
883}
884
885#[no_mangle]
887pub unsafe extern "C" fn xmlThrDefKeepBlanksDefaultValue(v: c_int) -> c_int {
888 unsafe {
889 if v != 0 {
890 xmlKeepBlanksDefaultValue = v;
891 }
892 xmlKeepBlanksDefaultValue
893 }
894}
895
896#[no_mangle]
898pub unsafe extern "C" fn xmlThrDefSubstituteEntitiesDefaultValue(v: c_int) -> c_int {
899 unsafe {
900 if v != 0 {
901 xmlSubstituteEntitiesDefaultValue = v;
902 }
903 xmlSubstituteEntitiesDefaultValue
904 }
905}
906
907#[no_mangle]
909pub unsafe extern "C" fn xmlThrDefParserDebugEntities(v: c_int) -> c_int {
910 unsafe {
911 if v != 0 {
912 xmlParserDebugEntities = v;
913 }
914 xmlParserDebugEntities
915 }
916}
917
918#[no_mangle]
920pub unsafe extern "C" fn xmlThrDefIndentTreeOutput(v: c_int) -> c_int {
921 unsafe {
922 if v != 0 {
923 xmlIndentTreeOutput = v;
924 }
925 xmlIndentTreeOutput
926 }
927}
928
929#[no_mangle]
932pub unsafe extern "C" fn xmlThrDefTreeIndentString(v: *const c_char) -> *const c_char {
933 unsafe {
934 if !v.is_null() {
935 xmlTreeIndentString = v as *const xmlChar;
936 }
937 xmlTreeIndentString as *const c_char
938 }
939}
940
941#[no_mangle]
943pub unsafe extern "C" fn xmlThrDefSaveNoEmptyTags(v: c_int) -> c_int {
944 unsafe {
945 if v != 0 {
946 xmlSaveNoEmptyTags = v;
947 }
948 xmlSaveNoEmptyTags
949 }
950}
951
952#[no_mangle]
954pub unsafe extern "C" fn xmlThrDefRegisterNodeDefault(
955 func: Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)>,
956) -> Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
957 unsafe {
958 if func.is_some() {
959 xmlRegisterNodeDefaultValue = func;
960 }
961 xmlRegisterNodeDefaultValue
962 }
963}
964
965#[no_mangle]
967pub unsafe extern "C" fn xmlThrDefDeregisterNodeDefault(
968 func: Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)>,
969) -> Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
970 unsafe {
971 if func.is_some() {
972 xmlDeregisterNodeDefaultValue = func;
973 }
974 xmlDeregisterNodeDefaultValue
975 }
976}
977
978#[no_mangle]
980pub unsafe extern "C" fn xmlThrDefSetGenericErrorFunc(
981 ctx: *mut c_void,
982 func: Option<xmlGenericErrorFunc>,
983) {
984 unsafe {
985 xmlGenericErrorContext = ctx;
986 xmlGenericError = func;
987 }
988}
989
990#[no_mangle]
992pub unsafe extern "C" fn xmlThrDefSetStructuredErrorFunc(
993 ctx: *mut c_void,
994 func: Option<xmlStructuredErrorFunc>,
995) {
996 unsafe {
997 xmlStructuredErrorContext = ctx;
998 xmlStructuredError = func;
999 }
1000}
1001
1002#[no_mangle]
1004pub unsafe extern "C" fn xmlThrDefDefaultBufferSize(v: c_int) -> c_int {
1005 unsafe {
1006 if v != 0 {
1007 xmlDefaultBufferSize = v;
1008 }
1009 xmlDefaultBufferSize
1010 }
1011}
1012
1013#[no_mangle]
1015pub unsafe extern "C" fn xmlThrDefBufferAllocScheme(v: c_int) -> c_int {
1016 unsafe {
1017 if v != 0 {
1018 xmlBufferAllocScheme = v;
1019 }
1020 xmlBufferAllocScheme
1021 }
1022}
1023
1024#[no_mangle]
1026pub unsafe extern "C" fn xmlThrDefParserInputBufferCreateFilenameDefault(
1027 func: Option<
1028 unsafe extern "C" fn(
1029 *const c_char,
1030 c_int,
1031 ) -> *mut crate::abi::structs::_xmlParserInputBuffer,
1032 >,
1033) -> Option<
1034 unsafe extern "C" fn(*const c_char, c_int) -> *mut crate::abi::structs::_xmlParserInputBuffer,
1035> {
1036 unsafe {
1037 if func.is_some() {
1038 xmlParserInputBufferCreateFilenameValue = func;
1039 }
1040 xmlParserInputBufferCreateFilenameValue
1041 }
1042}
1043
1044#[no_mangle]
1046pub unsafe extern "C" fn xmlThrDefOutputBufferCreateFilenameDefault(
1047 func: Option<
1048 unsafe extern "C" fn(
1049 *const c_char,
1050 crate::abi::structs::xmlCharEncodingHandlerPtr,
1051 c_int,
1052 ) -> *mut crate::abi::structs::_xmlOutputBuffer,
1053 >,
1054) -> Option<
1055 unsafe extern "C" fn(
1056 *const c_char,
1057 crate::abi::structs::xmlCharEncodingHandlerPtr,
1058 c_int,
1059 ) -> *mut crate::abi::structs::_xmlOutputBuffer,
1060> {
1061 unsafe {
1062 if func.is_some() {
1063 xmlOutputBufferCreateFilenameValue = func;
1064 }
1065 xmlOutputBufferCreateFilenameValue
1066 }
1067}
1068
1069#[no_mangle]
1077pub unsafe extern "C" fn __xmlBufferAllocScheme() -> *mut c_int {
1078 unsafe { core::ptr::addr_of_mut!(xmlBufferAllocScheme) }
1081}
1082
1083#[no_mangle]
1085pub unsafe extern "C" fn __xmlDefaultBufferSize() -> *mut c_int {
1086 unsafe { core::ptr::addr_of_mut!(xmlDefaultBufferSize) }
1089}
1090
1091#[no_mangle]
1093pub unsafe extern "C" fn __xmlDeregisterNodeDefaultValue(
1094) -> *mut Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
1095 unsafe { core::ptr::addr_of_mut!(xmlDeregisterNodeDefaultValue) }
1098}
1099
1100#[no_mangle]
1102pub unsafe extern "C" fn __xmlDoValidityCheckingDefaultValue() -> *mut c_int {
1103 unsafe { core::ptr::addr_of_mut!(xmlDoValidityCheckingDefaultValue) }
1106}
1107
1108#[no_mangle]
1110pub unsafe extern "C" fn __xmlGenericError() -> *mut Option<xmlGenericErrorFunc> {
1111 unsafe { core::ptr::addr_of_mut!(xmlGenericError) }
1114}
1115
1116#[no_mangle]
1118pub unsafe extern "C" fn __xmlGenericErrorContext() -> *mut *mut c_void {
1119 unsafe { core::ptr::addr_of_mut!(xmlGenericErrorContext) }
1122}
1123
1124#[no_mangle]
1126pub unsafe extern "C" fn __xmlGetWarningsDefaultValue() -> *mut c_int {
1127 unsafe { core::ptr::addr_of_mut!(xmlGetWarningsDefaultValue) }
1130}
1131
1132#[no_mangle]
1134pub unsafe extern "C" fn __xmlKeepBlanksDefaultValue() -> *mut c_int {
1135 unsafe { core::ptr::addr_of_mut!(xmlKeepBlanksDefaultValue) }
1138}
1139
1140#[no_mangle]
1142pub unsafe extern "C" fn __xmlLineNumbersDefaultValue() -> *mut c_int {
1143 unsafe { core::ptr::addr_of_mut!(xmlLineNumbersDefaultValue) }
1146}
1147
1148#[no_mangle]
1150pub unsafe extern "C" fn __xmlLoadExtDtdDefaultValue() -> *mut c_int {
1151 unsafe { core::ptr::addr_of_mut!(xmlLoadExtDtdDefaultValue) }
1154}
1155
1156#[no_mangle]
1158pub unsafe extern "C" fn __xmlOutputBufferCreateFilenameValue() -> *mut Option<
1159 unsafe extern "C" fn(
1160 *const c_char,
1161 crate::abi::structs::xmlCharEncodingHandlerPtr,
1162 c_int,
1163 ) -> *mut crate::abi::structs::_xmlOutputBuffer,
1164> {
1165 unsafe { core::ptr::addr_of_mut!(xmlOutputBufferCreateFilenameValue) }
1168}
1169
1170#[no_mangle]
1172pub unsafe extern "C" fn __xmlParserDebugEntities() -> *mut c_int {
1173 unsafe { core::ptr::addr_of_mut!(xmlParserDebugEntities) }
1176}
1177
1178#[no_mangle]
1180pub unsafe extern "C" fn __xmlParserInputBufferCreateFilenameValue() -> *mut Option<
1181 unsafe extern "C" fn(*const c_char, c_int) -> *mut crate::abi::structs::_xmlParserInputBuffer,
1182> {
1183 unsafe { core::ptr::addr_of_mut!(xmlParserInputBufferCreateFilenameValue) }
1186}
1187
1188#[no_mangle]
1190pub unsafe extern "C" fn __xmlParserVersion() -> *mut *const c_char {
1191 unsafe { core::ptr::addr_of_mut!(xmlParserVersion) }
1194}
1195
1196#[no_mangle]
1198pub unsafe extern "C" fn __xmlPedanticParserDefaultValue() -> *mut c_int {
1199 unsafe { core::ptr::addr_of_mut!(xmlPedanticParserDefaultValue) }
1202}
1203
1204#[no_mangle]
1206pub unsafe extern "C" fn __xmlRegisterNodeDefaultValue(
1207) -> *mut Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
1208 unsafe { core::ptr::addr_of_mut!(xmlRegisterNodeDefaultValue) }
1211}
1212
1213#[no_mangle]
1215pub unsafe extern "C" fn __xmlStructuredError() -> *mut Option<xmlStructuredErrorFunc> {
1216 unsafe { core::ptr::addr_of_mut!(xmlStructuredError) }
1219}
1220
1221#[no_mangle]
1223pub unsafe extern "C" fn __xmlStructuredErrorContext() -> *mut *mut c_void {
1224 unsafe { core::ptr::addr_of_mut!(xmlStructuredErrorContext) }
1227}
1228
1229#[no_mangle]
1231pub unsafe extern "C" fn __xmlSubstituteEntitiesDefaultValue() -> *mut c_int {
1232 unsafe { core::ptr::addr_of_mut!(xmlSubstituteEntitiesDefaultValue) }
1235}