Commit 1bfc515a authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

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.
parent e9360931
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
......
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
......
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
......
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
......
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
......
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
......
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
......
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
......
...@@ -12,6 +12,7 @@ ...@@ -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 @@ ...@@ -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;
......
...@@ -1521,6 +1521,17 @@ g_random_double ...@@ -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 ...@@ -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
......
<!-- ##### 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:
...@@ -15,6 +15,24 @@ Specifies the type of function passed to g_tree_search(). ...@@ -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>
......
...@@ -113,18 +113,6 @@ the node is inserted as the last child of @parent. ...@@ -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.
......
...@@ -383,6 +383,19 @@ Unicode Manipulation ...@@ -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>
......
...@@ -26,6 +26,8 @@ ...@@ -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, ...@@ -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));
} }
...@@ -61,20 +63,22 @@ open_converter (const gchar *to_codeset, ...@@ -61,20 +63,22 @@ open_converter (const gchar *to_codeset,
/** /**
* g_convert: * g_convert:
* @str: the string to convert * @str: the string to convert
* @len: the length of the string * @len: the length of the string
* @to_codeset: name of character set into which to convert @str * @to_codeset: name of character set into which to convert @str
* @from_codeset: character set of @str. * @from_codeset: character set of @str.
* @bytes_read: location to store the number of bytes in the * @bytes_read: location to store the number of bytes in the
* input string that were successfully converted, or %NULL. * input string that were successfully converted, or %NULL.
* Even if the conversion was succesful, this may be * Even if the conversion was succesful, this may be
* less than len if there were partial characters * less than len if there were partial characters
* at the end of the input. If the error * at the end of the input. If the error
* 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.
* @error: location to store the error occuring, or %NULL to ignore * @bytes_written: the stored in the output buffer (not including the
* errors. Any of the errors in #GConvertError may occur. * 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. * Convert a string from one character set to another.
* *
...@@ -151,12 +155,12 @@ g_convert (const gchar *str, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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;
......
...@@ -26,6 +26,8 @@ ...@@ -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, ...@@ -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));
} }
...@@ -61,20 +63,22 @@ open_converter (const gchar *to_codeset, ...@@ -61,20 +63,22 @@ open_converter (const gchar *to_codeset,
/** /**
* g_convert: * g_convert:
* @str: the string to convert * @str: the string to convert
* @len: the length of the string * @len: the length of the string
* @to_codeset: name of character set into which to convert @str * @to_codeset: name of character set into which to convert @str
* @from_codeset: character set of @str. * @from_codeset: character set of @str.
* @bytes_read: location to store the number of bytes in the * @bytes_read: location to store the number of bytes in the
* input string that were successfully converted, or %NULL. * input string that were successfully converted, or %NULL.
* Even if the conversion was succesful, this may be * Even if the conversion was succesful, this may be
* less than len if there were partial characters * less than len if there were partial characters
* at the end of the input. If the error * at the end of the input. If the error
* 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.
* @error: location to store the error occuring, or %NULL to ignore * @bytes_written: the stored in the output buffer (not including the
* errors. Any of the errors in #GConvertError may occur. * 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. * Convert a string from one character set to another.
* *
...@@ -151,12 +155,12 @@ g_convert (const gchar *str, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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;
......
...@@ -188,7 +188,7 @@ gint g_unichar_to_utf8 (gunichar c, ...@@ -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
......
...@@ -188,7 +188,7 @@ gint g_unichar_to_utf8 (gunichar c, ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment