home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume8 / dca2troff / do_spchar.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-02-18  |  1.5 KB  |  62 lines

  1.  
  2. /* special characters, not normally in troff */
  3. /* should be read in from a file for each device/font */
  4. /* we will output the 3rd field in the struct as a troff comment line */
  5. /* if the 2nd field is null */
  6.  
  7. struct spc {
  8.     int spcode;            /* dca code for character */
  9.     char *spstr;            /* titroff code for char on imagen */
  10.     char *explan;            /* what is the char ? */
  11. } spchar[] = {
  12.         0x59, "\\(ss",        "german sharp s",
  13.         0x70, "\\(O/",        "O slash",
  14.         0x8a, "",        "European open quote",
  15.         0x8b, "",        "European close quote",
  16.         0x8c, "",        "d stroke",
  17.         0x8e, "",        "small letter thorn",
  18.         0x9f, "",        "international currency sym",
  19.         0xa0, "",        "Micro",
  20.         0xaa, "\\(!!",        "inverted !",
  21.         0xab, "\\(??",        "inverted ?",
  22.         0xac, "",        "D stroke",
  23.         0xae, "",        "Capital Thorn",
  24.         0xb1, "",        "Pound sign",
  25.         0xb2, "",        "Yen",
  26.         0xb3, "",        "Peseta",
  27.         0xb4, "",        "Floren, Guilder",
  28.         0xb6, "\\(pa",        "paragraph sign",
  29.         0xbc, "\\(mc",        "overbar",
  30.         0xbd, "\\(..",        "diaeresis",
  31.         0xbf, "",        "double underscore",
  32.         0xda, "\\(ui",        "dotless i",
  33.         0xea, "\\u\\s-22\\s+2\\d",    "superscript 2",
  34.         0xfa, "\\u\\s-23\\s+2\\d",    "superscript 3",
  35.         0xff, "",        "Eight Ones",
  36.         0x00, "",        ""
  37. };
  38.  
  39. #include "dca2troff.h"
  40.  
  41. do_spchar(ch)
  42. char ch;
  43. {
  44.     int i;
  45.     for(i=0; spchar[i].spcode != ch; i++)
  46.         {
  47.         if (spchar[i].spcode == 0)
  48.             {
  49.             fprintf(stderr, "error: unknown special char 0X%02x\n", ch);
  50.             return(0);
  51.             }
  52.         }
  53.     if(strcmp(spchar[i].spstr, "") == 0)
  54.         {
  55.         sprintf(tline, "\\\" %s\n", spchar[i].explan);
  56.         outstr(tline);
  57.         }
  58.     else
  59.         outstr(spchar[i].spstr);
  60.     return(0);
  61. }
  62.