1 #ifndef UCDOMAP_H 2 #define UCDOMAP_H 3 4 #ifndef HTUTILS_H 5 #include <HTUtils.h> 6 #endif 7 8 #ifndef ALL_CHARSETS 9 #define ALL_CHARSETS 1 10 #endif 11 12 #include <UCkd.h> 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif 17 /* 18 * [old comments: - KW ] 19 * consolemap.h 20 * 21 * Interface between console.c, selection.c and UCmap.c 22 */ 23 #define LAT1_MAP 0 24 #define GRAF_MAP 1 25 #define IBMPC_MAP 2 26 #define USER_MAP 3 27 /* 28 * Some conventions I try to follow (loosely): 29 * [a-z]* only internal, names from linux driver code. 30 * UC_* to be only known internally. 31 * UC[A-Z]* to be exported to other parts of Lynx. -KW 32 */ extern void UC_Charset_Setup(const char *UC_MIMEcharset, 33 const char *UC_LYNXcharset, 34 const u8 * unicount, 35 const u16 * unitable, 36 int nnuni, 37 struct unimapdesc_str replacedesc, 38 int lowest_eight, 39 int UC_rawuni, 40 int codepage); 41 42 struct UC_charset { 43 const char *MIMEname; 44 const char *LYNXname; 45 const u8 *unicount; 46 const u16 *unitable; 47 int num_uni; 48 struct unimapdesc_str replacedesc; 49 int uc_status; 50 int LYhndl; 51 int GN; 52 int lowest_eight; 53 int enc; 54 int codepage; /* codepage number, used by OS/2 font-switching code */ 55 }; 56 57 extern int UCNumCharsets; 58 extern int UCInitialized; 59 60 extern void UCInit(void); 61 62 /* 63 * INSTRUCTIONS for adding new character sets which do not have Unicode tables. 64 * 65 * Several #defines below are declarations for charsets which need no tables 66 * for mapping to Unicode - CJK multibytes, x-transparent, UTF8 - Lynx takes 67 * care of them internally. 68 * 69 * The declaration's format is kept in chrtrans/XXX_uni.h - keep this in mind 70 * when changing ucmaketbl.c, see also UC_Charset_Setup() above for details. 71 */ 72 73 /* 74 * There is no strict correlation for the next five, since the transfer 75 * charset gets decoded into Display Char Set by the CJK code (separate from 76 * Unicode mechanism). For now we use the MIME name that describes what is 77 * output to the terminal. - KW 78 */ 79 80 /*----------------------------------------------------------------------------*/ 81 82 #ifndef NO_CHARSET_euc_cn 83 #define NO_CHARSET_euc_cn !ALL_CHARSETS 84 #endif 85 86 #if NO_CHARSET_euc_cn 87 #define UC_CHARSET_SETUP_euc_cn /* nothing */ 88 #else 89 #define UC_CHARSET_SETUP_euc_cn UC_Charset_NoUctb_Setup("euc-cn","Chinese",\ 90 1, 128,UCT_ENC_CJK,0) 91 #endif 92 93 /*----------------------------------------------------------------------------*/ 94 95 #ifndef NO_CHARSET_euc_jp 96 #define NO_CHARSET_euc_jp !ALL_CHARSETS 97 #endif 98 99 #if NO_CHARSET_euc_jp 100 #define UC_CHARSET_SETUP_euc_jp /* nothing */ 101 #else 102 #define UC_CHARSET_SETUP_euc_jp UC_Charset_NoUctb_Setup("euc-jp","Japanese (EUC-JP)",\ 103 1, 128,UCT_ENC_CJK,0) 104 #endif 105 106 /*----------------------------------------------------------------------------*/ 107 108 #ifndef NO_CHARSET_shift_jis 109 #define NO_CHARSET_shift_jis !ALL_CHARSETS 110 #endif 111 112 #if NO_CHARSET_shift_jis 113 #define UC_CHARSET_SETUP_shift_jis /* nothing */ 114 #else 115 #define UC_CHARSET_SETUP_shift_jis UC_Charset_NoUctb_Setup("shift_jis","Japanese (Shift_JIS)",\ 116 1, 128,UCT_ENC_CJK,0) 117 #endif 118 119 /*----------------------------------------------------------------------------*/ 120 121 #ifndef NO_CHARSET_euc_kr 122 #define NO_CHARSET_euc_kr !ALL_CHARSETS 123 #endif 124 125 #if NO_CHARSET_euc_kr 126 #define UC_CHARSET_SETUP_euc_kr /* nothing */ 127 #else 128 #define UC_CHARSET_SETUP_euc_kr UC_Charset_NoUctb_Setup("euc-kr","Korean",\ 129 1, 128,UCT_ENC_CJK,0) 130 #endif 131 132 /*----------------------------------------------------------------------------*/ 133 134 #ifndef NO_CHARSET_big5 135 #define NO_CHARSET_big5 !ALL_CHARSETS 136 #endif 137 138 #if NO_CHARSET_big5 139 #define UC_CHARSET_SETUP_big5 /* nothing */ 140 #else 141 #define UC_CHARSET_SETUP_big5 UC_Charset_NoUctb_Setup("big5","Taipei (Big5)",\ 142 1, 128,UCT_ENC_CJK,0) 143 #endif 144 145 /*----------------------------------------------------------------------------*/ 146 147 /* 148 * Placeholder for non-translation mode. - FM 149 */ 150 151 #ifndef NO_CHARSET_x_transparent 152 #define NO_CHARSET_x_transparent !ALL_CHARSETS 153 #endif 154 155 #if NO_CHARSET_x_transparent 156 #define UC_CHARSET_SETUP_x_transparent /* nothing */ 157 #else 158 #define UC_CHARSET_SETUP_x_transparent UC_Charset_NoUctb_Setup("x-transparent","Transparent",\ 159 0, 128,UCT_ENC_8BIT,0) 160 #endif 161 162 /*----------------------------------------------------------------------------*/ 163 164 #ifndef NO_CHARSET_utf_8 165 #define NO_CHARSET_utf_8 !ALL_CHARSETS 166 #endif 167 168 #if NO_CHARSET_utf_8 169 #define UC_CHARSET_SETUP_utf_8 /* nothing */ 170 #else 171 #define UC_CHARSET_SETUP_utf_8 UC_Charset_NoUctb_Setup("utf-8","UNICODE (UTF-8)",\ 172 0, 128,UCT_ENC_UTF8,-4) 173 #endif 174 175 #ifdef __cplusplus 176 } 177 #endif 178 #endif /* UCDOMAP_H */ 179