summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2006-07-30 20:28:16 -0700
committerJosh Triplett <josh@freedesktop.org>2006-07-30 22:03:46 -0700
commit65ed274f05ba670eb02a55b098aed141fa9611ec (patch)
treea5766067741ecf3ec1a5e1538605c38027a4cd33 /src
parentf74487e34fd61d11a501c07030f8fd7ed8caeb1c (diff)
Parameterize context in cookie-type and request-matching template.
Diffstat (limited to 'src')
-rw-r--r--src/c-client.xsl21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/c-client.xsl b/src/c-client.xsl
index 8a2d82e..e58d990 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -201,12 +201,14 @@ authorization from the authors.
</xsl:template>
<!-- Helper template for requests, that outputs the cookie type. The
- context node must be the request. -->
+ parameter "request" must be the request node, which defaults to the
+ context node. -->
<xsl:template name="cookie-type">
+ <xsl:param name="request" select="." />
<xsl:text>XCB</xsl:text>
<xsl:choose>
- <xsl:when test="reply">
- <xsl:value-of select="concat($ext, @name)" />
+ <xsl:when test="$request/reply">
+ <xsl:value-of select="concat($ext, $request/@name)" />
</xsl:when>
<xsl:otherwise>
<xsl:text>Void</xsl:text>
@@ -216,6 +218,7 @@ authorization from the authors.
</xsl:template>
<xsl:template match="request" mode="pass1">
+ <xsl:variable name="req" select="." />
<xsl:if test="reply">
<struct name="XCB{$ext}{@name}Cookie">
<field type="unsigned int" name="sequence" />
@@ -231,14 +234,16 @@ authorization from the authors.
<field type="CARD16" name="length" no-assign="true" />
</middle>
</struct>
- <function name="XCB{$ext}{@name}">
+ <function name="XCB{$ext}{$req/@name}">
<xsl:attribute name="type">
- <xsl:call-template name="cookie-type" />
+ <xsl:call-template name="cookie-type">
+ <xsl:with-param name="request" select="$req" />
+ </xsl:call-template>
</xsl:attribute>
<field type="XCBConnection *" name="c" />
- <xsl:apply-templates select="*[not(self::reply)]" mode="param" />
- <do-request ref="XCB{$ext}{@name}Req" opcode="{@opcode}">
- <xsl:if test="reply">
+ <xsl:apply-templates select="$req/*[not(self::reply)]" mode="param" />
+ <do-request ref="XCB{$ext}{$req/@name}Req" opcode="{$req/@opcode}">
+ <xsl:if test="$req/reply">
<xsl:attribute name="has-reply">true</xsl:attribute>
</xsl:if>
</do-request>