From 1bfc515a37d2e42157f869f8ac5339aff6ce10b3 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 19 Oct 2000 15:21:04 +0000 Subject: [PATCH] Change ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). Mon Sep 11 10:03:24 2000 Owen Taylor * glib.h convert.c (g_convert_with_fallback): Change ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). * docs/reference/glib/glib-sections.txt docs/reference/glib/glib-docs.sgml Update for g_convert, g_unicode_validate. --- ChangeLog | 9 ++++ ChangeLog.pre-2-0 | 9 ++++ ChangeLog.pre-2-10 | 9 ++++ ChangeLog.pre-2-12 | 9 ++++ ChangeLog.pre-2-2 | 9 ++++ ChangeLog.pre-2-4 | 9 ++++ ChangeLog.pre-2-6 | 9 ++++ ChangeLog.pre-2-8 | 9 ++++ docs/reference/glib/glib-docs.sgml | 2 + docs/reference/glib/glib-sections.txt | 12 +++++ docs/reference/glib/tmpl/conversions.sgml | 63 +++++++++++++++++++++++ docs/reference/glib/tmpl/glib-unused.sgml | 18 +++++++ docs/reference/glib/tmpl/trees-nary.sgml | 12 ----- docs/reference/glib/tmpl/unicode.sgml | 13 +++++ gconvert.c | 46 ++++++++++------- glib/gconvert.c | 46 ++++++++++------- glib/gunicode.h | 2 +- gunicode.h | 2 +- 18 files changed, 234 insertions(+), 54 deletions(-) create mode 100644 docs/reference/glib/tmpl/conversions.sgml diff --git a/ChangeLog b/ChangeLog index 3cb79c35..f0a10328 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Sep 11 10:03:24 2000 Owen Taylor + + * glib.h convert.c (g_convert_with_fallback): Change + ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). + + * docs/reference/glib/glib-sections.txt + docs/reference/glib/glib-docs.sgml Update for g_convert, + g_unicode_validate. + 2000-10-16 Tor Lillqvist * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 3cb79c35..f0a10328 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,12 @@ +Mon Sep 11 10:03:24 2000 Owen Taylor + + * glib.h convert.c (g_convert_with_fallback): Change + ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). + + * docs/reference/glib/glib-sections.txt + docs/reference/glib/glib-docs.sgml Update for g_convert, + g_unicode_validate. + 2000-10-16 Tor Lillqvist * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3cb79c35..f0a10328 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Mon Sep 11 10:03:24 2000 Owen Taylor + + * glib.h convert.c (g_convert_with_fallback): Change + ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). + + * docs/reference/glib/glib-sections.txt + docs/reference/glib/glib-docs.sgml Update for g_convert, + g_unicode_validate. + 2000-10-16 Tor Lillqvist * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 3cb79c35..f0a10328 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,12 @@ +Mon Sep 11 10:03:24 2000 Owen Taylor + + * glib.h convert.c (g_convert_with_fallback): Change + ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). + + * docs/reference/glib/glib-sections.txt + docs/reference/glib/glib-docs.sgml Update for g_convert, + g_unicode_validate. + 2000-10-16 Tor Lillqvist * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 3cb79c35..f0a10328 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Mon Sep 11 10:03:24 2000 Owen Taylor + + * glib.h convert.c (g_convert_with_fallback): Change + ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). + + * docs/reference/glib/glib-sections.txt + docs/reference/glib/glib-docs.sgml Update for g_convert, + g_unicode_validate. + 2000-10-16 Tor Lillqvist * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 3cb79c35..f0a10328 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Mon Sep 11 10:03:24 2000 Owen Taylor + + * glib.h convert.c (g_convert_with_fallback): Change + ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). + + * docs/reference/glib/glib-sections.txt + docs/reference/glib/glib-docs.sgml Update for g_convert, + g_unicode_validate. + 2000-10-16 Tor Lillqvist * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 3cb79c35..f0a10328 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Mon Sep 11 10:03:24 2000 Owen Taylor + + * glib.h convert.c (g_convert_with_fallback): Change + ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). + + * docs/reference/glib/glib-sections.txt + docs/reference/glib/glib-docs.sgml Update for g_convert, + g_unicode_validate. + 2000-10-16 Tor Lillqvist * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3cb79c35..f0a10328 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Mon Sep 11 10:03:24 2000 Owen Taylor + + * glib.h convert.c (g_convert_with_fallback): Change + ERROR_OTHER to ERROR_FAILED, add some dummy marking with _(). + + * docs/reference/glib/glib-sections.txt + docs/reference/glib/glib-docs.sgml Update for g_convert, + g_unicode_validate. + 2000-10-16 Tor Lillqvist * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h diff --git a/docs/reference/glib/glib-docs.sgml b/docs/reference/glib/glib-docs.sgml index cec7a88b..cd3a6bdf 100644 --- a/docs/reference/glib/glib-docs.sgml +++ b/docs/reference/glib/glib-docs.sgml @@ -12,6 +12,7 @@ + @@ -79,6 +80,7 @@ GLib Utilities &glib-String-Utility-Functions; + &glib-Character-Set-Conversion; &glib-Unicode-Manipulation; &glib-Date-and-Time-Functions; &glib-Random-Numbers; diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index 763ad519..66204f03 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -1521,6 +1521,17 @@ g_random_double g_random_double_range +
+Character Set Conversion +conversions +g_convert +g_convert_with_fallback +G_CONVERT_ERROR +GConvertError + +g_convert_error_quark +
+
Unicode Manipulation unicode @@ -1567,6 +1578,7 @@ g_utf8_strlen g_utf8_strncpy g_utf8_strchr g_utf8_strrchr +g_utf8_validate g_utf8_to_utf16 diff --git a/docs/reference/glib/tmpl/conversions.sgml b/docs/reference/glib/tmpl/conversions.sgml new file mode 100644 index 00000000..e30a5dc0 --- /dev/null +++ b/docs/reference/glib/tmpl/conversions.sgml @@ -0,0 +1,63 @@ + +Character Set Conversion + + + + + + + + + + + + + + + + + + + +@str: +@len: +@to_codeset: +@from_codeset: +@bytes_read: +@bytes_written: +@error: +@Returns: + + + + + + + +@str: +@len: +@to_codeset: +@from_codeset: +@fallback: +@bytes_read: +@bytes_written: +@error: +@Returns: + + + + + + + + + + + + + + +@G_CONVERT_ERROR_NO_CONVERSION: +@G_CONVERT_ERROR_ILLEGAL_SEQUENCE: +@G_CONVERT_ERROR_FAILED: + diff --git a/docs/reference/glib/tmpl/glib-unused.sgml b/docs/reference/glib/tmpl/glib-unused.sgml index bdd048e9..268f8b4c 100644 --- a/docs/reference/glib/tmpl/glib-unused.sgml +++ b/docs/reference/glib/tmpl/glib-unused.sgml @@ -15,6 +15,24 @@ Specifies the type of function passed to g_tree_search(). desired key comes before @key in the sort order of the #GTree, or a positive value if the desired key comes after @key. + + +Inserts a #GNode beneath the parent after the given sibling. + + +@parent: the #GNode to place @node under. +@sibling: the sibling #GNode to place @node after. If sibling is NULL, +the node is inserted as the first child of @parent. +@node: the #GNode to insert. +@Returns: the inserted #GNode. + + + + + + +@Returns: + diff --git a/docs/reference/glib/tmpl/trees-nary.sgml b/docs/reference/glib/tmpl/trees-nary.sgml index 8916fa69..2019c861 100644 --- a/docs/reference/glib/tmpl/trees-nary.sgml +++ b/docs/reference/glib/tmpl/trees-nary.sgml @@ -113,18 +113,6 @@ the node is inserted as the last child of @parent. @Returns: the inserted #GNode. - - -Inserts a #GNode beneath the parent after the given sibling. - - -@parent: the #GNode to place @node under. -@sibling: the sibling #GNode to place @node after. If sibling is NULL, -the node is inserted as the first child of @parent. -@node: the #GNode to insert. -@Returns: the inserted #GNode. - - Inserts a #GNode as the last child of the given parent. diff --git a/docs/reference/glib/tmpl/unicode.sgml b/docs/reference/glib/tmpl/unicode.sgml index 413cc89e..981634d4 100644 --- a/docs/reference/glib/tmpl/unicode.sgml +++ b/docs/reference/glib/tmpl/unicode.sgml @@ -383,6 +383,19 @@ Unicode Manipulation @ch: + + + + + +@str: +@max_len: +@end: +@Returns: + +@len: + + diff --git a/gconvert.c b/gconvert.c index ff7980c6..7e596b42 100644 --- a/gconvert.c +++ b/gconvert.c @@ -26,6 +26,8 @@ #include "glib.h" +#define _(s) (s) + GQuark g_convert_error_quark() { @@ -47,11 +49,11 @@ open_converter (const gchar *to_codeset, /* Something went wrong. */ if (errno == EINVAL) g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION, - "Conversion from character set `%s' to `%s' is not supported", + _("Conversion from character set `%s' to `%s' is not supported"), from_codeset, to_codeset); else g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - "Could not open converter from `%s' to `%s': %s", + _("Could not open converter from `%s' to `%s': %s"), from_codeset, to_codeset, strerror (errno)); } @@ -61,20 +63,22 @@ open_converter (const gchar *to_codeset, /** * g_convert: - * @str: the string to convert - * @len: the length of the string - * @to_codeset: name of character set into which to convert @str - * @from_codeset: character set of @str. - * @bytes_read: location to store the number of bytes in the - * input string that were successfully converted, or %NULL. - * Even if the conversion was succesful, this may be - * less than len if there were partial characters - * at the end of the input. If the error - * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value - * stored will the byte fofset after the last valid - * input sequence. - * @error: location to store the error occuring, or %NULL to ignore - * errors. Any of the errors in #GConvertError may occur. + * @str: the string to convert + * @len: the length of the string + * @to_codeset: name of character set into which to convert @str + * @from_codeset: character set of @str. + * @bytes_read: location to store the number of bytes in the + * input string that were successfully converted, or %NULL. + * Even if the conversion was succesful, this may be + * less than len if there were partial characters + * at the end of the input. If the error + * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value + * stored will the byte fofset after the last valid + * input sequence. + * @bytes_written: the stored in the output buffer (not including the + * terminating nul. + * @error: location to store the error occuring, or %NULL to ignore + * errors. Any of the errors in #GConvertError may occur. * * Convert a string from one character set to another. * @@ -151,12 +155,12 @@ g_convert (const gchar *str, } case EILSEQ: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - "Invalid byte sequence in conversion input"); + _("Invalid byte sequence in conversion input")); have_error = TRUE; break; default: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - "Error during conversion: %s", + _("Error during conversion: %s"), strerror (errno)); have_error = TRUE; break; @@ -201,6 +205,8 @@ g_convert (const gchar *str, * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value * stored will the byte fofset after the last valid * input sequence. + * @bytes_written: the stored in the output buffer (not including the + * terminating nul. * @error: location to store the error occuring, or %NULL to ignore * errors. Any of the errors in #GConvertError may occur. * @@ -329,7 +335,7 @@ g_convert_with_fallback (const gchar *str, /* Error converting fallback string - fatal */ g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - "Cannot convert fallback '%s' to codeset '%s'", + _("Cannot convert fallback '%s' to codeset '%s'"), insert_str, to_codeset); have_error = TRUE; break; @@ -354,7 +360,7 @@ g_convert_with_fallback (const gchar *str, break; default: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - "Error during conversion: %s", + _("Error during conversion: %s"), strerror (errno)); have_error = TRUE; break; diff --git a/glib/gconvert.c b/glib/gconvert.c index ff7980c6..7e596b42 100644 --- a/glib/gconvert.c +++ b/glib/gconvert.c @@ -26,6 +26,8 @@ #include "glib.h" +#define _(s) (s) + GQuark g_convert_error_quark() { @@ -47,11 +49,11 @@ open_converter (const gchar *to_codeset, /* Something went wrong. */ if (errno == EINVAL) g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION, - "Conversion from character set `%s' to `%s' is not supported", + _("Conversion from character set `%s' to `%s' is not supported"), from_codeset, to_codeset); else g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - "Could not open converter from `%s' to `%s': %s", + _("Could not open converter from `%s' to `%s': %s"), from_codeset, to_codeset, strerror (errno)); } @@ -61,20 +63,22 @@ open_converter (const gchar *to_codeset, /** * g_convert: - * @str: the string to convert - * @len: the length of the string - * @to_codeset: name of character set into which to convert @str - * @from_codeset: character set of @str. - * @bytes_read: location to store the number of bytes in the - * input string that were successfully converted, or %NULL. - * Even if the conversion was succesful, this may be - * less than len if there were partial characters - * at the end of the input. If the error - * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value - * stored will the byte fofset after the last valid - * input sequence. - * @error: location to store the error occuring, or %NULL to ignore - * errors. Any of the errors in #GConvertError may occur. + * @str: the string to convert + * @len: the length of the string + * @to_codeset: name of character set into which to convert @str + * @from_codeset: character set of @str. + * @bytes_read: location to store the number of bytes in the + * input string that were successfully converted, or %NULL. + * Even if the conversion was succesful, this may be + * less than len if there were partial characters + * at the end of the input. If the error + * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value + * stored will the byte fofset after the last valid + * input sequence. + * @bytes_written: the stored in the output buffer (not including the + * terminating nul. + * @error: location to store the error occuring, or %NULL to ignore + * errors. Any of the errors in #GConvertError may occur. * * Convert a string from one character set to another. * @@ -151,12 +155,12 @@ g_convert (const gchar *str, } case EILSEQ: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - "Invalid byte sequence in conversion input"); + _("Invalid byte sequence in conversion input")); have_error = TRUE; break; default: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - "Error during conversion: %s", + _("Error during conversion: %s"), strerror (errno)); have_error = TRUE; break; @@ -201,6 +205,8 @@ g_convert (const gchar *str, * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value * stored will the byte fofset after the last valid * input sequence. + * @bytes_written: the stored in the output buffer (not including the + * terminating nul. * @error: location to store the error occuring, or %NULL to ignore * errors. Any of the errors in #GConvertError may occur. * @@ -329,7 +335,7 @@ g_convert_with_fallback (const gchar *str, /* Error converting fallback string - fatal */ g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, - "Cannot convert fallback '%s' to codeset '%s'", + _("Cannot convert fallback '%s' to codeset '%s'"), insert_str, to_codeset); have_error = TRUE; break; @@ -354,7 +360,7 @@ g_convert_with_fallback (const gchar *str, break; default: g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, - "Error during conversion: %s", + _("Error during conversion: %s"), strerror (errno)); have_error = TRUE; break; diff --git a/glib/gunicode.h b/glib/gunicode.h index 442784ce..2665894f 100644 --- a/glib/gunicode.h +++ b/glib/gunicode.h @@ -188,7 +188,7 @@ gint g_unichar_to_utf8 (gunichar c, */ gboolean g_utf8_validate (const gchar *str, - gint len, + gint max_len, const gchar **end); G_END_DECLS diff --git a/gunicode.h b/gunicode.h index 442784ce..2665894f 100644 --- a/gunicode.h +++ b/gunicode.h @@ -188,7 +188,7 @@ gint g_unichar_to_utf8 (gunichar c, */ gboolean g_utf8_validate (const gchar *str, - gint len, + gint max_len, const gchar **end); G_END_DECLS -- 2.34.1