home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / CLISP / CLISPSRC.TAR / clisp-1995-01-01 / utils / charset / cv-to-next.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-23  |  5.4 KB  |  137 lines

  1. /* Konversionsprogramm Latin1-Zeichensatz -> NeXTstep-Zeichensatz */
  2. /* Bruno Haible 7.7.1994 */
  3.  
  4. /* Benutzt recode-3.3/nextstep.c.
  5.    Copyright (C) 1993 Free Software Foundation, Inc.
  6.    Francois Pinard <pinard@iro.umontreal.ca>, 1993.
  7. */
  8.  
  9. #include <stdio.h>
  10.  
  11. main ()
  12. { static int tabelle[256];
  13.   /* Tabelle initialisieren: */
  14.   int next, latin;
  15. #define NEXT(x) next=x;
  16. #define LATIN(y) latin=y;
  17. #define _ tabelle[latin]=next;
  18.   { int i;
  19.     for (i=0;i<128;i++) { NEXT(i) LATIN(i) _ }
  20.   }
  21.   { int i;
  22.     for (i=0;i<32;i++) { NEXT(-1) LATIN(128+i) _ }
  23.   }
  24.   NEXT(128) LATIN(160) _        /* non-breakable space */
  25.   NEXT(161) LATIN(161) _        /* inverted exclamation mark */
  26.   NEXT(162) LATIN(162) _        /* cent sign */
  27.   NEXT(163) LATIN(163) _        /* pound sterling sign */
  28.   NEXT(168) LATIN(164) _        /* currency sign */
  29.   NEXT(165) LATIN(165) _        /* yen sign  */
  30.   NEXT(181) LATIN(166) _        /* broken bar */
  31.   NEXT(167) LATIN(167) _        /* section (german paragraph) */
  32.   NEXT(200) LATIN(168) _        /* dieresis */
  33.   NEXT(160) LATIN(169) _        /* copyright */
  34.   NEXT(227) LATIN(170) _        /* feminine ordinal indicator */
  35.   NEXT(171) LATIN(171) _        /* gouillemot left */
  36.   NEXT(190) LATIN(172) _        /* logical not */
  37.   NEXT('-') LATIN(173) _        /* hyphen */
  38.   NEXT(176) LATIN(174) _        /* registered trademark */
  39.   NEXT(197) LATIN(175) _        /* macron */
  40.   NEXT(202) LATIN(176) _        /* ring */
  41.   NEXT(209) LATIN(177) _        /* plusminus */
  42.   NEXT(201) LATIN(178) _        /* superscript two */
  43.   NEXT(204) LATIN(179) _        /* superscript 3 */
  44.   NEXT(194) LATIN(180) _        /* accent acute */
  45.   NEXT(157) LATIN(181) _        /* greek letter mu (micro sign) */
  46.   NEXT(182) LATIN(182) _        /* paragraph sign */
  47.   NEXT(180) LATIN(183) _        /* centered period */
  48.   NEXT(203) LATIN(184) _        /* cedilla */
  49.   NEXT(192) LATIN(185) _        /* superscript one */
  50.   NEXT(235) LATIN(186) _        /* masculine ordinal indicator */
  51.   NEXT(187) LATIN(187) _        /* gouillemot right */
  52.   NEXT(210) LATIN(188) _        /* 1/4 */
  53.   NEXT(211) LATIN(189) _        /* 1/2 */
  54.   NEXT(212) LATIN(190) _        /* 3/4 */
  55.   NEXT(191) LATIN(191) _        /* inverted question mark */
  56.   NEXT(129) LATIN(192) _        /* A with accent grave */
  57.   NEXT(130) LATIN(193) _        /* A with accent acute */
  58.   NEXT(131) LATIN(194) _        /* A with circumflex  */
  59.   NEXT(132) LATIN(195) _        /* A with tilde */
  60.   NEXT(133) LATIN(196) _        /* A with dieresis  */
  61.   NEXT(134) LATIN(197) _        /* A with ring  */
  62.   NEXT(225) LATIN(198) _        /* AE */
  63.   NEXT(135) LATIN(199) _        /* C with cedilla */
  64.   NEXT(136) LATIN(200) _        /* E with accent grave */
  65.   NEXT(137) LATIN(201) _        /* E with accent acute */
  66.   NEXT(138) LATIN(202) _        /* E with circumflex */
  67.   NEXT(139) LATIN(203) _        /* E with dieresis */
  68.   NEXT(140) LATIN(204) _        /* I with accent grave */
  69.   NEXT(141) LATIN(205) _        /* I with accent acute */
  70.   NEXT(142) LATIN(206) _        /* I with circumflex */
  71.   NEXT(143) LATIN(207) _        /* I with dieresis */
  72.   NEXT(144) LATIN(208) _        /* capital icelandic Eth */
  73.   NEXT(145) LATIN(209) _        /* N with tilde */
  74.   NEXT(146) LATIN(210) _        /* O with accent grave */
  75.   NEXT(147) LATIN(211) _        /* O with accent acute */
  76.   NEXT(148) LATIN(212) _        /* O with circumflex */
  77.   NEXT(149) LATIN(213) _        /* O with tilde */
  78.   NEXT(150) LATIN(214) _        /* O with dieresis */
  79.   NEXT(158) LATIN(215) _        /* multiply */
  80.   NEXT(233) LATIN(216) _        /* O with slash */
  81.   NEXT(151) LATIN(217) _        /* U with accent grave */
  82.   NEXT(152) LATIN(218) _        /* U with accent acute */
  83.   NEXT(153) LATIN(219) _        /* U with circumflex */
  84.   NEXT(154) LATIN(220) _        /* U with dieresis */
  85.   NEXT(155) LATIN(221) _        /* Y with accent acute */
  86.   NEXT(156) LATIN(222) _        /* capital icelandig thorn */
  87.   NEXT(251) LATIN(223) _        /* german sz */
  88.   NEXT(213) LATIN(224) _        /* a with accent grave */
  89.   NEXT(214) LATIN(225) _        /* a with accent acute */
  90.   NEXT(215) LATIN(226) _        /* a with circumflex */
  91.   NEXT(216) LATIN(227) _        /* a with tilde */
  92.   NEXT(217) LATIN(228) _        /* a with dieresis */
  93.   NEXT(218) LATIN(229) _        /* a with ring */
  94.   NEXT(241) LATIN(230) _        /* ae */
  95.   NEXT(219) LATIN(231) _        /* c with cedilla */
  96.   NEXT(220) LATIN(232) _        /* e with accent grave */
  97.   NEXT(221) LATIN(233) _        /* e with accent acute */
  98.   NEXT(222) LATIN(234) _        /* e with circumflex */
  99.   NEXT(223) LATIN(235) _        /* e with dieresis */
  100.   NEXT(224) LATIN(236) _        /* i with accent grave */
  101.   NEXT(226) LATIN(237) _        /* i with accent acute */
  102.   NEXT(228) LATIN(238) _        /* i with circumflex */
  103.   NEXT(229) LATIN(239) _        /* i with dieresis */
  104.   NEXT(230) LATIN(240) _        /* small icelandic eth */
  105.   NEXT(231) LATIN(241) _        /* n with tilde */
  106.   NEXT(236) LATIN(242) _        /* o with accent grave */
  107.   NEXT(237) LATIN(243) _        /* o with accent acute */
  108.   NEXT(238) LATIN(244) _        /* o with circumflex */
  109.   NEXT(239) LATIN(245) _        /* o with tilde */
  110.   NEXT(240) LATIN(246) _        /* o with dieresis */
  111.   NEXT(159) LATIN(247) _        /* divide */
  112.   NEXT(249) LATIN(248) _        /* o with slash */
  113.   NEXT(242) LATIN(249) _        /* u with accent grave */
  114.   NEXT(243) LATIN(250) _        /* u with accent acute */
  115.   NEXT(244) LATIN(251) _        /* u with circumflex */
  116.   NEXT(246) LATIN(252) _        /* u with dieresis */
  117.   NEXT(247) LATIN(253) _        /* y with accent acute */
  118.   NEXT(252) LATIN(254) _        /* small icelandic thorn */
  119.   NEXT(253) LATIN(255) _        /* y with dieresis */
  120. #undef _
  121. #undef LATIN
  122. #undef NEXT
  123.   { int fehler = 0;
  124.     int c;
  125.     while (!((c = getchar()) == EOF))
  126.       { c = tabelle[c];
  127.         if (c < 0) { fehler++; } else putchar(c);
  128.       }
  129.     if (!(fehler == 0))
  130.       { fprintf(stderr,"%d illegal characters\n",fehler); exit(1); }
  131.       else
  132.       if (ferror(stdin) || ferror(stdout))
  133.         { exit(1); }
  134.         else
  135.         { exit(0); }
  136. } }
  137.