home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / GRECODE / ATARIST.C < prev    next >
C/C++ Source or Header  |  1993-12-11  |  3KB  |  128 lines

  1. /* Conversion of files between different charsets and usages.
  2.    Copyright (C) 1993 Free Software Foundation, Inc.
  3.    Francois Pinard <pinard@iro.umontreal.ca>, 1993.
  4.  
  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 2, or (at your option)
  8.    any later version.
  9.  
  10.    This program is distributed in the hope that it will be useful, but
  11.    WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU General Public License
  16.    along with this program; if not, write to the Free Software
  17.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. #include "recode.h"
  21.  
  22. /* Data for Atari ST to ISO Latin-1 code conversions.  */
  23.  
  24. static KNOWN_PAIR known_pairs[] =
  25.   {
  26.     {128, 199},            /* C, */
  27.     {129, 252},            /* u" */
  28.     {130, 233},            /* e' */
  29.     {131, 226},            /* a^ */
  30.     {132, 228},            /* a" */
  31.     {133, 224},            /* a` */
  32.     {134, 229},            /* aa */
  33.     {135, 231},            /* c, */
  34.     {136, 234},            /* e^ */
  35.     {137, 235},            /* e" */
  36.     {138, 232},            /* e` */
  37.     {139, 239},            /* i" */
  38.     {140, 238},            /* i^ */
  39.     {141, 236},            /* i` */
  40.     {142, 196},            /* A" */
  41.     {143, 197},            /* AA */
  42.     {144, 201},            /* E' */
  43.     {145, 230},            /* ae */
  44.     {146, 198},            /* AE */
  45.     {147, 244},            /* o^ */
  46.     {148, 246},            /* o" */
  47.     {149, 242},            /* o` */
  48.     {150, 251},            /* u^ */
  49.     {151, 249},            /* u` */
  50.     {152, 255},            /* y" */
  51.     {153, 214},            /* O" */
  52.     {154, 220},            /* U" */
  53.     {155, 162},            /* \cent */
  54.     {156, 163},            /* \pound */
  55.     {157, 165},            /* \yen */
  56.     {158, 223},            /* \ss */
  57.  
  58.     {160, 225},            /* a' */
  59.     {161, 237},            /* i' */
  60.     {162, 243},            /* o' */
  61.     {163, 250},            /* u' */
  62.     {164, 241},            /* n~ */
  63.     {165, 209},            /* N~ */
  64.     {166, 170},            /* a_ */
  65.     {167, 186},            /* o_ */
  66.     {168, 191},            /* ?' */
  67.  
  68.     {170, 172},            /* \neg */
  69.     {171, 189},            /* 1/2 */
  70.     {172, 188},            /* 1/4 */
  71.     {173, 161},            /* !` */
  72.     {174, 171},            /* `` */
  73.     {175, 187},            /* '' */
  74.     {176, 227},            /* a~ */
  75.     {177, 245},            /* o~ */
  76.     {178, 216},            /* O/ */
  77.     {179, 248},            /* o/ */
  78.  
  79.     {182, 192},            /* A` */
  80.     {183, 195},            /* A~ */
  81.     {184, 213},            /* O~ */
  82.     {185, 168},            /* diaeresis */
  83.     {186, 180},            /* acute accent */
  84.  
  85.     {188, 182},            /* pilcrow sign */
  86.     {189, 169},            /* copyright sign */
  87.     {190, 174},            /* registered trade mark sign */
  88.  
  89.     {221, 167},            /* paragraph sign, section sign */
  90.  
  91.     {230, 181},            /* mu, micro */
  92.  
  93.     {241, 177},            /* +- */
  94.  
  95.     {246, 247},            /* \div */
  96.  
  97.     {248, 176},            /* \deg */
  98.  
  99.     {250, 183},            /* \cdot */
  100.  
  101.     {253, 178},            /* ^2 */
  102.     {254, 179},            /* ^3 */
  103.   };
  104. #define NUMBER_OF_PAIRS (sizeof (known_pairs) / sizeof (KNOWN_PAIR))
  105.  
  106. extern int ascii_graphics;
  107.  
  108. static void
  109. init_latin1_atarist (STEP *step)
  110. {
  111.   complete_pairs (step, 1, known_pairs, NUMBER_OF_PAIRS, 1);
  112. }
  113.  
  114. static void
  115. init_atarist_latin1 (STEP *step)
  116. {
  117.   complete_pairs (step, 1, known_pairs, NUMBER_OF_PAIRS, 0);
  118. }
  119.  
  120. void
  121. module_atarist (void)
  122. {
  123.   declare_step ("latin1", "atarist", strict_mapping ? ONE_TO_MANY : REVERSIBLE,
  124.         init_latin1_atarist, NULL);
  125.   declare_step ("atarist", "latin1", strict_mapping ? ONE_TO_MANY : REVERSIBLE,
  126.         init_atarist_latin1, NULL);
  127. }
  128.