Files
glib/docs/reference/glib/tmpl/strings.sgml

341 lines
7.7 KiB
Plaintext
Raw Normal View History

1999-08-16 17:58:30 +00:00
<!-- ##### SECTION Title ##### -->
Strings
<!-- ##### SECTION Short_Description ##### -->
text buffers which grow automatically as text is added.
1999-08-16 17:58:30 +00:00
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GString is similar to a standard C string, except that it grows automatically
as text is appended or inserted. Also, it stores the length of the string, so
can be used for binary data with embedded nul bytes.
1999-08-16 17:58:30 +00:00
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### STRUCT GString ##### -->
<para>
The #GString struct contains the public fields of a #GString.
The <structfield>str</structfield> field points to the character data.
It may move as text is added.
The <structfield>len</structfield> field contains the length of the string,
not including the terminating null character.
</para>
<para>
The str field is zero-terminated and so can be used as an ordinary C
string. But it may be moved when text is appended or inserted into the
string.
1999-08-16 17:58:30 +00:00
</para>
@str:
@len:
@allocated_len:
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_new ##### -->
<para>
Creates a new #GString, initialized with the given string.
1999-08-16 17:58:30 +00:00
</para>
@init: the initial text to copy into the string.
@Returns: the new #GString.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_new_len ##### -->
<para>
Creates a new #GString with @len bytes of the @init buffer. Because a length is
provided, @init need not be nul-terminated, and can contain embedded nul bytes.
</para>
@init: initial contents of string
@len: length of @init to use
@Returns: a new #GString
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_sized_new ##### -->
<para>
Creates a new GString, with enough space for @dfl_size characters.
This is useful if you are going to add a lot of text to the string and
don't want it to be reallocated too often.
1999-08-16 17:58:30 +00:00
</para>
@dfl_size: the default size of the space allocated to hold the string.
@Returns: the new #GString.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_assign ##### -->
<para>
Copies the characters from one #GString into another, destroying any previous
contents. It is rather like the standard strcpy() function, except that
you do not have to worry about having enough space to copy the string.
1999-08-16 17:58:30 +00:00
</para>
@string: the destination #GString. Its current contents are destroyed.
@rval: the source #GString.
@Returns: the destination #GString.
1999-08-16 17:58:30 +00:00
changed prototype of g_boxed_type_register_static() to contain an optional Wed Mar 7 09:36:33 2001 Tim Janik <timj@gtk.org> * gboxed.[hc]: changed prototype of g_boxed_type_register_static() to contain an optional init function and a hint at whether the boxed structure uses ref counting internally. added g_value_set_boxed_take_ownership(). made G_TYPE_BOXED an abstract value type. * genums.[hc]: made G_TYPE_ENUM and G_TYPE_FLAGS abstract value types. * glib-genmarshal.c: argument type changes, preparation for third-party arg specification. * gobject.[hc]: cleaned up get/set property code. added g_strdup_value_contents() to improve warnings. * gparam.[hc]: added g_param_value_convert(), taking over responsibility of the old g_value_convert(). added G_PARAM_LAX_VALIDATION flag so validation alterations may be valid a part of the property setting process. * gparamspecs.[hc]: made value comparisons stable (for sort applications). added GParamSpecValueArray, a param spec for value arrays and GParamSpecClosure. nuked the value exchange functions and GParamSpecCCallback. * gtype.[hc]: catch unintialized usages of the type system with g_return_val_if_uninitialized(). introduced G_TYPE_FLAG_VALUE_ABSTRACT to flag types that introduce a value table, but can't be used for g_value_init(). cleaned up reserved type ids. * gvalue.[hc]: code cleanups and saner checking. nuked the value exchange API. implemented value transformations, we can't really "convert" values, rather transforms are an anylogy to C casts, real conversions need a param spec for validation, which is why g_param_value_convert() does real conversions now. * gvaluearray.[hc]: new files that implement a GValueArray, a struct that can hold inhomogeneous arrays of value (to that extend that it also allowes undefined values, i.e. G_VALUE_TYPE(value)==0). this is exposed to the type system as a boxed type. * gvaluetransform.c: new file implementing most of the former value exchange functions as single-sided transformations. * gvaluetypes.[hc]: nuked G_TYPE_CCALLBACK, added g_value_set_string_take_ownership(). * *.h: s/G_IS_VALUE_/G_VALUE_HOLDS_/. * *.[hc]: many fixes and cleanups. * many warning improvements. Tue Feb 27 18:35:15 2001 Tim Janik <timj@gtk.org> * gobject.c (g_object_get_valist): urg, pass G_VALUE_NOCOPY_CONTENTS into G_VALUE_LCOPY(), this needs proper documenting. * gparam.c: fixed G_PARAM_USER_MASK. * gtype.c (type_data_make_W): (type_data_last_unref_Wm): fixed invalid memory freeing. * gobject.c (g_object_last_unref): destroy signal handlers associated with object, right before finalization. * gsignal.c (g_signal_parse_name): catch destroyed nodes or signals that don't actually support details. * gobject.[hc]: got rid of property trailers. nuked GObject properties "data" and the "signal" variants. (g_object_connect): new convenience function to do multiple signal connections at once. (g_object_disconnect): likewise, for disconnections. * gparam.[hc] (g_param_spec_pool_lookup): took out trailer support. * gvalue.[hc]: marked g_value_fits_pointer() and g_value_peek_pointer() as private (the latter got renamed from g_value_get_as_pointer()). Wed Mar 7 09:32:06 2001 Tim Janik <timj@gtk.org> * glib-object.h: add gvaluearray.h. * gstring.[hc]: fixup naming of g_string_sprint*. * gtypes.h: fixed GCompareDataFunc naming. Wed Mar 7 09:33:27 2001 Tim Janik <timj@gtk.org> * gobject/Makefile.am: shuffled rules to avoid excessive rebuilds. * gobject/gobject-sections.txt: updates. * gobject/tmpl/*: bunch of updates, added another patch from Eric Lemings <eric.b.lemings@lmco.com>.
2001-03-07 14:46:45 +00:00
<!-- ##### MACRO g_string_sprintf ##### -->
1999-08-16 17:58:30 +00:00
<para>
Writes a formatted string into a #GString.
This is similar to the standard <function>sprintf()</function> function,
except that the GString buffer automatically expands to contain the results.
The previous contents of the GString are destroyed.
1999-08-16 17:58:30 +00:00
</para>
changed prototype of g_boxed_type_register_static() to contain an optional Wed Mar 7 09:36:33 2001 Tim Janik <timj@gtk.org> * gboxed.[hc]: changed prototype of g_boxed_type_register_static() to contain an optional init function and a hint at whether the boxed structure uses ref counting internally. added g_value_set_boxed_take_ownership(). made G_TYPE_BOXED an abstract value type. * genums.[hc]: made G_TYPE_ENUM and G_TYPE_FLAGS abstract value types. * glib-genmarshal.c: argument type changes, preparation for third-party arg specification. * gobject.[hc]: cleaned up get/set property code. added g_strdup_value_contents() to improve warnings. * gparam.[hc]: added g_param_value_convert(), taking over responsibility of the old g_value_convert(). added G_PARAM_LAX_VALIDATION flag so validation alterations may be valid a part of the property setting process. * gparamspecs.[hc]: made value comparisons stable (for sort applications). added GParamSpecValueArray, a param spec for value arrays and GParamSpecClosure. nuked the value exchange functions and GParamSpecCCallback. * gtype.[hc]: catch unintialized usages of the type system with g_return_val_if_uninitialized(). introduced G_TYPE_FLAG_VALUE_ABSTRACT to flag types that introduce a value table, but can't be used for g_value_init(). cleaned up reserved type ids. * gvalue.[hc]: code cleanups and saner checking. nuked the value exchange API. implemented value transformations, we can't really "convert" values, rather transforms are an anylogy to C casts, real conversions need a param spec for validation, which is why g_param_value_convert() does real conversions now. * gvaluearray.[hc]: new files that implement a GValueArray, a struct that can hold inhomogeneous arrays of value (to that extend that it also allowes undefined values, i.e. G_VALUE_TYPE(value)==0). this is exposed to the type system as a boxed type. * gvaluetransform.c: new file implementing most of the former value exchange functions as single-sided transformations. * gvaluetypes.[hc]: nuked G_TYPE_CCALLBACK, added g_value_set_string_take_ownership(). * *.h: s/G_IS_VALUE_/G_VALUE_HOLDS_/. * *.[hc]: many fixes and cleanups. * many warning improvements. Tue Feb 27 18:35:15 2001 Tim Janik <timj@gtk.org> * gobject.c (g_object_get_valist): urg, pass G_VALUE_NOCOPY_CONTENTS into G_VALUE_LCOPY(), this needs proper documenting. * gparam.c: fixed G_PARAM_USER_MASK. * gtype.c (type_data_make_W): (type_data_last_unref_Wm): fixed invalid memory freeing. * gobject.c (g_object_last_unref): destroy signal handlers associated with object, right before finalization. * gsignal.c (g_signal_parse_name): catch destroyed nodes or signals that don't actually support details. * gobject.[hc]: got rid of property trailers. nuked GObject properties "data" and the "signal" variants. (g_object_connect): new convenience function to do multiple signal connections at once. (g_object_disconnect): likewise, for disconnections. * gparam.[hc] (g_param_spec_pool_lookup): took out trailer support. * gvalue.[hc]: marked g_value_fits_pointer() and g_value_peek_pointer() as private (the latter got renamed from g_value_get_as_pointer()). Wed Mar 7 09:32:06 2001 Tim Janik <timj@gtk.org> * glib-object.h: add gvaluearray.h. * gstring.[hc]: fixup naming of g_string_sprint*. * gtypes.h: fixed GCompareDataFunc naming. Wed Mar 7 09:33:27 2001 Tim Janik <timj@gtk.org> * gobject/Makefile.am: shuffled rules to avoid excessive rebuilds. * gobject/gobject-sections.txt: updates. * gobject/tmpl/*: bunch of updates, added another patch from Eric Lemings <eric.b.lemings@lmco.com>.
2001-03-07 14:46:45 +00:00
<!-- # Unused Parameters # -->
@string: a #GString.
@format: the string format. See the <function>sprintf()</function>
documentation.
@Varargs: the parameters to insert into the format string.
1999-08-16 17:58:30 +00:00
changed prototype of g_boxed_type_register_static() to contain an optional Wed Mar 7 09:36:33 2001 Tim Janik <timj@gtk.org> * gboxed.[hc]: changed prototype of g_boxed_type_register_static() to contain an optional init function and a hint at whether the boxed structure uses ref counting internally. added g_value_set_boxed_take_ownership(). made G_TYPE_BOXED an abstract value type. * genums.[hc]: made G_TYPE_ENUM and G_TYPE_FLAGS abstract value types. * glib-genmarshal.c: argument type changes, preparation for third-party arg specification. * gobject.[hc]: cleaned up get/set property code. added g_strdup_value_contents() to improve warnings. * gparam.[hc]: added g_param_value_convert(), taking over responsibility of the old g_value_convert(). added G_PARAM_LAX_VALIDATION flag so validation alterations may be valid a part of the property setting process. * gparamspecs.[hc]: made value comparisons stable (for sort applications). added GParamSpecValueArray, a param spec for value arrays and GParamSpecClosure. nuked the value exchange functions and GParamSpecCCallback. * gtype.[hc]: catch unintialized usages of the type system with g_return_val_if_uninitialized(). introduced G_TYPE_FLAG_VALUE_ABSTRACT to flag types that introduce a value table, but can't be used for g_value_init(). cleaned up reserved type ids. * gvalue.[hc]: code cleanups and saner checking. nuked the value exchange API. implemented value transformations, we can't really "convert" values, rather transforms are an anylogy to C casts, real conversions need a param spec for validation, which is why g_param_value_convert() does real conversions now. * gvaluearray.[hc]: new files that implement a GValueArray, a struct that can hold inhomogeneous arrays of value (to that extend that it also allowes undefined values, i.e. G_VALUE_TYPE(value)==0). this is exposed to the type system as a boxed type. * gvaluetransform.c: new file implementing most of the former value exchange functions as single-sided transformations. * gvaluetypes.[hc]: nuked G_TYPE_CCALLBACK, added g_value_set_string_take_ownership(). * *.h: s/G_IS_VALUE_/G_VALUE_HOLDS_/. * *.[hc]: many fixes and cleanups. * many warning improvements. Tue Feb 27 18:35:15 2001 Tim Janik <timj@gtk.org> * gobject.c (g_object_get_valist): urg, pass G_VALUE_NOCOPY_CONTENTS into G_VALUE_LCOPY(), this needs proper documenting. * gparam.c: fixed G_PARAM_USER_MASK. * gtype.c (type_data_make_W): (type_data_last_unref_Wm): fixed invalid memory freeing. * gobject.c (g_object_last_unref): destroy signal handlers associated with object, right before finalization. * gsignal.c (g_signal_parse_name): catch destroyed nodes or signals that don't actually support details. * gobject.[hc]: got rid of property trailers. nuked GObject properties "data" and the "signal" variants. (g_object_connect): new convenience function to do multiple signal connections at once. (g_object_disconnect): likewise, for disconnections. * gparam.[hc] (g_param_spec_pool_lookup): took out trailer support. * gvalue.[hc]: marked g_value_fits_pointer() and g_value_peek_pointer() as private (the latter got renamed from g_value_get_as_pointer()). Wed Mar 7 09:32:06 2001 Tim Janik <timj@gtk.org> * glib-object.h: add gvaluearray.h. * gstring.[hc]: fixup naming of g_string_sprint*. * gtypes.h: fixed GCompareDataFunc naming. Wed Mar 7 09:33:27 2001 Tim Janik <timj@gtk.org> * gobject/Makefile.am: shuffled rules to avoid excessive rebuilds. * gobject/gobject-sections.txt: updates. * gobject/tmpl/*: bunch of updates, added another patch from Eric Lemings <eric.b.lemings@lmco.com>.
2001-03-07 14:46:45 +00:00
<!-- ##### MACRO g_string_sprintfa ##### -->
1999-08-16 17:58:30 +00:00
<para>
Appends a formatted string onto the end of a #GString.
This function is is similar to g_string_sprintf() except that
the text is appended to the GString.
1999-08-16 17:58:30 +00:00
</para>
changed prototype of g_boxed_type_register_static() to contain an optional Wed Mar 7 09:36:33 2001 Tim Janik <timj@gtk.org> * gboxed.[hc]: changed prototype of g_boxed_type_register_static() to contain an optional init function and a hint at whether the boxed structure uses ref counting internally. added g_value_set_boxed_take_ownership(). made G_TYPE_BOXED an abstract value type. * genums.[hc]: made G_TYPE_ENUM and G_TYPE_FLAGS abstract value types. * glib-genmarshal.c: argument type changes, preparation for third-party arg specification. * gobject.[hc]: cleaned up get/set property code. added g_strdup_value_contents() to improve warnings. * gparam.[hc]: added g_param_value_convert(), taking over responsibility of the old g_value_convert(). added G_PARAM_LAX_VALIDATION flag so validation alterations may be valid a part of the property setting process. * gparamspecs.[hc]: made value comparisons stable (for sort applications). added GParamSpecValueArray, a param spec for value arrays and GParamSpecClosure. nuked the value exchange functions and GParamSpecCCallback. * gtype.[hc]: catch unintialized usages of the type system with g_return_val_if_uninitialized(). introduced G_TYPE_FLAG_VALUE_ABSTRACT to flag types that introduce a value table, but can't be used for g_value_init(). cleaned up reserved type ids. * gvalue.[hc]: code cleanups and saner checking. nuked the value exchange API. implemented value transformations, we can't really "convert" values, rather transforms are an anylogy to C casts, real conversions need a param spec for validation, which is why g_param_value_convert() does real conversions now. * gvaluearray.[hc]: new files that implement a GValueArray, a struct that can hold inhomogeneous arrays of value (to that extend that it also allowes undefined values, i.e. G_VALUE_TYPE(value)==0). this is exposed to the type system as a boxed type. * gvaluetransform.c: new file implementing most of the former value exchange functions as single-sided transformations. * gvaluetypes.[hc]: nuked G_TYPE_CCALLBACK, added g_value_set_string_take_ownership(). * *.h: s/G_IS_VALUE_/G_VALUE_HOLDS_/. * *.[hc]: many fixes and cleanups. * many warning improvements. Tue Feb 27 18:35:15 2001 Tim Janik <timj@gtk.org> * gobject.c (g_object_get_valist): urg, pass G_VALUE_NOCOPY_CONTENTS into G_VALUE_LCOPY(), this needs proper documenting. * gparam.c: fixed G_PARAM_USER_MASK. * gtype.c (type_data_make_W): (type_data_last_unref_Wm): fixed invalid memory freeing. * gobject.c (g_object_last_unref): destroy signal handlers associated with object, right before finalization. * gsignal.c (g_signal_parse_name): catch destroyed nodes or signals that don't actually support details. * gobject.[hc]: got rid of property trailers. nuked GObject properties "data" and the "signal" variants. (g_object_connect): new convenience function to do multiple signal connections at once. (g_object_disconnect): likewise, for disconnections. * gparam.[hc] (g_param_spec_pool_lookup): took out trailer support. * gvalue.[hc]: marked g_value_fits_pointer() and g_value_peek_pointer() as private (the latter got renamed from g_value_get_as_pointer()). Wed Mar 7 09:32:06 2001 Tim Janik <timj@gtk.org> * glib-object.h: add gvaluearray.h. * gstring.[hc]: fixup naming of g_string_sprint*. * gtypes.h: fixed GCompareDataFunc naming. Wed Mar 7 09:33:27 2001 Tim Janik <timj@gtk.org> * gobject/Makefile.am: shuffled rules to avoid excessive rebuilds. * gobject/gobject-sections.txt: updates. * gobject/tmpl/*: bunch of updates, added another patch from Eric Lemings <eric.b.lemings@lmco.com>.
2001-03-07 14:46:45 +00:00
<!-- # Unused Parameters # -->
@string: a #GString.
@format: the string format. See the <function>sprintf()</function>
documentation.
@Varargs: the parameters to insert into the format string.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_printf ##### -->
<para>
</para>
@string:
@format:
@Varargs:
<!-- ##### FUNCTION g_string_printfa ##### -->
<para>
</para>
@string:
@format:
@Varargs:
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_append ##### -->
<para>
Adds a string onto the end of a #GString, expanding it if necessary.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@val: the string to append onto the end of the #GString.
@Returns: the #GString.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_append_c ##### -->
<para>
Adds a character onto the end of a #GString, expanding it if necessary.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@c: the character to append onto the end of the #GString.
@Returns: the #GString.
2000-09-06 00:04:49 +00:00
<!-- ##### FUNCTION g_string_append_unichar ##### -->
<para>
</para>
@string:
@wc:
@Returns:
2000-09-06 00:04:49 +00:00
<!-- ##### FUNCTION g_string_append_len ##### -->
<para>
Appends @len bytes of @val to @string. Because @len is provided,
@val may contain embedded nuls and need not be nul-terminated.
2000-09-06 00:04:49 +00:00
</para>
@string: a #GString
@val: bytes to append
@len: number of bytes of @val to use
@Returns: the #GString
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_prepend ##### -->
<para>
Adds a string on to the start of a #GString, expanding it if necessary.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@val: the string to prepend on the start of the #GString.
@Returns: the #GString.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_prepend_c ##### -->
<para>
Adds a character onto the start of a #GString, expanding it if necessary.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@c: the character to prepend on the start of the #GString.
@Returns: the #GString.
2000-09-06 00:04:49 +00:00
<!-- ##### FUNCTION g_string_prepend_unichar ##### -->
<para>
</para>
@string:
@wc:
@Returns:
2000-09-06 00:04:49 +00:00
<!-- ##### FUNCTION g_string_prepend_len ##### -->
<para>
Prepends @len bytes of @val to @string. Because @len is provided,
@val may contain embedded nuls and need not be nul-terminated.
2000-09-06 00:04:49 +00:00
</para>
@string: a #GString
@val: bytes to prepend
@len: number of bytes in @val to prepend
@Returns: the #GString passed in
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_insert ##### -->
<para>
Inserts a copy of a string into a #GString, expanding it if necessary.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@pos: the position to insert the copy of the string.
@val: the string to insert.
@Returns: the #GString.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_insert_c ##### -->
<para>
Inserts a character into a #GString, expanding it if necessary.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@pos: the position to insert the character.
@c: the character to insert.
@Returns: the #GString.
2000-09-06 00:04:49 +00:00
<!-- ##### FUNCTION g_string_insert_unichar ##### -->
<para>
</para>
@string:
@pos:
@wc:
@Returns:
2000-09-06 00:04:49 +00:00
<!-- ##### FUNCTION g_string_insert_len ##### -->
<para>
Inserts @len bytes of @val into @string at @pos. Because @len is provided, @val
may contain embedded nuls and need not be nul-terminated. If @pos is -1, bytes are inserted at the end of the string.
2000-09-06 00:04:49 +00:00
</para>
@string: a #GString
@pos: position in @string where insertion should happen, or -1 for at the end
@val: bytes to insert
@len: number of bytes of @val to insert
@Returns: the #GString
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_erase ##### -->
<para>
Removes @len characters from a #GString, starting at position @pos.
The rest of the #GString is shifted down to fill the gap.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@pos: the position of the characters to remove.
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane. Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com> Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane. * gconvert.c (g_convert/g_convert_with_fallback): Remove workarounds for since-fixed GNU libc bugs. Minor doc fix. * gconvert.[ch]: Change gint to gsize/gssize as appropriate. * gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect computation of bytes_read / bytes_written. * gfileutils.[ch] (g_file_get_contents): Make length out parameter 'gsize *len'. * ghook.c (g_hook_compare_ids): Don't compare a and b as 'a - b'. * gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE, GSIZE_TO_POINTER. * gmain.c (g_timeout_prepare): Rewrite to avoid overflows. (Fixes bug when system clock skews backwards more than 24 days.) * gmarkup.[ch]: Make lengths passed to callbacks gsize, length for g_markup_parse-context_parse(), g_markup_escape_text() gssize. * gmessages.[ch] (g_printf_string_upper_bound): Change return value to gsize. * gmessages.c (printf_string_upper_bound): Remove a ridiculous use of 'inline' on a 300 line function. * gstring.[ch]: Represent size of string as a gsize, not gint. Make parameters to functions take gsize, or gssize where -1 is allowed. * gstring.c (g_string_erase): Make g_string_erase (string, pos, -1) a synonym for g_string_truncate for consistency with other G* APIs. * gstrfuncs.[ch]: Make all functions taking a string length, take a gsize, or gssize if -1 is allowed. (g_strstr_len, g_strrstr_len). Also fix some boundary conditions in g_str[r]str[_len]. * gutf8.c tests/unicode-encoding.c: Make parameters that are byte lengths gsize, gssize as appropriate. Make character offsets, other counts, glong. * gasyncqueue.c gcompletion.c timeloop.c timeloop-basic.c gutils.c gspawn.c. Small 64 bit cleanliness fixups. * glist.c (g_list_sort2, g_list_sort_real): Fix functions that should have been static. * gdate.c (g_date_fill_parse_tokens): Fix extra declaration that was shadowing another. * tests/module-test.c: Include string.h Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com> * gutf8.c (g_get_charset): Make argument G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
@len: the number of characters to remove, or -1 to remove all
following characters.
@Returns: the #GString.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_truncate ##### -->
<para>
Cuts off the end of the GString, leaving the first @len characters.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@len: the new size of the #GString.
@Returns: the #GString.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_set_size ##### -->
<para>
</para>
@string:
@len:
@Returns:
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_free ##### -->
<para>
Frees the memory allocated for the #GString.
If free_segment is TRUE it also frees the character data.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@free_segment: if TRUE the actual character data is freed as well.
2000-09-06 00:04:49 +00:00
@Returns:
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_up ##### -->
<para>
Converts a #GString to upper case.
1999-08-16 17:58:30 +00:00
</para>
@string: a #GString.
@Returns: the #GString.
1999-08-16 17:58:30 +00:00
<!-- ##### FUNCTION g_string_down ##### -->
<para>
Converts a #GString to lower case.
2000-09-06 00:04:49 +00:00
</para>
@string: a #GString.
@Returns: the #GString.
2000-09-06 00:04:49 +00:00
<!-- ##### FUNCTION g_string_hash ##### -->
<para>
Creates a hash code for @str; for use with #GHashTable.
2000-09-06 00:04:49 +00:00
</para>
@str: a string to hash
@Returns: hash code for @str
2000-09-06 00:04:49 +00:00
<!-- ##### FUNCTION g_string_equal ##### -->
<para>
Compares two strings for equality, returning %TRUE if they are equal.
For use with #GHashTable.
1999-08-16 17:58:30 +00:00
</para>
@v: a #GString
@v2: another #GString
@Returns: %TRUE if they strings are the same length and contain the same bytes
1999-08-16 17:58:30 +00:00