mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
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:
parent
e936093123
commit
1bfc515a37
@ -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>
|
||||
|
||||
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h
|
||||
|
@ -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>
|
||||
|
||||
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h
|
||||
|
@ -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>
|
||||
|
||||
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h
|
||||
|
@ -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>
|
||||
|
||||
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h
|
||||
|
@ -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>
|
||||
|
||||
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h
|
||||
|
@ -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>
|
||||
|
||||
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h
|
||||
|
@ -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>
|
||||
|
||||
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h
|
||||
|
@ -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>
|
||||
|
||||
* glibconfig.h.win32.in: Remove alloca stuff from here. galloca.h
|
||||
|
@ -12,6 +12,7 @@
|
||||
<!entity glib-Message-Logging SYSTEM "sgml/messages.sgml">
|
||||
<!entity glib-Timers SYSTEM "sgml/timers.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-Random-Numbers SYSTEM "sgml/random_numbers.sgml">
|
||||
<!entity glib-Miscellaneous-Utility-Functions SYSTEM "sgml/misc_utils.sgml">
|
||||
@ -79,6 +80,7 @@
|
||||
<chapter id="glib-utilities">
|
||||
<title>GLib Utilities</title>
|
||||
&glib-String-Utility-Functions;
|
||||
&glib-Character-Set-Conversion;
|
||||
&glib-Unicode-Manipulation;
|
||||
&glib-Date-and-Time-Functions;
|
||||
&glib-Random-Numbers;
|
||||
|
@ -1521,6 +1521,17 @@ g_random_double
|
||||
g_random_double_range
|
||||
</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>
|
||||
<TITLE>Unicode Manipulation</TITLE>
|
||||
<FILE>unicode</FILE>
|
||||
@ -1567,6 +1578,7 @@ g_utf8_strlen
|
||||
g_utf8_strncpy
|
||||
g_utf8_strchr
|
||||
g_utf8_strrchr
|
||||
g_utf8_validate
|
||||
|
||||
<SUBSECTION>
|
||||
g_utf8_to_utf16
|
||||
|
63
docs/reference/glib/tmpl/conversions.sgml
Normal file
63
docs/reference/glib/tmpl/conversions.sgml
Normal 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:
|
||||
|
@ -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.
|
||||
|
||||
<!-- ##### 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 ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -113,18 +113,6 @@ the node is inserted as the last child of @parent.
|
||||
@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 ##### -->
|
||||
<para>
|
||||
Inserts a #GNode as the last child of the given parent.
|
||||
|
@ -383,6 +383,19 @@ Unicode Manipulation
|
||||
@ch:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_utf8_validate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@str:
|
||||
@max_len:
|
||||
@end:
|
||||
@Returns:
|
||||
<!-- # Unused Parameters # -->
|
||||
@len:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_utf8_to_utf16 ##### -->
|
||||
<para>
|
||||
|
||||
|
46
gconvert.c
46
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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user