add the first step toward the documentation of the request/reply functions. The argum...
[free-sw/xcb/libxcb] / src / c-client.xsl
index 0f7c025..d7a0eb9 100644 (file)
@@ -342,6 +342,24 @@ authorization from the authors.
           <xsl:with-param name="request" select="$req" />
         </xsl:call-template>
       </xsl:attribute>
+      <doc>/**</doc>
+      <doc> * Delivers a request to the X server</doc>
+      <doc> * @param c The connection</doc>
+      <doc> * @return A cookie</doc>
+      <doc> *</doc>
+      <doc> * Delivers a request to the X server.</doc>
+      <doc> * </doc>
+      <xsl:if test="$checked='true' and not($req/reply)">
+        <doc> * This form can be used only if the request will not cause</doc>
+        <doc> * a reply to be generated. Any returned error will be</doc>
+        <doc> * saved for handling by xcb_request_check().</doc>
+      </xsl:if>
+      <xsl:if test="$checked='false' and $req/reply">
+        <doc> * This form can be used only if the request will cause</doc>
+        <doc> * a reply to be generated. Any returned error will be</doc>
+        <doc> * placed in the event queue.</doc>
+      </xsl:if>
+      <doc> */</doc>
       <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="{translate(xcb:xcb-prefix($req/@name), $lcase, $ucase)}"
@@ -390,6 +408,18 @@ authorization from the authors.
       </struct>
       <iterator-functions ref="{xcb:xcb-prefix(@name)}" kind="_reply" />
       <function type="{xcb:xcb-prefix(@name)}_reply_t *" name="{xcb:xcb-prefix(@name)}_reply">
+        <doc>/**</doc>
+        <doc> * Return the reply</doc>
+        <doc> * @param c      The connection</doc>
+        <doc> * @param cookie The cookie</doc>
+        <doc> * @param e      The xcb_generic_error_t supplied</doc>
+        <doc> *</doc>
+        <doc> * Returns the reply of the request asked by</doc>
+        <doc> * </doc>
+        <doc> * The parameter @p e supplied to this function must be NULL if</doc>
+        <doc> * <xsl:value-of select="xcb:xcb-prefix(@name)" />_unchecked(). is used.</doc>
+        <doc> * Otherwise, it stores the error if any.</doc>
+        <doc> */</doc>
         <field type="xcb_connection_t *" name="c" />
         <field name="cookie">
           <xsl:attribute name="type">
@@ -590,7 +620,7 @@ authorization from the authors.
     </list>
   </xsl:template>
 
-  <xsl:template match="field|localfield" mode="param">
+  <xsl:template match="field" mode="param">
     <field>
       <xsl:attribute name="type">
         <xsl:call-template name="canonical-type-name" />
@@ -722,6 +752,10 @@ authorization from the authors.
     <l><xsl:value-of select="@ref" /> xcb_out;</l>
 
     <l />
+    <xsl:if test="not ($ext) and not($struct//*[(self::field or self::exprfield or self::pad)
+                                                and not(boolean(@no-assign))])">
+      <l>xcb_out.pad0 = 0;</l>
+    </xsl:if>
     <xsl:apply-templates select="$struct//*[(self::field or self::exprfield or self::pad)
                                             and not(boolean(@no-assign))]"
                          mode="assign" />
@@ -920,6 +954,14 @@ authorization from the authors.
     </xsl:for-each>
     <xsl:if test="not($kind)">
       <function type="void" name="{$ref}_next">
+        <doc>/**</doc>
+        <doc> * Get the next element of the iterator</doc>
+        <doc> * @param i Pointer to a <xsl:value-of select="$ref" />_iterator_t</doc>
+        <doc> *</doc>
+        <doc> * Get the next element in the iterator. The member rem is</doc>
+        <doc> * decreased by one. The member data points to the next</doc>
+        <doc> * element. The member index is increased by sizeof(<xsl:value-of select="$ref" />_t)</doc>
+        <doc> */</doc>
         <field type="{$ref}_iterator_t *" name="i" />
         <xsl:choose>
           <xsl:when test="$struct/list[not(@fixed)]">
@@ -938,6 +980,15 @@ authorization from the authors.
         </xsl:choose>
       </function>
       <function type="xcb_generic_iterator_t" name="{$ref}_end">
+        <doc>/**</doc>
+        <doc> * Return the iterator pointing to the last element</doc>
+        <doc> * @param i An <xsl:value-of select="$ref" />_iterator_t</doc>
+        <doc> * @return  The iterator pointing to the last element</doc>
+        <doc> *</doc>
+        <doc> * Set the current element in the iterator to the last element.</doc>
+        <doc> * The member rem is set to 0. The member data points to the</doc>
+        <doc> * last element.</doc>
+        <doc> */</doc>
         <field type="{$ref}_iterator_t" name="i" />
         <l>xcb_generic_iterator_t ret;</l>
         <xsl:choose>
@@ -1174,6 +1225,10 @@ authorization from the authors.
       </xsl:call-template>
   </xsl:variable>
   <!-- Doxygen for functions in header. -->
+    <xsl:if test="$h">
+      <xsl:apply-templates select="doc" mode="function-doc">
+      </xsl:apply-templates>
+    </xsl:if>
 /*****************************************************************************
  **
  ** <xsl:value-of select="@type" />
@@ -1238,6 +1293,11 @@ authorization from the authors.
     </xsl:if>
   </xsl:template>
 
+  <xsl:template match="doc" mode="function-doc">
+    <xsl:value-of select="." /><xsl:text>
+</xsl:text>
+  </xsl:template>
+
   <xsl:template match="l" mode="function-body">
     <xsl:param name="indent" />
     <xsl:value-of select="concat($indent, .)" /><xsl:text>