Enhance sort() documentation. (#314839, Behdad Esfahbod)

2005-08-30  Matthias Clasen  <mclasen@redhat.com>

	* glib/tmpl/arrays.sgml:
	* glib/tmpl/arrays_pointer.sgml:
	* glib/tmpl/arrays_byte.sgml: Enhance sort() documentation.
	(#314839, Behdad Esfahbod)
This commit is contained in:
Matthias Clasen
2005-08-30 14:19:56 +00:00
committed by Matthias Clasen
parent 141cf2434e
commit 555b46b039
4 changed files with 36 additions and 13 deletions

View File

@@ -1,3 +1,10 @@
2005-08-30 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/arrays.sgml:
* glib/tmpl/arrays_pointer.sgml:
* glib/tmpl/arrays_byte.sgml: Enhance sort() documentation.
(#314839, Behdad Esfahbod)
2005-08-26 Matthias Clasen <mclasen@redhat.com> 2005-08-26 Matthias Clasen <mclasen@redhat.com>
* glib/glib-docs.sgml: * glib/glib-docs.sgml:

View File

@@ -231,8 +231,12 @@ Removes the given number of elements starting at the given index from a
<!-- ##### FUNCTION g_array_sort ##### --> <!-- ##### FUNCTION g_array_sort ##### -->
<para> <para>
Sorts a #GArray using @compare_func which should be a qsort()-style comparison Sorts a #GArray using @compare_func which should be a qsort()-style comparison
function (returns -1 for first arg is less than second arg, 0 for equal, 1 if function (returns less than zero for first arg is less than second arg,
first arg is greater than second arg). zero for equal, greater zero if first arg is greater than second arg).
</para>
<para>
If two array elements compare equal, their order in the sorted array is
undefined.
</para> </para>
@array: a #GArray. @array: a #GArray.
@@ -241,7 +245,7 @@ first arg is greater than second arg).
<!-- ##### FUNCTION g_array_sort_with_data ##### --> <!-- ##### FUNCTION g_array_sort_with_data ##### -->
<para> <para>
Like g_array_sort(), but the comparison function receives a user data Like g_array_sort(), but the comparison function receives an extra user data
argument. argument.
</para> </para>

View File

@@ -144,8 +144,13 @@ Removes the given number of bytes starting at the given index from a
<!-- ##### FUNCTION g_byte_array_sort ##### --> <!-- ##### FUNCTION g_byte_array_sort ##### -->
<para> <para>
Sorts a byte array, using @compare_func which should be a qsort()-style Sorts a byte array, using @compare_func which should be a qsort()-style
comparison function (returns -1 for first arg is less than second arg, 0 for comparison function (returns less than zero for first arg is less than second
equal, 1 if first arg is greater than second arg). arg, zero for equal, greater than zero if first arg is greater than second
arg).
</para>
<para>
If two array elements compare equal, their order in the sorted array is
undefined.
</para> </para>
@array: a #GByteArray. @array: a #GByteArray.
@@ -154,7 +159,8 @@ equal, 1 if first arg is greater than second arg).
<!-- ##### FUNCTION g_byte_array_sort_with_data ##### --> <!-- ##### FUNCTION g_byte_array_sort_with_data ##### -->
<para> <para>
Like g_byte_array_sort(), but the comparison function takes a user data argument. Like g_byte_array_sort(), but the comparison function takes an extra user data
argument.
</para> </para>
@array: a #GByteArray. @array: a #GByteArray.

View File

@@ -173,12 +173,16 @@ Removes the given number of pointers starting at the given index from a
<!-- ##### FUNCTION g_ptr_array_sort ##### --> <!-- ##### FUNCTION g_ptr_array_sort ##### -->
<para> <para>
Sorts the array, using @compare_func which should be a qsort()-style comparison Sorts the array, using @compare_func which should be a qsort()-style comparison
function (returns -1 for first arg is less than second arg, 0 for equal, 1 if function (returns less than zero for first arg is less than second arg,
first arg is greater than second arg). zero for equal, greater than zero if irst arg is greater than second arg).
</para>
<para>
If two array elements compare equal, their order in the sorted array is
undefined.
</para> </para>
<note><para> <note><para>
The comparison function for g_ptr_array_sort() doesn't take the pointers from the array as arguments, The comparison function for g_ptr_array_sort() doesn't take the pointers
it takes pointers to the pointers in the array. from the array as arguments, it takes pointers to the pointers in the array.
</para></note> </para></note>
@array: a #GPtrArray. @array: a #GPtrArray.
@@ -187,11 +191,13 @@ it takes pointers to the pointers in the array.
<!-- ##### FUNCTION g_ptr_array_sort_with_data ##### --> <!-- ##### FUNCTION g_ptr_array_sort_with_data ##### -->
<para> <para>
Like g_ptr_array_sort(), but the comparison function has a user data argument. Like g_ptr_array_sort(), but the comparison function has an extra user data
argument.
</para> </para>
<note><para> <note><para>
The comparison function for g_ptr_array_sort_with_data() doesn't take the pointers from the array as arguments, The comparison function for g_ptr_array_sort_with_data() doesn't take the
it takes pointers to the pointers in the array. pointers from the array as arguments, it takes pointers to the pointers in
the array.
</para></note> </para></note>
@array: a #GPtrArray. @array: a #GPtrArray.