[gi-docgen] templates: Clarify GError arguments



commit cdb19c64dd7e502fe356e27b1f6c690c7a23a6bd
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Aug 12 23:04:09 2022 +0100

    templates: Clarify GError arguments
    
    We should add the same kind of descriptions we use for nullable,
    optional, and out arguments.

 gidocgen/templates/basic/class_method.html | 9 +++++++--
 gidocgen/templates/basic/ctor.html         | 9 +++++++--
 gidocgen/templates/basic/function.html     | 9 +++++++--
 gidocgen/templates/basic/method.html       | 9 +++++++--
 gidocgen/templates/basic/type_func.html    | 9 +++++++--
 gidocgen/templates/basic/vfunc.html        | 9 +++++++--
 6 files changed, 42 insertions(+), 12 deletions(-)
---
diff --git a/gidocgen/templates/basic/class_method.html b/gidocgen/templates/basic/class_method.html
index 6c621b7..4cde111 100644
--- a/gidocgen/templates/basic/class_method.html
+++ b/gidocgen/templates/basic/class_method.html
@@ -127,8 +127,13 @@
           {% if class_method.throws %}
           <dt class="arg-name"><code>error</code></dt>
           <dd class="arg-description">
-            <p><em>Type:</em>&nbsp;<code>GError **</code></p>
-            <p>The return location for a <code>GError*</code>, or <code>NULL</code>.</p>
+            <p><em>Type:</em>&nbsp;<a href="javascript:void(0)" data-namespace="GLib" 
data-link="struct.Error.html" class="external"><code>GError **</code></a></p>
+            <p>The return location for an error.</p>
+            <table>
+              <tr><td>The argument can be <code>NULL</code>.</td></tr>
+              <tr><td>The argument will be set to <code>NULL</code> by the function if there are no 
errors.</td></tr>
+              <tr><td>In case of error, the argument will be set and the caller will take ownership of the 
data, and be responsible for freeing it.</td></tr>
+            </table>
           </dd>
           {% endif %}
         </dl>
diff --git a/gidocgen/templates/basic/ctor.html b/gidocgen/templates/basic/ctor.html
index eb2f819..13def57 100644
--- a/gidocgen/templates/basic/ctor.html
+++ b/gidocgen/templates/basic/ctor.html
@@ -129,8 +129,13 @@
           {% if type_func.throws %}
           <dt class="arg-name"><code>error</code></dt>
           <dd class="arg-description">
-            <p><em>Type:</em>&nbsp;<code>GError **</code></p>
-            <p>The return location for a <code>GError*</code>, or <code>NULL</code>.</p>
+            <p><em>Type:</em>&nbsp;<a href="javascript:void(0)" data-namespace="GLib" 
data-link="struct.Error.html" class="external"><code>GError **</code></a></p>
+            <p>The return location for an error.</p>
+            <table>
+              <tr><td>The argument can be <code>NULL</code>.</td></tr>
+              <tr><td>The argument will be set to <code>NULL</code> by the function if there are no 
errors.</td></tr>
+              <tr><td>In case of error, the argument will be set and the caller will take ownership of the 
data, and be responsible for freeing it.</td></tr>
+            </table>
           </dd>
           {% endif %}
         </dl>
diff --git a/gidocgen/templates/basic/function.html b/gidocgen/templates/basic/function.html
index 3a72f19..4c9db8b 100644
--- a/gidocgen/templates/basic/function.html
+++ b/gidocgen/templates/basic/function.html
@@ -140,8 +140,13 @@
           {% if func.throws %}
           <dt class="arg-name"><code>error</code></dt>
           <dd class="arg-description">
-            <p><em>Type:</em>&nbsp;<code>GError **</code></p>
-            <p>The return location for a <code>GError*</code>, or <code>NULL</code>.</p>
+            <p><em>Type:</em>&nbsp;<a href="javascript:void(0)" data-namespace="GLib" 
data-link="struct.Error.html" class="external"><code>GError **</code></a></p>
+            <p>The return location for an error.</p>
+            <table>
+              <tr><td>The argument can be <code>NULL</code>.</td></tr>
+              <tr><td>The argument will be set to <code>NULL</code> by the function if there are no 
errors.</td></tr>
+              <tr><td>In case of error, the argument will be set and the caller will take ownership of the 
data, and be responsible for freeing it.</td></tr>
+            </table>
           </dd>
           {% endif %}
         </dl>
diff --git a/gidocgen/templates/basic/method.html b/gidocgen/templates/basic/method.html
index 744a603..fdd3cef 100644
--- a/gidocgen/templates/basic/method.html
+++ b/gidocgen/templates/basic/method.html
@@ -135,8 +135,13 @@
           {% if method.throws %}
           <dt class="arg-name"><code>error</code></dt>
           <dd class="arg-description">
-            <p><em>Type:</em>&nbsp;<code>GError **</code></p>
-            <p>The return location for a <code>GError*</code>, or <code>NULL</code>.</p>
+            <p><em>Type:</em>&nbsp;<a href="javascript:void(0)" data-namespace="GLib" 
data-link="struct.Error.html" class="external"><code>GError **</code></a></p>
+            <p>The return location for an error.</p>
+            <table>
+              <tr><td>The argument can be <code>NULL</code>.</td></tr>
+              <tr><td>The argument will be set to <code>NULL</code> by the function if there are no 
errors.</td></tr>
+              <tr><td>In case of error, the argument will be set and the caller will take ownership of the 
data, and be responsible for freeing it.</td></tr>
+            </table>
           </dd>
           {% endif %}
         </dl>
diff --git a/gidocgen/templates/basic/type_func.html b/gidocgen/templates/basic/type_func.html
index 3bfca9f..f1b9bc1 100644
--- a/gidocgen/templates/basic/type_func.html
+++ b/gidocgen/templates/basic/type_func.html
@@ -126,8 +126,13 @@
           {% if type_func.throws %}
           <dt class="arg-name"><code>error</code></dt>
           <dd class="arg-description">
-            <p><em>Type:</em>&nbsp;<code>GError **</code></p>
-            <p>The return location for a <code>GError*</code>, or <code>NULL</code>.</p>
+            <p><em>Type:</em>&nbsp;<a href="javascript:void(0)" data-namespace="GLib" 
data-link="struct.Error.html" class="external"><code>GError **</code></a></p>
+            <p>The return location for an error.</p>
+            <table>
+              <tr><td>The argument can be <code>NULL</code>.</td></tr>
+              <tr><td>The argument will be set to <code>NULL</code> by the function if there are no 
errors.</td></tr>
+              <tr><td>In case of error, the argument will be set and the caller will take ownership of the 
data, and be responsible for freeing it.</td></tr>
+            </table>
           </tr>
           {% endif %}
         </table>
diff --git a/gidocgen/templates/basic/vfunc.html b/gidocgen/templates/basic/vfunc.html
index 95a3823..2a7eb8b 100644
--- a/gidocgen/templates/basic/vfunc.html
+++ b/gidocgen/templates/basic/vfunc.html
@@ -126,8 +126,13 @@
           {% if vfunc.throws %}
           <dt class="arg-name"><code>error</code></dt>
           <dd class="arg-description">
-            <p><em>Type:</em>&nbsp;<code>GError **</code></p>
-            <p>The return location for a <code>GError*</code>, or <code>NULL</code>.</p>
+            <p><em>Type:</em>&nbsp;<a href="javascript:void(0)" data-namespace="GLib" 
data-link="struct.Error.html" class="external"><code>GError **</code></a></p>
+            <p>The return location for an error.</p>
+            <table>
+              <tr><td>The argument can be <code>NULL</code>.</td></tr>
+              <tr><td>The argument will be set to <code>NULL</code> by the function if there are no 
errors.</td></tr>
+              <tr><td>In case of error, the argument will be set and the caller will take ownership of the 
data, and be responsible for freeing it.</td></tr>
+            </table>
           </dd>
           {% endif %}
         </dl>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]