1 | /* lang.h -- declarations for language codes etc.
|
---|
2 | $Id: lang.h,v 1.6 2004/04/11 17:56:47 karl Exp $
|
---|
3 |
|
---|
4 | Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
|
---|
5 |
|
---|
6 | This program is free software; you can redistribute it and/or modify
|
---|
7 | it under the terms of the GNU General Public License as published by
|
---|
8 | the Free Software Foundation; either version 2, or (at your option)
|
---|
9 | any later version.
|
---|
10 |
|
---|
11 | This program is distributed in the hope that it will be useful,
|
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | GNU General Public License for more details.
|
---|
15 |
|
---|
16 | You should have received a copy of the GNU General Public License
|
---|
17 | along with this program; if not, write to the Free Software
|
---|
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
19 |
|
---|
20 | Originally written by Karl Heinz Marbaise <kama@hippo.fido.de>. */
|
---|
21 |
|
---|
22 | #ifndef LANG_H
|
---|
23 | #define LANG_H
|
---|
24 |
|
---|
25 | /* The language code which can be changed through @documentlanguage
|
---|
26 | * Actually we don't currently support this (may be in the future) ;-)
|
---|
27 | * These code are the ISO-639 two letter codes.
|
---|
28 | */
|
---|
29 | typedef enum
|
---|
30 | {
|
---|
31 | aa, ab, af, am, ar, as, ay, az,
|
---|
32 | ba, be, bg, bh, bi, bn, bo, br,
|
---|
33 | ca, co, cs, cy,
|
---|
34 | da, de, dz,
|
---|
35 | el, en, eo, es, et, eu,
|
---|
36 | fa, fi, fj, fo, fr, fy,
|
---|
37 | ga, gd, gl, gn, gu,
|
---|
38 | ha, he, hi, hr, hu, hy,
|
---|
39 | ia, id, ie, ik, is, it, iu,
|
---|
40 | ja, jw,
|
---|
41 | ka, kk, kl, km, kn, ko, ks, ku, ky,
|
---|
42 | la, ln, lo, lt, lv,
|
---|
43 | mg, mi, mk, ml, mn, mo, mr, ms, mt, my,
|
---|
44 | na, ne, nl, no,
|
---|
45 | oc, om, or,
|
---|
46 | pa, pl, ps, pt,
|
---|
47 | qu,
|
---|
48 | rm, rn, ro, ru, rw,
|
---|
49 | sa, sd, sg, sh, si, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw,
|
---|
50 | ta, te, tg, th, ti, tk, tl, tn, to, tr, ts, tt, tw,
|
---|
51 | ug, uk, ur, uz,
|
---|
52 | vi, vo,
|
---|
53 | wo,
|
---|
54 | xh,
|
---|
55 | yi, yo,
|
---|
56 | za, zh, zu,
|
---|
57 | last_language_code
|
---|
58 | } language_code_type;
|
---|
59 |
|
---|
60 | /* The current language code. */
|
---|
61 | extern language_code_type language_code;
|
---|
62 |
|
---|
63 |
|
---|
64 | /* Information for each language. */
|
---|
65 | typedef struct
|
---|
66 | {
|
---|
67 | language_code_type lc; /* language code as enum type */
|
---|
68 | char *abbrev; /* two letter language code */
|
---|
69 | char *desc; /* full name for language code */
|
---|
70 | } language_type;
|
---|
71 |
|
---|
72 | extern language_type language_table[];
|
---|
73 |
|
---|
74 |
|
---|
75 | |
---|
76 |
|
---|
77 | /* The document encoding. This is useful to produce true 8-bit
|
---|
78 | characters according to the @documentencoding. */
|
---|
79 |
|
---|
80 | typedef enum {
|
---|
81 | no_encoding,
|
---|
82 | US_ASCII,
|
---|
83 | ISO_8859_1,
|
---|
84 | ISO_8859_2,
|
---|
85 | ISO_8859_3, /* this and none of the rest are supported. */
|
---|
86 | ISO_8859_4,
|
---|
87 | ISO_8859_5,
|
---|
88 | ISO_8859_6,
|
---|
89 | ISO_8859_7,
|
---|
90 | ISO_8859_8,
|
---|
91 | ISO_8859_9,
|
---|
92 | ISO_8859_10,
|
---|
93 | ISO_8859_11,
|
---|
94 | ISO_8859_12,
|
---|
95 | ISO_8859_13,
|
---|
96 | ISO_8859_14,
|
---|
97 | ISO_8859_15,
|
---|
98 | last_encoding_code
|
---|
99 | } encoding_code_type;
|
---|
100 |
|
---|
101 | /* The current document encoding, or null if not set. */
|
---|
102 | extern encoding_code_type document_encoding_code;
|
---|
103 |
|
---|
104 | /* If an encoding is not supported, just keep it as a string. */
|
---|
105 | extern char *unknown_encoding;
|
---|
106 |
|
---|
107 | /* Maps an HTML abbreviation to ISO and Unicode codes for a given code. */
|
---|
108 |
|
---|
109 | typedef unsigned short int unicode_t; /* should be 16 bits */
|
---|
110 | typedef unsigned char byte_t;
|
---|
111 |
|
---|
112 | typedef struct
|
---|
113 | {
|
---|
114 | char *html; /* HTML equivalent like umlaut auml => ä */
|
---|
115 | byte_t bytecode; /* 8-Bit Code (ISO 8859-1,...) */
|
---|
116 | unicode_t unicode; /* Unicode in U+ convention */
|
---|
117 | } iso_map_type;
|
---|
118 |
|
---|
119 | /* Information about the document encoding. */
|
---|
120 | typedef struct
|
---|
121 | {
|
---|
122 | encoding_code_type ec; /* document encoding type (see above enum) */
|
---|
123 | char *encname; /* encoding name like "iso-8859-1", valid in
|
---|
124 | HTML and Emacs */
|
---|
125 | iso_map_type *isotab; /* address of ISO translation table */
|
---|
126 | } encoding_type;
|
---|
127 |
|
---|
128 | /* Table with all the encoding codes that we recognize. */
|
---|
129 | extern encoding_type encoding_table[];
|
---|
130 |
|
---|
131 | |
---|
132 |
|
---|
133 | /* The commands. */
|
---|
134 | extern void cm_documentlanguage (void),
|
---|
135 | cm_documentencoding (void);
|
---|
136 |
|
---|
137 | /* Accents, other non-English characters. */
|
---|
138 | void cm_accent (int arg), cm_special_char (int arg),
|
---|
139 | cm_dotless (int arg, int start, int end);
|
---|
140 |
|
---|
141 | extern void cm_accent_umlaut (int arg, int start, int end),
|
---|
142 | cm_accent_acute (int arg, int start, int end),
|
---|
143 | cm_accent_cedilla (int arg, int start, int end),
|
---|
144 | cm_accent_hat (int arg, int start, int end),
|
---|
145 | cm_accent_grave (int arg, int start, int end),
|
---|
146 | cm_accent_tilde (int arg, int start, int end);
|
---|
147 |
|
---|
148 | extern char *current_document_encoding (void);
|
---|
149 |
|
---|
150 | #endif /* not LANG_H */
|
---|