mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-22 09:57:52 +02:00
Move some docs inline, and add deprecation information. To see the list of
* glib/gutils.c: * glib/gtree.c: * glib/gstring.c: * glib/gstrfuncs.c: * glib/giochannel.c: Move some docs inline, and add deprecation information. To see the list of affected functions, grep for "Deprecated:". * glib/tmpl/strings.sgml: * glib/tmpl/string_utils.sgml: * glib/tmpl/misc_utils.sgml: Move some docs inline.
This commit is contained in:
@@ -93,19 +93,10 @@ The returned string should be freed when no longer needed.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_basename ##### -->
|
||||
<para>
|
||||
This function is deprecated and will be removed in the next major
|
||||
release of GLib. Use g_path_get_basename() instead.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Gets the name of the file without any leading
|
||||
directory components. It returns a pointer into the given file name
|
||||
string.
|
||||
</para>
|
||||
|
||||
@file_name: the name of the file.
|
||||
@Returns: the name of the file without any leading directory components.
|
||||
@file_name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### MACRO g_dirname ##### -->
|
||||
|
@@ -571,73 +571,37 @@ possibly non-ASCII character in.
|
||||
|
||||
<!-- ##### FUNCTION g_strup ##### -->
|
||||
<para>
|
||||
Converts a string to upper case. This function is totally broken
|
||||
for the reasons discussed in the g_strncasecmp() docs -
|
||||
use g_ascii_strup() or g_utf8_strup() instead.
|
||||
</para>
|
||||
|
||||
@string: the string to convert.
|
||||
@string:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_strdown ##### -->
|
||||
<para>
|
||||
Converts a string to lower case. This function is totally broken for
|
||||
the reasons discussed in the g_strncasecmp() docs - use
|
||||
g_ascii_strdown() or g_utf8_strdown() instead.
|
||||
</para>
|
||||
|
||||
@string: the string to convert.
|
||||
@string:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_strcasecmp ##### -->
|
||||
<para>
|
||||
A case-insensitive string comparison, corresponding to the standard
|
||||
<function>strcasecmp()</function> function on platforms which support it.
|
||||
</para>
|
||||
<para>
|
||||
See g_strncasecmp() for a discussion of why this is deprecated and
|
||||
how to replace it.
|
||||
</para>
|
||||
|
||||
@s1: a string.
|
||||
@s2: a string to compare with @s1.
|
||||
@Returns: 0 if the strings match, a negative value if @s1 < @s2, or a positive
|
||||
value if @s1 > @s2.
|
||||
@s1:
|
||||
@s2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_strncasecmp ##### -->
|
||||
<para>
|
||||
A case-insensitive string comparison, corresponding to the standard
|
||||
<function>strncasecmp()</function> function on platforms which support it.
|
||||
It is similar to g_strcasecmp() except it only compares the first @n characters
|
||||
of the strings.
|
||||
</para>
|
||||
<para>
|
||||
The problem with g_strncasecmp() is that it does the comparison by
|
||||
calling <function>toupper()</function>/<function>tolower()</function>
|
||||
on each byte. <function>toupper()</function>/<function>tolower()</function> are
|
||||
locale-specific and operate on single bytes. However, it is impossible
|
||||
to handle things correctly from an i18n standpoint by operating on
|
||||
bytes, since characters may be multibyte. Thus g_strncasecmp() is
|
||||
broken if your string is guaranteed to be ASCII, since it's
|
||||
locale-sensitive, and it's broken if your string is localized, since
|
||||
it doesn't work on many encodings at all, including UTF-8, EUC-JP,
|
||||
etc.
|
||||
</para>
|
||||
<para>
|
||||
There are therefore two replacement functions: g_ascii_strncasecmp(),
|
||||
which only works on ASCII and is not locale-sensitive, and
|
||||
g_utf8_casefold(), which is good for case-insensitive sorting of
|
||||
UTF-8.
|
||||
</para>
|
||||
|
||||
@s1: a string.
|
||||
@s2: a string to compare with @s1.
|
||||
@n: the maximum number of characters to compare.
|
||||
@Returns: 0 if the strings match, a negative value if @s1 < @s2, or a positive
|
||||
value if @s1 > @s2.
|
||||
@s1:
|
||||
@s2:
|
||||
@n:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_strreverse ##### -->
|
||||
|
@@ -313,20 +313,18 @@ If @free_segment is %TRUE it also frees the character data.
|
||||
|
||||
<!-- ##### FUNCTION g_string_up ##### -->
|
||||
<para>
|
||||
Converts a #GString to upper case.
|
||||
</para>
|
||||
|
||||
@string: a #GString.
|
||||
@Returns: the #GString.
|
||||
@string:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_string_down ##### -->
|
||||
<para>
|
||||
Converts a #GString to lower case.
|
||||
</para>
|
||||
|
||||
@string: a #GString.
|
||||
@Returns: the #GString.
|
||||
@string:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_string_hash ##### -->
|
||||
|
Reference in New Issue
Block a user