summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZephaniah E. Hull <warp@aehallh.com>2006-10-14 19:52:23 -0700
committerJamey Sharp <jamey@minilop.net>2006-10-14 19:52:23 -0700
commit5ec55dc9c0c51137d89dd870ede05cc3268f75ae (patch)
tree4a81976d3c3bb41ff4286f705dd90a2ee7818916
parentc1504691ec2786594e8ffc33f3962f460f041971 (diff)
Define and use constants for opcode numbers.
Hard coding the opcode numbers in the function just makes it harder to figure out what's going on, but much more to the point, not defining the opcodes in the header makes it impossible to use the generated headers instead of the x11proto headers in the server. The name I settled on is very simple, for an extension by the name of xconf, and a request by the name of list_devices, we get XCB_XCONF_LIST_DEVICES. If this somehow causes problems, we can probably add a _OP somewhere in there, but. Acked-by: Jamey Sharp <jamey@minilop.net> Closes: #8641
-rw-r--r--src/c-client.xsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/c-client.xsl b/src/c-client.xsl
index f9897f7..445a8a6 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -342,7 +342,7 @@ authorization from the authors.
</xsl:attribute>
<field type="xcb_connection_t *" name="c" />
<xsl:apply-templates select="$req/*[not(self::reply)]" mode="param" />
- <do-request ref="{xcb:xcb-prefix($req/@name)}_request_t" opcode="{$req/@opcode}"
+ <do-request ref="{xcb:xcb-prefix($req/@name)}_request_t" opcode="{translate(xcb:xcb-prefix($req/@name), $lcase, $ucase)}"
checked="{$checked}">
<xsl:if test="$req/reply">
<xsl:attribute name="has-reply">true</xsl:attribute>
@@ -358,6 +358,7 @@ authorization from the authors.
<field type="unsigned int" name="sequence" />
</struct>
</xsl:if>
+ <constant type="number" name="{xcb:xcb-prefix($req/@name)}" value="{$req/@opcode}" />
<struct name="{xcb:xcb-prefix(@name)}_request_t">
<field type="uint8_t" name="major_opcode" no-assign="true" />
<xsl:if test="$ext">