xref: /openbsd-src/gnu/usr.bin/texinfo/makeinfo/lang.h (revision a1acfa9b69ad64eb720639240c8438f11107dc85)
11cc83814Sespie /* lang.h -- declarations for language codes etc.
2*a1acfa9bSespie    $Id: lang.h,v 1.1.1.3 2006/07/17 16:03:47 espie Exp $
31cc83814Sespie 
4*a1acfa9bSespie    Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
51cc83814Sespie 
61cc83814Sespie    This program is free software; you can redistribute it and/or modify
71cc83814Sespie    it under the terms of the GNU General Public License as published by
81cc83814Sespie    the Free Software Foundation; either version 2, or (at your option)
91cc83814Sespie    any later version.
101cc83814Sespie 
111cc83814Sespie    This program is distributed in the hope that it will be useful,
121cc83814Sespie    but WITHOUT ANY WARRANTY; without even the implied warranty of
131cc83814Sespie    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141cc83814Sespie    GNU General Public License for more details.
151cc83814Sespie 
161cc83814Sespie    You should have received a copy of the GNU General Public License
171cc83814Sespie    along with this program; if not, write to the Free Software
181cc83814Sespie    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
191cc83814Sespie 
203fb98d4aSespie    Originally written by Karl Heinz Marbaise <kama@hippo.fido.de>.  */
211cc83814Sespie 
221cc83814Sespie #ifndef LANG_H
231cc83814Sespie #define LANG_H
241cc83814Sespie 
253fb98d4aSespie /* The language code which can be changed through @documentlanguage
263fb98d4aSespie  * Actually we don't currently support this (may be in the future) ;-)
273fb98d4aSespie  * These code are the ISO-639 two letter codes.
281cc83814Sespie  */
291cc83814Sespie typedef enum
301cc83814Sespie {
311cc83814Sespie   aa,  ab,  af,  am,  ar,  as,  ay,  az,
321cc83814Sespie   ba,  be,  bg,  bh,  bi,  bn,  bo,  br,
331cc83814Sespie   ca,  co,  cs,  cy,
341cc83814Sespie   da,  de,  dz,
351cc83814Sespie   el,  en,  eo,  es,  et,  eu,
361cc83814Sespie   fa,  fi,  fj,  fo,  fr,  fy,
371cc83814Sespie   ga,  gd,  gl,  gn,  gu,
381cc83814Sespie   ha,  he,  hi,  hr,  hu,  hy,
391cc83814Sespie   ia,  id,  ie,  ik,  is,  it,  iu,
401cc83814Sespie   ja,  jw,
411cc83814Sespie   ka,  kk,  kl,  km,  kn,  ko,  ks,  ku,  ky,
421cc83814Sespie   la,  ln,  lo,  lt,  lv,
431cc83814Sespie   mg,  mi,  mk,  ml,  mn,  mo,  mr,  ms,  mt,  my,
441cc83814Sespie   na,  ne,  nl,  no,
451cc83814Sespie   oc,  om,  or,
461cc83814Sespie   pa,  pl,  ps,  pt,
471cc83814Sespie   qu,
481cc83814Sespie   rm,  rn,  ro,  ru,  rw,
491cc83814Sespie   sa,  sd,  sg,  sh,  si,  sk,  sl,  sm,  sn,  so,  sq,  sr,  ss,  st,  su,  sv,  sw,
501cc83814Sespie   ta,  te,  tg,  th,  ti,  tk,  tl,  tn,  to,  tr,  ts,  tt,  tw,
511cc83814Sespie   ug,  uk,  ur,  uz,
521cc83814Sespie   vi,  vo,
531cc83814Sespie   wo,
541cc83814Sespie   xh,
551cc83814Sespie   yi,  yo,
561cc83814Sespie   za,  zh,  zu,
571cc83814Sespie   last_language_code
581cc83814Sespie } language_code_type;
591cc83814Sespie 
601cc83814Sespie /* The current language code.  */
611cc83814Sespie extern language_code_type language_code;
621cc83814Sespie 
633fb98d4aSespie 
643fb98d4aSespie /* Information for each language.  */
651cc83814Sespie typedef struct
661cc83814Sespie {
671cc83814Sespie   language_code_type lc; /* language code as enum type */
681cc83814Sespie   char *abbrev;          /* two letter language code */
691cc83814Sespie   char *desc;            /* full name for language code */
703fb98d4aSespie } language_type;
711cc83814Sespie 
723fb98d4aSespie extern language_type language_table[];
731cc83814Sespie 
741cc83814Sespie 
753fb98d4aSespie 
76*a1acfa9bSespie /* The document encoding. This is useful to produce true 8-bit
77*a1acfa9bSespie    characters according to the @documentencoding.  */
78*a1acfa9bSespie 
793fb98d4aSespie typedef enum {
803fb98d4aSespie   no_encoding,
81*a1acfa9bSespie   US_ASCII,
82*a1acfa9bSespie   ISO_8859_1,
83*a1acfa9bSespie   ISO_8859_2,
84*a1acfa9bSespie   ISO_8859_3,    /* this and none of the rest are supported. */
853fb98d4aSespie   ISO_8859_4,
863fb98d4aSespie   ISO_8859_5,
873fb98d4aSespie   ISO_8859_6,
883fb98d4aSespie   ISO_8859_7,
893fb98d4aSespie   ISO_8859_8,
903fb98d4aSespie   ISO_8859_9,
913fb98d4aSespie   ISO_8859_10,
923fb98d4aSespie   ISO_8859_11,
933fb98d4aSespie   ISO_8859_12,
943fb98d4aSespie   ISO_8859_13,
953fb98d4aSespie   ISO_8859_14,
963fb98d4aSespie   ISO_8859_15,
973fb98d4aSespie   last_encoding_code
983fb98d4aSespie } encoding_code_type;
993fb98d4aSespie 
1003fb98d4aSespie /* The current document encoding, or null if not set.  */
1013fb98d4aSespie extern encoding_code_type document_encoding_code;
1023fb98d4aSespie 
103*a1acfa9bSespie /* If an encoding is not supported, just keep it as a string.  */
104*a1acfa9bSespie extern char *unknown_encoding;
1053fb98d4aSespie 
1063fb98d4aSespie /* Maps an HTML abbreviation to ISO and Unicode codes for a given code.  */
1073fb98d4aSespie 
1083fb98d4aSespie typedef unsigned short int unicode_t; /* should be 16 bits */
1093fb98d4aSespie typedef unsigned char byte_t;
1103fb98d4aSespie 
1113fb98d4aSespie typedef struct
1123fb98d4aSespie {
1133fb98d4aSespie   char *html;        /* HTML equivalent like umlaut auml => &auml; */
1143fb98d4aSespie   byte_t bytecode;   /* 8-Bit Code (ISO 8859-1,...) */
1153fb98d4aSespie   unicode_t unicode; /* Unicode in U+ convention */
1163fb98d4aSespie } iso_map_type;
1173fb98d4aSespie 
1183fb98d4aSespie /* Information about the document encoding. */
1193fb98d4aSespie typedef struct
1203fb98d4aSespie {
1213fb98d4aSespie   encoding_code_type ec; /* document encoding type (see above enum) */
122*a1acfa9bSespie   char *encname;         /* encoding name like "iso-8859-1", valid in
123*a1acfa9bSespie                             HTML and Emacs */
1243fb98d4aSespie   iso_map_type *isotab;  /* address of ISO translation table */
1253fb98d4aSespie } encoding_type;
1263fb98d4aSespie 
1273fb98d4aSespie /* Table with all the encoding codes that we recognize.  */
1283fb98d4aSespie extern encoding_type encoding_table[];
1293fb98d4aSespie 
1303fb98d4aSespie 
1311cc83814Sespie /* The commands.  */
132*a1acfa9bSespie extern void cm_documentlanguage (void),
133*a1acfa9bSespie      cm_documentencoding (void);
1341cc83814Sespie 
1351cc83814Sespie /* Accents, other non-English characters.  */
136*a1acfa9bSespie void cm_accent (int arg), cm_special_char (int arg),
137*a1acfa9bSespie      cm_dotless (int arg, int start, int end);
1381cc83814Sespie 
139*a1acfa9bSespie extern void cm_accent_umlaut (int arg, int start, int end),
140*a1acfa9bSespie      cm_accent_acute (int arg, int start, int end),
141*a1acfa9bSespie      cm_accent_cedilla (int arg, int start, int end),
142*a1acfa9bSespie      cm_accent_hat (int arg, int start, int end),
143*a1acfa9bSespie      cm_accent_grave (int arg, int start, int end),
144*a1acfa9bSespie      cm_accent_tilde (int arg, int start, int end);
145*a1acfa9bSespie 
146*a1acfa9bSespie extern char *current_document_encoding (void);
1471cc83814Sespie 
1481cc83814Sespie #endif /* not LANG_H */
149