[PATCH] small improvements to GLib API docs



This bit two people yesterday (one of them was me) in wondering how
g_strchomp and g_strchug actually worked. Did it allocate memory, did it
return different pointers, would I have to keep another pointer around.
Stuff like that.

I added a couple of sentences and some cross referencing (because the
functions aren't entirely clearly named) in an attempt to clear this up.

--d

PS. CC me, I'm off list.
? glib-doc-additions.diff
Index: docs/reference/glib/tmpl/string_utils.sgml
===================================================================
RCS file: /cvs/gnome/glib/docs/reference/glib/tmpl/string_utils.sgml,v
retrieving revision 1.40
diff -u -p -r1.40 string_utils.sgml
--- docs/reference/glib/tmpl/string_utils.sgml	5 May 2005 14:57:27 -0000	1.40
+++ docs/reference/glib/tmpl/string_utils.sgml	30 Sep 2005 04:46:03 -0000
@@ -722,6 +722,13 @@ The typical usage would be something lik
 Removes leading whitespace from a string, by moving the rest of the
 characters forward.
 </para>
+<para>
+This function doesn't allocate or reallocate any memory; it modifies @string
+in place. The pointer to @string is returned to allow the nesting of functions.
+</para>
+<para>
+Also see g_strchomp() and g_strstrip().
+</para>
 
 @string: a string to remove the leading whitespace from.
 @Returns: @string.
@@ -731,6 +738,13 @@ characters forward.
 <para>
 Removes trailing whitespace from a string.
 </para>
+<para>
+This function doesn't allocate or reallocate any memory; it modifies @string in
+place. The pointer to @string is return to allow the nesting of functions.
+</para>
+<para>
+Also see g_strchug() and g_strstrip().
+</para>
 
 @string: a string to remove the trailing whitespace from.
 @Returns: @string.
@@ -738,7 +752,8 @@ Removes trailing whitespace from a strin
 
 <!-- ##### MACRO g_strstrip ##### -->
 <para>
-Removes leading and trailing whitespace from a string.
+Removes leading and trailing whitespace from a string. See g_strchomp() and
+g_strchug().
 </para>
 
 @string: a string to remove the leading and trailing whitespace from.


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