1 /* 2 * Multi-language support for CUPS. 3 * 4 * Copyright 2007-2011 by Apple Inc. 5 * Copyright 1997-2006 by Easy Software Products. 6 * 7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information. 8 */ 9 10 #ifndef _CUPS_LANGUAGE_H_ 11 # define _CUPS_LANGUAGE_H_ 12 13 /* 14 * Include necessary headers... 15 */ 16 17 # include <locale.h> 18 # include "array.h" 19 20 # ifdef __cplusplus 21 extern "C" { 22 # endif /* __cplusplus */ 23 24 25 /* 26 * Types... 27 */ 28 29 typedef enum cups_encoding_e /**** Language Encodings @exclude all@ ****/ 30 { 31 CUPS_AUTO_ENCODING = -1, /* Auto-detect the encoding @private@ */ 32 CUPS_US_ASCII, /* US ASCII */ 33 CUPS_ISO8859_1, /* ISO-8859-1 */ 34 CUPS_ISO8859_2, /* ISO-8859-2 */ 35 CUPS_ISO8859_3, /* ISO-8859-3 */ 36 CUPS_ISO8859_4, /* ISO-8859-4 */ 37 CUPS_ISO8859_5, /* ISO-8859-5 */ 38 CUPS_ISO8859_6, /* ISO-8859-6 */ 39 CUPS_ISO8859_7, /* ISO-8859-7 */ 40 CUPS_ISO8859_8, /* ISO-8859-8 */ 41 CUPS_ISO8859_9, /* ISO-8859-9 */ 42 CUPS_ISO8859_10, /* ISO-8859-10 */ 43 CUPS_UTF8, /* UTF-8 */ 44 CUPS_ISO8859_13, /* ISO-8859-13 */ 45 CUPS_ISO8859_14, /* ISO-8859-14 */ 46 CUPS_ISO8859_15, /* ISO-8859-15 */ 47 CUPS_WINDOWS_874, /* CP-874 */ 48 CUPS_WINDOWS_1250, /* CP-1250 */ 49 CUPS_WINDOWS_1251, /* CP-1251 */ 50 CUPS_WINDOWS_1252, /* CP-1252 */ 51 CUPS_WINDOWS_1253, /* CP-1253 */ 52 CUPS_WINDOWS_1254, /* CP-1254 */ 53 CUPS_WINDOWS_1255, /* CP-1255 */ 54 CUPS_WINDOWS_1256, /* CP-1256 */ 55 CUPS_WINDOWS_1257, /* CP-1257 */ 56 CUPS_WINDOWS_1258, /* CP-1258 */ 57 CUPS_KOI8_R, /* KOI-8-R */ 58 CUPS_KOI8_U, /* KOI-8-U */ 59 CUPS_ISO8859_11, /* ISO-8859-11 */ 60 CUPS_ISO8859_16, /* ISO-8859-16 */ 61 CUPS_MAC_ROMAN, /* MacRoman */ 62 CUPS_ENCODING_SBCS_END = 63, /* End of single-byte encodings @private@ */ 63 64 CUPS_WINDOWS_932, /* Japanese JIS X0208-1990 */ 65 CUPS_WINDOWS_936, /* Simplified Chinese GB 2312-80 */ 66 CUPS_WINDOWS_949, /* Korean KS C5601-1992 */ 67 CUPS_WINDOWS_950, /* Traditional Chinese Big Five */ 68 CUPS_WINDOWS_1361, /* Korean Johab */ 69 CUPS_ENCODING_DBCS_END = 127, /* End of double-byte encodings @private@ */ 70 71 CUPS_EUC_CN, /* EUC Simplified Chinese */ 72 CUPS_EUC_JP, /* EUC Japanese */ 73 CUPS_EUC_KR, /* EUC Korean */ 74 CUPS_EUC_TW, /* EUC Traditional Chinese */ 75 CUPS_JIS_X0213, /* JIS X0213 aka Shift JIS */ 76 CUPS_ENCODING_VBCS_END = 191 /* End of variable-length encodings @private@ */ 77 } cups_encoding_t; 78 79 typedef struct cups_lang_s /**** Language Cache Structure ****/ 80 { 81 struct cups_lang_s *next; /* Next language in cache */ 82 int used; /* Number of times this entry has been used. */ 83 cups_encoding_t encoding; /* Text encoding */ 84 char language[16]; /* Language/locale name */ 85 cups_array_t *strings; /* Message strings @private@ */ 86 } cups_lang_t; 87 88 89 /* 90 * Prototypes... 91 */ 92 93 extern cups_lang_t *cupsLangDefault(void) _CUPS_PUBLIC; 94 extern const char *cupsLangEncoding(cups_lang_t *lang) _CUPS_PUBLIC; 95 extern void cupsLangFlush(void) _CUPS_PUBLIC; 96 extern void cupsLangFree(cups_lang_t *lang) _CUPS_PUBLIC; 97 extern cups_lang_t *cupsLangGet(const char *language) _CUPS_PUBLIC; 98 99 # ifdef __cplusplus 100 } 101 # endif /* __cplusplus */ 102 103 #endif /* !_CUPS_LANGUAGE_H_ */ 104