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 28 matching lines...) Expand all Loading... |
39 */ | 39 */ |
40 static xmlMutexPtr xmlThrDefMutex = NULL; | 40 static xmlMutexPtr xmlThrDefMutex = NULL; |
41 | 41 |
42 /** | 42 /** |
43 * xmlInitGlobals: | 43 * xmlInitGlobals: |
44 * | 44 * |
45 * Additional initialisation for multi-threading | 45 * Additional initialisation for multi-threading |
46 */ | 46 */ |
47 void xmlInitGlobals(void) | 47 void xmlInitGlobals(void) |
48 { | 48 { |
49 xmlThrDefMutex = xmlNewMutex(); | 49 if (xmlThrDefMutex == NULL) |
| 50 xmlThrDefMutex = xmlNewMutex(); |
50 } | 51 } |
51 | 52 |
52 /** | 53 /** |
53 * xmlCleanupGlobals: | 54 * xmlCleanupGlobals: |
54 * | 55 * |
55 * Additional cleanup for multi-threading | 56 * Additional cleanup for multi-threading |
56 */ | 57 */ |
57 void xmlCleanupGlobals(void) | 58 void xmlCleanupGlobals(void) |
58 { | 59 { |
59 if (xmlThrDefMutex != NULL) { | 60 if (xmlThrDefMutex != NULL) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 #undef htmlDefaultSAXHandler | 142 #undef htmlDefaultSAXHandler |
142 #undef oldXMLWDcompatibility | 143 #undef oldXMLWDcompatibility |
143 #undef xmlBufferAllocScheme | 144 #undef xmlBufferAllocScheme |
144 #undef xmlDefaultBufferSize | 145 #undef xmlDefaultBufferSize |
145 #undef xmlDefaultSAXHandler | 146 #undef xmlDefaultSAXHandler |
146 #undef xmlDefaultSAXLocator | 147 #undef xmlDefaultSAXLocator |
147 #undef xmlDoValidityCheckingDefaultValue | 148 #undef xmlDoValidityCheckingDefaultValue |
148 #undef xmlGenericError | 149 #undef xmlGenericError |
149 #undef xmlStructuredError | 150 #undef xmlStructuredError |
150 #undef xmlGenericErrorContext | 151 #undef xmlGenericErrorContext |
| 152 #undef xmlStructuredErrorContext |
151 #undef xmlGetWarningsDefaultValue | 153 #undef xmlGetWarningsDefaultValue |
152 #undef xmlIndentTreeOutput | 154 #undef xmlIndentTreeOutput |
153 #undef xmlTreeIndentString | 155 #undef xmlTreeIndentString |
154 #undef xmlKeepBlanksDefaultValue | 156 #undef xmlKeepBlanksDefaultValue |
155 #undef xmlLineNumbersDefaultValue | 157 #undef xmlLineNumbersDefaultValue |
156 #undef xmlLoadExtDtdDefaultValue | 158 #undef xmlLoadExtDtdDefaultValue |
157 #undef xmlParserDebugEntities | 159 #undef xmlParserDebugEntities |
158 #undef xmlParserVersion | 160 #undef xmlParserVersion |
159 #undef xmlPedanticParserDefaultValue | 161 #undef xmlPedanticParserDefaultValue |
160 #undef xmlSaveNoEmptyTags | 162 #undef xmlSaveNoEmptyTags |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 */ | 309 */ |
308 xmlStructuredErrorFunc xmlStructuredError = NULL; | 310 xmlStructuredErrorFunc xmlStructuredError = NULL; |
309 static xmlStructuredErrorFunc xmlStructuredErrorThrDef = NULL; | 311 static xmlStructuredErrorFunc xmlStructuredErrorThrDef = NULL; |
310 /** | 312 /** |
311 * xmlGenericErrorContext: | 313 * xmlGenericErrorContext: |
312 * | 314 * |
313 * Global setting passed to generic error callbacks | 315 * Global setting passed to generic error callbacks |
314 */ | 316 */ |
315 void *xmlGenericErrorContext = NULL; | 317 void *xmlGenericErrorContext = NULL; |
316 static void *xmlGenericErrorContextThrDef = NULL; | 318 static void *xmlGenericErrorContextThrDef = NULL; |
| 319 /** |
| 320 * xmlStructuredErrorContext: |
| 321 * |
| 322 * Global setting passed to structured error callbacks |
| 323 */ |
| 324 void *xmlStructuredErrorContext = NULL; |
| 325 static void *xmlStructuredErrorContextThrDef = NULL; |
317 xmlError xmlLastError; | 326 xmlError xmlLastError; |
318 | 327 |
319 /* | 328 /* |
320 * output defaults | 329 * output defaults |
321 */ | 330 */ |
322 /** | 331 /** |
323 * xmlIndentTreeOutput: | 332 * xmlIndentTreeOutput: |
324 * | 333 * |
325 * Global setting, asking the serializer to indent the output tree by default | 334 * Global setting, asking the serializer to indent the output tree by default |
326 * Enabled by default | 335 * Enabled by default |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef; | 547 gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef; |
539 gs->xmlParserVersion = LIBXML_VERSION_STRING; | 548 gs->xmlParserVersion = LIBXML_VERSION_STRING; |
540 gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; | 549 gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; |
541 gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; | 550 gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; |
542 gs->xmlSubstituteEntitiesDefaultValue = | 551 gs->xmlSubstituteEntitiesDefaultValue = |
543 xmlSubstituteEntitiesDefaultValueThrDef; | 552 xmlSubstituteEntitiesDefaultValueThrDef; |
544 | 553 |
545 gs->xmlGenericError = xmlGenericErrorThrDef; | 554 gs->xmlGenericError = xmlGenericErrorThrDef; |
546 gs->xmlStructuredError = xmlStructuredErrorThrDef; | 555 gs->xmlStructuredError = xmlStructuredErrorThrDef; |
547 gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef; | 556 gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef; |
| 557 gs->xmlStructuredErrorContext = xmlStructuredErrorContextThrDef; |
548 gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef; | 558 gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef; |
549 gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef; | 559 gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef; |
550 | 560 |
551 gs->xmlParserInputBufferCreateFilenameValue = xmlParserInputBufferCreate
FilenameValueThrDef; | 561 gs->xmlParserInputBufferCreateFilenameValue = xmlParserInputBufferCreate
FilenameValueThrDef; |
552 gs->xmlOutputBufferCreateFilenameValue = xmlOutputBufferCreateFilenameVa
lueThrDef; | 562 gs->xmlOutputBufferCreateFilenameValue = xmlOutputBufferCreateFilenameVa
lueThrDef; |
553 memset(&gs->xmlLastError, 0, sizeof(xmlError)); | 563 memset(&gs->xmlLastError, 0, sizeof(xmlError)); |
554 | 564 |
555 xmlMutexUnlock(xmlThrDefMutex); | 565 xmlMutexUnlock(xmlThrDefMutex); |
556 } | 566 } |
557 | 567 |
558 /** | 568 /** |
559 * DOC_DISABLE : we ignore missing doc for the xmlThrDef functions, | 569 * DOC_DISABLE : we ignore missing doc for the xmlThrDef functions, |
560 * those are really internal work | 570 * those are really internal work |
561 */ | 571 */ |
562 void | 572 void |
563 xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) { | 573 xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) { |
564 xmlMutexLock(xmlThrDefMutex); | 574 xmlMutexLock(xmlThrDefMutex); |
565 xmlGenericErrorContextThrDef = ctx; | 575 xmlGenericErrorContextThrDef = ctx; |
566 if (handler != NULL) | 576 if (handler != NULL) |
567 xmlGenericErrorThrDef = handler; | 577 xmlGenericErrorThrDef = handler; |
568 else | 578 else |
569 xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc; | 579 xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc; |
570 xmlMutexUnlock(xmlThrDefMutex); | 580 xmlMutexUnlock(xmlThrDefMutex); |
571 } | 581 } |
572 | 582 |
573 void | 583 void |
574 xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) { | 584 xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) { |
575 xmlMutexLock(xmlThrDefMutex); | 585 xmlMutexLock(xmlThrDefMutex); |
576 xmlGenericErrorContextThrDef = ctx; | 586 xmlStructuredErrorContextThrDef = ctx; |
577 xmlStructuredErrorThrDef = handler; | 587 xmlStructuredErrorThrDef = handler; |
578 xmlMutexUnlock(xmlThrDefMutex); | 588 xmlMutexUnlock(xmlThrDefMutex); |
579 } | 589 } |
580 | 590 |
581 /** | 591 /** |
582 * xmlRegisterNodeDefault: | 592 * xmlRegisterNodeDefault: |
583 * @func: function pointer to the new RegisterNodeFunc | 593 * @func: function pointer to the new RegisterNodeFunc |
584 * | 594 * |
585 * Registers a callback for node creation | 595 * Registers a callback for node creation |
586 * | 596 * |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 | 879 |
870 #undef xmlGenericErrorContext | 880 #undef xmlGenericErrorContext |
871 void * * | 881 void * * |
872 __xmlGenericErrorContext(void) { | 882 __xmlGenericErrorContext(void) { |
873 if (IS_MAIN_THREAD) | 883 if (IS_MAIN_THREAD) |
874 return (&xmlGenericErrorContext); | 884 return (&xmlGenericErrorContext); |
875 else | 885 else |
876 return (&xmlGetGlobalState()->xmlGenericErrorContext); | 886 return (&xmlGetGlobalState()->xmlGenericErrorContext); |
877 } | 887 } |
878 | 888 |
| 889 #undef xmlStructuredErrorContext |
| 890 void * * |
| 891 __xmlStructuredErrorContext(void) { |
| 892 if (IS_MAIN_THREAD) |
| 893 return (&xmlStructuredErrorContext); |
| 894 else |
| 895 return (&xmlGetGlobalState()->xmlStructuredErrorContext); |
| 896 } |
| 897 |
879 #undef xmlGetWarningsDefaultValue | 898 #undef xmlGetWarningsDefaultValue |
880 int * | 899 int * |
881 __xmlGetWarningsDefaultValue(void) { | 900 __xmlGetWarningsDefaultValue(void) { |
882 if (IS_MAIN_THREAD) | 901 if (IS_MAIN_THREAD) |
883 return (&xmlGetWarningsDefaultValue); | 902 return (&xmlGetWarningsDefaultValue); |
884 else | 903 else |
885 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue); | 904 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue); |
886 } | 905 } |
887 int xmlThrDefGetWarningsDefaultValue(int v) { | 906 int xmlThrDefGetWarningsDefaultValue(int v) { |
888 int ret; | 907 int ret; |
(...skipping 14 matching lines...) Expand all Loading... |
903 } | 922 } |
904 int xmlThrDefIndentTreeOutput(int v) { | 923 int xmlThrDefIndentTreeOutput(int v) { |
905 int ret; | 924 int ret; |
906 xmlMutexLock(xmlThrDefMutex); | 925 xmlMutexLock(xmlThrDefMutex); |
907 ret = xmlIndentTreeOutputThrDef; | 926 ret = xmlIndentTreeOutputThrDef; |
908 xmlIndentTreeOutputThrDef = v; | 927 xmlIndentTreeOutputThrDef = v; |
909 xmlMutexUnlock(xmlThrDefMutex); | 928 xmlMutexUnlock(xmlThrDefMutex); |
910 return ret; | 929 return ret; |
911 } | 930 } |
912 | 931 |
913 #undef xmlTreeIndentString | 932 #undef» xmlTreeIndentString |
914 const char * * | 933 const char * * |
915 __xmlTreeIndentString(void) { | 934 __xmlTreeIndentString(void) { |
916 if (IS_MAIN_THREAD) | 935 if (IS_MAIN_THREAD) |
917 return (&xmlTreeIndentString); | 936 return (&xmlTreeIndentString); |
918 else | 937 else |
919 return (&xmlGetGlobalState()->xmlTreeIndentString); | 938 return (&xmlGetGlobalState()->xmlTreeIndentString); |
920 } | 939 } |
921 const char * xmlThrDefTreeIndentString(const char * v) { | 940 const char * xmlThrDefTreeIndentString(const char * v) { |
922 const char * ret; | 941 const char * ret; |
923 xmlMutexLock(xmlThrDefMutex); | 942 xmlMutexLock(xmlThrDefMutex); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 xmlOutputBufferCreateFilenameFunc * | 1105 xmlOutputBufferCreateFilenameFunc * |
1087 __xmlOutputBufferCreateFilenameValue(void) { | 1106 __xmlOutputBufferCreateFilenameValue(void) { |
1088 if (IS_MAIN_THREAD) | 1107 if (IS_MAIN_THREAD) |
1089 return (&xmlOutputBufferCreateFilenameValue); | 1108 return (&xmlOutputBufferCreateFilenameValue); |
1090 else | 1109 else |
1091 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue); | 1110 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue); |
1092 } | 1111 } |
1093 | 1112 |
1094 #define bottom_globals | 1113 #define bottom_globals |
1095 #include "elfgcchack.h" | 1114 #include "elfgcchack.h" |
OLD | NEW |