OLD | NEW |
1 /* | 1 /* |
2 * globals.c: definition and handling of the set of global variables | 2 * globals.c: definition and handling of the set of global variables |
3 * of the library | 3 * of the library |
4 * | 4 * |
5 * The bottom of this file is automatically generated by build_glob.py | 5 * The bottom of this file is automatically generated by build_glob.py |
6 * based on the description file global.data | 6 * based on the description file global.data |
7 * | 7 * |
8 * See Copyright for the status of this software. | 8 * See Copyright for the status of this software. |
9 * | 9 * |
10 * Gary Pennington <Gary.Pennington@uk.sun.com> | 10 * Gary Pennington <Gary.Pennington@uk.sun.com> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void xmlCleanupGlobals(void) | 58 void xmlCleanupGlobals(void) |
59 { | 59 { |
60 if (xmlThrDefMutex != NULL) { | 60 if (xmlThrDefMutex != NULL) { |
61 xmlFreeMutex(xmlThrDefMutex); | 61 xmlFreeMutex(xmlThrDefMutex); |
62 xmlThrDefMutex = NULL; | 62 xmlThrDefMutex = NULL; |
63 } | 63 } |
64 __xmlGlobalInitMutexDestroy(); | 64 __xmlGlobalInitMutexDestroy(); |
65 } | 65 } |
66 | 66 |
67 /************************************************************************ | 67 /************************************************************************ |
68 * » » » » » » » » » * | 68 *» » » » » » » » » * |
69 * All the user accessible global variables of the library * | 69 * All the user accessible global variables of the library * |
70 * » » » » » » » » » * | 70 *» » » » » » » » » * |
71 ************************************************************************/ | 71 ************************************************************************/ |
72 | 72 |
73 /* | 73 /* |
74 * Memory allocation routines | 74 * Memory allocation routines |
75 */ | 75 */ |
76 #undef xmlFree | 76 #undef xmlFree |
77 #undef xmlMalloc | 77 #undef xmlMalloc |
78 #undef xmlMallocAtomic | 78 #undef xmlMallocAtomic |
79 #undef xmlMemStrdup | 79 #undef xmlMemStrdup |
80 #undef xmlRealloc | 80 #undef xmlRealloc |
81 | 81 |
82 #if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY) | 82 #if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY) |
83 xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree; | 83 xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree; |
84 xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc; | 84 xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
85 xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc; | 85 xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc; |
86 xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc; | 86 xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
87 xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; | 87 xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
88 #else | 88 #else |
89 | |
90 #define MAX_LIBXML_MALLOC (1024*1024*512) | |
91 | |
92 static void* size_checked_malloc(size_t size) { | |
93 if (size > MAX_LIBXML_MALLOC) { | |
94 *(volatile char*)0 = '\0'; | |
95 return NULL; | |
96 } | |
97 return malloc(size); | |
98 } | |
99 | |
100 static void* size_checked_realloc(void* ptr, size_t size) { | |
101 if (size > MAX_LIBXML_MALLOC) { | |
102 *(volatile char*)0 = '\0'; | |
103 return NULL; | |
104 } | |
105 return realloc(ptr, size); | |
106 } | |
107 | |
108 /** | 89 /** |
109 * xmlFree: | 90 * xmlFree: |
110 * @mem: an already allocated block of memory | 91 * @mem: an already allocated block of memory |
111 * | 92 * |
112 * The variable holding the libxml free() implementation | 93 * The variable holding the libxml free() implementation |
113 */ | 94 */ |
114 xmlFreeFunc xmlFree = (xmlFreeFunc) free; | 95 xmlFreeFunc xmlFree = (xmlFreeFunc) free; |
115 /** | 96 /** |
116 * xmlMalloc: | 97 * xmlMalloc: |
117 * @size: the size requested in bytes | 98 * @size: the size requested in bytes |
118 * | 99 * |
119 * The variable holding the libxml malloc() implementation | 100 * The variable holding the libxml malloc() implementation |
120 * | 101 * |
121 * Returns a pointer to the newly allocated block or NULL in case of error | 102 * Returns a pointer to the newly allocated block or NULL in case of error |
122 */ | 103 */ |
123 xmlMallocFunc xmlMalloc = (xmlMallocFunc) size_checked_malloc; | 104 xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc; |
124 /** | 105 /** |
125 * xmlMallocAtomic: | 106 * xmlMallocAtomic: |
126 * @size: the size requested in bytes | 107 * @size: the size requested in bytes |
127 * | 108 * |
128 * The variable holding the libxml malloc() implementation for atomic | 109 * The variable holding the libxml malloc() implementation for atomic |
129 * data (i.e. blocks not containings pointers), useful when using a | 110 * data (i.e. blocks not containings pointers), useful when using a |
130 * garbage collecting allocator. | 111 * garbage collecting allocator. |
131 * | 112 * |
132 * Returns a pointer to the newly allocated block or NULL in case of error | 113 * Returns a pointer to the newly allocated block or NULL in case of error |
133 */ | 114 */ |
134 xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) size_checked_malloc; | 115 xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) malloc; |
135 /** | 116 /** |
136 * xmlRealloc: | 117 * xmlRealloc: |
137 * @mem: an already allocated block of memory | 118 * @mem: an already allocated block of memory |
138 * @size: the new size requested in bytes | 119 * @size: the new size requested in bytes |
139 * | 120 * |
140 * The variable holding the libxml realloc() implementation | 121 * The variable holding the libxml realloc() implementation |
141 * | 122 * |
142 * Returns a pointer to the newly reallocated block or NULL in case of error | 123 * Returns a pointer to the newly reallocated block or NULL in case of error |
143 */ | 124 */ |
144 xmlReallocFunc xmlRealloc = (xmlReallocFunc) size_checked_realloc; | 125 xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc; |
145 /** | 126 /** |
146 * xmlMemStrdup: | 127 * xmlMemStrdup: |
147 * @str: a zero terminated string | 128 * @str: a zero terminated string |
148 * | 129 * |
149 * The variable holding the libxml strdup() implementation | 130 * The variable holding the libxml strdup() implementation |
150 * | 131 * |
151 * Returns the copy of the string or NULL in case of error | 132 * Returns the copy of the string or NULL in case of error |
152 */ | 133 */ |
153 xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup; | 134 xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup; |
154 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */ | 135 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */ |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 * | 239 * |
259 * Global setting, indicate that the parser be pedantic | 240 * Global setting, indicate that the parser be pedantic |
260 * Disabled by default. | 241 * Disabled by default. |
261 */ | 242 */ |
262 int xmlPedanticParserDefaultValue = 0; | 243 int xmlPedanticParserDefaultValue = 0; |
263 static int xmlPedanticParserDefaultValueThrDef = 0; | 244 static int xmlPedanticParserDefaultValueThrDef = 0; |
264 /** | 245 /** |
265 * xmlLineNumbersDefaultValue: | 246 * xmlLineNumbersDefaultValue: |
266 * | 247 * |
267 * Global setting, indicate that the parser should store the line number | 248 * Global setting, indicate that the parser should store the line number |
268 * in the content field of elements in the DOM tree. | 249 * in the content field of elements in the DOM tree. |
269 * Disabled by default since this may not be safe for old classes of | 250 * Disabled by default since this may not be safe for old classes of |
270 * applicaton. | 251 * applicaton. |
271 */ | 252 */ |
272 int xmlLineNumbersDefaultValue = 0; | 253 int xmlLineNumbersDefaultValue = 0; |
273 static int xmlLineNumbersDefaultValueThrDef = 0; | 254 static int xmlLineNumbersDefaultValueThrDef = 0; |
274 /** | 255 /** |
275 * xmlKeepBlanksDefaultValue: | 256 * xmlKeepBlanksDefaultValue: |
276 * | 257 * |
277 * Global setting, indicate that the parser should keep all blanks | 258 * Global setting, indicate that the parser should keep all blanks |
278 * nodes found in the content | 259 * nodes found in the content |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 * Perform initialization as required by libxml | 502 * Perform initialization as required by libxml |
522 */ | 503 */ |
523 if (xmlThrDefMutex == NULL) | 504 if (xmlThrDefMutex == NULL) |
524 xmlInitGlobals(); | 505 xmlInitGlobals(); |
525 | 506 |
526 xmlMutexLock(xmlThrDefMutex); | 507 xmlMutexLock(xmlThrDefMutex); |
527 | 508 |
528 #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LI
BXML_SAX1_ENABLED) | 509 #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LI
BXML_SAX1_ENABLED) |
529 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); | 510 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); |
530 #endif | 511 #endif |
531 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) | 512 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LI
BXML_SAX1_ENABLED) |
532 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); | 513 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); |
533 #endif | 514 #endif |
534 | 515 |
535 gs->oldXMLWDcompatibility = 0; | 516 gs->oldXMLWDcompatibility = 0; |
536 gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef; | 517 gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef; |
537 gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef; | 518 gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef; |
538 #if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED) | 519 #if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED) |
539 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); | 520 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); |
540 #endif /* LIBXML_SAX1_ENABLED */ | 521 #endif /* LIBXML_SAX1_ENABLED */ |
541 gs->xmlDefaultSAXLocator.getPublicId = xmlSAX2GetPublicId; | 522 gs->xmlDefaultSAXLocator.getPublicId = xmlSAX2GetPublicId; |
542 gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId; | 523 gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId; |
543 gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber; | 524 gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber; |
544 gs->xmlDefaultSAXLocator.getColumnNumber = xmlSAX2GetColumnNumber; | 525 gs->xmlDefaultSAXLocator.getColumnNumber = xmlSAX2GetColumnNumber; |
545 gs->xmlDoValidityCheckingDefaultValue = | 526 gs->xmlDoValidityCheckingDefaultValue = |
546 xmlDoValidityCheckingDefaultValueThrDef; | 527 xmlDoValidityCheckingDefaultValueThrDef; |
547 #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) | 528 #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) |
548 gs->xmlFree = (xmlFreeFunc) xmlMemFree; | 529 gs->xmlFree = (xmlFreeFunc) xmlMemFree; |
549 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc; | 530 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
550 gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc; | 531 gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc; |
551 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc; | 532 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
552 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; | 533 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
553 #else | 534 #else |
554 gs->xmlFree = (xmlFreeFunc) free; | 535 gs->xmlFree = (xmlFreeFunc) free; |
555 gs->xmlMalloc = (xmlMallocFunc) malloc; | 536 gs->xmlMalloc = (xmlMallocFunc) malloc; |
556 gs->xmlMallocAtomic = (xmlMallocFunc) malloc; | 537 gs->xmlMallocAtomic = (xmlMallocFunc) malloc; |
557 gs->xmlRealloc = (xmlReallocFunc) realloc; | 538 gs->xmlRealloc = (xmlReallocFunc) realloc; |
558 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup; | 539 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup; |
559 #endif | 540 #endif |
560 gs->xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef; | 541 gs->xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef; |
561 gs->xmlIndentTreeOutput = xmlIndentTreeOutputThrDef; | 542 gs->xmlIndentTreeOutput = xmlIndentTreeOutputThrDef; |
562 gs->xmlTreeIndentString = xmlTreeIndentStringThrDef; | 543 gs->xmlTreeIndentString = xmlTreeIndentStringThrDef; |
563 gs->xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef; | 544 gs->xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef; |
564 gs->xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef; | 545 gs->xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef; |
565 gs->xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef; | 546 gs->xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef; |
566 gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef; | 547 gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef; |
567 gs->xmlParserVersion = LIBXML_VERSION_STRING; | 548 gs->xmlParserVersion = LIBXML_VERSION_STRING; |
568 gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; | 549 gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; |
569 gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; | 550 gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; |
570 gs->xmlSubstituteEntitiesDefaultValue = | 551 gs->xmlSubstituteEntitiesDefaultValue = |
571 xmlSubstituteEntitiesDefaultValueThrDef; | 552 xmlSubstituteEntitiesDefaultValueThrDef; |
572 | 553 |
573 gs->xmlGenericError = xmlGenericErrorThrDef; | 554 gs->xmlGenericError = xmlGenericErrorThrDef; |
574 gs->xmlStructuredError = xmlStructuredErrorThrDef; | 555 gs->xmlStructuredError = xmlStructuredErrorThrDef; |
575 gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef; | 556 gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef; |
576 gs->xmlStructuredErrorContext = xmlStructuredErrorContextThrDef; | 557 gs->xmlStructuredErrorContext = xmlStructuredErrorContextThrDef; |
577 gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef; | 558 gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef; |
578 gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef; | 559 gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef; |
579 | 560 |
580 gs->xmlParserInputBufferCreateFilenameValue = xmlParserInputBufferCreate
FilenameValueThrDef; | 561 gs->xmlParserInputBufferCreateFilenameValue = xmlParserInputBufferCreate
FilenameValueThrDef; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 * @func: function pointer to the new RegisterNodeFunc | 593 * @func: function pointer to the new RegisterNodeFunc |
613 * | 594 * |
614 * Registers a callback for node creation | 595 * Registers a callback for node creation |
615 * | 596 * |
616 * Returns the old value of the registration function | 597 * Returns the old value of the registration function |
617 */ | 598 */ |
618 xmlRegisterNodeFunc | 599 xmlRegisterNodeFunc |
619 xmlRegisterNodeDefault(xmlRegisterNodeFunc func) | 600 xmlRegisterNodeDefault(xmlRegisterNodeFunc func) |
620 { | 601 { |
621 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue; | 602 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue; |
622 | 603 |
623 __xmlRegisterCallbacks = 1; | 604 __xmlRegisterCallbacks = 1; |
624 xmlRegisterNodeDefaultValue = func; | 605 xmlRegisterNodeDefaultValue = func; |
625 return(old); | 606 return(old); |
626 } | 607 } |
627 | 608 |
628 xmlRegisterNodeFunc | 609 xmlRegisterNodeFunc |
629 xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func) | 610 xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func) |
630 { | 611 { |
631 xmlRegisterNodeFunc old; | 612 xmlRegisterNodeFunc old; |
632 | 613 |
633 xmlMutexLock(xmlThrDefMutex); | 614 xmlMutexLock(xmlThrDefMutex); |
634 old = xmlRegisterNodeDefaultValueThrDef; | 615 old = xmlRegisterNodeDefaultValueThrDef; |
635 | 616 |
636 __xmlRegisterCallbacks = 1; | 617 __xmlRegisterCallbacks = 1; |
637 xmlRegisterNodeDefaultValueThrDef = func; | 618 xmlRegisterNodeDefaultValueThrDef = func; |
638 xmlMutexUnlock(xmlThrDefMutex); | 619 xmlMutexUnlock(xmlThrDefMutex); |
639 | 620 |
640 return(old); | 621 return(old); |
641 } | 622 } |
642 | 623 |
643 /** | 624 /** |
644 * xmlDeregisterNodeDefault: | 625 * xmlDeregisterNodeDefault: |
645 * @func: function pointer to the new DeregisterNodeFunc | 626 * @func: function pointer to the new DeregisterNodeFunc |
646 * | 627 * |
647 * Registers a callback for node destruction | 628 * Registers a callback for node destruction |
648 * | 629 * |
649 * Returns the previous value of the deregistration function | 630 * Returns the previous value of the deregistration function |
650 */ | 631 */ |
651 xmlDeregisterNodeFunc | 632 xmlDeregisterNodeFunc |
652 xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func) | 633 xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func) |
653 { | 634 { |
654 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue; | 635 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue; |
655 | 636 |
656 __xmlRegisterCallbacks = 1; | 637 __xmlRegisterCallbacks = 1; |
657 xmlDeregisterNodeDefaultValue = func; | 638 xmlDeregisterNodeDefaultValue = func; |
658 return(old); | 639 return(old); |
659 } | 640 } |
660 | 641 |
661 xmlDeregisterNodeFunc | 642 xmlDeregisterNodeFunc |
662 xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func) | 643 xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func) |
663 { | 644 { |
664 xmlDeregisterNodeFunc old; | 645 xmlDeregisterNodeFunc old; |
665 | 646 |
666 xmlMutexLock(xmlThrDefMutex); | 647 xmlMutexLock(xmlThrDefMutex); |
667 old = xmlDeregisterNodeDefaultValueThrDef; | 648 old = xmlDeregisterNodeDefaultValueThrDef; |
668 | 649 |
669 __xmlRegisterCallbacks = 1; | 650 __xmlRegisterCallbacks = 1; |
670 xmlDeregisterNodeDefaultValueThrDef = func; | 651 xmlDeregisterNodeDefaultValueThrDef = func; |
671 xmlMutexUnlock(xmlThrDefMutex); | 652 xmlMutexUnlock(xmlThrDefMutex); |
672 | 653 |
673 return(old); | 654 return(old); |
674 } | 655 } |
675 | 656 |
676 xmlParserInputBufferCreateFilenameFunc | 657 xmlParserInputBufferCreateFilenameFunc |
677 xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilena
meFunc func) | 658 xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilena
meFunc func) |
678 { | 659 { |
679 xmlParserInputBufferCreateFilenameFunc old; | 660 xmlParserInputBufferCreateFilenameFunc old; |
680 | 661 |
681 xmlMutexLock(xmlThrDefMutex); | 662 xmlMutexLock(xmlThrDefMutex); |
682 old = xmlParserInputBufferCreateFilenameValueThrDef; | 663 old = xmlParserInputBufferCreateFilenameValueThrDef; |
683 if (old == NULL) { | 664 if (old == NULL) { |
684 old = __xmlParserInputBufferCreateFilename; | 665 old = __xmlParserInputBufferCreateFilename; |
685 } | 666 } |
686 | 667 |
687 xmlParserInputBufferCreateFilenameValueThrDef = func; | 668 xmlParserInputBufferCreateFilenameValueThrDef = func; |
688 xmlMutexUnlock(xmlThrDefMutex); | 669 xmlMutexUnlock(xmlThrDefMutex); |
689 | 670 |
690 return(old); | 671 return(old); |
691 } | 672 } |
692 | 673 |
693 xmlOutputBufferCreateFilenameFunc | 674 xmlOutputBufferCreateFilenameFunc |
694 xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc fun
c) | 675 xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc fun
c) |
695 { | 676 { |
696 xmlOutputBufferCreateFilenameFunc old; | 677 xmlOutputBufferCreateFilenameFunc old; |
697 | 678 |
698 xmlMutexLock(xmlThrDefMutex); | 679 xmlMutexLock(xmlThrDefMutex); |
699 old = xmlOutputBufferCreateFilenameValueThrDef; | 680 old = xmlOutputBufferCreateFilenameValueThrDef; |
700 #ifdef LIBXML_OUTPUT_ENABLED | 681 #ifdef LIBXML_OUTPUT_ENABLED |
701 if (old == NULL) { | 682 if (old == NULL) { |
702 old = __xmlOutputBufferCreateFilename; | 683 old = __xmlOutputBufferCreateFilename; |
703 } | 684 } |
704 #endif | 685 #endif |
705 xmlOutputBufferCreateFilenameValueThrDef = func; | 686 xmlOutputBufferCreateFilenameValueThrDef = func; |
706 xmlMutexUnlock(xmlThrDefMutex); | 687 xmlMutexUnlock(xmlThrDefMutex); |
707 | 688 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 * and were re-inserted at this point on June 10, 2004. Hope it's | 725 * and were re-inserted at this point on June 10, 2004. Hope it's |
745 * the right place for them :-) | 726 * the right place for them :-) |
746 */ | 727 */ |
747 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED) | 728 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED) |
748 #undef xmlMalloc | 729 #undef xmlMalloc |
749 xmlMallocFunc * | 730 xmlMallocFunc * |
750 __xmlMalloc(void){ | 731 __xmlMalloc(void){ |
751 if (IS_MAIN_THREAD) | 732 if (IS_MAIN_THREAD) |
752 return (&xmlMalloc); | 733 return (&xmlMalloc); |
753 else | 734 else |
754 » return (&xmlGetGlobalState()->xmlMalloc); | 735 » return (&xmlGetGlobalState()->xmlMalloc); |
755 } | 736 } |
756 | 737 |
757 #undef xmlMallocAtomic | 738 #undef xmlMallocAtomic |
758 xmlMallocFunc * | 739 xmlMallocFunc * |
759 __xmlMallocAtomic(void){ | 740 __xmlMallocAtomic(void){ |
760 if (IS_MAIN_THREAD) | 741 if (IS_MAIN_THREAD) |
761 return (&xmlMallocAtomic); | 742 return (&xmlMallocAtomic); |
762 else | 743 else |
763 return (&xmlGetGlobalState()->xmlMallocAtomic); | 744 return (&xmlGetGlobalState()->xmlMallocAtomic); |
764 } | 745 } |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 xmlOutputBufferCreateFilenameFunc * | 1105 xmlOutputBufferCreateFilenameFunc * |
1125 __xmlOutputBufferCreateFilenameValue(void) { | 1106 __xmlOutputBufferCreateFilenameValue(void) { |
1126 if (IS_MAIN_THREAD) | 1107 if (IS_MAIN_THREAD) |
1127 return (&xmlOutputBufferCreateFilenameValue); | 1108 return (&xmlOutputBufferCreateFilenameValue); |
1128 else | 1109 else |
1129 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue); | 1110 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue); |
1130 } | 1111 } |
1131 | 1112 |
1132 #define bottom_globals | 1113 #define bottom_globals |
1133 #include "elfgcchack.h" | 1114 #include "elfgcchack.h" |
OLD | NEW |