From 3346808702b3c828b82f4b444b796f2bb8cd5c4e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 11 Mar 2002 21:38:18 +0000 Subject: [PATCH] Add a note about g_strreverse() and UTF-8. * glib/tmpl/string_utils.sgml: Add a note about g_strreverse() and UTF-8. * glib/gstrfuncs.c (g_strtod): (g_ascii_strtod): (g_ascii_dtostr): (g_ascii_formatd): Doc formatting fixes. --- ChangeLog | 7 +++ ChangeLog.pre-2-0 | 7 +++ ChangeLog.pre-2-10 | 7 +++ ChangeLog.pre-2-12 | 7 +++ ChangeLog.pre-2-2 | 7 +++ ChangeLog.pre-2-4 | 7 +++ ChangeLog.pre-2-6 | 7 +++ ChangeLog.pre-2-8 | 7 +++ docs/reference/ChangeLog | 4 ++ docs/reference/glib/tmpl/string_utils.sgml | 5 +- glib/gstrfuncs.c | 54 +++++++++++----------- 11 files changed, 91 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b44d8a92..2c89fa3b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-03-11 Matthias Clasen + + * glib/gstrfuncs.c (g_strtod): + (g_ascii_strtod): + (g_ascii_dtostr): + (g_ascii_formatd): Doc formatting fixes. + Fri Mar 8 10:58:28 2002 Owen Taylor * ======== Released 2.0.0 ======== diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 6b44d8a92..2c89fa3b6 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +2002-03-11 Matthias Clasen + + * glib/gstrfuncs.c (g_strtod): + (g_ascii_strtod): + (g_ascii_dtostr): + (g_ascii_formatd): Doc formatting fixes. + Fri Mar 8 10:58:28 2002 Owen Taylor * ======== Released 2.0.0 ======== diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6b44d8a92..2c89fa3b6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2002-03-11 Matthias Clasen + + * glib/gstrfuncs.c (g_strtod): + (g_ascii_strtod): + (g_ascii_dtostr): + (g_ascii_formatd): Doc formatting fixes. + Fri Mar 8 10:58:28 2002 Owen Taylor * ======== Released 2.0.0 ======== diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 6b44d8a92..2c89fa3b6 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +2002-03-11 Matthias Clasen + + * glib/gstrfuncs.c (g_strtod): + (g_ascii_strtod): + (g_ascii_dtostr): + (g_ascii_formatd): Doc formatting fixes. + Fri Mar 8 10:58:28 2002 Owen Taylor * ======== Released 2.0.0 ======== diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 6b44d8a92..2c89fa3b6 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +2002-03-11 Matthias Clasen + + * glib/gstrfuncs.c (g_strtod): + (g_ascii_strtod): + (g_ascii_dtostr): + (g_ascii_formatd): Doc formatting fixes. + Fri Mar 8 10:58:28 2002 Owen Taylor * ======== Released 2.0.0 ======== diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6b44d8a92..2c89fa3b6 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +2002-03-11 Matthias Clasen + + * glib/gstrfuncs.c (g_strtod): + (g_ascii_strtod): + (g_ascii_dtostr): + (g_ascii_formatd): Doc formatting fixes. + Fri Mar 8 10:58:28 2002 Owen Taylor * ======== Released 2.0.0 ======== diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6b44d8a92..2c89fa3b6 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +2002-03-11 Matthias Clasen + + * glib/gstrfuncs.c (g_strtod): + (g_ascii_strtod): + (g_ascii_dtostr): + (g_ascii_formatd): Doc formatting fixes. + Fri Mar 8 10:58:28 2002 Owen Taylor * ======== Released 2.0.0 ======== diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6b44d8a92..2c89fa3b6 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +2002-03-11 Matthias Clasen + + * glib/gstrfuncs.c (g_strtod): + (g_ascii_strtod): + (g_ascii_dtostr): + (g_ascii_formatd): Doc formatting fixes. + Fri Mar 8 10:58:28 2002 Owen Taylor * ======== Released 2.0.0 ======== diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index f99549a84..aead46156 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,7 @@ +2002-03-11 Matthias Clasen + + * glib/tmpl/string_utils.sgml: Add a note about g_strreverse() and UTF-8. + 2002-02-21 Matthias Clasen * glib/Makefile.am (IGNORE_HFILES): Add gdebug.h. diff --git a/docs/reference/glib/tmpl/string_utils.sgml b/docs/reference/glib/tmpl/string_utils.sgml index 1ad7edc8d..a0ff56e9c 100644 --- a/docs/reference/glib/tmpl/string_utils.sgml +++ b/docs/reference/glib/tmpl/string_utils.sgml @@ -601,9 +601,12 @@ value if @s1 > @s2. -Reverses all of the characters in a string. +Reverses all of the bytes in a string. For example, g_strreverse ("abcdef") will result in "fedcba". + +Note that g_strreverse() doesn't work on UTF-8 strings containing multibyte characters. + @string: the string to reverse. @Returns: the same pointer passed in as @string. diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index 28ccc9e3b..08c3e55b8 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -257,22 +257,22 @@ g_strconcat (const gchar *string1, ...) /** * g_strtod: * @nptr: the string to convert to a numeric value. - * @endptr: if non-NULL, it returns the character after + * @endptr: if non-%NULL, it returns the character after * the last character used in the conversion. * - * Converts a string to a gdouble value. + * Converts a string to a #gdouble value. * It calls the standard strtod() function to handle the conversion, but * if the string is not completely converted it attempts the conversion - * again with @g_ascii_strtod, and returns the best match. + * again with g_ascii_strtod(), and returns the best match. * - * This function should seldom be used. The normal situation when reading - * numbers not for human consumption is to use @g_ascii_strtod(). Only when - * you know that you must expect both locale formated and C formated numbers + * This function should seldomly be used. The normal situation when reading + * numbers not for human consumption is to use g_ascii_strtod(). Only when + * you know that you must expect both locale formatted and C formatted numbers * should you use this. Make sure that you don't pass strings such as comma * separated lists of values, since the commas may be interpreted as a decimal * point in some locales, causing unexpected results. * - * Return value: the gdouble value. + * Return value: the #gdouble value. **/ gdouble g_strtod (const gchar *nptr, @@ -310,10 +310,10 @@ g_strtod (const gchar *nptr, /** * g_ascii_strtod: * @nptr: the string to convert to a numeric value. - * @endptr: if non-NULL, it returns the character after + * @endptr: if non-%NULL, it returns the character after * the last character used in the conversion. * - * Converts a string to a gdouble value. + * Converts a string to a #gdouble value. * This function behaves like the standard strtod() function * does in the C locale. It does this without actually * changing the current locale, since that would not be @@ -322,20 +322,20 @@ g_strtod (const gchar *nptr, * This function is typically used when reading configuration * files or other non-user input that should be locale dependent. * To handle input from the user you should normally use the - * locale-sensitive system strtod function. + * locale-sensitive system strtod() function. * - * To convert from a string to double in a locale-insensitive - * way, use @g_ascii_dtostr. + * To convert from a string to #gdouble in a locale-insensitive + * way, use g_ascii_dtostr(). * - * If the correct value would cause overflow, plus or minus HUGE_VAL - * is returned (according to the sign of the value), and ERANGE is - * stored in errno. If the correct value would cause underflow, - * zero is returned and ERANGE is stored in errno. + * If the correct value would cause overflow, plus or minus %HUGE_VAL + * is returned (according to the sign of the value), and %ERANGE is + * stored in %errno. If the correct value would cause underflow, + * zero is returned and %ERANGE is stored in %errno. * - * This function resets errno before calling strtod() so that + * This function resets %errno before calling strtod() so that * you can reliably detect overflow and underflow. * - * Return value: the gdouble value. + * Return value: the #gdouble value. **/ gdouble g_ascii_strtod (const gchar *nptr, @@ -467,13 +467,13 @@ g_ascii_strtod (const gchar *nptr, * g_ascii_dtostr: * @buffer: A buffer to place the resulting string in * @buf_len: The length of the buffer. - * @d: The double to convert + * @d: The #gdouble to convert * - * Converts a double to a string, using the '.' as - * decimal_point. + * Converts a #gdouble to a string, using the '.' as + * decimal point. * * This functions generates enough precision that converting - * the string back using @g_strtod gives the same machine-number + * the string back using g_strtod() gives the same machine-number * (on machines with IEEE compatible 64bit doubles). It is * guaranteed that the size of the resulting string will never * be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes. @@ -494,15 +494,15 @@ g_ascii_dtostr (gchar *buffer, * @buf_len: The length of the buffer. * @format: The printf-style format to use for the * code to use for converting. - * @d: The double to convert + * @d: The #gdouble to convert * - * Converts a double to a string, using the '.' as - * decimal_point. To format the number you pass in + * Converts a #gdouble to a string, using the '.' as + * decimal point. To format the number you pass in * a printf-style formating string. Allowed conversion - * specifiers are eEfFgG. + * specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'. * * If you just want to want to serialize the value into a - * string, use @g_ascii_dtostr. + * string, use g_ascii_dtostr(). * * Return value: The pointer to the buffer with the converted string. **/