globals.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  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/SAX2.h>
  19. #include <libxml/xmlmemory.h>
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. XML_DEPRECATED
  24. XMLPUBFUN void XMLCALL xmlInitGlobals(void);
  25. XML_DEPRECATED
  26. XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
  27. /**
  28. * xmlParserInputBufferCreateFilenameFunc:
  29. * @URI: the URI to read from
  30. * @enc: the requested source encoding
  31. *
  32. * Signature for the function doing the lookup for a suitable input method
  33. * corresponding to an URI.
  34. *
  35. * Returns the new xmlParserInputBufferPtr in case of success or NULL if no
  36. * method was found.
  37. */
  38. typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI,
  39. xmlCharEncoding enc);
  40. /**
  41. * xmlOutputBufferCreateFilenameFunc:
  42. * @URI: the URI to write to
  43. * @enc: the requested target encoding
  44. *
  45. * Signature for the function doing the lookup for a suitable output method
  46. * corresponding to an URI.
  47. *
  48. * Returns the new xmlOutputBufferPtr in case of success or NULL if no
  49. * method was found.
  50. */
  51. typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI,
  52. xmlCharEncodingHandlerPtr encoder,
  53. int compression);
  54. XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
  55. XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
  56. XMLPUBFUN xmlOutputBufferCreateFilenameFunc
  57. XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func);
  58. /*
  59. * Externally global symbols which need to be protected for backwards
  60. * compatibility support.
  61. */
  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; /* unused */
  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_HTML_ENABLED
  219. XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void);
  220. #ifdef LIBXML_THREAD_ENABLED
  221. #define htmlDefaultSAXHandler \
  222. (*(__htmlDefaultSAXHandler()))
  223. #else
  224. XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler;
  225. #endif
  226. #endif
  227. XMLPUBFUN xmlError * XMLCALL __xmlLastError(void);
  228. #ifdef LIBXML_THREAD_ENABLED
  229. #define xmlLastError \
  230. (*(__xmlLastError()))
  231. #else
  232. XMLPUBVAR xmlError xmlLastError;
  233. #endif
  234. /*
  235. * Everything starting from the line below is
  236. * Automatically generated by build_glob.py.
  237. * Do not modify the previous line.
  238. */
  239. XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void);
  240. #ifdef LIBXML_THREAD_ENABLED
  241. #define oldXMLWDcompatibility \
  242. (*(__oldXMLWDcompatibility()))
  243. #else
  244. XMLPUBVAR int oldXMLWDcompatibility;
  245. #endif
  246. XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void);
  247. #ifdef LIBXML_THREAD_ENABLED
  248. #define xmlBufferAllocScheme \
  249. (*(__xmlBufferAllocScheme()))
  250. #else
  251. XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
  252. #endif
  253. XMLPUBFUN xmlBufferAllocationScheme XMLCALL
  254. xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
  255. XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void);
  256. #ifdef LIBXML_THREAD_ENABLED
  257. #define xmlDefaultBufferSize \
  258. (*(__xmlDefaultBufferSize()))
  259. #else
  260. XMLPUBVAR int xmlDefaultBufferSize;
  261. #endif
  262. XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v);
  263. XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void);
  264. #ifdef LIBXML_THREAD_ENABLED
  265. #define xmlDefaultSAXHandler \
  266. (*(__xmlDefaultSAXHandler()))
  267. #else
  268. XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler;
  269. #endif
  270. XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void);
  271. #ifdef LIBXML_THREAD_ENABLED
  272. #define xmlDefaultSAXLocator \
  273. (*(__xmlDefaultSAXLocator()))
  274. #else
  275. XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator;
  276. #endif
  277. XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void);
  278. #ifdef LIBXML_THREAD_ENABLED
  279. #define xmlDoValidityCheckingDefaultValue \
  280. (*(__xmlDoValidityCheckingDefaultValue()))
  281. #else
  282. XMLPUBVAR int xmlDoValidityCheckingDefaultValue;
  283. #endif
  284. XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v);
  285. XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void);
  286. #ifdef LIBXML_THREAD_ENABLED
  287. #define xmlGenericError \
  288. (*(__xmlGenericError()))
  289. #else
  290. XMLPUBVAR xmlGenericErrorFunc xmlGenericError;
  291. #endif
  292. XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void);
  293. #ifdef LIBXML_THREAD_ENABLED
  294. #define xmlStructuredError \
  295. (*(__xmlStructuredError()))
  296. #else
  297. XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
  298. #endif
  299. XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
  300. #ifdef LIBXML_THREAD_ENABLED
  301. #define xmlGenericErrorContext \
  302. (*(__xmlGenericErrorContext()))
  303. #else
  304. XMLPUBVAR void * xmlGenericErrorContext;
  305. #endif
  306. XMLPUBFUN void * * XMLCALL __xmlStructuredErrorContext(void);
  307. #ifdef LIBXML_THREAD_ENABLED
  308. #define xmlStructuredErrorContext \
  309. (*(__xmlStructuredErrorContext()))
  310. #else
  311. XMLPUBVAR void * xmlStructuredErrorContext;
  312. #endif
  313. XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void);
  314. #ifdef LIBXML_THREAD_ENABLED
  315. #define xmlGetWarningsDefaultValue \
  316. (*(__xmlGetWarningsDefaultValue()))
  317. #else
  318. XMLPUBVAR int xmlGetWarningsDefaultValue;
  319. #endif
  320. XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v);
  321. XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void);
  322. #ifdef LIBXML_THREAD_ENABLED
  323. #define xmlIndentTreeOutput \
  324. (*(__xmlIndentTreeOutput()))
  325. #else
  326. XMLPUBVAR int xmlIndentTreeOutput;
  327. #endif
  328. XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v);
  329. XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void);
  330. #ifdef LIBXML_THREAD_ENABLED
  331. #define xmlTreeIndentString \
  332. (*(__xmlTreeIndentString()))
  333. #else
  334. XMLPUBVAR const char * xmlTreeIndentString;
  335. #endif
  336. XMLPUBFUN const char * XMLCALL xmlThrDefTreeIndentString(const char * v);
  337. XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void);
  338. #ifdef LIBXML_THREAD_ENABLED
  339. #define xmlKeepBlanksDefaultValue \
  340. (*(__xmlKeepBlanksDefaultValue()))
  341. #else
  342. XMLPUBVAR int xmlKeepBlanksDefaultValue;
  343. #endif
  344. XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v);
  345. XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void);
  346. #ifdef LIBXML_THREAD_ENABLED
  347. #define xmlLineNumbersDefaultValue \
  348. (*(__xmlLineNumbersDefaultValue()))
  349. #else
  350. XMLPUBVAR int xmlLineNumbersDefaultValue;
  351. #endif
  352. XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v);
  353. XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void);
  354. #ifdef LIBXML_THREAD_ENABLED
  355. #define xmlLoadExtDtdDefaultValue \
  356. (*(__xmlLoadExtDtdDefaultValue()))
  357. #else
  358. XMLPUBVAR int xmlLoadExtDtdDefaultValue;
  359. #endif
  360. XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v);
  361. XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void);
  362. #ifdef LIBXML_THREAD_ENABLED
  363. #define xmlParserDebugEntities \
  364. (*(__xmlParserDebugEntities()))
  365. #else
  366. XMLPUBVAR int xmlParserDebugEntities;
  367. #endif
  368. XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v);
  369. XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void);
  370. #ifdef LIBXML_THREAD_ENABLED
  371. #define xmlParserVersion \
  372. (*(__xmlParserVersion()))
  373. #else
  374. XMLPUBVAR const char * xmlParserVersion;
  375. #endif
  376. XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void);
  377. #ifdef LIBXML_THREAD_ENABLED
  378. #define xmlPedanticParserDefaultValue \
  379. (*(__xmlPedanticParserDefaultValue()))
  380. #else
  381. XMLPUBVAR int xmlPedanticParserDefaultValue;
  382. #endif
  383. XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v);
  384. XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void);
  385. #ifdef LIBXML_THREAD_ENABLED
  386. #define xmlSaveNoEmptyTags \
  387. (*(__xmlSaveNoEmptyTags()))
  388. #else
  389. XMLPUBVAR int xmlSaveNoEmptyTags;
  390. #endif
  391. XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v);
  392. XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void);
  393. #ifdef LIBXML_THREAD_ENABLED
  394. #define xmlSubstituteEntitiesDefaultValue \
  395. (*(__xmlSubstituteEntitiesDefaultValue()))
  396. #else
  397. XMLPUBVAR int xmlSubstituteEntitiesDefaultValue;
  398. #endif
  399. XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v);
  400. XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void);
  401. #ifdef LIBXML_THREAD_ENABLED
  402. #define xmlRegisterNodeDefaultValue \
  403. (*(__xmlRegisterNodeDefaultValue()))
  404. #else
  405. XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
  406. #endif
  407. XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void);
  408. #ifdef LIBXML_THREAD_ENABLED
  409. #define xmlDeregisterNodeDefaultValue \
  410. (*(__xmlDeregisterNodeDefaultValue()))
  411. #else
  412. XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
  413. #endif
  414. XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL \
  415. __xmlParserInputBufferCreateFilenameValue(void);
  416. #ifdef LIBXML_THREAD_ENABLED
  417. #define xmlParserInputBufferCreateFilenameValue \
  418. (*(__xmlParserInputBufferCreateFilenameValue()))
  419. #else
  420. XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
  421. #endif
  422. XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void);
  423. #ifdef LIBXML_THREAD_ENABLED
  424. #define xmlOutputBufferCreateFilenameValue \
  425. (*(__xmlOutputBufferCreateFilenameValue()))
  426. #else
  427. XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
  428. #endif
  429. #ifdef __cplusplus
  430. }
  431. #endif
  432. #endif /* __XML_GLOBALS_H */