~ubuntu-branches/ubuntu/edgy/lynx/edgy

« back to all changes in this revision

Viewing changes to src/UCdomap.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-16 12:14:10 UTC
  • Revision ID: james.westby@ubuntu.com-20040916121410-cz1gu92c4nqfeyrg
Tags: upstream-2.8.5
ImportĀ upstreamĀ versionĀ 2.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
/*
 
15
 *  [old comments: - KW ]
 
16
 *  consolemap.h
 
17
 *
 
18
 *  Interface between console.c, selection.c  and UCmap.c
 
19
 */
 
20
#define LAT1_MAP 0
 
21
#define GRAF_MAP 1
 
22
#define IBMPC_MAP 2
 
23
#define USER_MAP 3
 
24
 
 
25
/*
 
26
 *  Some conventions I try to follow (loosely):
 
27
 *      [a-z]* only internal, names from linux driver code.
 
28
 *      UC_* to be only known internally.
 
29
 *      UC[A-Z]* to be exported to other parts of Lynx. -KW
 
30
 */
 
31
extern void UC_Charset_Setup PARAMS((
 
32
        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 NOARGS;
 
61
 
 
62
/*
 
63
 *  INSTRUCTIONS for adding new character sets which do not have
 
64
 *              Unicode tables.
 
65
 *
 
66
 *  Several #defines below are declarations for charsets which need no
 
67
 *  tables for mapping to Unicode - CJK multibytes, x-transparent, UTF8 -
 
68
 *  Lynx takes care of them internally.
 
69
 *
 
70
 *  The declaration's format is kept in chrtrans/XXX_uni.h -
 
71
 *  keep this in mind when changing ucmaketbl.c,
 
72
 *  see also UC_Charset_Setup() above for details.
 
73
 */
 
74
 
 
75
  /*
 
76
   *  There is no strict correlation for the next five, since the transfer
 
77
   *  charset gets decoded into Display Char Set by the CJK code (separate
 
78
   *  from Unicode mechanism).  For now we use the MIME name that describes
 
79
   *  what is output to the terminal. - KW
 
80
   */
 
81
 
 
82
/*----------------------------------------------------------------------------*/
 
83
 
 
84
#ifndef NO_CHARSET_euc_cn
 
85
#define NO_CHARSET_euc_cn !ALL_CHARSETS
 
86
#endif
 
87
 
 
88
#if NO_CHARSET_euc_cn
 
89
#define UC_CHARSET_SETUP_euc_cn /*nothing*/
 
90
#else
 
91
#define UC_CHARSET_SETUP_euc_cn UC_Charset_NoUctb_Setup("euc-cn","Chinese",\
 
92
       1, 128,UCT_ENC_CJK,0)
 
93
#endif
 
94
 
 
95
/*----------------------------------------------------------------------------*/
 
96
 
 
97
#ifndef NO_CHARSET_euc_jp
 
98
#define NO_CHARSET_euc_jp !ALL_CHARSETS
 
99
#endif
 
100
 
 
101
#if NO_CHARSET_euc_jp
 
102
#define UC_CHARSET_SETUP_euc_jp /*nothing*/
 
103
#else
 
104
#define UC_CHARSET_SETUP_euc_jp UC_Charset_NoUctb_Setup("euc-jp","Japanese (EUC-JP)",\
 
105
       1, 128,UCT_ENC_CJK,0)
 
106
#endif
 
107
 
 
108
/*----------------------------------------------------------------------------*/
 
109
 
 
110
#ifndef NO_CHARSET_shift_jis
 
111
#define NO_CHARSET_shift_jis !ALL_CHARSETS
 
112
#endif
 
113
 
 
114
#if NO_CHARSET_shift_jis
 
115
#define UC_CHARSET_SETUP_shift_jis /*nothing*/
 
116
#else
 
117
#define UC_CHARSET_SETUP_shift_jis UC_Charset_NoUctb_Setup("shift_jis","Japanese (Shift_JIS)",\
 
118
       1, 128,UCT_ENC_CJK,0)
 
119
#endif
 
120
 
 
121
/*----------------------------------------------------------------------------*/
 
122
 
 
123
#ifndef NO_CHARSET_euc_kr
 
124
#define NO_CHARSET_euc_kr !ALL_CHARSETS
 
125
#endif
 
126
 
 
127
#if NO_CHARSET_euc_kr
 
128
#define UC_CHARSET_SETUP_euc_kr /*nothing*/
 
129
#else
 
130
#define UC_CHARSET_SETUP_euc_kr UC_Charset_NoUctb_Setup("euc-kr","Korean",\
 
131
       1, 128,UCT_ENC_CJK,0)
 
132
#endif
 
133
 
 
134
/*----------------------------------------------------------------------------*/
 
135
 
 
136
#ifndef NO_CHARSET_big5
 
137
#define NO_CHARSET_big5 !ALL_CHARSETS
 
138
#endif
 
139
 
 
140
#if NO_CHARSET_big5
 
141
#define UC_CHARSET_SETUP_big5 /*nothing*/
 
142
#else
 
143
#define UC_CHARSET_SETUP_big5 UC_Charset_NoUctb_Setup("big5","Taipei (Big5)",\
 
144
       1, 128,UCT_ENC_CJK,0)
 
145
#endif
 
146
 
 
147
/*----------------------------------------------------------------------------*/
 
148
 
 
149
  /*
 
150
   *  Placeholder for non-translation mode. - FM
 
151
   */
 
152
 
 
153
#ifndef NO_CHARSET_x_transparent
 
154
#define NO_CHARSET_x_transparent !ALL_CHARSETS
 
155
#endif
 
156
 
 
157
#if NO_CHARSET_x_transparent
 
158
#define UC_CHARSET_SETUP_x_transparent /*nothing*/
 
159
#else
 
160
#define UC_CHARSET_SETUP_x_transparent UC_Charset_NoUctb_Setup("x-transparent","Transparent",\
 
161
       0, 128,UCT_ENC_8BIT,0)
 
162
#endif
 
163
 
 
164
/*----------------------------------------------------------------------------*/
 
165
 
 
166
#ifndef NO_CHARSET_utf_8
 
167
#define NO_CHARSET_utf_8 !ALL_CHARSETS
 
168
#endif
 
169
 
 
170
#if NO_CHARSET_utf_8
 
171
#define UC_CHARSET_SETUP_utf_8 /*nothing*/
 
172
#else
 
173
#define UC_CHARSET_SETUP_utf_8 UC_Charset_NoUctb_Setup("utf-8","UNICODE (UTF-8)",\
 
174
       0, 128,UCT_ENC_UTF8,-4)
 
175
#endif
 
176
 
 
177
 
 
178
#endif /* UCDOMAP_H */