elfgcchack.xsl 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xhtml="http://www.w3.org/1999/xhtml"
  4. version="1.0">
  5. <xsl:output method="text" encoding="ISO-8859-1"/>
  6. <xsl:template match="/">
  7. <xsl:text>/*
  8. * elfgcchack.h: hack by Arjan van de Ven &lt;arjanv@redhat.com&gt; to speed
  9. * up the code when using gcc for call within the library.
  10. *
  11. * Based on the analysis http://people.redhat.com/drepper/dsohowto.pdf
  12. * from Ulrich drepper. Rewritten to be generated from the XML description
  13. * file for libxml2 API
  14. * autogenerated with xsltproc doc/elfgcchack.xsl doc/libxml2-api.xml
  15. */
  16. #ifdef IN_LIBXML
  17. #ifdef __GNUC__
  18. #ifdef PIC
  19. #ifdef linux
  20. #if (__GNUC__ == 3 &amp;&amp; __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
  21. #include "libxml/c14n.h"
  22. #include "libxml/catalog.h"
  23. #include "libxml/chvalid.h"
  24. #include "libxml/debugXML.h"
  25. #include "libxml/dict.h"
  26. #include "libxml/DOCBparser.h"
  27. #include "libxml/encoding.h"
  28. #include "libxml/entities.h"
  29. #include "libxml/globals.h"
  30. #include "libxml/hash.h"
  31. #include "libxml/HTMLparser.h"
  32. #include "libxml/HTMLtree.h"
  33. #include "libxml/list.h"
  34. #include "libxml/nanoftp.h"
  35. #include "libxml/nanohttp.h"
  36. #include "libxml/parser.h"
  37. #include "libxml/parserInternals.h"
  38. #include "libxml/pattern.h"
  39. #include "libxml/relaxng.h"
  40. #include "libxml/SAX2.h"
  41. #include "libxml/SAX.h"
  42. #include "libxml/schemasInternals.h"
  43. #include "libxml/schematron.h"
  44. #include "libxml/threads.h"
  45. #include "libxml/tree.h"
  46. #include "libxml/uri.h"
  47. #include "libxml/valid.h"
  48. #include "libxml/xinclude.h"
  49. #include "libxml/xlink.h"
  50. #include "libxml/xmlautomata.h"
  51. #include "libxml/xmlerror.h"
  52. #include "libxml/xmlexports.h"
  53. #include "libxml/xmlIO.h"
  54. #include "libxml/xmlmemory.h"
  55. #include "libxml/xmlreader.h"
  56. #include "libxml/xmlregexp.h"
  57. #include "libxml/xmlsave.h"
  58. #include "libxml/xmlschemas.h"
  59. #include "libxml/xmlschemastypes.h"
  60. #include "libxml/xmlstring.h"
  61. #include "libxml/xmlunicode.h"
  62. #include "libxml/xmlversion.h"
  63. #include "libxml/xmlwriter.h"
  64. #include "libxml/xpath.h"
  65. #include "libxml/xpathInternals.h"
  66. #include "libxml/xpointer.h"
  67. #include "libxml/xmlmodule.h"
  68. /* special hot spot not exported ones */
  69. #ifdef bottom_globals
  70. #undef __xmlGenericError
  71. extern __typeof (__xmlGenericError) __xmlGenericError __attribute((alias("__xmlGenericError__internal_alias")));
  72. #else
  73. #ifndef __xmlGenericError
  74. extern __typeof (__xmlGenericError) __xmlGenericError__internal_alias __attribute((visibility("hidden")));
  75. #define __xmlGenericError __xmlGenericError__internal_alias
  76. #endif
  77. #endif
  78. #ifdef bottom_globals
  79. #undef __xmlGenericErrorContext
  80. extern __typeof (__xmlGenericErrorContext) __xmlGenericErrorContext __attribute((alias("__xmlGenericErrorContext__internal_alias")));
  81. #else
  82. #ifndef __xmlGenericErrorContext
  83. extern __typeof (__xmlGenericErrorContext) __xmlGenericErrorContext__internal_alias __attribute((visibility("hidden")));
  84. #define __xmlGenericErrorContext __xmlGenericErrorContext__internal_alias
  85. #endif
  86. #endif
  87. /* list generated from libxml2-api.xml */
  88. </xsl:text>
  89. <xsl:apply-templates select="/api/symbols/function"/>
  90. <xsl:text>
  91. #endif
  92. #endif
  93. #endif
  94. #endif
  95. #endif
  96. </xsl:text>
  97. </xsl:template>
  98. <xsl:template match="function">
  99. <xsl:variable name="str" select="string(@name)"/>
  100. <xsl:if test="(starts-with(@name, 'xml') or starts-with(@name, 'html') or contains(@name, 'Push') or contains(@name, 'Pop')) and (not(contains(@name, 'xmlDllMain')))">
  101. <xsl:variable name="alias" select="concat($str, '__internal_alias')"/>
  102. <xsl:apply-templates select="cond"/>
  103. <xsl:text>#ifdef bottom_</xsl:text>
  104. <xsl:value-of select="string(@module)"/>
  105. <xsl:text>
  106. #undef </xsl:text>
  107. <xsl:value-of select="$str"/>
  108. <xsl:text>
  109. extern __typeof (</xsl:text>
  110. <xsl:value-of select="$str"/>
  111. <xsl:text>) </xsl:text>
  112. <xsl:value-of select="$str"/>
  113. <xsl:text> __attribute((alias("</xsl:text>
  114. <xsl:value-of select="$alias"/>
  115. <xsl:text>")));
  116. #else
  117. #ifndef </xsl:text>
  118. <xsl:value-of select="$str"/>
  119. <xsl:text>
  120. </xsl:text>
  121. <xsl:text>extern __typeof (</xsl:text>
  122. <xsl:value-of select="$str"/>
  123. <xsl:text>) </xsl:text>
  124. <xsl:value-of select="$alias"/>
  125. <xsl:text> __attribute((visibility("hidden")));
  126. </xsl:text>
  127. <xsl:text>#define </xsl:text>
  128. <xsl:value-of select="$str"/>
  129. <xsl:text> </xsl:text>
  130. <xsl:value-of select="$alias"/>
  131. <xsl:text>
  132. #endif
  133. #endif
  134. </xsl:text>
  135. <xsl:apply-templates select="cond" mode="end"/>
  136. <xsl:text>
  137. </xsl:text>
  138. </xsl:if>
  139. </xsl:template>
  140. <xsl:template match="cond">
  141. <xsl:text>#if </xsl:text>
  142. <xsl:value-of select="."/>
  143. <xsl:text>
  144. </xsl:text>
  145. </xsl:template>
  146. <xsl:template match="cond" mode="end">
  147. <xsl:text>#endif
  148. </xsl:text>
  149. </xsl:template>
  150. </xsl:stylesheet>