glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,

glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
This commit is contained in:
Matthias Clasen
2001-09-24 21:28:57 +00:00
parent 1efae7e5ba
commit 50d0ad9803
13 changed files with 160 additions and 95 deletions

View File

@@ -1,3 +1,8 @@
2001-09-24 Matthias Clasen <matthiasc@poet.de>
* glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> 2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* configure.in: Added "sk" to ALL_LINGUAS. * configure.in: Added "sk" to ALL_LINGUAS.

View File

@@ -1,3 +1,8 @@
2001-09-24 Matthias Clasen <matthiasc@poet.de>
* glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> 2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* configure.in: Added "sk" to ALL_LINGUAS. * configure.in: Added "sk" to ALL_LINGUAS.

View File

@@ -1,3 +1,8 @@
2001-09-24 Matthias Clasen <matthiasc@poet.de>
* glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> 2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* configure.in: Added "sk" to ALL_LINGUAS. * configure.in: Added "sk" to ALL_LINGUAS.

View File

@@ -1,3 +1,8 @@
2001-09-24 Matthias Clasen <matthiasc@poet.de>
* glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> 2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* configure.in: Added "sk" to ALL_LINGUAS. * configure.in: Added "sk" to ALL_LINGUAS.

View File

@@ -1,3 +1,8 @@
2001-09-24 Matthias Clasen <matthiasc@poet.de>
* glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> 2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* configure.in: Added "sk" to ALL_LINGUAS. * configure.in: Added "sk" to ALL_LINGUAS.

View File

@@ -1,3 +1,8 @@
2001-09-24 Matthias Clasen <matthiasc@poet.de>
* glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> 2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* configure.in: Added "sk" to ALL_LINGUAS. * configure.in: Added "sk" to ALL_LINGUAS.

View File

@@ -1,3 +1,8 @@
2001-09-24 Matthias Clasen <matthiasc@poet.de>
* glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> 2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* configure.in: Added "sk" to ALL_LINGUAS. * configure.in: Added "sk" to ALL_LINGUAS.

View File

@@ -1,3 +1,8 @@
2001-09-24 Matthias Clasen <matthiasc@poet.de>
* glib/gutf8.c, glib/gunibreak.c, glib/gunicollate.c,
glib/gunidecomp.c, glib/guniprop.c: Inline doc consistency fixes.
2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> 2001-09-24 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* configure.in: Added "sk" to ALL_LINGUAS. * configure.in: Added "sk" to ALL_LINGUAS.

View File

@@ -43,10 +43,10 @@
* (to derive a character from UTF-8 encoded text, use * (to derive a character from UTF-8 encoded text, use
* g_utf8_get_char()). The break type is used to find word and line * g_utf8_get_char()). The break type is used to find word and line
* breaks ("text boundaries"), Pango implements the Unicode boundary * breaks ("text boundaries"), Pango implements the Unicode boundary
* resolution alogorithms and normally you would use a function such * resolution algorithms and normally you would use a function such
* as pango_break() instead of caring about break types yourself. * as pango_break() instead of caring about break types yourself.
* *
* Return value: break type * Return value: the break type of @c
**/ **/
GUnicodeBreakType GUnicodeBreakType
g_unichar_break_type (gunichar c) g_unichar_break_type (gunichar c)

View File

@@ -39,11 +39,11 @@ extern gunichar *_g_utf8_normalize_wc (const gchar *str,
* correct rules for the current locale. When sorting a large * correct rules for the current locale. When sorting a large
* number of strings, it will be significantly faster to * number of strings, it will be significantly faster to
* obtain collation keys with g_utf8_collate_key() and * obtain collation keys with g_utf8_collate_key() and
* compare the keys with strcmp() when sorting instead of * compare the keys with <function>strcmp()</function> when
* sorting the original strings. * sorting instead of sorting the original strings.
* *
* Return value: -1 if str1 compares before str2, 0 if they * Return value: -1 if @str1 compares before @str2, 0 if they
* compare equal, 1 if str1 compares after str2. * compare equal, 1 if @str1 compares after @str2.
**/ **/
gint gint
g_utf8_collate (const gchar *str1, g_utf8_collate (const gchar *str1,
@@ -152,13 +152,13 @@ utf8_encode (char *buf, wchar_t val)
* @len: length of @str, in bytes, or -1 if @str is nul-terminated. * @len: length of @str, in bytes, or -1 if @str is nul-terminated.
* *
* Converts a string into a collation key that can be compared * Converts a string into a collation key that can be compared
* with other collation keys using strcmp(). The results of * with other collation keys using <function>strcmp()</function>.
* comparing the collation keys of two strings with strcmp() * The results of comparing the collation keys of two strings
* will always be the same as comparing the two original * with <function>strcmp()</function> will always be the same as
* keys with g_utf8_collate(). * comparing the two original keys with g_utf8_collate().
* *
* Return value: a newly allocated string. This string should * Return value: a newly allocated string. This string should
* be freed with g_free when you are done with it. * be freed with g_free() when you are done with it.
**/ **/
gchar * gchar *
g_utf8_collate_key (const gchar *str, g_utf8_collate_key (const gchar *str,

View File

@@ -38,7 +38,16 @@
#define COMBINING_CLASS(Char) \ #define COMBINING_CLASS(Char) \
(((Char) > (G_UNICODE_LAST_CHAR)) ? 0 : CC((Char) >> 8, (Char) & 0xff)) (((Char) > (G_UNICODE_LAST_CHAR)) ? 0 : CC((Char) >> 8, (Char) & 0xff))
/* Compute the canonical ordering of a string in-place. */ /**
* g_unicode_canonical_ordering:
* @string: a UCS-4 encoded string.
* @len: the maximum length of @string to use.
*
* Computes the canonical ordering of a string in-place.
* This rearranges decomposed characters in the string
* according to their combining classes. See the Unicode
* manual for more information.
**/
void void
g_unicode_canonical_ordering (gunichar *string, g_unicode_canonical_ordering (gunichar *string,
gsize len) gsize len)
@@ -121,6 +130,16 @@ find_decomposition (gunichar ch,
return NULL; return NULL;
} }
/**
* g_unicode_canonical_decomposition:
* @ch: a Unicode character.
* @result_len: location to store the length of the return value.
*
* Computes the canonical decomposition of a Unicode character.
*
* Return value: a newly allocated string of Unicode characters.
* @result_len is set to the resulting length of the string.
**/
gunichar * gunichar *
g_unicode_canonical_decomposition (gunichar ch, g_unicode_canonical_decomposition (gunichar ch,
gsize *result_len) gsize *result_len)
@@ -349,11 +368,11 @@ _g_utf8_normalize_wc (const gchar *str,
* @len: length of @str, in bytes, or -1 if @str is nul-terminated. * @len: length of @str, in bytes, or -1 if @str is nul-terminated.
* @mode: the type of normalization to perform. * @mode: the type of normalization to perform.
* *
* Convert a string into canonical form, standardizing * Converts a string into canonical form, standardizing
* such issues as whether a character with an accent * such issues as whether a character with an accent
* is represented as a base character and combining * is represented as a base character and combining
* accent or as a single precomposed characters. You * accent or as a single precomposed character. You
* should generally call g_utf8_normalize before * should generally call g_utf8_normalize() before
* comparing two Unicode strings. * comparing two Unicode strings.
* *
* The normalization mode %G_NORMALIZE_DEFAULT only * The normalization mode %G_NORMALIZE_DEFAULT only
@@ -376,7 +395,8 @@ _g_utf8_normalize_wc (const gchar *str,
* a legacy encoding or pass it to a system with * a legacy encoding or pass it to a system with
* less capable Unicode handling. * less capable Unicode handling.
* *
* Return value: the string in normalized form * Return value: a newly allocated string, that is the
* normalized form of @str.
**/ **/
gchar * gchar *
g_utf8_normalize (const gchar *str, g_utf8_normalize (const gchar *str,

View File

@@ -247,11 +247,11 @@ g_unichar_isspace (gunichar c)
/** /**
* g_unichar_isupper: * g_unichar_isupper:
* @c: a unicode character * @c: a Unicode character
* *
* Determines if a character is uppercase. * Determines if a character is uppercase.
* *
* Return value: %TRUE if @c is an uppercase character. * Return value: %TRUE if @c is an uppercase character
**/ **/
gboolean gboolean
g_unichar_isupper (gunichar c) g_unichar_isupper (gunichar c)
@@ -261,16 +261,16 @@ g_unichar_isupper (gunichar c)
/** /**
* g_unichar_istitle: * g_unichar_istitle:
* @c: a unicode character * @c: a Unicode character
* *
* Determines if a character is titlecase. Some characters in * Determines if a character is titlecase. Some characters in
* Unicode which are composites, such as the DZ digraph * Unicode which are composites, such as the DZ digraph
* have three case variants instead of just two. The titlecase * have three case variants instead of just two. The titlecase
* form is used at the beginning of a word where only the * form is used at the beginning of a word where only the
* first letter is capitalized. The titlecase form of the DZ * first letter is capitalized. The titlecase form of the DZ
* digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z * digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z.
* *
* Return value: %TRUE if the character is titlecase. * Return value: %TRUE if the character is titlecase
**/ **/
gboolean gboolean
g_unichar_istitle (gunichar c) g_unichar_istitle (gunichar c)
@@ -284,11 +284,11 @@ g_unichar_istitle (gunichar c)
/** /**
* g_unichar_isxdigit: * g_unichar_isxdigit:
* @c: a unicode character. * @c: a Unicode character.
* *
* Determines if a characters is a hexidecimal digit * Determines if a character is a hexidecimal digit.
* *
* Return value: %TRUE if the character is a hexadecimal digit. * Return value: %TRUE if the character is a hexadecimal digit
**/ **/
gboolean gboolean
g_unichar_isxdigit (gunichar c) g_unichar_isxdigit (gunichar c)
@@ -301,12 +301,12 @@ g_unichar_isxdigit (gunichar c)
/** /**
* g_unichar_isdefined: * g_unichar_isdefined:
* @c: a unicode character * @c: a Unicode character
* *
* Determines if a given character is assigned in the Unicode * Determines if a given character is assigned in the Unicode
* standard. * standard.
* *
* Return value: %TRUE if the character has an assigned value. * Return value: %TRUE if the character has an assigned value
**/ **/
gboolean gboolean
g_unichar_isdefined (gunichar c) g_unichar_isdefined (gunichar c)
@@ -317,12 +317,12 @@ g_unichar_isdefined (gunichar c)
/** /**
* g_unichar_iswide: * g_unichar_iswide:
* @c: a unicode character * @c: a Unicode character
* *
* Determines if a character is typically rendered in a double-width * Determines if a character is typically rendered in a double-width
* cell. * cell.
* *
* Return value: %TRUE if the character is wide. * Return value: %TRUE if the character is wide
**/ **/
/* This function stolen from Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk>. */ /* This function stolen from Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk>. */
gboolean gboolean
@@ -343,9 +343,9 @@ g_unichar_iswide (gunichar c)
/** /**
* g_unichar_toupper: * g_unichar_toupper:
* @c: a unicode character * @c: a Unicode character
* *
* Convert a character to uppercase. * Converts a character to uppercase.
* *
* Return value: the result of converting @c to uppercase. * Return value: the result of converting @c to uppercase.
* If @c is not an lowercase or titlecase character, * If @c is not an lowercase or titlecase character,
@@ -380,9 +380,9 @@ g_unichar_toupper (gunichar c)
/** /**
* g_unichar_tolower: * g_unichar_tolower:
* @c: a unicode character. * @c: a Unicode character.
* *
* Convert a character to lower case * Converts a character to lower case.
* *
* Return value: the result of converting @c to lower case. * Return value: the result of converting @c to lower case.
* If @c is not an upperlower or titlecase character, * If @c is not an upperlower or titlecase character,
@@ -417,9 +417,9 @@ g_unichar_tolower (gunichar c)
/** /**
* g_unichar_totitle: * g_unichar_totitle:
* @c: a unicode character * @c: a Unicode character
* *
* Convert a character to the titlecase * Converts a character to the titlecase.
* *
* Return value: the result of converting @c to titlecase. * Return value: the result of converting @c to titlecase.
* If @c is not an uppercase or lowercase character, * If @c is not an uppercase or lowercase character,
@@ -442,13 +442,13 @@ g_unichar_totitle (gunichar c)
/** /**
* g_unichar_digit_value: * g_unichar_digit_value:
* @c: a unicode character * @c: a Unicode character
* *
* Determines the numeric value of a character as a decimal * Determines the numeric value of a character as a decimal
* digit. * digit.
* *
* Return value: If @c is a decimal digit (according to * Return value: If @c is a decimal digit (according to
* `g_unichar_isdigit'), its numeric value. Otherwise, -1. * g_unichar_isdigit()), its numeric value. Otherwise, -1.
**/ **/
int int
g_unichar_digit_value (gunichar c) g_unichar_digit_value (gunichar c)
@@ -460,13 +460,13 @@ g_unichar_digit_value (gunichar c)
/** /**
* g_unichar_xdigit_value: * g_unichar_xdigit_value:
* @c: a unicode character * @c: a Unicode character
* *
* Determines the numeric value of a character as a hexidecimal * Determines the numeric value of a character as a hexidecimal
* digit. * digit.
* *
* Return value: If @c is a hex digit (according to * Return value: If @c is a hex digit (according to
* `g_unichar_isxdigit'), its numeric value. Otherwise, -1. * g_unichar_isxdigit()), its numeric value. Otherwise, -1.
**/ **/
int int
g_unichar_xdigit_value (gunichar c) g_unichar_xdigit_value (gunichar c)
@@ -482,9 +482,9 @@ g_unichar_xdigit_value (gunichar c)
/** /**
* g_unichar_type: * g_unichar_type:
* @c: a unicode character * @c: a Unicode character
* *
* Classifies a unicode character by type. * Classifies a Unicode character by type.
* *
* Return value: the type of the character. * Return value: the type of the character.
**/ **/

View File

@@ -114,14 +114,14 @@ const gchar * const g_utf8_skip = utf8_skip_data;
/** /**
* g_utf8_find_prev_char: * g_utf8_find_prev_char:
* @str: pointer to the beginning of a UTF-8 string * @str: pointer to the beginning of a UTF-8 encoded string
* @p: pointer to some position within @str * @p: pointer to some position within @str
* *
* Given a position @p with a UTF-8 encoded string @str, find the start * Given a position @p with a UTF-8 encoded string @str, find the start
* of the previous UTF-8 character starting before @p. Returns %NULL if no * of the previous UTF-8 character starting before @p. Returns %NULL if no
* UTF-8 characters are present in @p before @str. * UTF-8 characters are present in @p before @str.
* *
* @p does not have to be at the beginning of a UTF-8 chracter. No check * @p does not have to be at the beginning of a UTF-8 character. No check
* is made to see if the character found is actually valid other than * is made to see if the character found is actually valid other than
* it starts with an appropriate byte. * it starts with an appropriate byte.
* *
@@ -143,12 +143,12 @@ g_utf8_find_prev_char (const char *str,
* g_utf8_find_next_char: * g_utf8_find_next_char:
* @p: a pointer to a position within a UTF-8 encoded string * @p: a pointer to a position within a UTF-8 encoded string
* @end: a pointer to the end of the string, or %NULL to indicate * @end: a pointer to the end of the string, or %NULL to indicate
* that the string is NULL terminated, in which case * that the string is nul-terminated, in which case
* the returned value will be * the returned value will be
* *
* Find the start of the next utf-8 character in the string after @p * Finds the start of the next UTF-8 character in the string after @p.
* *
* @p does not have to be at the beginning of a UTF-8 chracter. No check * @p does not have to be at the beginning of a UTF-8 character. No check
* is made to see if the character found is actually valid other than * is made to see if the character found is actually valid other than
* it starts with an appropriate byte. * it starts with an appropriate byte.
* *
@@ -174,12 +174,12 @@ g_utf8_find_next_char (const gchar *p,
* g_utf8_prev_char: * g_utf8_prev_char:
* @p: a pointer to a position within a UTF-8 encoded string * @p: a pointer to a position within a UTF-8 encoded string
* *
* Find the previous UTF-8 character in the string before @p. * Finds the previous UTF-8 character in the string before @p.
* *
* @p does not have to be at the beginning of a UTF-8 character. No check * @p does not have to be at the beginning of a UTF-8 character. No check
* is made to see if the character found is actually valid other than * is made to see if the character found is actually valid other than
* it starts with an appropriate byte. If @p might be the first * it starts with an appropriate byte. If @p might be the first
* character of the string, you must use g_utf8_find_prev_char instead. * character of the string, you must use g_utf8_find_prev_char() instead.
* *
* Return value: a pointer to the found character. * Return value: a pointer to the found character.
**/ **/
@@ -196,11 +196,13 @@ g_utf8_prev_char (const gchar *p)
/** /**
* g_utf8_strlen: * g_utf8_strlen:
* @p: pointer to the start of a UTF-8 string. * @p: pointer to the start of a UTF-8 encoded string.
* @max: the maximum number of bytes to examine. If @max * @max: the maximum number of bytes to examine. If @max
* is less than 0, then the string is assumed to be * is less than 0, then the string is assumed to be
* nul-terminated. * nul-terminated.
* *
* Returns the length of the string in characters.
*
* Return value: the length of the string in characters * Return value: the length of the string in characters
**/ **/
glong glong
@@ -243,12 +245,12 @@ g_utf8_strlen (const gchar *p,
/** /**
* g_utf8_get_char: * g_utf8_get_char:
* @p: a pointer to unicode character encoded as UTF-8 * @p: a pointer to Unicode character encoded as UTF-8
* *
* Convert a sequence of bytes encoded as UTF-8 to a unicode character. * Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
* If @p does not point to a valid UTF-8 encoded character, results are * If @p does not point to a valid UTF-8 encoded character, results are
* undefined. If you are not sure that the bytes are complete * undefined. If you are not sure that the bytes are complete
* valid unicode characters, you should use g_utf8_get_char_validated() * valid Unicode characters, you should use g_utf8_get_char_validated()
* instead. * instead.
* *
* Return value: the resulting character * Return value: the resulting character
@@ -271,7 +273,7 @@ g_utf8_get_char (const gchar *p)
/** /**
* g_utf8_offset_to_pointer: * g_utf8_offset_to_pointer:
* @str: a UTF-8 encoded string * @str: a UTF-8 encoded string
* @offset: a character offset within the string. * @offset: a character offset within @str
* *
* Converts from an integer character offset to a pointer to a position * Converts from an integer character offset to a pointer to a position
* within the string. * within the string.
@@ -295,7 +297,7 @@ g_utf8_offset_to_pointer (const gchar *str,
* @pos: a pointer to a position within @str * @pos: a pointer to a position within @str
* *
* Converts from a pointer to position within a string to a integer * Converts from a pointer to position within a string to a integer
* character offset * character offset.
* *
* Return value: the resulting character offset * Return value: the resulting character offset
**/ **/
@@ -319,13 +321,14 @@ g_utf8_pointer_to_offset (const gchar *str,
/** /**
* g_utf8_strncpy: * g_utf8_strncpy:
* @dest: buffer to fill with characters from @src * @dest: buffer to fill with characters from @src
* @src: UTF-8 string * @src: UTF-8 encoded string
* @n: character count * @n: character count
* *
* Like the standard C strncpy() function, but copies a given number * Like the standard C <function>strncpy()</function> function, but
* of characters instead of a given number of bytes. The @src string * copies a given number of characters instead of a given number of
* must be valid UTF-8 encoded text. (Use g_utf8_validate() on all * bytes. The @src string must be valid UTF-8 encoded text.
* text before trying to use UTF-8 utility functions with it.) * (Use g_utf8_validate() on all text before trying to use UTF-8
* utility functions with it.)
* *
* Return value: @dest * Return value: @dest
**/ **/
@@ -440,9 +443,9 @@ g_get_charset (G_CONST_RETURN char **charset)
* @c: a ISO10646 character code * @c: a ISO10646 character code
* @outbuf: output buffer, must have at least 6 bytes of space. * @outbuf: output buffer, must have at least 6 bytes of space.
* If %NULL, the length will be computed and returned * If %NULL, the length will be computed and returned
* and nothing will be written to @out. * and nothing will be written to @outbuf.
* *
* Convert a single character to utf8 * Converts a single character to UTF-8.
* *
* Return value: number of bytes written * Return value: number of bytes written
**/ **/
@@ -500,16 +503,17 @@ g_unichar_to_utf8 (gunichar c,
/** /**
* g_utf8_strchr: * g_utf8_strchr:
* @p: a nul-terminated utf-8 string * @p: a nul-terminated UTF-8 encoded string
* @len: the maximum length of p * @len: the maximum length of @p
* @c: a iso-10646 character * @c: a ISO10646 character
* *
* Find the leftmost occurence of the given iso-10646 character * Finds the leftmost occurrence of the given ISO10646 character
* in a UTF-8 string, while limiting the search to p_len bytes. * in a UTF-8 encoded string, while limiting the search to @len bytes.
* If len is -1, allow unbounded search. * If @len is -1, allow unbounded search.
* *
* Return value: NULL if the string does not contain the character, otherwise, a * Return value: %NULL if the string does not contain the character,
* a pointer to the start of the leftmost of the character in the string. * otherwise, a pointer to the start of the leftmost occurrence of
* the character in the string.
**/ **/
gchar * gchar *
g_utf8_strchr (const char *p, g_utf8_strchr (const char *p,
@@ -527,16 +531,17 @@ g_utf8_strchr (const char *p,
/** /**
* g_utf8_strrchr: * g_utf8_strrchr:
* @p: a nul-terminated utf-8 string * @p: a nul-terminated UTF-8 encoded string
* @len: the maximum length of p * @len: the maximum length of @p
* @c: a iso-10646 character/ * @c: a ISO10646 character
* *
* Find the rightmost occurence of the given iso-10646 character * Find the rightmost occurrence of the given ISO10646 character
* in a UTF-8 string, while limiting the search to p_len bytes. * in a UTF-8 encoded string, while limiting the search to @len bytes.
* If len is -1, allow unbounded search. * If @len is -1, allow unbounded search.
* *
* Return value: NULL if the string does not contain the character, otherwise, a * Return value: %NULL if the string does not contain the character,
* a pointer to the start of the rightmost of the character in the string. * otherwise, a pointer to the start of the rightmost occurrence of the
* character in the string.
**/ **/
gchar * gchar *
g_utf8_strrchr (const char *p, g_utf8_strrchr (const char *p,
@@ -634,10 +639,10 @@ g_utf8_get_char_extended (const gchar *p,
/** /**
* g_utf8_get_char_validated: * g_utf8_get_char_validated:
* @p: a pointer to unicode character encoded as UTF-8 * @p: a pointer to Unicode character encoded as UTF-8
* @max_len: the maximum number of bytes to read, or -1, for no maximum. * @max_len: the maximum number of bytes to read, or -1, for no maximum.
* *
* Convert a sequence of bytes encoded as UTF-8 to a unicode character. * Convert a sequence of bytes encoded as UTF-8 to a Unicode character.
* This function checks for incomplete characters, for invalid characters * This function checks for incomplete characters, for invalid characters
* such as characters that are out of the range of Unicode, and for * such as characters that are out of the range of Unicode, and for
* overlong encodings of valid characters. * overlong encodings of valid characters.
@@ -645,7 +650,7 @@ g_utf8_get_char_extended (const gchar *p,
* Return value: the resulting character. If @p points to a partial * Return value: the resulting character. If @p points to a partial
* sequence at the end of a string that could begin a valid character, * sequence at the end of a string that could begin a valid character,
* returns (gunichar)-2; otherwise, if @p does not point to a valid * returns (gunichar)-2; otherwise, if @p does not point to a valid
* UTF-8 encoded unicode character, returns (gunichar)-1. * UTF-8 encoded Unicode character, returns (gunichar)-1.
**/ **/
gunichar gunichar
g_utf8_get_char_validated (const gchar *p, g_utf8_get_char_validated (const gchar *p,
@@ -664,8 +669,8 @@ g_utf8_get_char_validated (const gchar *p,
/** /**
* g_utf8_to_ucs4_fast: * g_utf8_to_ucs4_fast:
* @str: a UTF-8 encoded string * @str: a UTF-8 encoded string
* @len: the maximum length of @str to use. If < 0, then * @len: the maximum length of @str to use. If @len < 0, then
* the string is %NULL terminated. * the string is nul-terminated.
* @items_written: location to store the number of characters in the * @items_written: location to store the number of characters in the
* result, or %NULL. * result, or %NULL.
* *
@@ -675,7 +680,7 @@ g_utf8_get_char_validated (const gchar *p,
* but does no error checking on the input. * but does no error checking on the input.
* *
* Return value: a pointer to a newly allocated UCS-4 string. * Return value: a pointer to a newly allocated UCS-4 string.
* This value must be freed with g_free() * This value must be freed with g_free().
**/ **/
gunichar * gunichar *
g_utf8_to_ucs4_fast (const gchar *str, g_utf8_to_ucs4_fast (const gchar *str,
@@ -769,8 +774,8 @@ g_utf8_to_ucs4_fast (const gchar *str,
/** /**
* g_utf8_to_ucs4: * g_utf8_to_ucs4:
* @str: a UTF-8 encoded string * @str: a UTF-8 encoded string
* @len: the maximum length of @str to use. If < 0, then * @len: the maximum length of @str to use. If @len < 0, then
* the string is %NULL terminated. * the string is nul-terminated.
* @items_read: location to store number of bytes read, or %NULL. * @items_read: location to store number of bytes read, or %NULL.
* If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be * If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be
* returned in case @str contains a trailing partial * returned in case @str contains a trailing partial
@@ -853,8 +858,8 @@ g_utf8_to_ucs4 (const gchar *str,
/** /**
* g_ucs4_to_utf8: * g_ucs4_to_utf8:
* @str: a UCS-4 encoded string * @str: a UCS-4 encoded string
* @len: the maximum length of @str to use. If < 0, then * @len: the maximum length of @str to use. If @len < 0, then
* the string is %NULL terminated. * the string is terminated with a 0 character.
* @items_read: location to store number of characters read read, or %NULL. * @items_read: location to store number of characters read read, or %NULL.
* @items_written: location to store number of bytes written or %NULL. * @items_written: location to store number of bytes written or %NULL.
* The value here stored does not include the trailing 0 * The value here stored does not include the trailing 0
@@ -926,7 +931,7 @@ g_ucs4_to_utf8 (const gunichar *str,
/** /**
* g_utf16_to_utf8: * g_utf16_to_utf8:
* @str: a UTF-16 encoded string * @str: a UTF-16 encoded string
* @len: the maximum length of @str to use. If < 0, then * @len: the maximum length of @str to use. If @len < 0, then
* the string is terminated with a 0 character. * the string is terminated with a 0 character.
* @items_read: location to store number of words read, or %NULL. * @items_read: location to store number of words read, or %NULL.
* If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be * If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be
@@ -1070,7 +1075,7 @@ g_utf16_to_utf8 (const gunichar2 *str,
/** /**
* g_utf16_to_ucs4: * g_utf16_to_ucs4:
* @str: a UTF-16 encoded string * @str: a UTF-16 encoded string
* @len: the maximum length of @str to use. If < 0, then * @len: the maximum length of @str to use. If @len < 0, then
* the string is terminated with a 0 character. * the string is terminated with a 0 character.
* @items_read: location to store number of words read, or %NULL. * @items_read: location to store number of words read, or %NULL.
* If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be * If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be
@@ -1212,8 +1217,8 @@ g_utf16_to_ucs4 (const gunichar2 *str,
/** /**
* g_utf8_to_utf16: * g_utf8_to_utf16:
* @str: a UTF-8 encoded string * @str: a UTF-8 encoded string
* @len: the maximum length of @str to use. If < 0, then * @len: the maximum length of @str to use. If @len < 0, then
* the string is %NULL terminated. * the string is nul-terminated.
* @items_read: location to store number of bytes read, or %NULL. * @items_read: location to store number of bytes read, or %NULL.
* If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be * If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be
@@ -1330,8 +1335,8 @@ g_utf8_to_utf16 (const gchar *str,
/** /**
* g_ucs4_to_utf16: * g_ucs4_to_utf16:
* @str: a UCS-4 encoded string * @str: a UCS-4 encoded string
* @len: the maximum length of @str to use. If < 0, then * @len: the maximum length of @str to use. If @len < 0, then
* the string is terminated with a zero character. * the string is terminated with a 0 character.
* @items_read: location to store number of bytes read, or %NULL. * @items_read: location to store number of bytes read, or %NULL.
* If an error occurs then the index of the invalid input * If an error occurs then the index of the invalid input
* is stored here. * is stored here.
@@ -1433,12 +1438,12 @@ g_ucs4_to_utf16 (const gunichar *str,
* if some bytes were invalid, or the end of the text being validated * if some bytes were invalid, or the end of the text being validated
* otherwise). * otherwise).
* *
* Returns TRUE if all of @str was valid. Many GLib and GTK+ * Returns %TRUE if all of @str was valid. Many GLib and GTK+
* routines <emphasis>require</emphasis> valid UTF8 as input; * routines <emphasis>require</emphasis> valid UTF-8 as input;
* so data read from a file or the network should be checked * so data read from a file or the network should be checked
* with g_utf8_validate() before doing anything else with it. * with g_utf8_validate() before doing anything else with it.
* *
* Return value: TRUE if the text was valid UTF-8. * Return value: %TRUE if the text was valid UTF-8
**/ **/
gboolean gboolean
g_utf8_validate (const gchar *str, g_utf8_validate (const gchar *str,