[gimp] pdbgen: programmatically add hint about using g_strfreev()



commit 9b2e301c878dd58c5e72aadc703bc9ad86ca1676
Author: Sven Neumann <sven gimp org>
Date:   Tue Dec 4 21:01:13 2012 +0100

    pdbgen: programmatically add hint about using g_strfreev()
    
    Add the note about the need to free the returned string array
    to the generated libgimp code. This way it will show up in the
    libgimp documentation but not in the general PDB API.

 libgimp/gimp_pdb.c          |    2 +-
 libgimp/gimpbrushes_pdb.c   |    2 +-
 libgimp/gimpbuffer_pdb.c    |    2 +-
 libgimp/gimpdynamics_pdb.c  |    2 +-
 libgimp/gimpfonts_pdb.c     |    2 +-
 libgimp/gimpgradients_pdb.c |    2 +-
 libgimp/gimpimage_pdb.c     |    2 +-
 libgimp/gimpitem_pdb.c      |    2 +-
 libgimp/gimppalettes_pdb.c  |    2 +-
 libgimp/gimppaths_pdb.c     |    2 +-
 libgimp/gimppatterns_pdb.c  |    2 +-
 tools/pdbgen/lib.pl         |    4 ++++
 12 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/libgimp/gimp_pdb.c b/libgimp/gimp_pdb.c
index 15432be..ec21f87 100644
--- a/libgimp/gimp_pdb.c
+++ b/libgimp/gimp_pdb.c
@@ -196,7 +196,7 @@ gimp_get_parasite (const gchar *name)
  *
  * Returns a list of all currently attached global parasites.
  *
- * Returns: The names of currently attached parasites.
+ * Returns: The names of currently attached parasites The returned value must be freed with g_strfreev().
  *
  * Since: GIMP 2.8
  **/
diff --git a/libgimp/gimpbrushes_pdb.c b/libgimp/gimpbrushes_pdb.c
index e18b901..6e767cd 100644
--- a/libgimp/gimpbrushes_pdb.c
+++ b/libgimp/gimpbrushes_pdb.c
@@ -75,7 +75,7 @@ gimp_brushes_refresh (void)
  * Each name returned can be used as input to the
  * gimp_context_set_brush() procedure.
  *
- * Returns: The list of brush names.
+ * Returns: The list of brush names The returned value must be freed with g_strfreev().
  **/
 gchar **
 gimp_brushes_get_list (const gchar *filter,
diff --git a/libgimp/gimpbuffer_pdb.c b/libgimp/gimpbuffer_pdb.c
index b28aac4..3d231f7 100644
--- a/libgimp/gimpbuffer_pdb.c
+++ b/libgimp/gimpbuffer_pdb.c
@@ -44,7 +44,7 @@
  * This procedure returns a complete listing of available named
  * buffers.
  *
- * Returns: The list of buffer names.
+ * Returns: The list of buffer names The returned value must be freed with g_strfreev().
  *
  * Since: GIMP 2.4
  **/
diff --git a/libgimp/gimpdynamics_pdb.c b/libgimp/gimpdynamics_pdb.c
index 1fa8b8b..8a947a0 100644
--- a/libgimp/gimpdynamics_pdb.c
+++ b/libgimp/gimpdynamics_pdb.c
@@ -75,7 +75,7 @@ gimp_dynamics_refresh (void)
  * This procedure returns a list of the paint dynamics that are
  * currently available.
  *
- * Returns: The list of paint dynamics names.
+ * Returns: The list of paint dynamics names The returned value must be freed with g_strfreev().
  *
  * Since: GIMP 2.8
  **/
diff --git a/libgimp/gimpfonts_pdb.c b/libgimp/gimpfonts_pdb.c
index 1e35910..d2b786d 100644
--- a/libgimp/gimpfonts_pdb.c
+++ b/libgimp/gimpfonts_pdb.c
@@ -72,7 +72,7 @@ gimp_fonts_refresh (void)
  * This procedure returns a list of the fonts that are currently
  * available.
  *
- * Returns: The list of font names.
+ * Returns: The list of font names The returned value must be freed with g_strfreev().
  **/
 gchar **
 gimp_fonts_get_list (const gchar *filter,
diff --git a/libgimp/gimpgradients_pdb.c b/libgimp/gimpgradients_pdb.c
index 8078435..18de777 100644
--- a/libgimp/gimpgradients_pdb.c
+++ b/libgimp/gimpgradients_pdb.c
@@ -75,7 +75,7 @@ gimp_gradients_refresh (void)
  * loaded. You can later use the gimp_context_set_gradient() function
  * to set the active gradient.
  *
- * Returns: The list of gradient names.
+ * Returns: The list of gradient names The returned value must be freed with g_strfreev().
  **/
 gchar **
 gimp_gradients_get_list (const gchar *filter,
diff --git a/libgimp/gimpimage_pdb.c b/libgimp/gimpimage_pdb.c
index 18a0cf8..6531c93 100644
--- a/libgimp/gimpimage_pdb.c
+++ b/libgimp/gimpimage_pdb.c
@@ -3086,7 +3086,7 @@ gimp_image_get_parasite (gint32       image_ID,
  *
  * Returns a list of all currently attached parasites.
  *
- * Returns: The names of currently attached parasites.
+ * Returns: The names of currently attached parasites The returned value must be freed with g_strfreev().
  *
  * Since: GIMP 2.8
  **/
diff --git a/libgimp/gimpitem_pdb.c b/libgimp/gimpitem_pdb.c
index efb19db..69a1896 100644
--- a/libgimp/gimpitem_pdb.c
+++ b/libgimp/gimpitem_pdb.c
@@ -982,7 +982,7 @@ gimp_item_get_parasite (gint32       item_ID,
  *
  * Returns a list of all parasites currently attached the an item.
  *
- * Returns: The names of currently attached parasites.
+ * Returns: The names of currently attached parasites The returned value must be freed with g_strfreev().
  *
  * Since: GIMP 2.8
  **/
diff --git a/libgimp/gimppalettes_pdb.c b/libgimp/gimppalettes_pdb.c
index ce76eab..631decd 100644
--- a/libgimp/gimppalettes_pdb.c
+++ b/libgimp/gimppalettes_pdb.c
@@ -73,7 +73,7 @@ gimp_palettes_refresh (void)
  * Each name returned can be used as input to the command
  * gimp_context_set_palette().
  *
- * Returns: The list of palette names.
+ * Returns: The list of palette names The returned value must be freed with g_strfreev().
  **/
 gchar **
 gimp_palettes_get_list (const gchar *filter,
diff --git a/libgimp/gimppaths_pdb.c b/libgimp/gimppaths_pdb.c
index 6d70752..157d138 100644
--- a/libgimp/gimppaths_pdb.c
+++ b/libgimp/gimppaths_pdb.c
@@ -43,7 +43,7 @@
  *
  * Deprecated: Use gimp_image_get_vectors() instead.
  *
- * Returns: List of the paths belonging to this image.
+ * Returns: List of the paths belonging to this image. The returned value must be freed with g_strfreev().
  **/
 gchar **
 gimp_path_list (gint32  image_ID,
diff --git a/libgimp/gimppatterns_pdb.c b/libgimp/gimppatterns_pdb.c
index 36514b6..83b12a8 100644
--- a/libgimp/gimppatterns_pdb.c
+++ b/libgimp/gimppatterns_pdb.c
@@ -75,7 +75,7 @@ gimp_patterns_refresh (void)
  * patterns. Each name returned can be used as input to the
  * gimp_context_set_pattern().
  *
- * Returns: The list of pattern names.
+ * Returns: The list of pattern names The returned value must be freed with g_strfreev().
  **/
 gchar **
 gimp_patterns_get_list (const gchar *filter,
diff --git a/tools/pdbgen/lib.pl b/tools/pdbgen/lib.pl
index c777c8e..af462ec 100644
--- a/tools/pdbgen/lib.pl
+++ b/tools/pdbgen/lib.pl
@@ -121,6 +121,10 @@ sub generate {
 	    $retarg->{retval} = 1;
 
 	    $retdesc = exists $retarg->{desc} ? $retarg->{desc} : "";
+
+	    if ($retarg->{type} eq 'stringarray') {
+		$retdesc .= " The returned value must be freed with g_strfreev().";
+	    }
 	}
 	else {
 	    # No return values



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