PageRenderTime 48ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/xmlParser/libxml/globals.h

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