Edinburgh Speech Tools  2.1-release
charset.h
Go to the documentation of this file.
1 /*************************************************************************/
2 /* */
3 /* Copyright (c) 1997-98 Richard Tobin, Language Technology Group, HCRC, */
4 /* University of Edinburgh. */
5 /* */
6 /* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, */
7 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
8 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
9 /* IN NO EVENT SHALL THE AUTHOR OR THE UNIVERSITY OF EDINBURGH BE LIABLE */
10 /* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF */
11 /* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION */
12 /* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
13 /* */
14 /*************************************************************************/
15 #ifndef CHARSET_H
16 #define CHARSET_H
17 
18 #ifndef FOR_LT
19 #define STD_API
20 #endif
21 
22 STD_API void init_charset(void);
23 
24 /*
25  * We'd like char8 to be unsigned char, but it causes too many problems.
26  * For example:
27  * char8 name; ...; return name ? name : "<none>"
28  * produces a warning with many compilers if char8 is unsigned.
29  */
30 
31 typedef char char8;
32 typedef unsigned short char16;
33 typedef unsigned int char32;
34 
35 #if !defined(CHAR_SIZE)
36 # error CHAR_SIZE not defined
37 #endif
38 
39 #if CHAR_SIZE == 8
40 typedef char8 Char;
41 #elif CHAR_SIZE == 16
42 typedef char16 Char;
43 #else
44 #error CHAR_SIZE must be 8 or 16
45 #endif
46 
47 /* Character encodings */
48 
53 
56 
59 };
60 
62 
64 
67 
69 extern STD_API struct character_encoding_alias CharacterEncodingAlias[];
70 extern STD_API const int CE_alias_count;
71 
74  CharacterEncoding *enc3);
76 
77 /* Translation tables for Latin-N - do this right sometime! XXX */
78 
79 extern STD_API int iso_to_unicode[8][256];
80 extern STD_API int iso_max_val[8];
81 extern STD_API char8 *unicode_to_iso[8];
82 
83 #endif /* CHARSET_H */
STD_API const int CE_alias_count
Definition: charset.c:228
STD_API const char8 * CharacterEncodingName[CE_enum_count]
Definition: charset.c:170
STD_API const char8 * CharacterEncodingNameAndByteOrder[CE_enum_count]
Definition: charset.c:193
STD_API char8 * unicode_to_iso[8]
Definition: charset.c:35
#define STD_API
Definition: charset.h:19
const char8 * name
Definition: charset.h:68
unsigned short char16
Definition: charset.h:32
STD_API CharacterEncoding InternalCharacterEncoding
Definition: charset.c:231
STD_API int iso_max_val[8]
Definition: charset.c:34
STD_API void init_charset(void)
Definition: charset.c:233
character_encoding
Definition: charset.h:49
STD_API int EncodingsCompatible(CharacterEncoding enc1, CharacterEncoding enc2, CharacterEncoding *enc3)
Definition: charset.c:297
enum character_encoding CharacterEncoding
Definition: charset.h:61
unsigned int char32
Definition: charset.h:33
CharacterEncoding enc
Definition: charset.h:68
STD_API int EncodingIsAsciiSuperset(CharacterEncoding enc)
Definition: charset.c:286
char char8
Definition: charset.h:31
STD_API CharacterEncoding FindEncoding(char8 *name)
Definition: charset.c:335
STD_API int iso_to_unicode[8][256]
Definition: charset.c:33