Back to index

tetex-bin  3.0
lang.h
Go to the documentation of this file.
00001 /* lang.h -- declarations for language codes etc.
00002    $Id: lang.h,v 1.6 2004/04/11 17:56:47 karl Exp $
00003 
00004    Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software
00018    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019 
00020    Originally written by Karl Heinz Marbaise <kama@hippo.fido.de>.  */
00021 
00022 #ifndef LANG_H
00023 #define LANG_H
00024 
00025 /* The language code which can be changed through @documentlanguage
00026  * Actually we don't currently support this (may be in the future) ;-)
00027  * These code are the ISO-639 two letter codes.
00028  */
00029 typedef enum
00030 {
00031   aa,  ab,  af,  am,  ar,  as,  ay,  az,
00032   ba,  be,  bg,  bh,  bi,  bn,  bo,  br,
00033   ca,  co,  cs,  cy,
00034   da,  de,  dz,
00035   el,  en,  eo,  es,  et,  eu,
00036   fa,  fi,  fj,  fo,  fr,  fy,
00037   ga,  gd,  gl,  gn,  gu,
00038   ha,  he,  hi,  hr,  hu,  hy,
00039   ia,  id,  ie,  ik,  is,  it,  iu,
00040   ja,  jw,
00041   ka,  kk,  kl,  km,  kn,  ko,  ks,  ku,  ky,
00042   la,  ln,  lo,  lt,  lv,
00043   mg,  mi,  mk,  ml,  mn,  mo,  mr,  ms,  mt,  my,
00044   na,  ne,  nl,  no,
00045   oc,  om,  or,
00046   pa,  pl,  ps,  pt,
00047   qu,
00048   rm,  rn,  ro,  ru,  rw,
00049   sa,  sd,  sg,  sh,  si,  sk,  sl,  sm,  sn,  so,  sq,  sr,  ss,  st,  su,  sv,  sw,
00050   ta,  te,  tg,  th,  ti,  tk,  tl,  tn,  to,  tr,  ts,  tt,  tw,
00051   ug,  uk,  ur,  uz,
00052   vi,  vo,
00053   wo,
00054   xh,
00055   yi,  yo,
00056   za,  zh,  zu,
00057   last_language_code
00058 } language_code_type;
00059 
00060 /* The current language code.  */
00061 extern language_code_type language_code;
00062 
00063 
00064 /* Information for each language.  */
00065 typedef struct
00066 {
00067   language_code_type lc; /* language code as enum type */
00068   char *abbrev;          /* two letter language code */
00069   char *desc;            /* full name for language code */
00070 } language_type;
00071 
00072 extern language_type language_table[];
00073 
00074 
00075 
00076 /* The document encoding. This is useful to produce true 8-bit
00077    characters according to the @documentencoding.  */
00078 
00079 typedef enum {
00080   no_encoding,
00081   US_ASCII,
00082   ISO_8859_1,
00083   ISO_8859_2,
00084   ISO_8859_3,    /* this and none of the rest are supported. */
00085   ISO_8859_4,
00086   ISO_8859_5,
00087   ISO_8859_6,
00088   ISO_8859_7,
00089   ISO_8859_8,
00090   ISO_8859_9,
00091   ISO_8859_10,
00092   ISO_8859_11,
00093   ISO_8859_12,
00094   ISO_8859_13,
00095   ISO_8859_14,
00096   ISO_8859_15,
00097   last_encoding_code
00098 } encoding_code_type;
00099 
00100 /* The current document encoding, or null if not set.  */
00101 extern encoding_code_type document_encoding_code;
00102 
00103 /* If an encoding is not supported, just keep it as a string.  */
00104 extern char *unknown_encoding;
00105 
00106 /* Maps an HTML abbreviation to ISO and Unicode codes for a given code.  */
00107 
00108 typedef unsigned short int unicode_t; /* should be 16 bits */
00109 typedef unsigned char byte_t;
00110 
00111 typedef struct
00112 {
00113   char *html;        /* HTML equivalent like umlaut auml => &auml; */
00114   byte_t bytecode;   /* 8-Bit Code (ISO 8859-1,...) */
00115   unicode_t unicode; /* Unicode in U+ convention */
00116 } iso_map_type;
00117 
00118 /* Information about the document encoding. */
00119 typedef struct
00120 {
00121   encoding_code_type ec; /* document encoding type (see above enum) */
00122   char *encname;         /* encoding name like "iso-8859-1", valid in
00123                             HTML and Emacs */
00124   iso_map_type *isotab;  /* address of ISO translation table */
00125 } encoding_type;
00126 
00127 /* Table with all the encoding codes that we recognize.  */
00128 extern encoding_type encoding_table[];
00129 
00130 
00131 /* The commands.  */
00132 extern void cm_documentlanguage (void),
00133      cm_documentencoding (void);
00134 
00135 /* Accents, other non-English characters.  */
00136 void cm_accent (int arg), cm_special_char (int arg),
00137      cm_dotless (int arg, int start, int end);
00138 
00139 extern void cm_accent_umlaut (int arg, int start, int end),
00140      cm_accent_acute (int arg, int start, int end),
00141      cm_accent_cedilla (int arg, int start, int end),
00142      cm_accent_hat (int arg, int start, int end),
00143      cm_accent_grave (int arg, int start, int end),
00144      cm_accent_tilde (int arg, int start, int end);
00145 
00146 extern char *current_document_encoding (void);
00147 
00148 #endif /* not LANG_H */