156160Sru/* lang.h -- declarations for language codes etc. 2146515Sru $Id: lang.h,v 1.6 2004/04/11 17:56:47 karl Exp $ 356160Sru 4116525Sru Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. 556160Sru 656160Sru This program is free software; you can redistribute it and/or modify 756160Sru it under the terms of the GNU General Public License as published by 856160Sru the Free Software Foundation; either version 2, or (at your option) 956160Sru any later version. 1056160Sru 1156160Sru This program is distributed in the hope that it will be useful, 1256160Sru but WITHOUT ANY WARRANTY; without even the implied warranty of 1356160Sru MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1456160Sru GNU General Public License for more details. 1556160Sru 1656160Sru You should have received a copy of the GNU General Public License 1756160Sru along with this program; if not, write to the Free Software 1856160Sru Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1956160Sru 2093139Sru Originally written by Karl Heinz Marbaise <kama@hippo.fido.de>. */ 2156160Sru 2256160Sru#ifndef LANG_H 2356160Sru#define LANG_H 2456160Sru 2593139Sru/* The language code which can be changed through @documentlanguage 2693139Sru * Actually we don't currently support this (may be in the future) ;-) 2793139Sru * These code are the ISO-639 two letter codes. 2856160Sru */ 2956160Srutypedef enum 3056160Sru{ 3156160Sru aa, ab, af, am, ar, as, ay, az, 3256160Sru ba, be, bg, bh, bi, bn, bo, br, 3356160Sru ca, co, cs, cy, 3456160Sru da, de, dz, 3556160Sru el, en, eo, es, et, eu, 3656160Sru fa, fi, fj, fo, fr, fy, 3756160Sru ga, gd, gl, gn, gu, 3856160Sru ha, he, hi, hr, hu, hy, 3956160Sru ia, id, ie, ik, is, it, iu, 4056160Sru ja, jw, 4156160Sru ka, kk, kl, km, kn, ko, ks, ku, ky, 4256160Sru la, ln, lo, lt, lv, 4356160Sru mg, mi, mk, ml, mn, mo, mr, ms, mt, my, 4456160Sru na, ne, nl, no, 4556160Sru oc, om, or, 4656160Sru pa, pl, ps, pt, 4756160Sru qu, 4856160Sru rm, rn, ro, ru, rw, 4956160Sru sa, sd, sg, sh, si, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, 5056160Sru ta, te, tg, th, ti, tk, tl, tn, to, tr, ts, tt, tw, 5156160Sru ug, uk, ur, uz, 5256160Sru vi, vo, 5356160Sru wo, 5456160Sru xh, 5556160Sru yi, yo, 5656160Sru za, zh, zu, 5756160Sru last_language_code 5856160Sru} language_code_type; 5956160Sru 6056160Sru/* The current language code. */ 6156160Sruextern language_code_type language_code; 6256160Sru 6393139Sru 6493139Sru/* Information for each language. */ 6556160Srutypedef struct 6656160Sru{ 6756160Sru language_code_type lc; /* language code as enum type */ 6856160Sru char *abbrev; /* two letter language code */ 6956160Sru char *desc; /* full name for language code */ 7093139Sru} language_type; 7156160Sru 7293139Sruextern language_type language_table[]; 7356160Sru 7456160Sru 7593139Sru 76146515Sru/* The document encoding. This is useful to produce true 8-bit 77146515Sru characters according to the @documentencoding. */ 78146515Sru 7993139Srutypedef enum { 80146515Sru no_encoding, 81146515Sru US_ASCII, 82146515Sru ISO_8859_1, 83146515Sru ISO_8859_2, 84146515Sru ISO_8859_3, /* this and none of the rest are supported. */ 85146515Sru ISO_8859_4, 86146515Sru ISO_8859_5, 87146515Sru ISO_8859_6, 88146515Sru ISO_8859_7, 89146515Sru ISO_8859_8, 90146515Sru ISO_8859_9, 91146515Sru ISO_8859_10, 92146515Sru ISO_8859_11, 93146515Sru ISO_8859_12, 94146515Sru ISO_8859_13, 95146515Sru ISO_8859_14, 96146515Sru ISO_8859_15, 97146515Sru last_encoding_code 9893139Sru} encoding_code_type; 9993139Sru 10093139Sru/* The current document encoding, or null if not set. */ 10193139Sruextern encoding_code_type document_encoding_code; 10293139Sru 103146515Sru/* If an encoding is not supported, just keep it as a string. */ 104146515Sruextern char *unknown_encoding; 10593139Sru 10693139Sru/* Maps an HTML abbreviation to ISO and Unicode codes for a given code. */ 10793139Sru 10893139Srutypedef unsigned short int unicode_t; /* should be 16 bits */ 10993139Srutypedef unsigned char byte_t; 11093139Sru 11193139Srutypedef struct 11293139Sru{ 11393139Sru char *html; /* HTML equivalent like umlaut auml => ä */ 11493139Sru byte_t bytecode; /* 8-Bit Code (ISO 8859-1,...) */ 11593139Sru unicode_t unicode; /* Unicode in U+ convention */ 11693139Sru} iso_map_type; 11793139Sru 11893139Sru/* Information about the document encoding. */ 11993139Srutypedef struct 12093139Sru{ 12193139Sru encoding_code_type ec; /* document encoding type (see above enum) */ 122146515Sru char *encname; /* encoding name like "iso-8859-1", valid in 123146515Sru HTML and Emacs */ 12493139Sru iso_map_type *isotab; /* address of ISO translation table */ 12593139Sru} encoding_type; 12693139Sru 12793139Sru/* Table with all the encoding codes that we recognize. */ 12893139Sruextern encoding_type encoding_table[]; 12993139Sru 13093139Sru 13156160Sru/* The commands. */ 132146515Sruextern void cm_documentlanguage (void), 133146515Sru cm_documentencoding (void); 13456160Sru 13556160Sru/* Accents, other non-English characters. */ 136146515Sruvoid cm_accent (int arg), cm_special_char (int arg), 137146515Sru cm_dotless (int arg, int start, int end); 13856160Sru 139146515Sruextern void cm_accent_umlaut (int arg, int start, int end), 140146515Sru cm_accent_acute (int arg, int start, int end), 141146515Sru cm_accent_cedilla (int arg, int start, int end), 142146515Sru cm_accent_hat (int arg, int start, int end), 143146515Sru cm_accent_grave (int arg, int start, int end), 144146515Sru cm_accent_tilde (int arg, int start, int end); 14556160Sru 146146515Sruextern char *current_document_encoding (void); 147146515Sru 14856160Sru#endif /* not LANG_H */ 149