lang.h 4.5 KB

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