Upgrade Texinfo from 4.8 to 4.13 on the vendor branch
[dragonfly.git] / contrib / texinfo / makeinfo / lang.h
1 /* lang.h -- declarations for language codes etc.
2    $Id: lang.h,v 1.14 2007/11/21 23:02:22 karl Exp $
3
4    Copyright (C) 1999, 2001, 2002, 2003, 2006, 2007
5    Free Software Foundation, Inc.
6
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
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    These code are the ISO-639 two letter codes.  */
27
28 #undef hz /* AIX 4.3.3 */
29 typedef enum
30
31   aa, ab, ae, af, ak, am, an, ar, as, av, ay, az, ba, be, bg, bh, bi,
32   bm, bn, bo, br, bs, ca, ce, ch, co, cr, cs, cu, cv, cy, da, de, dv,
33   dz, ee, el, en, eo, es, et, eu, fa, ff, fi, fj, fo, fr, fy, ga, gd,
34   gl, gn, gu, gv, ha, he, hi, ho, hr, ht, hu, hy, hz, ia, id, ie, ig,
35   ii, ik, io, is, it, iu, ja, jv, ka, kg, ki, kj, kk, kl, km, kn, ko,
36   kr, ks, ku, kv, kw, ky, la, lb, lg, li, ln, lo, lt, lu, lv, mg, mh,
37   mi, mk, ml, mn, mo, mr, ms, mt, my, na, nb, nd, ne, ng, nl, nn, no,
38   nr, nv, ny, oc, oj, om, or, os, pa, pi, pl, ps, pt, qu, rm, rn, ro,
39   ru, rw, sa, sc, sd, se, sg, si, sk, sl, sm, sn, so, sq, sr, ss, st,
40   su, sv, sw, ta, te, tg, th, ti, tk, tl, tn, to, tr, ts, tt, tw, ty,
41   ug, uk, ur, uz, ve, vi, vo, wa, wo, xh, yi, yo, za, zh, zu,
42   last_language_code
43 } language_code_type;
44
45 /* The current language code.  */
46 extern language_code_type language_code;
47
48
49 /* Information for each language.  */
50 typedef struct
51 {
52   language_code_type lc; /* language code as enum type */
53   char *abbrev;          /* two letter language code */
54   char *desc;            /* full name for language code */
55 } language_type;
56
57 extern language_type language_table[];
58
59
60 \f
61 /* The document encoding. This is useful to produce true 8-bit
62    characters according to the @documentencoding.  */
63
64 typedef enum {
65   no_encoding,
66   US_ASCII,
67   ISO_8859_1,
68   ISO_8859_2,
69   ISO_8859_3,    /* this and none of the rest are supported. */
70   ISO_8859_4,
71   ISO_8859_5,
72   ISO_8859_6,
73   ISO_8859_7,
74   ISO_8859_8,
75   ISO_8859_9,
76   ISO_8859_10,
77   ISO_8859_11,
78   ISO_8859_12,
79   ISO_8859_13,
80   ISO_8859_14,
81   ISO_8859_15,
82   KOI8_R,
83   KOI8_U,
84   UTF_8,
85   last_encoding_code
86 } encoding_code_type;
87
88 /* The current document encoding, or null if not set.  */
89 extern encoding_code_type document_encoding_code;
90
91 /* If an encoding is not supported, just keep it as a string.  */
92 extern char *unknown_encoding;
93
94 /* Maps an HTML abbreviation to ISO and Unicode codes for a given code.  */
95
96 typedef unsigned short int unicode_t; /* should be 16 bits */
97 typedef unsigned char byte_t;
98
99 typedef struct
100 {
101   char *html;        /* HTML equivalent like umlaut auml => &auml; */
102   byte_t bytecode;   /* 8-Bit Code (ISO 8859-1,...) */
103   unicode_t unicode; /* Unicode in U+ convention */
104   char *translit;    /* 7-bit transliteration */
105 } iso_map_type;
106
107 /* Information about the document encoding. */
108 typedef struct
109 {
110   encoding_code_type ec; /* document encoding type (see above enum) */
111   char *encname;         /* encoding name like "iso-8859-1", valid in
112                             HTML and Emacs */
113   iso_map_type *isotab;  /* address of ISO translation table */
114 } encoding_type;
115
116 /* Table with all the encoding codes that we recognize.  */
117 extern encoding_type encoding_table[];
118
119 \f
120 /* The commands.  */
121 extern void cm_documentlanguage (void),
122      cm_documentencoding (void);
123
124 /* Accents, other non-English characters.  */
125 void cm_accent (int arg), cm_special_char (int arg),
126      cm_dotless (int arg, int start, int end);
127
128 extern void cm_accent_umlaut (int arg, int start, int end),
129      cm_accent_acute (int arg, int start, int end),
130      cm_accent_cedilla (int arg, int start, int end),
131      cm_accent_hat (int arg, int start, int end),
132      cm_accent_grave (int arg, int start, int end),
133      cm_accent_tilde (int arg, int start, int end);
134
135 extern char *current_document_encoding (void);
136
137 extern const char *lang_transliterate_char (byte_t ch);
138
139 extern char *document_language;
140
141 #endif /* not LANG_H */