Replaces special-casing in c-client stylesheet with support
authorEamon Walsh <ewalsh@tycho.nsa.gov>
Thu, 29 Mar 2007 19:28:07 +0000 (12:28 -0700)
committerBart Massey <bart@cs.pdx.edu>
Thu, 29 Mar 2007 19:28:07 +0000 (12:28 -0700)
for new attribute.  Tested with diff and found no difference with
previous stylesheet header-file output.

src/c-client.xsl

index d7a0eb9..24ffe6c 100644 (file)
@@ -97,31 +97,19 @@ authorization from the authors.
     <xsl:param name="name" />
     <func:result>
       <xsl:text>xcb</xsl:text>
-      <xsl:choose>
-        <xsl:when test="/xcb/@extension-name = 'RandR'">
-          <xsl:text>_randr</xsl:text>
-        </xsl:when>
-        <xsl:when test="/xcb/@extension-name = 'ScreenSaver'">
-          <xsl:text>_screensaver</xsl:text>
-        </xsl:when>
-        <xsl:when test="/xcb/@extension-name = 'XF86Dri'">
-          <xsl:text>_xf86dri</xsl:text>
-        </xsl:when>
-        <xsl:when test="/xcb/@extension-name = 'XFixes'">
-          <xsl:text>_xfixes</xsl:text>
-        </xsl:when>
-        <xsl:when test="/xcb/@extension-name = 'XvMC'">
-          <xsl:text>_xvmc</xsl:text>
-        </xsl:when>
-        <xsl:when test="/xcb/@extension-name">
-          <xsl:text>_</xsl:text>
-          <xsl:call-template name="camelcase-to-underscore">
-            <xsl:with-param name="camelcase" select="/xcb/@extension-name" />
-          </xsl:call-template>
-        </xsl:when>
-        <xsl:otherwise>
-        </xsl:otherwise>
-      </xsl:choose>
+      <xsl:if test="/xcb/@extension-name">
+       <xsl:text>_</xsl:text>
+       <xsl:choose>
+         <xsl:when test="/xcb/@extension-oneword = 'true' or /xcb/@extension-oneword = '1'">
+           <xsl:value-of select="translate(/xcb/@extension-name, $ucase, $lcase)"/>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:call-template name="camelcase-to-underscore">
+             <xsl:with-param name="camelcase" select="/xcb/@extension-name" />
+           </xsl:call-template>
+         </xsl:otherwise>
+       </xsl:choose>
+      </xsl:if>
       <xsl:if test="$name">
         <xsl:text>_</xsl:text>
         <xsl:call-template name="camelcase-to-underscore">