2 * fribidi-char-sets.h - character set conversion routines
5 * Behdad Esfahbod, 2001, 2002, 2004
6 * Dov Grobgeld, 1999, 2000
8 * Copyright (C) 2004 Sharif FarsiWeb, Inc
9 * Copyright (C) 2001,2002 Behdad Esfahbod
10 * Copyright (C) 1999,2000 Dov Grobgeld
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this library, in a file named COPYING; if not, write to the
24 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA
27 * For licensing issues, contact <fribidi.license@gmail.com>.
29 #ifndef _FRIBIDI_CHAR_SETS_H
30 #define _FRIBIDI_CHAR_SETS_H
32 #include "fribidi-common.h"
34 #include "fribidi-types.h"
36 #include "fribidi-begindecls.h"
40 _FRIBIDI_CHAR_SET_NOT_FOUND,
41 # define _FRIBIDI_ADD_CHAR_SET(CHAR_SET, char_set) FRIBIDI_CHAR_SET_##CHAR_SET,
42 # include "fribidi-char-sets-list.h"
43 # undef _FRIBIDI_ADD_CHAR_SET
44 _FRIBIDI_CHAR_SETS_NUM_PLUS_ONE
48 #define FRIBIDI_CHAR_SET_NOT_FOUND _FRIBIDI_CHAR_SET_NOT_FOUND
49 #define FRIBIDI_CHAR_SETS_NUM (_FRIBIDI_CHAR_SETS_NUM_PLUS_ONE - 1)
52 /* fribidi_charset_to_unicode - convert string to Unicode
54 * This function converts an string from a character set, to a Unicode string.
56 * Returns: The length of the new string.
58 FRIBIDI_ENTRY FriBidiStrIndex fribidi_charset_to_unicode (
59 FriBidiCharSet char_set, /* character set to convert from */
60 const char *s, /* input string encoded in char_set */
61 FriBidiStrIndex len, /* input string length */
62 FriBidiChar *us /* output Unicode string */
65 /* fribidi_unicode_to_charset - convert string from Unicode
67 * This function converts a Unicode string to an string in another character
68 * set. It also null-terminates the output string.
70 * Returns: The length of the new string.
72 FRIBIDI_ENTRY FriBidiStrIndex fribidi_unicode_to_charset (
73 FriBidiCharSet char_set, /* character set to convert to */
74 const FriBidiChar *us, /* input Unicode string */
75 FriBidiStrIndex len, /* input string length */
76 char *s /* output string encoded in char_set */
79 /* fribidi_parse_charset - parse character set name
81 * Returns: The character set named s, or FRIBIDI_CHAR_SET_NOT_FOUND if the
82 * character set is not available.
84 FRIBIDI_ENTRY FriBidiCharSet fribidi_parse_charset (
85 const char *s /* input name of the character set */
89 FRIBIDI_ENTRY const char *fribidi_char_set_name (
90 FriBidiCharSet char_set
93 FRIBIDI_ENTRY const char *fribidi_char_set_title (
94 FriBidiCharSet char_set
97 FRIBIDI_ENTRY const char *fribidi_char_set_desc (
98 FriBidiCharSet char_set
101 #include "fribidi-enddecls.h"
103 #endif /* !_FRIBIDI_CHAR_SETS_H */
104 /* Editor directions:
105 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent