1 | /* |
2 | * "$Id: language.h 10996 2013-05-29 11:51:34Z msweet $" |
3 | * |
4 | * Multi-language support for CUPS. |
5 | * |
6 | * Copyright 2007-2011 by Apple Inc. |
7 | * Copyright 1997-2006 by Easy Software Products. |
8 | * |
9 | * These coded instructions, statements, and computer programs are the |
10 | * property of Apple Inc. and are protected by Federal copyright |
11 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" |
12 | * which should have been included with this file. If this file is |
13 | * file is missing or damaged, see the license at "http://www.cups.org/". |
14 | * |
15 | * This file is subject to the Apple OS-Developed Software exception. |
16 | */ |
17 | |
18 | #ifndef _CUPS_LANGUAGE_H_ |
19 | # define _CUPS_LANGUAGE_H_ |
20 | |
21 | /* |
22 | * Include necessary headers... |
23 | */ |
24 | |
25 | # include <locale.h> |
26 | # include "array.h" |
27 | |
28 | # ifdef __cplusplus |
29 | extern "C" { |
30 | # endif /* __cplusplus */ |
31 | |
32 | |
33 | /* |
34 | * Types... |
35 | */ |
36 | |
37 | typedef enum cups_encoding_e /**** Language Encodings ****/ |
38 | { |
39 | CUPS_AUTO_ENCODING = -1, /* Auto-detect the encoding @private@ */ |
40 | CUPS_US_ASCII, /* US ASCII */ |
41 | CUPS_ISO8859_1, /* ISO-8859-1 */ |
42 | CUPS_ISO8859_2, /* ISO-8859-2 */ |
43 | CUPS_ISO8859_3, /* ISO-8859-3 */ |
44 | CUPS_ISO8859_4, /* ISO-8859-4 */ |
45 | CUPS_ISO8859_5, /* ISO-8859-5 */ |
46 | CUPS_ISO8859_6, /* ISO-8859-6 */ |
47 | CUPS_ISO8859_7, /* ISO-8859-7 */ |
48 | CUPS_ISO8859_8, /* ISO-8859-8 */ |
49 | CUPS_ISO8859_9, /* ISO-8859-9 */ |
50 | CUPS_ISO8859_10, /* ISO-8859-10 */ |
51 | CUPS_UTF8, /* UTF-8 */ |
52 | CUPS_ISO8859_13, /* ISO-8859-13 */ |
53 | CUPS_ISO8859_14, /* ISO-8859-14 */ |
54 | CUPS_ISO8859_15, /* ISO-8859-15 */ |
55 | CUPS_WINDOWS_874, /* CP-874 */ |
56 | CUPS_WINDOWS_1250, /* CP-1250 */ |
57 | CUPS_WINDOWS_1251, /* CP-1251 */ |
58 | CUPS_WINDOWS_1252, /* CP-1252 */ |
59 | CUPS_WINDOWS_1253, /* CP-1253 */ |
60 | CUPS_WINDOWS_1254, /* CP-1254 */ |
61 | CUPS_WINDOWS_1255, /* CP-1255 */ |
62 | CUPS_WINDOWS_1256, /* CP-1256 */ |
63 | CUPS_WINDOWS_1257, /* CP-1257 */ |
64 | CUPS_WINDOWS_1258, /* CP-1258 */ |
65 | CUPS_KOI8_R, /* KOI-8-R */ |
66 | CUPS_KOI8_U, /* KOI-8-U */ |
67 | CUPS_ISO8859_11, /* ISO-8859-11 */ |
68 | CUPS_ISO8859_16, /* ISO-8859-16 */ |
69 | CUPS_MAC_ROMAN, /* MacRoman */ |
70 | CUPS_ENCODING_SBCS_END = 63, /* End of single-byte encodings @private@ */ |
71 | |
72 | CUPS_WINDOWS_932, /* Japanese JIS X0208-1990 */ |
73 | CUPS_WINDOWS_936, /* Simplified Chinese GB 2312-80 */ |
74 | CUPS_WINDOWS_949, /* Korean KS C5601-1992 */ |
75 | CUPS_WINDOWS_950, /* Traditional Chinese Big Five */ |
76 | CUPS_WINDOWS_1361, /* Korean Johab */ |
77 | CUPS_ENCODING_DBCS_END = 127, /* End of double-byte encodings @private@ */ |
78 | |
79 | CUPS_EUC_CN, /* EUC Simplified Chinese */ |
80 | CUPS_EUC_JP, /* EUC Japanese */ |
81 | CUPS_EUC_KR, /* EUC Korean */ |
82 | CUPS_EUC_TW, /* EUC Traditional Chinese */ |
83 | CUPS_JIS_X0213, /* JIS X0213 aka Shift JIS */ |
84 | CUPS_ENCODING_VBCS_END = 191 /* End of variable-length encodings @private@ */ |
85 | } cups_encoding_t; |
86 | |
87 | typedef struct cups_lang_s /**** Language Cache Structure ****/ |
88 | { |
89 | struct cups_lang_s *next; /* Next language in cache */ |
90 | int used; /* Number of times this entry has been used. */ |
91 | cups_encoding_t encoding; /* Text encoding */ |
92 | char language[16]; /* Language/locale name */ |
93 | cups_array_t *strings; /* Message strings @private@ */ |
94 | } cups_lang_t; |
95 | |
96 | |
97 | /* |
98 | * Prototypes... |
99 | */ |
100 | |
101 | extern cups_lang_t *cupsLangDefault(void); |
102 | extern const char *cupsLangEncoding(cups_lang_t *lang); |
103 | extern void cupsLangFlush(void); |
104 | extern void cupsLangFree(cups_lang_t *lang); |
105 | extern cups_lang_t *cupsLangGet(const char *language); |
106 | |
107 | # ifdef __cplusplus |
108 | } |
109 | # endif /* __cplusplus */ |
110 | |
111 | #endif /* !_CUPS_LANGUAGE_H_ */ |
112 | |
113 | /* |
114 | * End of "$Id: language.h 10996 2013-05-29 11:51:34Z msweet $". |
115 | */ |
116 | |