Change ERROR_OTHER to ERROR_FAILED, add some dummy marking with _().

Mon Sep 11 10:03:24 2000  Owen Taylor  <otaylor@redhat.com>

	* 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.
This commit is contained in:
Owen Taylor
2000-10-19 15:21:04 +00:00
committed by Owen Taylor
parent e936093123
commit 1bfc515a37
18 changed files with 234 additions and 54 deletions

View File

@@ -1,3 +1,12 @@
Mon Sep 11 10:03:24 2000 Owen Taylor <otaylor@redhat.com>
* 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 <tml@iki.fi> 2000-10-16 Tor Lillqvist <tml@iki.fi>
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h

View File

@@ -1,3 +1,12 @@
Mon Sep 11 10:03:24 2000 Owen Taylor <otaylor@redhat.com>
* 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 <tml@iki.fi> 2000-10-16 Tor Lillqvist <tml@iki.fi>
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h

View File

@@ -1,3 +1,12 @@
Mon Sep 11 10:03:24 2000 Owen Taylor <otaylor@redhat.com>
* 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 <tml@iki.fi> 2000-10-16 Tor Lillqvist <tml@iki.fi>
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h

View File

@@ -1,3 +1,12 @@
Mon Sep 11 10:03:24 2000 Owen Taylor <otaylor@redhat.com>
* 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 <tml@iki.fi> 2000-10-16 Tor Lillqvist <tml@iki.fi>
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h

View File

@@ -1,3 +1,12 @@
Mon Sep 11 10:03:24 2000 Owen Taylor <otaylor@redhat.com>
* 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 <tml@iki.fi> 2000-10-16 Tor Lillqvist <tml@iki.fi>
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h

View File

@@ -1,3 +1,12 @@
Mon Sep 11 10:03:24 2000 Owen Taylor <otaylor@redhat.com>
* 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 <tml@iki.fi> 2000-10-16 Tor Lillqvist <tml@iki.fi>
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h

View File

@@ -1,3 +1,12 @@
Mon Sep 11 10:03:24 2000 Owen Taylor <otaylor@redhat.com>
* 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 <tml@iki.fi> 2000-10-16 Tor Lillqvist <tml@iki.fi>
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h

View File

@@ -1,3 +1,12 @@
Mon Sep 11 10:03:24 2000 Owen Taylor <otaylor@redhat.com>
* 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 <tml@iki.fi> 2000-10-16 Tor Lillqvist <tml@iki.fi>
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h * glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h

View File

@@ -12,6 +12,7 @@
<!entity glib-Message-Logging SYSTEM "sgml/messages.sgml"> <!entity glib-Message-Logging SYSTEM "sgml/messages.sgml">
<!entity glib-Timers SYSTEM "sgml/timers.sgml"> <!entity glib-Timers SYSTEM "sgml/timers.sgml">
<!entity glib-String-Utility-Functions SYSTEM "sgml/string_utils.sgml"> <!entity glib-String-Utility-Functions SYSTEM "sgml/string_utils.sgml">
<!entity glib-Character-Set-Conversion SYSTEM "sgml/conversions.sgml">
<!entity glib-Unicode-Manipulation SYSTEM "sgml/unicode.sgml"> <!entity glib-Unicode-Manipulation SYSTEM "sgml/unicode.sgml">
<!entity glib-Random-Numbers SYSTEM "sgml/random_numbers.sgml"> <!entity glib-Random-Numbers SYSTEM "sgml/random_numbers.sgml">
<!entity glib-Miscellaneous-Utility-Functions SYSTEM "sgml/misc_utils.sgml"> <!entity glib-Miscellaneous-Utility-Functions SYSTEM "sgml/misc_utils.sgml">
@@ -79,6 +80,7 @@
<chapter id="glib-utilities"> <chapter id="glib-utilities">
<title>GLib Utilities</title> <title>GLib Utilities</title>
&glib-String-Utility-Functions; &glib-String-Utility-Functions;
&glib-Character-Set-Conversion;
&glib-Unicode-Manipulation; &glib-Unicode-Manipulation;
&glib-Date-and-Time-Functions; &glib-Date-and-Time-Functions;
&glib-Random-Numbers; &glib-Random-Numbers;

View File

@@ -1521,6 +1521,17 @@ g_random_double
g_random_double_range g_random_double_range
</SECTION> </SECTION>
<SECTION>
<TITLE>Character Set Conversion</TITLE>
<FILE>conversions</FILE>
g_convert
g_convert_with_fallback
G_CONVERT_ERROR
GConvertError
<SUBSECTION Private>
g_convert_error_quark
</SECTION>
<SECTION> <SECTION>
<TITLE>Unicode Manipulation</TITLE> <TITLE>Unicode Manipulation</TITLE>
<FILE>unicode</FILE> <FILE>unicode</FILE>
@@ -1567,6 +1578,7 @@ g_utf8_strlen
g_utf8_strncpy g_utf8_strncpy
g_utf8_strchr g_utf8_strchr
g_utf8_strrchr g_utf8_strrchr
g_utf8_validate
<SUBSECTION> <SUBSECTION>
g_utf8_to_utf16 g_utf8_to_utf16

View File

@@ -0,0 +1,63 @@
<!-- ##### SECTION Title ##### -->
Character Set Conversion
<!-- ##### SECTION Short_Description ##### -->
<!-- ##### SECTION Long_Description ##### -->
<para>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### FUNCTION g_convert ##### -->
<para>
</para>
@str:
@len:
@to_codeset:
@from_codeset:
@bytes_read:
@bytes_written:
@error:
@Returns:
<!-- ##### FUNCTION g_convert_with_fallback ##### -->
<para>
</para>
@str:
@len:
@to_codeset:
@from_codeset:
@fallback:
@bytes_read:
@bytes_written:
@error:
@Returns:
<!-- ##### MACRO G_CONVERT_ERROR ##### -->
<para>
</para>
<!-- ##### ENUM GConvertError ##### -->
<para>
</para>
@G_CONVERT_ERROR_NO_CONVERSION:
@G_CONVERT_ERROR_ILLEGAL_SEQUENCE:
@G_CONVERT_ERROR_FAILED:

View File

@@ -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 desired key comes before @key in the sort order of the #GTree, or a positive
value if the desired key comes after @key. value if the desired key comes after @key.
<!-- ##### FUNCTION g_node_insert_after ##### -->
<para>
Inserts a #GNode beneath the parent after the given sibling.
</para>
@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.
<!-- ##### FUNCTION g_convert_error_quark ##### -->
<para>
</para>
@Returns:
<!-- ##### MACRO write ##### --> <!-- ##### MACRO write ##### -->
<para> <para>

View File

@@ -113,18 +113,6 @@ the node is inserted as the last child of @parent.
@Returns: the inserted #GNode. @Returns: the inserted #GNode.
<!-- ##### FUNCTION g_node_insert_after ##### -->
<para>
Inserts a #GNode beneath the parent after the given sibling.
</para>
@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.
<!-- ##### MACRO g_node_append ##### --> <!-- ##### MACRO g_node_append ##### -->
<para> <para>
Inserts a #GNode as the last child of the given parent. Inserts a #GNode as the last child of the given parent.

View File

@@ -383,6 +383,19 @@ Unicode Manipulation
@ch: @ch:
<!-- ##### FUNCTION g_utf8_validate ##### -->
<para>
</para>
@str:
@max_len:
@end:
@Returns:
<!-- # Unused Parameters # -->
@len:
<!-- ##### FUNCTION g_utf8_to_utf16 ##### --> <!-- ##### FUNCTION g_utf8_to_utf16 ##### -->
<para> <para>

View File

@@ -26,6 +26,8 @@
#include "glib.h" #include "glib.h"
#define _(s) (s)
GQuark GQuark
g_convert_error_quark() g_convert_error_quark()
{ {
@@ -47,11 +49,11 @@ open_converter (const gchar *to_codeset,
/* Something went wrong. */ /* Something went wrong. */
if (errno == EINVAL) if (errno == EINVAL)
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION, 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); from_codeset, to_codeset);
else else
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, 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)); from_codeset, to_codeset, strerror (errno));
} }
@@ -73,6 +75,8 @@ open_converter (const gchar *to_codeset,
* G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
* stored will the byte fofset after the last valid * stored will the byte fofset after the last valid
* input sequence. * 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 * @error: location to store the error occuring, or %NULL to ignore
* errors. Any of the errors in #GConvertError may occur. * errors. Any of the errors in #GConvertError may occur.
* *
@@ -151,12 +155,12 @@ g_convert (const gchar *str,
} }
case EILSEQ: case EILSEQ:
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, 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; have_error = TRUE;
break; break;
default: default:
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED,
"Error during conversion: %s", _("Error during conversion: %s"),
strerror (errno)); strerror (errno));
have_error = TRUE; have_error = TRUE;
break; break;
@@ -201,6 +205,8 @@ g_convert (const gchar *str,
* G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
* stored will the byte fofset after the last valid * stored will the byte fofset after the last valid
* input sequence. * 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 * @error: location to store the error occuring, or %NULL to ignore
* errors. Any of the errors in #GConvertError may occur. * 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 /* Error converting fallback string - fatal
*/ */
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, 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); insert_str, to_codeset);
have_error = TRUE; have_error = TRUE;
break; break;
@@ -354,7 +360,7 @@ g_convert_with_fallback (const gchar *str,
break; break;
default: default:
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED,
"Error during conversion: %s", _("Error during conversion: %s"),
strerror (errno)); strerror (errno));
have_error = TRUE; have_error = TRUE;
break; break;

View File

@@ -26,6 +26,8 @@
#include "glib.h" #include "glib.h"
#define _(s) (s)
GQuark GQuark
g_convert_error_quark() g_convert_error_quark()
{ {
@@ -47,11 +49,11 @@ open_converter (const gchar *to_codeset,
/* Something went wrong. */ /* Something went wrong. */
if (errno == EINVAL) if (errno == EINVAL)
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION, 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); from_codeset, to_codeset);
else else
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, 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)); from_codeset, to_codeset, strerror (errno));
} }
@@ -73,6 +75,8 @@ open_converter (const gchar *to_codeset,
* G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
* stored will the byte fofset after the last valid * stored will the byte fofset after the last valid
* input sequence. * 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 * @error: location to store the error occuring, or %NULL to ignore
* errors. Any of the errors in #GConvertError may occur. * errors. Any of the errors in #GConvertError may occur.
* *
@@ -151,12 +155,12 @@ g_convert (const gchar *str,
} }
case EILSEQ: case EILSEQ:
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, 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; have_error = TRUE;
break; break;
default: default:
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED,
"Error during conversion: %s", _("Error during conversion: %s"),
strerror (errno)); strerror (errno));
have_error = TRUE; have_error = TRUE;
break; break;
@@ -201,6 +205,8 @@ g_convert (const gchar *str,
* G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value * G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
* stored will the byte fofset after the last valid * stored will the byte fofset after the last valid
* input sequence. * 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 * @error: location to store the error occuring, or %NULL to ignore
* errors. Any of the errors in #GConvertError may occur. * 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 /* Error converting fallback string - fatal
*/ */
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, 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); insert_str, to_codeset);
have_error = TRUE; have_error = TRUE;
break; break;
@@ -354,7 +360,7 @@ g_convert_with_fallback (const gchar *str,
break; break;
default: default:
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED,
"Error during conversion: %s", _("Error during conversion: %s"),
strerror (errno)); strerror (errno));
have_error = TRUE; have_error = TRUE;
break; break;

View File

@@ -188,7 +188,7 @@ gint g_unichar_to_utf8 (gunichar c,
*/ */
gboolean g_utf8_validate (const gchar *str, gboolean g_utf8_validate (const gchar *str,
gint len, gint max_len,
const gchar **end); const gchar **end);
G_END_DECLS G_END_DECLS

View File

@@ -188,7 +188,7 @@ gint g_unichar_to_utf8 (gunichar c,
*/ */
gboolean g_utf8_validate (const gchar *str, gboolean g_utf8_validate (const gchar *str,
gint len, gint max_len,
const gchar **end); const gchar **end);
G_END_DECLS G_END_DECLS