2000-06-21 16:11:21 +00:00
|
|
|
/* gunicode.h - Unicode manipulation functions
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999, 2000 Tom Tromey
|
2005-06-08 05:22:05 +00:00
|
|
|
* Copyright 2000, 2005 Red Hat, Inc.
|
2000-06-21 16:11:21 +00:00
|
|
|
*
|
|
|
|
* The Gnome Library is free software; you can redistribute it and/or
|
2000-07-26 11:02:02 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public License as
|
2000-06-21 16:11:21 +00:00
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* The Gnome Library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:02:02 +00:00
|
|
|
* Lesser General Public License for more details.
|
2000-06-21 16:11:21 +00:00
|
|
|
*
|
2000-07-26 11:02:02 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2000-06-21 16:11:21 +00:00
|
|
|
* License along with the Gnome Library; see the file COPYING.LIB. If not,
|
|
|
|
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 11:52:07 +00:00
|
|
|
#ifndef __G_UNICODE_H__
|
|
|
|
#define __G_UNICODE_H__
|
2000-06-21 16:11:21 +00:00
|
|
|
|
2001-06-26 16:01:21 +00:00
|
|
|
#include <glib/gerror.h>
|
|
|
|
#include <glib/gtypes.h>
|
2000-06-21 16:11:21 +00:00
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 11:52:07 +00:00
|
|
|
G_BEGIN_DECLS
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
typedef guint32 gunichar;
|
|
|
|
typedef guint16 gunichar2;
|
|
|
|
|
2000-11-29 23:38:24 +00:00
|
|
|
/* These are the possible character classifications.
|
2005-08-15 18:49:11 +00:00
|
|
|
* See http://www.unicode.org/Public/UNIDATA/UCD.html#General_Category_Values
|
2000-11-29 23:38:24 +00:00
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
2000-06-21 16:11:21 +00:00
|
|
|
G_UNICODE_CONTROL,
|
|
|
|
G_UNICODE_FORMAT,
|
|
|
|
G_UNICODE_UNASSIGNED,
|
|
|
|
G_UNICODE_PRIVATE_USE,
|
|
|
|
G_UNICODE_SURROGATE,
|
|
|
|
G_UNICODE_LOWERCASE_LETTER,
|
|
|
|
G_UNICODE_MODIFIER_LETTER,
|
|
|
|
G_UNICODE_OTHER_LETTER,
|
|
|
|
G_UNICODE_TITLECASE_LETTER,
|
|
|
|
G_UNICODE_UPPERCASE_LETTER,
|
|
|
|
G_UNICODE_COMBINING_MARK,
|
|
|
|
G_UNICODE_ENCLOSING_MARK,
|
|
|
|
G_UNICODE_NON_SPACING_MARK,
|
|
|
|
G_UNICODE_DECIMAL_NUMBER,
|
|
|
|
G_UNICODE_LETTER_NUMBER,
|
|
|
|
G_UNICODE_OTHER_NUMBER,
|
|
|
|
G_UNICODE_CONNECT_PUNCTUATION,
|
|
|
|
G_UNICODE_DASH_PUNCTUATION,
|
|
|
|
G_UNICODE_CLOSE_PUNCTUATION,
|
|
|
|
G_UNICODE_FINAL_PUNCTUATION,
|
|
|
|
G_UNICODE_INITIAL_PUNCTUATION,
|
|
|
|
G_UNICODE_OTHER_PUNCTUATION,
|
|
|
|
G_UNICODE_OPEN_PUNCTUATION,
|
|
|
|
G_UNICODE_CURRENCY_SYMBOL,
|
|
|
|
G_UNICODE_MODIFIER_SYMBOL,
|
|
|
|
G_UNICODE_MATH_SYMBOL,
|
|
|
|
G_UNICODE_OTHER_SYMBOL,
|
|
|
|
G_UNICODE_LINE_SEPARATOR,
|
|
|
|
G_UNICODE_PARAGRAPH_SEPARATOR,
|
|
|
|
G_UNICODE_SPACE_SEPARATOR
|
|
|
|
} GUnicodeType;
|
|
|
|
|
2000-11-29 23:38:24 +00:00
|
|
|
/* These are the possible line break classifications.
|
2005-10-01 12:34:21 +00:00
|
|
|
* Note that new types may be added in the future.
|
|
|
|
* Implementations may regard unknown values like G_UNICODE_BREAK_UNKNOWN
|
2000-11-29 23:38:24 +00:00
|
|
|
* See http://www.unicode.org/unicode/reports/tr14/
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
G_UNICODE_BREAK_MANDATORY,
|
|
|
|
G_UNICODE_BREAK_CARRIAGE_RETURN,
|
|
|
|
G_UNICODE_BREAK_LINE_FEED,
|
|
|
|
G_UNICODE_BREAK_COMBINING_MARK,
|
|
|
|
G_UNICODE_BREAK_SURROGATE,
|
|
|
|
G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
|
|
|
|
G_UNICODE_BREAK_INSEPARABLE,
|
|
|
|
G_UNICODE_BREAK_NON_BREAKING_GLUE,
|
|
|
|
G_UNICODE_BREAK_CONTINGENT,
|
|
|
|
G_UNICODE_BREAK_SPACE,
|
|
|
|
G_UNICODE_BREAK_AFTER,
|
|
|
|
G_UNICODE_BREAK_BEFORE,
|
|
|
|
G_UNICODE_BREAK_BEFORE_AND_AFTER,
|
|
|
|
G_UNICODE_BREAK_HYPHEN,
|
|
|
|
G_UNICODE_BREAK_NON_STARTER,
|
|
|
|
G_UNICODE_BREAK_OPEN_PUNCTUATION,
|
|
|
|
G_UNICODE_BREAK_CLOSE_PUNCTUATION,
|
|
|
|
G_UNICODE_BREAK_QUOTATION,
|
|
|
|
G_UNICODE_BREAK_EXCLAMATION,
|
|
|
|
G_UNICODE_BREAK_IDEOGRAPHIC,
|
|
|
|
G_UNICODE_BREAK_NUMERIC,
|
|
|
|
G_UNICODE_BREAK_INFIX_SEPARATOR,
|
|
|
|
G_UNICODE_BREAK_SYMBOL,
|
|
|
|
G_UNICODE_BREAK_ALPHABETIC,
|
|
|
|
G_UNICODE_BREAK_PREFIX,
|
|
|
|
G_UNICODE_BREAK_POSTFIX,
|
|
|
|
G_UNICODE_BREAK_COMPLEX_CONTEXT,
|
|
|
|
G_UNICODE_BREAK_AMBIGUOUS,
|
2003-07-31 02:27:56 +00:00
|
|
|
G_UNICODE_BREAK_UNKNOWN,
|
|
|
|
G_UNICODE_BREAK_NEXT_LINE,
|
2005-10-01 12:34:21 +00:00
|
|
|
G_UNICODE_BREAK_WORD_JOINER,
|
|
|
|
G_UNICODE_BREAK_HANGUL_L_JAMO,
|
|
|
|
G_UNICODE_BREAK_HANGUL_V_JAMO,
|
|
|
|
G_UNICODE_BREAK_HANGUL_T_JAMO,
|
|
|
|
G_UNICODE_BREAK_HANGUL_LV_SYLLABLE,
|
|
|
|
G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE
|
2000-11-29 23:38:24 +00:00
|
|
|
} GUnicodeBreakType;
|
|
|
|
|
2000-06-21 16:11:21 +00:00
|
|
|
/* Returns TRUE if current locale uses UTF-8 charset. If CHARSET is
|
|
|
|
* not null, sets *CHARSET to the name of the current locale's
|
2000-12-17 18:43:57 +00:00
|
|
|
* charset. This value is statically allocated, and should be copied
|
|
|
|
* in case the locale's charset will be changed later using setlocale()
|
|
|
|
* or in some other way.
|
2000-06-21 16:11:21 +00:00
|
|
|
*/
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
gboolean g_get_charset (G_CONST_RETURN char **charset);
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
/* These are all analogs of the <ctype.h> functions.
|
|
|
|
*/
|
Mark the following functions G_GNUC_CONST (to allow betteroptimization)
2000-08-25 Elliot Lee <sopwith@redhat.com>
* glib.h, gunicode.h, gmodule/gmodule.h:
Mark the following functions G_GNUC_CONST (to allow
betteroptimization) because their results are a function of only their parameters:
g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
g_unichar_to*, g_unichar_*digit_value, g_unichar_type
2000-08-25 22:45:48 +00:00
|
|
|
gboolean g_unichar_isalnum (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_isalpha (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_iscntrl (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_isdigit (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_isgraph (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_islower (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_isprint (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_ispunct (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_isspace (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_isupper (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_isxdigit (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_istitle (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_isdefined (gunichar c) G_GNUC_CONST;
|
|
|
|
gboolean g_unichar_iswide (gunichar c) G_GNUC_CONST;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
/* More <ctype.h> functions. These convert between the three cases.
|
|
|
|
* See the Unicode book to understand title case. */
|
Mark the following functions G_GNUC_CONST (to allow betteroptimization)
2000-08-25 Elliot Lee <sopwith@redhat.com>
* glib.h, gunicode.h, gmodule/gmodule.h:
Mark the following functions G_GNUC_CONST (to allow
betteroptimization) because their results are a function of only their parameters:
g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
g_unichar_to*, g_unichar_*digit_value, g_unichar_type
2000-08-25 22:45:48 +00:00
|
|
|
gunichar g_unichar_toupper (gunichar c) G_GNUC_CONST;
|
|
|
|
gunichar g_unichar_tolower (gunichar c) G_GNUC_CONST;
|
|
|
|
gunichar g_unichar_totitle (gunichar c) G_GNUC_CONST;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
/* If C is a digit (according to `g_unichar_isdigit'), then return its
|
|
|
|
numeric value. Otherwise return -1. */
|
Mark the following functions G_GNUC_CONST (to allow betteroptimization)
2000-08-25 Elliot Lee <sopwith@redhat.com>
* glib.h, gunicode.h, gmodule/gmodule.h:
Mark the following functions G_GNUC_CONST (to allow
betteroptimization) because their results are a function of only their parameters:
g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
g_unichar_to*, g_unichar_*digit_value, g_unichar_type
2000-08-25 22:45:48 +00:00
|
|
|
gint g_unichar_digit_value (gunichar c) G_GNUC_CONST;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
Mark the following functions G_GNUC_CONST (to allow betteroptimization)
2000-08-25 Elliot Lee <sopwith@redhat.com>
* glib.h, gunicode.h, gmodule/gmodule.h:
Mark the following functions G_GNUC_CONST (to allow
betteroptimization) because their results are a function of only their parameters:
g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
g_unichar_to*, g_unichar_*digit_value, g_unichar_type
2000-08-25 22:45:48 +00:00
|
|
|
gint g_unichar_xdigit_value (gunichar c) G_GNUC_CONST;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
/* Return the Unicode character type of a given character. */
|
Mark the following functions G_GNUC_CONST (to allow betteroptimization)
2000-08-25 Elliot Lee <sopwith@redhat.com>
* glib.h, gunicode.h, gmodule/gmodule.h:
Mark the following functions G_GNUC_CONST (to allow
betteroptimization) because their results are a function of only their parameters:
g_int_hash, g_int_equal, g_direct_hash, g_direct_equal, g_quark_to_string,
g_date_is_leap_year, g_date_days_in_month, g_date_monday_weeks_in_year,
g_date_sunday_weeks_in_year, g_spaced_primes_closest, g_unichar_is*,
g_unichar_to*, g_unichar_*digit_value, g_unichar_type
2000-08-25 22:45:48 +00:00
|
|
|
GUnicodeType g_unichar_type (gunichar c) G_GNUC_CONST;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
2000-11-29 23:38:24 +00:00
|
|
|
/* Return the line break property for a given character */
|
|
|
|
GUnicodeBreakType g_unichar_break_type (gunichar c) G_GNUC_CONST;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Compute canonical ordering of a string in-place. This rearranges
|
|
|
|
decomposed characters in the string according to their combining
|
|
|
|
classes. See the Unicode manual for more information. */
|
|
|
|
void g_unicode_canonical_ordering (gunichar *string,
|
2001-06-04 20:00:26 +00:00
|
|
|
gsize len);
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
/* Compute canonical decomposition of a character. Returns g_malloc()d
|
|
|
|
string of Unicode characters. RESULT_LEN is set to the resulting
|
|
|
|
length of the string. */
|
|
|
|
gunichar *g_unicode_canonical_decomposition (gunichar ch,
|
2004-11-28 19:12:04 +00:00
|
|
|
gsize *result_len) G_GNUC_MALLOC;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
2000-07-08 12:40:09 +00:00
|
|
|
/* Array of skip-bytes-per-initial character.
|
2000-06-21 16:11:21 +00:00
|
|
|
*/
|
2001-09-02 17:14:23 +00:00
|
|
|
GLIB_VAR const gchar * const g_utf8_skip;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
#define g_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(guchar *)(p)])
|
|
|
|
|
2001-07-19 14:35:48 +00:00
|
|
|
gunichar g_utf8_get_char (const gchar *p);
|
|
|
|
gunichar g_utf8_get_char_validated (const gchar *p,
|
|
|
|
gssize max_len);
|
|
|
|
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_utf8_offset_to_pointer (const gchar *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong offset);
|
|
|
|
glong g_utf8_pointer_to_offset (const gchar *str,
|
2000-06-21 16:11:21 +00:00
|
|
|
const gchar *pos);
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_utf8_prev_char (const gchar *p);
|
|
|
|
gchar* g_utf8_find_next_char (const gchar *p,
|
2000-09-06 14:42:13 +00:00
|
|
|
const gchar *end);
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_utf8_find_prev_char (const gchar *str,
|
2000-06-21 16:11:21 +00:00
|
|
|
const gchar *p);
|
|
|
|
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong g_utf8_strlen (const gchar *p,
|
|
|
|
gssize max);
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
/* Copies n characters from src to dest */
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_utf8_strncpy (gchar *dest,
|
2000-06-21 16:11:21 +00:00
|
|
|
const gchar *src,
|
2001-06-04 20:00:26 +00:00
|
|
|
gsize n);
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
/* Find the UTF-8 character corresponding to ch, in string p. These
|
|
|
|
functions are equivalants to strchr and strrchr */
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_utf8_strchr (const gchar *p,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
gssize len,
|
2000-09-06 14:42:13 +00:00
|
|
|
gunichar c);
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_utf8_strrchr (const gchar *p,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
gssize len,
|
2000-09-06 14:42:13 +00:00
|
|
|
gunichar c);
|
2002-07-26 19:48:02 +00:00
|
|
|
gchar* g_utf8_strreverse (const gchar *str,
|
|
|
|
gssize len);
|
2000-06-21 16:11:21 +00:00
|
|
|
|
2001-01-05 21:22:47 +00:00
|
|
|
gunichar2 *g_utf8_to_utf16 (const gchar *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong len,
|
|
|
|
glong *items_read,
|
|
|
|
glong *items_written,
|
2004-11-28 19:12:04 +00:00
|
|
|
GError **error) G_GNUC_MALLOC;
|
2001-01-05 21:22:47 +00:00
|
|
|
gunichar * g_utf8_to_ucs4 (const gchar *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong len,
|
|
|
|
glong *items_read,
|
|
|
|
glong *items_written,
|
2004-11-28 19:12:04 +00:00
|
|
|
GError **error) G_GNUC_MALLOC;
|
2001-01-05 21:22:47 +00:00
|
|
|
gunichar * g_utf8_to_ucs4_fast (const gchar *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong len,
|
2004-11-28 19:12:04 +00:00
|
|
|
glong *items_written) G_GNUC_MALLOC;
|
2001-01-05 21:22:47 +00:00
|
|
|
gunichar * g_utf16_to_ucs4 (const gunichar2 *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong len,
|
|
|
|
glong *items_read,
|
|
|
|
glong *items_written,
|
2004-11-28 19:12:04 +00:00
|
|
|
GError **error) G_GNUC_MALLOC;
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_utf16_to_utf8 (const gunichar2 *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong len,
|
|
|
|
glong *items_read,
|
|
|
|
glong *items_written,
|
2004-11-28 19:12:04 +00:00
|
|
|
GError **error) G_GNUC_MALLOC;
|
2001-01-05 21:22:47 +00:00
|
|
|
gunichar2 *g_ucs4_to_utf16 (const gunichar *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong len,
|
|
|
|
glong *items_read,
|
|
|
|
glong *items_written,
|
2004-11-28 19:12:04 +00:00
|
|
|
GError **error) G_GNUC_MALLOC;
|
2001-02-17 23:30:48 +00:00
|
|
|
gchar* g_ucs4_to_utf8 (const gunichar *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
glong len,
|
|
|
|
glong *items_read,
|
|
|
|
glong *items_written,
|
2004-11-28 19:12:04 +00:00
|
|
|
GError **error) G_GNUC_MALLOC;
|
2000-06-21 16:11:21 +00:00
|
|
|
|
|
|
|
/* Convert a single character into UTF-8. outbuf must have at
|
|
|
|
* least 6 bytes of space. Returns the number of bytes in the
|
|
|
|
* result.
|
|
|
|
*/
|
|
|
|
gint g_unichar_to_utf8 (gunichar c,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
gchar *outbuf);
|
2000-06-21 16:11:21 +00:00
|
|
|
|
2000-09-11 00:09:31 +00:00
|
|
|
/* Validate a UTF8 string, return TRUE if valid, put pointer to
|
|
|
|
* first invalid char in **end
|
|
|
|
*/
|
|
|
|
|
|
|
|
gboolean g_utf8_validate (const gchar *str,
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 13:55:09 +00:00
|
|
|
gssize max_len,
|
2000-09-11 00:09:31 +00:00
|
|
|
const gchar **end);
|
|
|
|
|
2001-03-20 00:55:44 +00:00
|
|
|
/* Validate a Unicode character */
|
|
|
|
gboolean g_unichar_validate (gunichar ch);
|
|
|
|
|
2001-07-07 02:42:49 +00:00
|
|
|
gchar *g_utf8_strup (const gchar *str,
|
2004-11-28 19:12:04 +00:00
|
|
|
gssize len) G_GNUC_MALLOC;
|
2001-07-07 02:42:49 +00:00
|
|
|
gchar *g_utf8_strdown (const gchar *str,
|
2004-11-28 19:12:04 +00:00
|
|
|
gssize len) G_GNUC_MALLOC;
|
2001-07-07 02:42:49 +00:00
|
|
|
gchar *g_utf8_casefold (const gchar *str,
|
2004-11-28 19:12:04 +00:00
|
|
|
gssize len) G_GNUC_MALLOC;
|
2001-07-02 00:49:21 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
G_NORMALIZE_DEFAULT,
|
|
|
|
G_NORMALIZE_NFD = G_NORMALIZE_DEFAULT,
|
|
|
|
G_NORMALIZE_DEFAULT_COMPOSE,
|
|
|
|
G_NORMALIZE_NFC = G_NORMALIZE_DEFAULT_COMPOSE,
|
|
|
|
G_NORMALIZE_ALL,
|
|
|
|
G_NORMALIZE_NFKD = G_NORMALIZE_ALL,
|
|
|
|
G_NORMALIZE_ALL_COMPOSE,
|
|
|
|
G_NORMALIZE_NFKC = G_NORMALIZE_ALL_COMPOSE
|
|
|
|
} GNormalizeMode;
|
|
|
|
|
|
|
|
gchar *g_utf8_normalize (const gchar *str,
|
2001-07-07 02:42:49 +00:00
|
|
|
gssize len,
|
2004-11-28 19:12:04 +00:00
|
|
|
GNormalizeMode mode) G_GNUC_MALLOC;
|
2001-07-02 00:49:21 +00:00
|
|
|
|
|
|
|
gint g_utf8_collate (const gchar *str1,
|
|
|
|
const gchar *str2);
|
2001-07-07 02:42:49 +00:00
|
|
|
gchar *g_utf8_collate_key (const gchar *str,
|
2004-11-28 19:12:04 +00:00
|
|
|
gssize len) G_GNUC_MALLOC;
|
2005-06-08 05:22:05 +00:00
|
|
|
gchar *g_utf8_collate_key_for_filename (const gchar *str,
|
|
|
|
gssize len) G_GNUC_MALLOC;
|
2001-07-02 00:49:21 +00:00
|
|
|
|
2003-09-12 17:54:43 +00:00
|
|
|
gboolean g_unichar_get_mirror_char (gunichar ch,
|
|
|
|
gunichar *mirrored_ch);
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 11:52:07 +00:00
|
|
|
G_END_DECLS
|
2000-06-21 16:11:21 +00:00
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 11:52:07 +00:00
|
|
|
#endif /* __G_UNICODE_H__ */
|