Home | History | Annotate | Line # | Download | only in makeinfo
      1 /*	$NetBSD: lang.h,v 1.4 2025/12/31 22:18:50 oster Exp $	*/
      2 
      3 /* lang.h -- declarations for language codes etc.
      4    Id: lang.h,v 1.6 2004/04/11 17:56:47 karl Exp
      5 
      6    Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
      7 
      8    This program is free software; you can redistribute it and/or modify
      9    it under the terms of the GNU General Public License as published by
     10    the Free Software Foundation; either version 2, or (at your option)
     11    any later version.
     12 
     13    This program is distributed in the hope that it will be useful,
     14    but WITHOUT ANY WARRANTY; without even the implied warranty of
     15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16    GNU General Public License for more details.
     17 
     18    You should have received a copy of the GNU General Public License
     19    along with this program; if not, write to the Free Software
     20    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     21 
     22    Originally written by Karl Heinz Marbaise <kama (at) hippo.fido.de>.  */
     23 
     24 #ifndef LANG_H
     25 #define LANG_H
     26 
     27 /* The language code which can be changed through @documentlanguage
     28  * Actually we don't currently support this (may be in the future) ;-)
     29  * These code are the ISO-639 two letter codes.
     30  */
     31 typedef enum
     32 {
     33   aa,  ab,  af,  am,  ar,  as,  ay,  az,
     34   ba,  be,  bg,  bh,  bi,  bn,  bo,  br,
     35   ca,  co,  cs,  cy,
     36   da,  de,  dz,
     37   el,  en,  eo,  es,  et,  eu,
     38   fa,  fi,  fj,  fo,  fr,  fy,
     39   ga,  gd,  gl,  gn,  gu,
     40   ha,  he,  hi,  hr,  hu,  hy,
     41   ia,  id,  ie,  ik,  is,  it,  iu,
     42   ja,  jw,
     43   ka,  kk,  kl,  km,  kn,  ko,  ks,  ku,  ky,
     44   la,  ln,  lo,  lt,  lv,
     45   mg,  mi,  mk,  ml,  mn,  mo,  mr,  ms,  mt,  my,
     46   na,  ne,  nl,  no,
     47   oc,  om,  or,
     48   pa,  pl,  ps,  pt,
     49   qu,
     50   rm,  rn,  ro,  ru,  rw,
     51   sa,  sd,  sg,  sh,  si,  sk,  sl,  sm,  sn,  so,  sq,  sr,  ss,  st,  su,  sv,  sw,
     52   ta,  te,  tg,  th,  ti,  tk,  tl,  tn,  to,  tr,  ts,  tt,  tw,
     53   ug,  uk,  ur,  uz,
     54   vi,  vo,
     55   wo,
     56   xh,
     57   yi,  yo,
     58   za,  zh,  zu,
     59   last_language_code
     60 } language_code_type;
     61 
     62 /* The current language code.  */
     63 extern language_code_type language_code;
     64 
     65 
     66 /* Information for each language.  */
     67 typedef struct
     68 {
     69   language_code_type lc; /* language code as enum type */
     70   char *abbrev;          /* two letter language code */
     71   char *desc;            /* full name for language code */
     72 } language_type;
     73 
     74 extern language_type language_table[];
     75 
     76 
     77 
     78 /* The document encoding. This is useful to produce true 8-bit
     80    characters according to the @documentencoding.  */
     81 
     82 typedef enum {
     83   no_encoding,
     84   US_ASCII,
     85   ISO_8859_1,
     86   ISO_8859_2,
     87   ISO_8859_3,    /* this and none of the rest are supported. */
     88   ISO_8859_4,
     89   ISO_8859_5,
     90   ISO_8859_6,
     91   ISO_8859_7,
     92   ISO_8859_8,
     93   ISO_8859_9,
     94   ISO_8859_10,
     95   ISO_8859_11,
     96   ISO_8859_12,
     97   ISO_8859_13,
     98   ISO_8859_14,
     99   ISO_8859_15,
    100   last_encoding_code
    101 } encoding_code_type;
    102 
    103 /* The current document encoding, or null if not set.  */
    104 extern encoding_code_type document_encoding_code;
    105 
    106 /* If an encoding is not supported, just keep it as a string.  */
    107 extern char *unknown_encoding;
    108 
    109 /* Maps an HTML abbreviation to ISO and Unicode codes for a given code.  */
    110 
    111 typedef unsigned short int unicode_t; /* should be 16 bits */
    112 typedef unsigned char byte_t;
    113 
    114 typedef struct
    115 {
    116   char *html;        /* HTML equivalent like umlaut auml => &auml; */
    117   byte_t bytecode;   /* 8-Bit Code (ISO 8859-1,...) */
    118   unicode_t unicode; /* Unicode in U+ convention */
    119 } iso_map_type;
    120 
    121 /* Information about the document encoding. */
    122 typedef struct
    123 {
    124   encoding_code_type ec; /* document encoding type (see above enum) */
    125   char *encname;         /* encoding name like "iso-8859-1", valid in
    126                             HTML and Emacs */
    127   iso_map_type *isotab;  /* address of ISO translation table */
    128 } encoding_type;
    129 
    130 /* Table with all the encoding codes that we recognize.  */
    131 extern encoding_type encoding_table[];
    132 
    133 
    134 /* The commands.  */
    136 extern void cm_documentlanguage (int arg, int arg2, int arg3),
    137      cm_documentencoding (int arg, int arg2, int arg3);
    138 
    139 /* Accents, other non-English characters.  */
    140 void cm_accent (int arg, int arg2, int arg3), cm_special_char (int arg, int arg2, int arg3),
    141      cm_dotless (int arg, int start, int end);
    142 
    143 extern void cm_accent_umlaut (int arg, int start, int end),
    144      cm_accent_acute (int arg, int start, int end),
    145      cm_accent_cedilla (int arg, int start, int end),
    146      cm_accent_hat (int arg, int start, int end),
    147      cm_accent_grave (int arg, int start, int end),
    148      cm_accent_tilde (int arg, int start, int end);
    149 
    150 extern char *current_document_encoding (void);
    151 
    152 #endif /* not LANG_H */
    153