2 * fribidi-char-sets.h - character set conversion routines
4 * $Id: fribidi-char-sets.h,v 1.3 2004-06-09 14:59:21 behdad Exp $
6 * $Date: 2004-06-09 14:59:21 $
8 * $Source: /home/behdad/src/fdo/fribidi/togit/git/../fribidi/fribidi2/charset/fribidi-char-sets.h,v $
11 * Behdad Esfahbod, 2001, 2002, 2004
12 * Dov Grobgeld, 1999, 2000
14 * Copyright (C) 2004 Sharif FarsiWeb, Inc
15 * Copyright (C) 2001,2002 Behdad Esfahbod
16 * Copyright (C) 1999,2000 Dov Grobgeld
18 * This library is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU Lesser General Public
20 * License as published by the Free Software Foundation; either
21 * version 2.1 of the License, or (at your option) any later version.
23 * This library is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 * Lesser General Public License for more details.
28 * You should have received a copy of the GNU Lesser General Public License
29 * along with this library, in a file named COPYING; if not, write to the
30 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
31 * Boston, MA 02110-1301, USA
33 * For licensing issues, contact <license@farsiweb.info>.
35 #ifndef _FRIBIDI_CHAR_SETS_H
36 #define _FRIBIDI_CHAR_SETS_H
38 #include "fribidi-common.h"
40 #include "fribidi-types.h"
42 #include "fribidi-begindecls.h"
46 _FRIBIDI_CHAR_SET_NOT_FOUND,
47 # define _FRIBIDI_ADD_CHAR_SET(CHAR_SET, char_set) FRIBIDI_CHAR_SET_##CHAR_SET,
48 # include "fribidi-char-sets-list.h"
49 # undef _FRIBIDI_ADD_CHAR_SET
50 _FRIBIDI_CHAR_SETS_NUM_PLUS_ONE
54 #define FRIBIDI_CHAR_SET_NOT_FOUND _FRIBIDI_CHAR_SET_NOT_FOUND
55 #define FRIBIDI_CHAR_SETS_NUM (_FRIBIDI_CHAR_SETS_NUM_PLUS_ONE - 1)
58 #define fribidi_charset_to_unicode FRIBIDI_NAMESPACE(charset_to_unicode)
59 /* fribidi_charset_to_unicode - convert string to Unicode
61 * This function converts an string from a character set, to a Unicode string.
63 * Returns: The length of the new string.
65 FRIBIDI_ENTRY FriBidiStrIndex fribidi_charset_to_unicode (
66 FriBidiCharSet char_set, /* character set to convert from */
67 const char *s, /* input string encoded in char_set */
68 FriBidiStrIndex len, /* input string length */
69 FriBidiChar *us /* output Unicode string */
72 #define fribidi_unicode_to_charset FRIBIDI_NAMESPACE(unicode_to_charset)
73 /* fribidi_unicode_to_charset - convert string from Unicode
75 * This function converts a Unicode string to an string in another character
76 * set. It also null-terminates the output string.
78 * Returns: The length of the new string.
80 FRIBIDI_ENTRY FriBidiStrIndex fribidi_unicode_to_charset (
81 FriBidiCharSet char_set, /* character set to conver to */
82 const FriBidiChar *us, /* input Unicode string */
83 FriBidiStrIndex len, /* input string length */
84 char *s /* output string encoded in char_set */
87 #define fribidi_parse_charset FRIBIDI_NAMESPACE(parse_charset)
88 /* fribidi_parse_charset - parse character set name
90 * Returns: The character set named s, or FRIBIDI_CHAR_SET_NOT_FOUND if the
91 * character set is not available.
93 FRIBIDI_ENTRY FriBidiCharSet fribidi_parse_charset (
94 const char *s /* input name of the character set */
98 #define fribidi_char_set_name FRIBIDI_NAMESPACE(char_set_name)
99 FRIBIDI_ENTRY const char *fribidi_char_set_name (
100 FriBidiCharSet char_set
103 #define fribidi_char_set_title FRIBIDI_NAMESPACE(char_set_title)
104 FRIBIDI_ENTRY const char *fribidi_char_set_title (
105 FriBidiCharSet char_set
108 #define fribidi_char_set_desc FRIBIDI_NAMESPACE(char_set_desc)
109 FRIBIDI_ENTRY const char *fribidi_char_set_desc (
110 FriBidiCharSet char_set
113 #include "fribidi-enddecls.h"
115 #endif /* !_FRIBIDI_CHAR_SETS_H */
116 /* Editor directions:
117 * vim:textwidth=78:tabstop=8:shiftwidth=2:autoindent:cindent