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
87#[no_mangle]
89pub static mut xmlDeregisterNodeDefaultValue: Option<
90 unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode),
91> = None;
92
93#[no_mangle]
102pub static mut xmlParserVersion: *const c_char = {
103 static V: [u8; 17] = *b"21503-GITv2.15.3\0";
104 V.as_ptr() as *const c_char
105};
106
107#[no_mangle]
109pub static mut xmlParserMaxDepth: c_int = 256;
110
111#[no_mangle]
117pub static mut xmlDefaultBufferSize: c_int = 4096;
118
119#[no_mangle]
122pub static mut xmlBufferAllocScheme: c_int = 1;
123
124#[cfg(target_arch = "x86_64")]
134#[no_mangle]
135pub static mut xmlGenericError: Option<xmlGenericErrorFunc> = Some(XML_GENERIC_ERROR_DEFAULT);
136
137#[cfg(not(target_arch = "x86_64"))]
138#[no_mangle]
139pub static mut xmlGenericError: Option<xmlGenericErrorFunc> = None;
140
141#[no_mangle]
143pub static mut xmlGenericErrorContext: *mut c_void = core::ptr::null_mut();
144
145#[no_mangle]
147pub static mut xmlStructuredError: Option<xmlStructuredErrorFunc> = None;
148
149#[no_mangle]
151pub static mut xmlStructuredErrorContext: *mut c_void = core::ptr::null_mut();
152
153#[cfg(target_arch = "x86_64")]
170#[repr(C)]
171#[derive(Clone, Copy)]
172struct VaListTag {
173 gp_offset: c_uint,
174 fp_offset: c_uint,
175 overflow_arg_area: *mut c_void,
176 reg_save_area: *mut c_void,
177}
178
179#[cfg(target_arch = "x86_64")]
180unsafe extern "C" {
181 fn vfprintf(stream: *mut c_void, format: *const c_char, ap: *mut VaListTag) -> c_int;
182}
183
184#[cfg(target_arch = "x86_64")]
187unsafe fn stderr_file() -> *mut c_void {
188 static mut STDERR_FILE: *mut c_void = core::ptr::null_mut();
189 unsafe {
190 if STDERR_FILE.is_null() {
191 STDERR_FILE = libc::fdopen(2, b"w\0".as_ptr() as *const c_char) as *mut c_void;
192 }
193 STDERR_FILE
194 }
195}
196
197#[cfg(target_arch = "x86_64")]
200#[no_mangle]
201pub unsafe extern "C" fn xmlGenericErrorDefaultFuncV(
202 _ctx: *mut c_void,
203 msg: *const c_char,
204 ap: *mut VaListTag,
205) -> c_int {
206 unsafe {
207 if crate::abi::data_globals::xmlGenericErrorContext.is_null() {
208 crate::abi::data_globals::xmlGenericErrorContext = stderr_file();
209 }
210 let stream = crate::abi::data_globals::xmlGenericErrorContext;
211 if msg.is_null() || stream.is_null() {
212 return 0;
213 }
214 vfprintf(stream, msg, ap)
215 }
216}
217
218#[cfg(target_arch = "x86_64")]
225pub unsafe extern "C" fn xmlGenericErrorDefaultFunc() -> c_int {
226 unsafe {
227 core::arch::asm!(
228 "sub rsp, 240",
229 "mov [rsp+0], rdi",
230 "mov [rsp+8], rsi",
231 "mov [rsp+16], rdx",
232 "mov [rsp+24], rcx",
233 "mov [rsp+32], r8",
234 "mov [rsp+40], r9",
235 "movaps [rsp+48], xmm0",
236 "movaps [rsp+64], xmm1",
237 "movaps [rsp+80], xmm2",
238 "movaps [rsp+96], xmm3",
239 "movaps [rsp+112], xmm4",
240 "movaps [rsp+128], xmm5",
241 "movaps [rsp+144], xmm6",
242 "movaps [rsp+160], xmm7",
243 "mov dword ptr [rsp+176], 16",
244 "mov dword ptr [rsp+180], 48",
245 "lea rax, [rsp+256]",
246 "mov [rsp+184], rax",
247 "lea rax, [rsp]",
248 "mov [rsp+192], rax",
249 "lea rdx, [rsp+176]",
250 "call xmlGenericErrorDefaultFuncV",
251 "add rsp, 240",
252 "add rsp, 8",
253 "ret",
254 options(noreturn),
255 );
256 }
257}
258
259#[cfg(target_arch = "x86_64")]
261const XML_GENERIC_ERROR_DEFAULT: xmlGenericErrorFunc = unsafe {
262 core::mem::transmute::<
266 unsafe extern "C" fn() -> c_int,
267 unsafe extern "C" fn(*mut c_void, *const c_char),
268 >(xmlGenericErrorDefaultFunc)
269};
270
271#[cfg(target_arch = "x86_64")]
274#[no_mangle]
275pub unsafe extern "C" fn xsltGenericErrorDefaultFuncV(
276 _ctx: *mut c_void,
277 msg: *const c_char,
278 ap: *mut VaListTag,
279) -> c_int {
280 unsafe {
281 if crate::abi::data_globals::xsltGenericErrorContext.is_null() {
282 crate::abi::data_globals::xsltGenericErrorContext = stderr_file();
283 }
284 let stream = crate::abi::data_globals::xsltGenericErrorContext;
285 if msg.is_null() || stream.is_null() {
286 return 0;
287 }
288 vfprintf(stream, msg, ap)
289 }
290}
291
292#[cfg(target_arch = "x86_64")]
295pub unsafe extern "C" fn xsltGenericErrorDefaultFunc() -> c_int {
296 unsafe {
297 core::arch::asm!(
298 "sub rsp, 240",
299 "mov [rsp+0], rdi",
300 "mov [rsp+8], rsi",
301 "mov [rsp+16], rdx",
302 "mov [rsp+24], rcx",
303 "mov [rsp+32], r8",
304 "mov [rsp+40], r9",
305 "movaps [rsp+48], xmm0",
306 "movaps [rsp+64], xmm1",
307 "movaps [rsp+80], xmm2",
308 "movaps [rsp+96], xmm3",
309 "movaps [rsp+112], xmm4",
310 "movaps [rsp+128], xmm5",
311 "movaps [rsp+144], xmm6",
312 "movaps [rsp+160], xmm7",
313 "mov dword ptr [rsp+176], 16",
314 "mov dword ptr [rsp+180], 48",
315 "lea rax, [rsp+256]",
316 "mov [rsp+184], rax",
317 "lea rax, [rsp]",
318 "mov [rsp+192], rax",
319 "lea rdx, [rsp+176]",
320 "call xsltGenericErrorDefaultFuncV",
321 "add rsp, 240",
322 "add rsp, 8",
323 "ret",
324 options(noreturn),
325 );
326 }
327}
328
329#[cfg(target_arch = "x86_64")]
331const XSLT_GENERIC_ERROR_DEFAULT: xmlGenericErrorFunc = unsafe {
332 core::mem::transmute::<
334 unsafe extern "C" fn() -> c_int,
335 unsafe extern "C" fn(*mut c_void, *const c_char),
336 >(xsltGenericErrorDefaultFunc)
337};
338
339pub fn default_generic_error_func() -> Option<xmlGenericErrorFunc> {
344 #[cfg(target_arch = "x86_64")]
345 {
346 Some(XML_GENERIC_ERROR_DEFAULT)
347 }
348 #[cfg(not(target_arch = "x86_64"))]
349 {
350 None
351 }
352}
353
354#[no_mangle]
360pub static xmlStringText: [xmlChar; 5] = [b't', b'e', b'x', b't', 0];
361
362#[no_mangle]
364pub static xmlStringTextNoenc: [xmlChar; 9] =
365 [b't', b'e', b'x', b't', b'n', b'o', b'e', b'n', b'c'];
366
367#[no_mangle]
369pub static xmlStringComment: [xmlChar; 8] = [b'c', b'o', b'm', b'm', b'e', b'n', b't', 0];
370
371#[no_mangle]
377pub static xmlXPathNAN: f64 = f64::NAN;
378
379#[no_mangle]
381pub static xmlXPathPINF: f64 = f64::INFINITY;
382
383#[no_mangle]
385pub static xmlXPathNINF: f64 = f64::NEG_INFINITY;
386
387#[no_mangle]
396pub static xsltLibxmlVersion: c_int = 21503;
397
398#[cfg(target_arch = "x86_64")]
403#[no_mangle]
404pub static mut xsltGenericError: Option<xmlGenericErrorFunc> = Some(XSLT_GENERIC_ERROR_DEFAULT);
405
406#[cfg(not(target_arch = "x86_64"))]
407#[no_mangle]
408pub static mut xsltGenericError: Option<xmlGenericErrorFunc> = None;
409
410#[no_mangle]
412pub static mut xsltGenericErrorContext: *mut c_void = core::ptr::null_mut();
413
414#[no_mangle]
416pub static mut xsltGenericDebugContext: *mut c_void = core::ptr::null_mut();
417
418#[no_mangle]
421pub static xsltExtMarker: [xmlChar; 1] = [0];
422
423#[no_mangle]
428pub static mut xsltDocDefaultLoader: Option<
429 unsafe extern "C" fn(
430 *const xmlChar,
431 *mut c_void,
432 c_int,
433 *mut crate::abi::structs::_xsltStylesheet,
434 *mut crate::abi::structs::_xsltTransformContext,
435 ) -> *mut crate::abi::structs::_xmlDoc,
436> = None;
437
438#[no_mangle]
444pub static mut xmlParserInputBufferCreateFilenameValue: Option<
445 unsafe extern "C" fn(*const c_char, c_int) -> *mut crate::abi::structs::_xmlParserInputBuffer,
446> = None;
447
448#[no_mangle]
450pub static mut xmlOutputBufferCreateFilenameValue: Option<
451 unsafe extern "C" fn(
452 *const c_char,
453 crate::abi::structs::xmlCharEncodingHandlerPtr,
454 c_int,
455 ) -> *mut crate::abi::structs::_xmlOutputBuffer,
456> = None;
457
458#[no_mangle]
470pub static xmlDefaultSAXHandler: crate::abi::structs::_xmlSAXHandlerV1 =
471 crate::abi::structs::_xmlSAXHandlerV1 {
472 internalSubset: Some(crate::abi::exports_xml2::xmlSAX2InternalSubset),
473 isStandalone: Some(crate::abi::exports_xml2::xmlSAX2IsStandalone),
474 hasInternalSubset: Some(crate::abi::exports_xml2::xmlSAX2HasInternalSubset),
475 hasExternalSubset: Some(crate::abi::exports_xml2::xmlSAX2HasExternalSubset),
476 resolveEntity: Some(crate::abi::exports_xml2::xmlSAX2ResolveEntity),
477 getEntity: Some(crate::abi::exports_xml2::xmlSAX2GetEntity),
478 entityDecl: Some(crate::abi::exports_xml2::xmlSAX2EntityDecl),
479 notationDecl: Some(crate::abi::exports_xml2::xmlSAX2NotationDecl),
480 attributeDecl: Some(crate::abi::exports_xml2::xmlSAX2AttributeDecl),
481 elementDecl: Some(crate::abi::exports_xml2::xmlSAX2ElementDecl),
482 unparsedEntityDecl: Some(crate::abi::exports_xml2::xmlSAX2UnparsedEntityDecl),
483 setDocumentLocator: Some(crate::abi::exports_xml2::xmlSAX2SetDocumentLocator),
484 startDocument: Some(crate::abi::exports_xml2::xmlSAX2StartDocument),
485 endDocument: Some(crate::abi::exports_xml2::xmlSAX2EndDocument),
486 startElement: Some(crate::abi::exports_xml2::xmlSAX2StartElement),
487 endElement: Some(crate::abi::exports_xml2::xmlSAX2EndElement),
488 reference: Some(crate::abi::exports_xml2::xmlSAX2Reference),
489 characters: Some(crate::abi::exports_xml2::xmlSAX2Characters),
490 ignorableWhitespace: Some(crate::abi::exports_xml2::xmlSAX2IgnorableWhitespace),
491 processingInstruction: Some(crate::abi::exports_xml2::xmlSAX2ProcessingInstruction),
492 comment: Some(crate::abi::exports_xml2::xmlSAX2Comment),
493 warning: Some(crate::xml::errors::xmlParserWarning),
494 error: Some(crate::xml::errors::xmlParserError),
495 fatalError: Some(crate::xml::errors::xmlParserError),
496 getParameterEntity: Some(crate::abi::exports_xml2::xmlSAX2GetParameterEntity),
497 cdataBlock: Some(crate::abi::exports_xml2::xmlSAX2CDataBlock),
498 externalSubset: Some(crate::abi::exports_xml2::xmlSAX2ExternalSubset),
499 initialized: 1,
500 };
501
502#[no_mangle]
504pub static htmlDefaultSAXHandler: crate::abi::structs::_xmlSAXHandlerV1 =
505 crate::abi::structs::_xmlSAXHandlerV1 {
506 internalSubset: Some(crate::abi::exports_xml2::xmlSAX2InternalSubset),
507 isStandalone: None,
508 hasInternalSubset: None,
509 hasExternalSubset: None,
510 resolveEntity: None,
511 getEntity: Some(crate::abi::exports_xml2::xmlSAX2GetEntity),
512 entityDecl: None,
513 notationDecl: None,
514 attributeDecl: None,
515 elementDecl: None,
516 unparsedEntityDecl: None,
517 setDocumentLocator: Some(crate::abi::exports_xml2::xmlSAX2SetDocumentLocator),
518 startDocument: Some(crate::abi::exports_xml2::xmlSAX2StartDocument),
519 endDocument: Some(crate::abi::exports_xml2::xmlSAX2EndDocument),
520 startElement: Some(crate::abi::exports_xml2::xmlSAX2StartElement),
521 endElement: Some(crate::abi::exports_xml2::xmlSAX2EndElement),
522 reference: None,
523 characters: Some(crate::abi::exports_xml2::xmlSAX2Characters),
524 ignorableWhitespace: Some(crate::abi::exports_xml2::xmlSAX2IgnorableWhitespace),
525 processingInstruction: Some(crate::abi::exports_xml2::xmlSAX2ProcessingInstruction),
526 comment: Some(crate::abi::exports_xml2::xmlSAX2Comment),
527 warning: Some(crate::xml::errors::xmlParserWarning),
528 error: Some(crate::xml::errors::xmlParserError),
529 fatalError: Some(crate::xml::errors::xmlParserError),
530 getParameterEntity: None,
531 cdataBlock: Some(crate::abi::exports_xml2::xmlSAX2CDataBlock),
532 externalSubset: None,
533 initialized: 1,
534 };
535
536#[no_mangle]
538pub static xmlDefaultSAXLocator: crate::abi::callbacks::_xmlSAXLocator =
539 crate::abi::callbacks::_xmlSAXLocator {
540 getPublicId: Some(crate::abi::exports_xml2::xmlSAX2GetPublicId),
541 getSystemId: Some(crate::abi::exports_xml2::xmlSAX2GetSystemId),
542 getLineNumber: Some(crate::abi::exports_xml2::xmlSAX2GetLineNumber),
543 getColumnNumber: Some(crate::abi::exports_xml2::xmlSAX2GetColumnNumber),
544 };
545
546#[no_mangle]
558pub static mut xmlLastError: crate::abi::structs::_xmlError = crate::abi::structs::_xmlError {
559 domain: 0,
560 code: 0,
561 message: core::ptr::null_mut(),
562 level: 0,
563 file: core::ptr::null_mut(),
564 line: 0,
565 str1: core::ptr::null_mut(),
566 str2: core::ptr::null_mut(),
567 str3: core::ptr::null_mut(),
568 int1: 0,
569 int2: 0,
570 ctxt: core::ptr::null_mut(),
571 node: core::ptr::null_mut(),
572};
573
574pub unsafe fn sync_xml_last_error(err: *const crate::abi::structs::_xmlError) {
585 if err.is_null() {
586 return;
587 }
588 unsafe {
589 reset_xml_last_error();
590 let src = &*err;
591 let dst = core::ptr::addr_of_mut!(xmlLastError);
592 (*dst).domain = src.domain;
593 (*dst).code = src.code;
594 (*dst).level = src.level;
595 (*dst).line = src.line;
596 (*dst).int1 = src.int1;
597 (*dst).int2 = src.int2;
598 (*dst).ctxt = src.ctxt;
599 (*dst).node = src.node;
600 (*dst).message = dup_cstr(src.message as *const u8);
601 (*dst).file = dup_cstr(src.file as *const u8);
602 (*dst).str1 = dup_cstr(src.str1 as *const u8);
603 (*dst).str2 = dup_cstr(src.str2 as *const u8);
604 (*dst).str3 = dup_cstr(src.str3 as *const u8);
605 }
606}
607
608pub unsafe fn reset_xml_last_error() {
616 unsafe {
617 let dst = core::ptr::addr_of_mut!(xmlLastError);
618 if !(*dst).message.is_null() {
619 libc::free((*dst).message as *mut libc::c_void);
620 }
621 if !(*dst).file.is_null() {
622 libc::free((*dst).file as *mut libc::c_void);
623 }
624 if !(*dst).str1.is_null() {
625 libc::free((*dst).str1 as *mut libc::c_void);
626 }
627 if !(*dst).str2.is_null() {
628 libc::free((*dst).str2 as *mut libc::c_void);
629 }
630 if !(*dst).str3.is_null() {
631 libc::free((*dst).str3 as *mut libc::c_void);
632 }
633 *dst = crate::abi::structs::_xmlError {
634 domain: 0,
635 code: 0,
636 message: core::ptr::null_mut(),
637 level: 0,
638 file: core::ptr::null_mut(),
639 line: 0,
640 str1: core::ptr::null_mut(),
641 str2: core::ptr::null_mut(),
642 str3: core::ptr::null_mut(),
643 int1: 0,
644 int2: 0,
645 ctxt: core::ptr::null_mut(),
646 node: core::ptr::null_mut(),
647 };
648 }
649}
650
651unsafe fn dup_cstr(s: *const u8) -> *mut c_char {
653 if s.is_null() {
654 return core::ptr::null_mut();
655 }
656 unsafe {
657 let len = libc::strlen(s as *const libc::c_char) as usize;
658 let p = libc::malloc(len + 1) as *mut u8;
659 if p.is_null() {
660 return core::ptr::null_mut();
661 }
662 libc::memcpy(p as *mut libc::c_void, s as *const libc::c_void, len + 1);
663 p as *mut c_char
664 }
665}
666
667#[no_mangle]
678pub unsafe extern "C" fn xmlKeepBlanksDefault(v: c_int) -> c_int {
679 unsafe {
680 if v != 0 {
681 xmlKeepBlanksDefaultValue = v;
682 }
683 xmlKeepBlanksDefaultValue
684 }
685}
686
687#[no_mangle]
689pub unsafe extern "C" fn xmlLineNumbersDefault(v: c_int) -> c_int {
690 unsafe {
691 if v != 0 {
692 xmlLineNumbersDefaultValue = v;
693 }
694 xmlLineNumbersDefaultValue
695 }
696}
697
698#[no_mangle]
700pub unsafe extern "C" fn xmlSubstituteEntitiesDefault(v: c_int) -> c_int {
701 unsafe {
702 if v != 0 {
703 xmlSubstituteEntitiesDefaultValue = v;
704 }
705 xmlSubstituteEntitiesDefaultValue
706 }
707}
708
709#[no_mangle]
711pub unsafe extern "C" fn xmlPedanticParserDefault(v: c_int) -> c_int {
712 unsafe {
713 if v != 0 {
714 xmlPedanticParserDefaultValue = v;
715 }
716 xmlPedanticParserDefaultValue
717 }
718}
719
720#[no_mangle]
726pub unsafe extern "C" fn xmlRegisterNodeDefault(
727 func: Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)>,
728) -> Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
729 unsafe {
730 if func.is_some() {
731 xmlRegisterNodeDefaultValue = func;
732 }
733 xmlRegisterNodeDefaultValue
734 }
735}
736
737#[no_mangle]
739pub unsafe extern "C" fn xmlDeregisterNodeDefault(
740 func: Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)>,
741) -> Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
742 unsafe {
743 if func.is_some() {
744 xmlDeregisterNodeDefaultValue = func;
745 }
746 xmlDeregisterNodeDefaultValue
747 }
748}
749
750#[no_mangle]
753pub unsafe extern "C" fn __xmlIndentTreeOutput() -> *mut c_int {
754 unsafe { core::ptr::addr_of_mut!(xmlIndentTreeOutput) }
755}
756
757#[no_mangle]
760pub unsafe extern "C" fn __xmlSaveNoEmptyTags() -> *mut c_int {
761 unsafe { core::ptr::addr_of_mut!(xmlSaveNoEmptyTags) }
762}
763
764#[no_mangle]
767pub unsafe extern "C" fn __xmlTreeIndentString() -> *mut *const xmlChar {
768 unsafe { core::ptr::addr_of_mut!(xmlTreeIndentString) }
769}
770
771#[no_mangle]
783pub unsafe extern "C" fn xmlThrDefDoValidityCheckingDefaultValue(v: c_int) -> c_int {
784 unsafe {
785 if v != 0 {
786 xmlDoValidityCheckingDefaultValue = v;
787 }
788 xmlDoValidityCheckingDefaultValue
789 }
790}
791
792#[no_mangle]
794pub unsafe extern "C" fn xmlThrDefGetWarningsDefaultValue(v: c_int) -> c_int {
795 unsafe {
796 if v != 0 {
797 xmlGetWarningsDefaultValue = v;
798 }
799 xmlGetWarningsDefaultValue
800 }
801}
802
803#[no_mangle]
805pub unsafe extern "C" fn xmlThrDefLoadExtDtdDefaultValue(v: c_int) -> c_int {
806 unsafe {
807 if v != 0 {
808 xmlLoadExtDtdDefaultValue = v;
809 }
810 xmlLoadExtDtdDefaultValue
811 }
812}
813
814#[no_mangle]
816pub unsafe extern "C" fn xmlThrDefPedanticParserDefaultValue(v: c_int) -> c_int {
817 unsafe {
818 if v != 0 {
819 xmlPedanticParserDefaultValue = v;
820 }
821 xmlPedanticParserDefaultValue
822 }
823}
824
825#[no_mangle]
827pub unsafe extern "C" fn xmlThrDefLineNumbersDefaultValue(v: c_int) -> c_int {
828 unsafe {
829 if v != 0 {
830 xmlLineNumbersDefaultValue = v;
831 }
832 xmlLineNumbersDefaultValue
833 }
834}
835
836#[no_mangle]
838pub unsafe extern "C" fn xmlThrDefKeepBlanksDefaultValue(v: c_int) -> c_int {
839 unsafe {
840 if v != 0 {
841 xmlKeepBlanksDefaultValue = v;
842 }
843 xmlKeepBlanksDefaultValue
844 }
845}
846
847#[no_mangle]
849pub unsafe extern "C" fn xmlThrDefSubstituteEntitiesDefaultValue(v: c_int) -> c_int {
850 unsafe {
851 if v != 0 {
852 xmlSubstituteEntitiesDefaultValue = v;
853 }
854 xmlSubstituteEntitiesDefaultValue
855 }
856}
857
858#[no_mangle]
860pub unsafe extern "C" fn xmlThrDefParserDebugEntities(v: c_int) -> c_int {
861 unsafe {
862 if v != 0 {
863 xmlParserDebugEntities = v;
864 }
865 xmlParserDebugEntities
866 }
867}
868
869#[no_mangle]
871pub unsafe extern "C" fn xmlThrDefIndentTreeOutput(v: c_int) -> c_int {
872 unsafe {
873 if v != 0 {
874 xmlIndentTreeOutput = v;
875 }
876 xmlIndentTreeOutput
877 }
878}
879
880#[no_mangle]
883pub unsafe extern "C" fn xmlThrDefTreeIndentString(v: *const c_char) -> *const c_char {
884 unsafe {
885 if !v.is_null() {
886 xmlTreeIndentString = v as *const xmlChar;
887 }
888 xmlTreeIndentString as *const c_char
889 }
890}
891
892#[no_mangle]
894pub unsafe extern "C" fn xmlThrDefSaveNoEmptyTags(v: c_int) -> c_int {
895 unsafe {
896 if v != 0 {
897 xmlSaveNoEmptyTags = v;
898 }
899 xmlSaveNoEmptyTags
900 }
901}
902
903#[no_mangle]
905pub unsafe extern "C" fn xmlThrDefRegisterNodeDefault(
906 func: Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)>,
907) -> Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
908 unsafe {
909 if func.is_some() {
910 xmlRegisterNodeDefaultValue = func;
911 }
912 xmlRegisterNodeDefaultValue
913 }
914}
915
916#[no_mangle]
918pub unsafe extern "C" fn xmlThrDefDeregisterNodeDefault(
919 func: Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)>,
920) -> Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
921 unsafe {
922 if func.is_some() {
923 xmlDeregisterNodeDefaultValue = func;
924 }
925 xmlDeregisterNodeDefaultValue
926 }
927}
928
929#[no_mangle]
931pub unsafe extern "C" fn xmlThrDefSetGenericErrorFunc(
932 ctx: *mut c_void,
933 func: Option<xmlGenericErrorFunc>,
934) {
935 unsafe {
936 xmlGenericErrorContext = ctx;
937 xmlGenericError = func;
938 }
939}
940
941#[no_mangle]
943pub unsafe extern "C" fn xmlThrDefSetStructuredErrorFunc(
944 ctx: *mut c_void,
945 func: Option<xmlStructuredErrorFunc>,
946) {
947 unsafe {
948 xmlStructuredErrorContext = ctx;
949 xmlStructuredError = func;
950 }
951}
952
953#[no_mangle]
955pub unsafe extern "C" fn xmlThrDefDefaultBufferSize(v: c_int) -> c_int {
956 unsafe {
957 if v != 0 {
958 xmlDefaultBufferSize = v;
959 }
960 xmlDefaultBufferSize
961 }
962}
963
964#[no_mangle]
966pub unsafe extern "C" fn xmlThrDefBufferAllocScheme(v: c_int) -> c_int {
967 unsafe {
968 if v != 0 {
969 xmlBufferAllocScheme = v;
970 }
971 xmlBufferAllocScheme
972 }
973}
974
975#[no_mangle]
977pub unsafe extern "C" fn xmlThrDefParserInputBufferCreateFilenameDefault(
978 func: Option<
979 unsafe extern "C" fn(
980 *const c_char,
981 c_int,
982 ) -> *mut crate::abi::structs::_xmlParserInputBuffer,
983 >,
984) -> Option<
985 unsafe extern "C" fn(*const c_char, c_int) -> *mut crate::abi::structs::_xmlParserInputBuffer,
986> {
987 unsafe {
988 if func.is_some() {
989 xmlParserInputBufferCreateFilenameValue = func;
990 }
991 xmlParserInputBufferCreateFilenameValue
992 }
993}
994
995#[no_mangle]
997pub unsafe extern "C" fn xmlThrDefOutputBufferCreateFilenameDefault(
998 func: Option<
999 unsafe extern "C" fn(
1000 *const c_char,
1001 crate::abi::structs::xmlCharEncodingHandlerPtr,
1002 c_int,
1003 ) -> *mut crate::abi::structs::_xmlOutputBuffer,
1004 >,
1005) -> Option<
1006 unsafe extern "C" fn(
1007 *const c_char,
1008 crate::abi::structs::xmlCharEncodingHandlerPtr,
1009 c_int,
1010 ) -> *mut crate::abi::structs::_xmlOutputBuffer,
1011> {
1012 unsafe {
1013 if func.is_some() {
1014 xmlOutputBufferCreateFilenameValue = func;
1015 }
1016 xmlOutputBufferCreateFilenameValue
1017 }
1018}
1019
1020#[no_mangle]
1028pub unsafe extern "C" fn __xmlBufferAllocScheme() -> *mut c_int {
1029 unsafe { core::ptr::addr_of_mut!(xmlBufferAllocScheme) }
1032}
1033
1034#[no_mangle]
1036pub unsafe extern "C" fn __xmlDefaultBufferSize() -> *mut c_int {
1037 unsafe { core::ptr::addr_of_mut!(xmlDefaultBufferSize) }
1040}
1041
1042#[no_mangle]
1044pub unsafe extern "C" fn __xmlDeregisterNodeDefaultValue(
1045) -> *mut Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
1046 unsafe { core::ptr::addr_of_mut!(xmlDeregisterNodeDefaultValue) }
1049}
1050
1051#[no_mangle]
1053pub unsafe extern "C" fn __xmlDoValidityCheckingDefaultValue() -> *mut c_int {
1054 unsafe { core::ptr::addr_of_mut!(xmlDoValidityCheckingDefaultValue) }
1057}
1058
1059#[no_mangle]
1061pub unsafe extern "C" fn __xmlGenericError() -> *mut Option<xmlGenericErrorFunc> {
1062 unsafe { core::ptr::addr_of_mut!(xmlGenericError) }
1065}
1066
1067#[no_mangle]
1069pub unsafe extern "C" fn __xmlGenericErrorContext() -> *mut *mut c_void {
1070 unsafe { core::ptr::addr_of_mut!(xmlGenericErrorContext) }
1073}
1074
1075#[no_mangle]
1077pub unsafe extern "C" fn __xmlGetWarningsDefaultValue() -> *mut c_int {
1078 unsafe { core::ptr::addr_of_mut!(xmlGetWarningsDefaultValue) }
1081}
1082
1083#[no_mangle]
1085pub unsafe extern "C" fn __xmlKeepBlanksDefaultValue() -> *mut c_int {
1086 unsafe { core::ptr::addr_of_mut!(xmlKeepBlanksDefaultValue) }
1089}
1090
1091#[no_mangle]
1093pub unsafe extern "C" fn __xmlLineNumbersDefaultValue() -> *mut c_int {
1094 unsafe { core::ptr::addr_of_mut!(xmlLineNumbersDefaultValue) }
1097}
1098
1099#[no_mangle]
1101pub unsafe extern "C" fn __xmlLoadExtDtdDefaultValue() -> *mut c_int {
1102 unsafe { core::ptr::addr_of_mut!(xmlLoadExtDtdDefaultValue) }
1105}
1106
1107#[no_mangle]
1109pub unsafe extern "C" fn __xmlOutputBufferCreateFilenameValue() -> *mut Option<
1110 unsafe extern "C" fn(
1111 *const c_char,
1112 crate::abi::structs::xmlCharEncodingHandlerPtr,
1113 c_int,
1114 ) -> *mut crate::abi::structs::_xmlOutputBuffer,
1115> {
1116 unsafe { core::ptr::addr_of_mut!(xmlOutputBufferCreateFilenameValue) }
1119}
1120
1121#[no_mangle]
1123pub unsafe extern "C" fn __xmlParserDebugEntities() -> *mut c_int {
1124 unsafe { core::ptr::addr_of_mut!(xmlParserDebugEntities) }
1127}
1128
1129#[no_mangle]
1131pub unsafe extern "C" fn __xmlParserInputBufferCreateFilenameValue() -> *mut Option<
1132 unsafe extern "C" fn(*const c_char, c_int) -> *mut crate::abi::structs::_xmlParserInputBuffer,
1133> {
1134 unsafe { core::ptr::addr_of_mut!(xmlParserInputBufferCreateFilenameValue) }
1137}
1138
1139#[no_mangle]
1141pub unsafe extern "C" fn __xmlParserVersion() -> *mut *const c_char {
1142 unsafe { core::ptr::addr_of_mut!(xmlParserVersion) }
1145}
1146
1147#[no_mangle]
1149pub unsafe extern "C" fn __xmlPedanticParserDefaultValue() -> *mut c_int {
1150 unsafe { core::ptr::addr_of_mut!(xmlPedanticParserDefaultValue) }
1153}
1154
1155#[no_mangle]
1157pub unsafe extern "C" fn __xmlRegisterNodeDefaultValue(
1158) -> *mut Option<unsafe extern "C" fn(*mut crate::abi::structs::_xmlNode)> {
1159 unsafe { core::ptr::addr_of_mut!(xmlRegisterNodeDefaultValue) }
1162}
1163
1164#[no_mangle]
1166pub unsafe extern "C" fn __xmlStructuredError() -> *mut Option<xmlStructuredErrorFunc> {
1167 unsafe { core::ptr::addr_of_mut!(xmlStructuredError) }
1170}
1171
1172#[no_mangle]
1174pub unsafe extern "C" fn __xmlStructuredErrorContext() -> *mut *mut c_void {
1175 unsafe { core::ptr::addr_of_mut!(xmlStructuredErrorContext) }
1178}
1179
1180#[no_mangle]
1182pub unsafe extern "C" fn __xmlSubstituteEntitiesDefaultValue() -> *mut c_int {
1183 unsafe { core::ptr::addr_of_mut!(xmlSubstituteEntitiesDefaultValue) }
1186}