You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

509 lines
14 KiB

4 years ago
  1. /*
  2. * Summary: interface for all global variables of the library
  3. * Description: all the global variables and thread handling for
  4. * those variables is handled by this module.
  5. *
  6. * The bottom of this file is automatically generated by build_glob.py
  7. * based on the description file global.data
  8. *
  9. * Copy: See Copyright for the status of this software.
  10. *
  11. * Author: Gary Pennington <Gary.Pennington@uk.sun.com>, Daniel Veillard
  12. */
  13. #ifndef __XML_GLOBALS_H
  14. #define __XML_GLOBALS_H
  15. #include <libxml/xmlversion.h>
  16. #include <libxml/parser.h>
  17. #include <libxml/xmlerror.h>
  18. #include <libxml/SAX.h>
  19. #include <libxml/SAX2.h>
  20. #include <libxml/xmlmemory.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. XMLPUBFUN void XMLCALL xmlInitGlobals(void);
  25. XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
  26. /**
  27. * xmlParserInputBufferCreateFilenameFunc:
  28. * @URI: the URI to read from
  29. * @enc: the requested source encoding
  30. *
  31. * Signature for the function doing the lookup for a suitable input method
  32. * corresponding to an URI.
  33. *
  34. * Returns the new xmlParserInputBufferPtr in case of success or NULL if no
  35. * method was found.
  36. */
  37. typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI,
  38. xmlCharEncoding enc);
  39. /**
  40. * xmlOutputBufferCreateFilenameFunc:
  41. * @URI: the URI to write to
  42. * @enc: the requested target encoding
  43. *
  44. * Signature for the function doing the lookup for a suitable output method
  45. * corresponding to an URI.
  46. *
  47. * Returns the new xmlOutputBufferPtr in case of success or NULL if no
  48. * method was found.
  49. */
  50. typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI,
  51. xmlCharEncodingHandlerPtr encoder,
  52. int compression);
  53. XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
  54. XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
  55. XMLPUBFUN xmlOutputBufferCreateFilenameFunc
  56. XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func);
  57. /*
  58. * Externally global symbols which need to be protected for backwards
  59. * compatibility support.
  60. */
  61. #undef docbDefaultSAXHandler
  62. #undef htmlDefaultSAXHandler
  63. #undef oldXMLWDcompatibility
  64. #undef xmlBufferAllocScheme
  65. #undef xmlDefaultBufferSize
  66. #undef xmlDefaultSAXHandler
  67. #undef xmlDefaultSAXLocator
  68. #undef xmlDoValidityCheckingDefaultValue
  69. #undef xmlFree
  70. #undef xmlGenericError
  71. #undef xmlStructuredError
  72. #undef xmlGenericErrorContext
  73. #undef xmlStructuredErrorContext
  74. #undef xmlGetWarningsDefaultValue
  75. #undef xmlIndentTreeOutput
  76. #undef xmlTreeIndentString
  77. #undef xmlKeepBlanksDefaultValue
  78. #undef xmlLineNumbersDefaultValue
  79. #undef xmlLoadExtDtdDefaultValue
  80. #undef xmlMalloc
  81. #undef xmlMallocAtomic
  82. #undef xmlMemStrdup
  83. #undef xmlParserDebugEntities
  84. #undef xmlParserVersion
  85. #undef xmlPedanticParserDefaultValue
  86. #undef xmlRealloc
  87. #undef xmlSaveNoEmptyTags
  88. #undef xmlSubstituteEntitiesDefaultValue
  89. #undef xmlRegisterNodeDefaultValue
  90. #undef xmlDeregisterNodeDefaultValue
  91. #undef xmlLastError
  92. #undef xmlParserInputBufferCreateFilenameValue
  93. #undef xmlOutputBufferCreateFilenameValue
  94. /**
  95. * xmlRegisterNodeFunc:
  96. * @node: the current node
  97. *
  98. * Signature for the registration callback of a created node
  99. */
  100. typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
  101. /**
  102. * xmlDeregisterNodeFunc:
  103. * @node: the current node
  104. *
  105. * Signature for the deregistration callback of a discarded node
  106. */
  107. typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
  108. typedef struct _xmlGlobalState xmlGlobalState;
  109. typedef xmlGlobalState *xmlGlobalStatePtr;
  110. struct _xmlGlobalState
  111. {
  112. const char *xmlParserVersion;
  113. xmlSAXLocator xmlDefaultSAXLocator;
  114. xmlSAXHandlerV1 xmlDefaultSAXHandler;
  115. xmlSAXHandlerV1 docbDefaultSAXHandler;
  116. xmlSAXHandlerV1 htmlDefaultSAXHandler;
  117. xmlFreeFunc xmlFree;
  118. xmlMallocFunc xmlMalloc;
  119. xmlStrdupFunc xmlMemStrdup;
  120. xmlReallocFunc xmlRealloc;
  121. xmlGenericErrorFunc xmlGenericError;
  122. xmlStructuredErrorFunc xmlStructuredError;
  123. void *xmlGenericErrorContext;
  124. int oldXMLWDcompatibility;
  125. xmlBufferAllocationScheme xmlBufferAllocScheme;
  126. int xmlDefaultBufferSize;
  127. int xmlSubstituteEntitiesDefaultValue;
  128. int xmlDoValidityCheckingDefaultValue;
  129. int xmlGetWarningsDefaultValue;
  130. int xmlKeepBlanksDefaultValue;
  131. int xmlLineNumbersDefaultValue;
  132. int xmlLoadExtDtdDefaultValue;
  133. int xmlParserDebugEntities;
  134. int xmlPedanticParserDefaultValue;
  135. int xmlSaveNoEmptyTags;
  136. int xmlIndentTreeOutput;
  137. const char *xmlTreeIndentString;
  138. xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
  139. xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
  140. xmlMallocFunc xmlMallocAtomic;
  141. xmlError xmlLastError;
  142. xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
  143. xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
  144. void *xmlStructuredErrorContext;
  145. };
  146. #ifdef __cplusplus
  147. }
  148. #endif
  149. #include <libxml/threads.h>
  150. #ifdef __cplusplus
  151. extern "C" {
  152. #endif
  153. XMLPUBFUN void XMLCALL xmlInitializeGlobalState(xmlGlobalStatePtr gs);
  154. XMLPUBFUN void XMLCALL xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler);
  155. XMLPUBFUN void XMLCALL xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler);
  156. XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlRegisterNodeDefault(xmlRegisterNodeFunc func);
  157. XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func);
  158. XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func);
  159. XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
  160. XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
  161. xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
  162. XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
  163. xmlThrDefParserInputBufferCreateFilenameDefault(
  164. xmlParserInputBufferCreateFilenameFunc func);
  165. /** DOC_DISABLE */
  166. /*
  167. * In general the memory allocation entry points are not kept
  168. * thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED
  169. * - xmlMalloc
  170. * - xmlMallocAtomic
  171. * - xmlRealloc
  172. * - xmlMemStrdup
  173. * - xmlFree
  174. */
  175. #ifdef LIBXML_THREAD_ALLOC_ENABLED
  176. #ifdef LIBXML_THREAD_ENABLED
  177. XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMalloc(void);
  178. #define xmlMalloc \
  179. (*(__xmlMalloc()))
  180. #else
  181. XMLPUBVAR xmlMallocFunc xmlMalloc;
  182. #endif
  183. #ifdef LIBXML_THREAD_ENABLED
  184. XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMallocAtomic(void);
  185. #define xmlMallocAtomic \
  186. (*(__xmlMallocAtomic()))
  187. #else
  188. XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
  189. #endif
  190. #ifdef LIBXML_THREAD_ENABLED
  191. XMLPUBFUN xmlReallocFunc * XMLCALL __xmlRealloc(void);
  192. #define xmlRealloc \
  193. (*(__xmlRealloc()))
  194. #else
  195. XMLPUBVAR xmlReallocFunc xmlRealloc;
  196. #endif
  197. #ifdef LIBXML_THREAD_ENABLED
  198. XMLPUBFUN xmlFreeFunc * XMLCALL __xmlFree(void);
  199. #define xmlFree \
  200. (*(__xmlFree()))
  201. #else
  202. XMLPUBVAR xmlFreeFunc xmlFree;
  203. #endif
  204. #ifdef LIBXML_THREAD_ENABLED
  205. XMLPUBFUN xmlStrdupFunc * XMLCALL __xmlMemStrdup(void);
  206. #define xmlMemStrdup \
  207. (*(__xmlMemStrdup()))
  208. #else
  209. XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
  210. #endif
  211. #else /* !LIBXML_THREAD_ALLOC_ENABLED */
  212. XMLPUBVAR xmlMallocFunc xmlMalloc;
  213. XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
  214. XMLPUBVAR xmlReallocFunc xmlRealloc;
  215. XMLPUBVAR xmlFreeFunc xmlFree;
  216. XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
  217. #endif /* LIBXML_THREAD_ALLOC_ENABLED */
  218. #ifdef LIBXML_DOCB_ENABLED
  219. XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void);
  220. #ifdef LIBXML_THREAD_ENABLED
  221. #define docbDefaultSAXHandler \
  222. (*(__docbDefaultSAXHandler()))
  223. #else
  224. XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler;
  225. #endif
  226. #endif
  227. #ifdef LIBXML_HTML_ENABLED
  228. XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void);
  229. #ifdef LIBXML_THREAD_ENABLED
  230. #define htmlDefaultSAXHandler \
  231. (*(__htmlDefaultSAXHandler()))
  232. #else
  233. XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler;
  234. #endif
  235. #endif
  236. XMLPUBFUN xmlError * XMLCALL __xmlLastError(void);
  237. #ifdef LIBXML_THREAD_ENABLED
  238. #define xmlLastError \
  239. (*(__xmlLastError()))
  240. #else
  241. XMLPUBVAR xmlError xmlLastError;
  242. #endif
  243. /*
  244. * Everything starting from the line below is
  245. * Automatically generated by build_glob.py.
  246. * Do not modify the previous line.
  247. */
  248. XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void);
  249. #ifdef LIBXML_THREAD_ENABLED
  250. #define oldXMLWDcompatibility \
  251. (*(__oldXMLWDcompatibility()))
  252. #else
  253. XMLPUBVAR int oldXMLWDcompatibility;
  254. #endif
  255. XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void);
  256. #ifdef LIBXML_THREAD_ENABLED
  257. #define xmlBufferAllocScheme \
  258. (*(__xmlBufferAllocScheme()))
  259. #else
  260. XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
  261. #endif
  262. XMLPUBFUN xmlBufferAllocationScheme XMLCALL
  263. xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
  264. XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void);
  265. #ifdef LIBXML_THREAD_ENABLED
  266. #define xmlDefaultBufferSize \
  267. (*(__xmlDefaultBufferSize()))
  268. #else
  269. XMLPUBVAR int xmlDefaultBufferSize;
  270. #endif
  271. XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v);
  272. XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void);
  273. #ifdef LIBXML_THREAD_ENABLED
  274. #define xmlDefaultSAXHandler \
  275. (*(__xmlDefaultSAXHandler()))
  276. #else
  277. XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler;
  278. #endif
  279. XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void);
  280. #ifdef LIBXML_THREAD_ENABLED
  281. #define xmlDefaultSAXLocator \
  282. (*(__xmlDefaultSAXLocator()))
  283. #else
  284. XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator;
  285. #endif
  286. XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void);
  287. #ifdef LIBXML_THREAD_ENABLED
  288. #define xmlDoValidityCheckingDefaultValue \
  289. (*(__xmlDoValidityCheckingDefaultValue()))
  290. #else
  291. XMLPUBVAR int xmlDoValidityCheckingDefaultValue;
  292. #endif
  293. XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v);
  294. XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void);
  295. #ifdef LIBXML_THREAD_ENABLED
  296. #define xmlGenericError \
  297. (*(__xmlGenericError()))
  298. #else
  299. XMLPUBVAR xmlGenericErrorFunc xmlGenericError;
  300. #endif
  301. XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void);
  302. #ifdef LIBXML_THREAD_ENABLED
  303. #define xmlStructuredError \
  304. (*(__xmlStructuredError()))
  305. #else
  306. XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
  307. #endif
  308. XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
  309. #ifdef LIBXML_THREAD_ENABLED
  310. #define xmlGenericErrorContext \
  311. (*(__xmlGenericErrorContext()))
  312. #else
  313. XMLPUBVAR void * xmlGenericErrorContext;
  314. #endif
  315. XMLPUBFUN void * * XMLCALL __xmlStructuredErrorContext(void);
  316. #ifdef LIBXML_THREAD_ENABLED
  317. #define xmlStructuredErrorContext \
  318. (*(__xmlStructuredErrorContext()))
  319. #else
  320. XMLPUBVAR void * xmlStructuredErrorContext;
  321. #endif
  322. XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void);
  323. #ifdef LIBXML_THREAD_ENABLED
  324. #define xmlGetWarningsDefaultValue \
  325. (*(__xmlGetWarningsDefaultValue()))
  326. #else
  327. XMLPUBVAR int xmlGetWarningsDefaultValue;
  328. #endif
  329. XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v);
  330. XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void);
  331. #ifdef LIBXML_THREAD_ENABLED
  332. #define xmlIndentTreeOutput \
  333. (*(__xmlIndentTreeOutput()))
  334. #else
  335. XMLPUBVAR int xmlIndentTreeOutput;
  336. #endif
  337. XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v);
  338. XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void);
  339. #ifdef LIBXML_THREAD_ENABLED
  340. #define xmlTreeIndentString \
  341. (*(__xmlTreeIndentString()))
  342. #else
  343. XMLPUBVAR const char * xmlTreeIndentString;
  344. #endif
  345. XMLPUBFUN const char * XMLCALL xmlThrDefTreeIndentString(const char * v);
  346. XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void);
  347. #ifdef LIBXML_THREAD_ENABLED
  348. #define xmlKeepBlanksDefaultValue \
  349. (*(__xmlKeepBlanksDefaultValue()))
  350. #else
  351. XMLPUBVAR int xmlKeepBlanksDefaultValue;
  352. #endif
  353. XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v);
  354. XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void);
  355. #ifdef LIBXML_THREAD_ENABLED
  356. #define xmlLineNumbersDefaultValue \
  357. (*(__xmlLineNumbersDefaultValue()))
  358. #else
  359. XMLPUBVAR int xmlLineNumbersDefaultValue;
  360. #endif
  361. XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v);
  362. XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void);
  363. #ifdef LIBXML_THREAD_ENABLED
  364. #define xmlLoadExtDtdDefaultValue \
  365. (*(__xmlLoadExtDtdDefaultValue()))
  366. #else
  367. XMLPUBVAR int xmlLoadExtDtdDefaultValue;
  368. #endif
  369. XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v);
  370. XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void);
  371. #ifdef LIBXML_THREAD_ENABLED
  372. #define xmlParserDebugEntities \
  373. (*(__xmlParserDebugEntities()))
  374. #else
  375. XMLPUBVAR int xmlParserDebugEntities;
  376. #endif
  377. XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v);
  378. XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void);
  379. #ifdef LIBXML_THREAD_ENABLED
  380. #define xmlParserVersion \
  381. (*(__xmlParserVersion()))
  382. #else
  383. XMLPUBVAR const char * xmlParserVersion;
  384. #endif
  385. XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void);
  386. #ifdef LIBXML_THREAD_ENABLED
  387. #define xmlPedanticParserDefaultValue \
  388. (*(__xmlPedanticParserDefaultValue()))
  389. #else
  390. XMLPUBVAR int xmlPedanticParserDefaultValue;
  391. #endif
  392. XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v);
  393. XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void);
  394. #ifdef LIBXML_THREAD_ENABLED
  395. #define xmlSaveNoEmptyTags \
  396. (*(__xmlSaveNoEmptyTags()))
  397. #else
  398. XMLPUBVAR int xmlSaveNoEmptyTags;
  399. #endif
  400. XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v);
  401. XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void);
  402. #ifdef LIBXML_THREAD_ENABLED
  403. #define xmlSubstituteEntitiesDefaultValue \
  404. (*(__xmlSubstituteEntitiesDefaultValue()))
  405. #else
  406. XMLPUBVAR int xmlSubstituteEntitiesDefaultValue;
  407. #endif
  408. XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v);
  409. XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void);
  410. #ifdef LIBXML_THREAD_ENABLED
  411. #define xmlRegisterNodeDefaultValue \
  412. (*(__xmlRegisterNodeDefaultValue()))
  413. #else
  414. XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
  415. #endif
  416. XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void);
  417. #ifdef LIBXML_THREAD_ENABLED
  418. #define xmlDeregisterNodeDefaultValue \
  419. (*(__xmlDeregisterNodeDefaultValue()))
  420. #else
  421. XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
  422. #endif
  423. XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL \
  424. __xmlParserInputBufferCreateFilenameValue(void);
  425. #ifdef LIBXML_THREAD_ENABLED
  426. #define xmlParserInputBufferCreateFilenameValue \
  427. (*(__xmlParserInputBufferCreateFilenameValue()))
  428. #else
  429. XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
  430. #endif
  431. XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void);
  432. #ifdef LIBXML_THREAD_ENABLED
  433. #define xmlOutputBufferCreateFilenameValue \
  434. (*(__xmlOutputBufferCreateFilenameValue()))
  435. #else
  436. XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
  437. #endif
  438. #ifdef __cplusplus
  439. }
  440. #endif
  441. #endif /* __XML_GLOBALS_H */