Remove arbitrary division between xcb_types and xproto by merging
[free-sw/xcb/libxcb] / src / c-client.xsl
index 56dbaac..8a2d82e 100644 (file)
@@ -62,19 +62,9 @@ authorization from the authors.
     <xsl:for-each select="/xcb/import">
       <path><xsl:value-of select="concat($extension-path, ., '.xml')" /></path>
     </xsl:for-each>
-    <xsl:choose>
-      <xsl:when test="$header='xproto'">
-        <path><xsl:value-of select="concat($base-path,
-                                           'xcb_types.xml')" /></path>
-      </xsl:when>
-      <xsl:when test="$header='xcb_types'" />
-      <xsl:otherwise>
-        <path><xsl:value-of select="concat($base-path,
-                                           'xproto.xml')" /></path>
-        <path><xsl:value-of select="concat($base-path,
-                                           'xcb_types.xml')" /></path>
-      </xsl:otherwise>
-    </xsl:choose>
+    <xsl:if test="not($header='xproto')">
+      <path><xsl:value-of select="concat($base-path, 'xproto.xml')" /></path>
+    </xsl:if>
   </xsl:variable>
   <xsl:variable name="search-path" select="e:node-set($search-path-rtf)/path"/>
 
@@ -711,7 +701,7 @@ authorization from the authors.
                                /*[self::valueparam or self::list]" />
       <xsl:if test="not($is-variable)">
         <function type="{@type} *" name="{$ref}{$field-name}">
-          <field type="{$ref}{$kind} *" name="R" />
+          <field type="const {$ref}{$kind} *" name="R" />
           <xsl:choose>
             <xsl:when test="$is-first">
               <l>return (<xsl:value-of select="@type" /> *) <!--
@@ -728,7 +718,7 @@ authorization from the authors.
         </function>
       </xsl:if>
       <function type="int" name="{$ref}{$field-name}Length">
-        <field type="{$ref}{$kind} *" name="R" />
+        <field type="const {$ref}{$kind} *" name="R" />
         <l>return <xsl:apply-templates mode="output-expression">
                     <xsl:with-param name="field-prefix" select="'R->'" />
                   </xsl:apply-templates>;</l>
@@ -736,7 +726,7 @@ authorization from the authors.
       <xsl:choose>
         <xsl:when test="substring(@type, 1, 3) = 'XCB'">
           <function type="{@type}Iter" name="{$ref}{$field-name}Iter">
-            <field type="{$ref}{$kind} *" name="R" />
+            <field type="const {$ref}{$kind} *" name="R" />
             <l><xsl:value-of select="@type" />Iter i;</l>
             <xsl:choose>
               <xsl:when test="$is-first">
@@ -766,7 +756,7 @@ authorization from the authors.
             </xsl:choose>
           </xsl:variable>
           <function type="XCBGenericIter" name="{$ref}{$field-name}End">
-            <field type="{$ref}{$kind} *" name="R" />
+            <field type="const {$ref}{$kind} *" name="R" />
             <l>XCBGenericIter i;</l>
             <xsl:choose>
               <xsl:when test="$is-first">