/usr/share/yelp-xsl/xslt/docbook/html/db2html-funcsynopsis.xsl is in yelp-xsl 3.18.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<!--
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:str="http://exslt.org/strings"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="db str"
version="1.0">
<!--!!==========================================================================
DocBook to HTML - Function Synopses
:Requires: db2html-block db2html-inline
REMARK: Describe this module
-->
<!--@@==========================================================================
db2html.funcsynopsis.style
How to render #{funcsynopsis} elements
This parameter controls the indentation style used to render #{funcsynopsis}
elements. Supported values are #{'KR'} and #{'ANSI'}. This value can also
be set with the #{db2html.funcsynopsis.style} processing instruction at the
top of the XML document. The same processing instruction or inside a
#{funcsynopsis} element will override this setting for that synopsis.
-->
<xsl:param name="db2html.funcsynopsis.style">
<xsl:choose>
<xsl:when test="/processing-instruction('db2html.funcsynopsis.style')">
<xsl:value-of select="/processing-instruction('db2html.funcsynopsis.style')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'ANSI'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!-- == Matched Templates == -->
<!-- = funcdef = -->
<xsl:template match="funcdef | db:funcdef">
<xsl:call-template name="db2html.inline"/>
</xsl:template>
<!-- = funcparams = -->
<xsl:template match="funcparams | db:funcparams">
<xsl:text>(</xsl:text>
<xsl:call-template name="db2html.inline"/>
<xsl:text>)</xsl:text>
</xsl:template>
<!-- = funcprototype = -->
<xsl:template match="funcprototype | db:funcprototype">
<xsl:variable name="style">
<xsl:choose>
<xsl:when test="../processing-instruction('db2html.funcsynopsis.style')">
<xsl:value-of select="../processing-instruction('db2html.funcsynopsis.style')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$db2html.funcsynopsis.style"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="funcdef/preceding-sibling::modifier |
db:funcdef/preceding-sibling::db:modifier">
<xsl:apply-templates select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:apply-templates select="funcdef | db:funcdef"/>
<xsl:text> (</xsl:text>
<xsl:choose>
<xsl:when test="$style = 'KR'">
<xsl:for-each select="void | varargs | paramdef |
db:void | db:varargs | db:paramdef">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:choose>
<xsl:when test="self::paramdef or self::db:paramdef">
<xsl:call-template name="db2html.inline">
<xsl:with-param name="node" select="."/>
<xsl:with-param name="children" select="parameter | db:parameter"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text>)</xsl:text>
<xsl:for-each select="funcdef/following-sibling::modifier |
db:funcdef/following-sibling::db:modifier">
<xsl:text> </xsl:text>
<xsl:apply-templates select="."/>
</xsl:for-each>
<xsl:text>;</xsl:text>
<xsl:for-each select="paramdef | db:paramdef">
<xsl:text>
 </xsl:text>
<xsl:apply-templates select="."/>
<xsl:text>;</xsl:text>
</xsl:for-each>
</xsl:when>
<!-- ANSI is the default -->
<xsl:otherwise>
<xsl:variable name="indent">
<xsl:call-template name="_db2html.funcsynopsis.pad">
<xsl:with-param name="nodes"
select="funcdef | funcdef/preceding-sibling::modifier|
db:funcdef |
db:fundef/preceding-sibling::db:modifier"/>
</xsl:call-template>
<xsl:value-of select="str:padding(count(funcdef/preceding-sibling::modifier) +
count(db:funcdef/preceding-sibling::db:modifier) + 2)"/>
</xsl:variable>
<xsl:for-each select="void | varargs | paramdef |
db:void | db:varargs | db:paramdef">
<xsl:if test="position() != 1">
<xsl:text>,
</xsl:text>
<xsl:value-of select="$indent"/>
</xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
<xsl:text>)</xsl:text>
<xsl:for-each select="funcdef/following-sibling::modifier |
db:funcdef/following-sibling::db:modifier">
<xsl:text> </xsl:text>
<xsl:apply-templates select="."/>
</xsl:for-each>
<xsl:text>;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- = funcsynopsis = -->
<xsl:template match="funcsynopsis | db:funcsynopsis">
<xsl:call-template name="db2html.pre">
<xsl:with-param name="node" select="."/>
<xsl:with-param name="children" select="*"/>
<xsl:with-param name="class" select="'synopsis'"/>
</xsl:call-template>
</xsl:template>
<!-- = funcsynopsisinfo = -->
<xsl:template match="funcsynopsisinfo | db:funcsynopsisinfo">
<xsl:call-template name="db2html.pre"/>
</xsl:template>
<!-- = initializer = -->
<xsl:template match="initializer | db:initializer">
<xsl:call-template name="db2html.inline"/>
</xsl:template>
<!-- = modifier = -->
<xsl:template match="modifier | db:modifier">
<xsl:call-template name="db2html.inline"/>
</xsl:template>
<!-- = paramdef = -->
<xsl:template match="paramdef | db:paramdef">
<xsl:call-template name="db2html.inline"/>
</xsl:template>
<!-- = varargs = -->
<xsl:template match="varargs | db:varargs">
<xsl:text>...</xsl:text>
</xsl:template>
<!-- = void = -->
<xsl:template match="void | db:void">
<xsl:text>void</xsl:text>
</xsl:template>
<!-- == Utility Templates == -->
<!--#* _db2html.funcsynopsis.pad -->
<xsl:template name="_db2html.funcsynopsis.pad">
<xsl:param name="nodes"/>
<xsl:value-of select="str:padding(string-length($nodes[1]))"/>
<xsl:if test="$nodes[position() != 1]">
<xsl:call-template name="_db2html.funcsynopsis.pad">
<xsl:with-param name="nodes" select="$nodes[position() != 1]"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
|