summaryrefslogtreecommitdiffstats
path: root/libxml2/doc/checkapisym.xsl
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-11-17 21:10:17 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-11-17 21:10:17 (GMT)
commit8096d34300076a1aa9cb517de49fb920a051939f (patch)
tree5f2b1b7c41f89fedc31af973d6a747ca674cfd24 /libxml2/doc/checkapisym.xsl
parentfc7f7edd0b8011cb71573b15462ef83068d9e54b (diff)
parent574585fa78070b0cc6b5ad22543e21a3502a122b (diff)
downloadblt-8096d34300076a1aa9cb517de49fb920a051939f.zip
blt-8096d34300076a1aa9cb517de49fb920a051939f.tar.gz
blt-8096d34300076a1aa9cb517de49fb920a051939f.tar.bz2
Merge commit '574585fa78070b0cc6b5ad22543e21a3502a122b' as 'libxml2'
Diffstat (limited to 'libxml2/doc/checkapisym.xsl')
-rw-r--r--libxml2/doc/checkapisym.xsl48
1 files changed, 48 insertions, 0 deletions
diff --git a/libxml2/doc/checkapisym.xsl b/libxml2/doc/checkapisym.xsl
new file mode 100644
index 0000000..8591393
--- /dev/null
+++ b/libxml2/doc/checkapisym.xsl
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!-- This stylesheet is used to check that symbols exported
+ from libxml2-api.xml are also present in the symbol file
+ symbols.xml which is used to generate libxml2.syms setting
+ up the allowed access point to the shared libraries -->
+
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+ <xsl:output method="text" encoding="UTF-8"/>
+
+ <xsl:variable name="syms" select="document('symbols.xml')"/>
+
+ <xsl:template match="/">
+ <xsl:message terminate="no">
+ <xsl:text>Looking for functions in symbols.xml</xsl:text>
+ </xsl:message>
+ <xsl:apply-templates select="/api/symbols/function"/>
+ <xsl:message terminate="no">
+ <xsl:text>Found </xsl:text>
+ <xsl:value-of select="count(/api/symbols/function)"/>
+ <xsl:text> functions</xsl:text>
+ </xsl:message>
+ <xsl:message terminate="no">
+ <xsl:text>Looking for variables in symbols.xml</xsl:text>
+ </xsl:message>
+ <xsl:apply-templates select="/api/symbols/variable"/>
+ <xsl:message terminate="no">
+ <xsl:text>Found </xsl:text>
+ <xsl:value-of select="count(/api/symbols/variable)"/>
+ <xsl:text> variables</xsl:text>
+ </xsl:message>
+ </xsl:template>
+
+ <xsl:template match="function|variable">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:variable name="symbol"
+ select="$syms/symbols/release/symbol[. = $name]"/>
+ <xsl:if test="string($symbol) != $name">
+ <xsl:message terminate="yes">
+ <xsl:text>Failed to find export in symbols.xml: </xsl:text>
+ <xsl:value-of select="$name"/>
+ </xsl:message>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
+