home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / cat2deskjet / part01 / lcat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-30  |  5.2 KB  |  282 lines

  1. /*
  2.  *  lcat.h -- common definitions for the [lv]cat programs
  3.  *  Copyright (C) 1990 Vassilis Prevelakis
  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 and included with this distribution in the
  8.  *  file named LICENSE.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU 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.  *  Bugs fixes, comments etc. to:
  20.  *       Vasilis Prevelakis
  21.  *       Centre Universitaire d'Informatique (CUI)
  22.  *       12 Rue du Lac, Geneva, Switzerland CH-1207
  23.  *  email: vp@cui.unige.ch
  24.  *  uucp:  ...!mcsun!cui!vp
  25.  */
  26.  
  27. typedef unsigned char u_char;
  28.  
  29. #define BASELINE     150
  30. #define RASTWIDTH    400
  31. #define NLINES        200
  32. #ifdef LCAT
  33. extern u_char raster[NLINES][RASTWIDTH];
  34. #endif
  35.  
  36. #define MIN(X, Y)    ((X < Y) ? X : Y)
  37. #define MAX(X, Y)    ((X > Y) ? X : Y)
  38.  
  39. #ifdef UNIX
  40. #define huge /**/
  41. #define O_BINARY 0
  42. char *calloc();
  43. #endif
  44.  
  45. static char    asctab[128] = {
  46. /*    '\0',    /*blank*/
  47.     'h',    /*h*/
  48.     't',    /*t*/
  49.     'n',    /*n*/
  50.     'm',    /*m*/
  51.     'l',    /*l*/
  52.     'i',    /*i*/
  53.     'z',    /*z*/
  54.     's',    /*s*/
  55.     'd',    /*d*/
  56.     'b',    /*b*/
  57.     'x',    /*x*/
  58.     'f',    /*f*/
  59.     'j',    /*j*/
  60.     'u',    /*u*/
  61.     'k',    /*k*/
  62.     '\0',    /*blank*/
  63.     'p',    /*p*/
  64.     '\06',    /*_ 3/4 em dash*/
  65.     ';',    /*;*/
  66.     '\0',    /*blank*/
  67.     'a',    /*a*/
  68.     '\05',    /*rule*/
  69.     'c',    /*c*/
  70.     '`',    /*` open*/
  71.     'e',    /*e*/
  72.     '\'',    /*' close*/
  73.     'o',    /*o*/
  74.     '\021',    /*1/4*/
  75.     'r',    /*r*/
  76.     '\022',    /*1/2*/
  77.     'v',    /*v*/
  78.     '-',    /*- hyphen*/
  79.     'w',    /*w*/
  80.     'q',    /*q*/
  81.     '/',    /*/*/
  82.     '.',    /*.*/
  83.     'g',    /*g*/
  84.     '\023',    /*3/4*/
  85.     ',',    /*,*/
  86.     '&',    /*&*/
  87.     'y',    /*y*/
  88.     '\0',    /*blank*/
  89.     '%',    /*%*/
  90.     '\0',    /*blank*/
  91.     'Q',    /*Q*/
  92.     'T',    /*T*/
  93.     'O',    /*O*/
  94.     'H',    /*H*/
  95.     'N',    /*N*/
  96.     'M',    /*M*/
  97.     'L',    /*L*/
  98.     'R',    /*R*/
  99.     'G',    /*G*/
  100.     'I',    /*I*/
  101.     'P',    /*P*/
  102.     'C',    /*C*/
  103.     'V',    /*V*/
  104.     'E',    /*E*/
  105.     'Z',    /*Z*/
  106.     'D',    /*D*/
  107.     'B',    /*B*/
  108.     'S',    /*S*/
  109.     'Y',    /*Y*/
  110. /*    '\0',    /*blank*/
  111.     'F',    /*F*/
  112.     'X',    /*X*/
  113.     'A',    /*A*/
  114.     'W',    /*W*/
  115.     'J',    /*J*/
  116.     'U',    /*U*/
  117.     'K',    /*K*/
  118.     '0',    /*0*/
  119.     '1',    /*1*/
  120.     '2',    /*2*/
  121.     '3',    /*3*/
  122.     '4',    /*4*/
  123.     '5',    /*5*/
  124.     '6',    /*6*/
  125.     '7',    /*7*/
  126.     '8',    /*8*/
  127.     '9',    /*9*/
  128.     '*',    /***/
  129.     '\04',    /*minus*/
  130.     '\01',    /*fi*/
  131.     '\02',    /*fl*/
  132.     '\03',    /*ff*/
  133.     '\020',    /* cent sign */
  134.     '\012',    /*ffl*/
  135.     '\011',    /*ffi*/
  136.     '(',    /*(*/
  137.     ')',    /*)*/
  138.     '[',    /*[*/
  139.     ']',    /*]*/
  140.     '\013',    /* degree */
  141.     '\014',    /* dagger */
  142.     '=',    /*=*/
  143.     '\017',    /* registered */
  144.     ':',    /*:*/
  145.     '+',    /*+*/
  146.     '\0',    /*blank*/
  147.     '!',    /*!*/
  148.     '\07',    /* bullet */
  149.     '?',    /*?*/
  150.     '\015',    /*foot mark*/
  151.     '|',    /*|*/
  152.     '\0',    /*blank*/
  153.     '\016',    /* copyright */
  154.     '\010',    /* square */
  155.     '$',    /*$*/
  156.     '\0',
  157.     '\0',
  158.     '"',    /*"*/
  159.     '#',    /*#*/
  160.     '<',    /*<*/
  161.     '>',    /*>*/
  162.     '@',    /*@*/
  163.     '\\',    /*\\*/
  164.     '^',    /*^*/
  165.     '{',    /*{*/
  166.     '}',    /*}*/
  167.     '~'    /*~*/
  168. };
  169.  
  170. static char spectab[128] = {
  171. /*    '\0',    /*blank*/
  172.     'w',    /*psi*/
  173.     'h',    /*theta*/
  174.     'm',    /*nu*/
  175.     'l',    /*mu*/
  176.     'k',    /*lambda*/
  177.     'i',    /*iota*/
  178.     'f',    /*zeta*/
  179.     'r',    /*sigma*/
  180.     'd',    /*delta*/
  181.     'b',    /*beta*/
  182.     'n',    /*xi*/
  183.     'g',    /*eta*/
  184.     'u',    /*phi*/
  185.     't',    /*upsilon*/
  186.     'j',    /*kappa*/
  187.     '\0',    /*blank*/
  188.     'p',    /*pi*/
  189.     '@',    /*at-sign*/
  190.     '7',    /*down arrow*/
  191.     '\0',    /*blank*/
  192.     'a',    /*alpha*/
  193.     '|',    /*or*/
  194.     'v',    /*chi*/
  195.     '"',    /*"*/
  196.     'e',    /*epsilon*/
  197.     '=',    /*=*/
  198.     'o',    /*omicron*/
  199.     '4',    /*left arrow*/
  200.     'q',    /*rho*/
  201.     '6',    /*up arrow*/
  202.     's',    /*tau*/
  203.     '_',    /*underrule*/
  204.     '\\',    /*\*/
  205.     'W',    /*Psi*/
  206.     '\07',    /*bell system sign*/
  207.     '\001',    /*infinity*/
  208.     'c',    /*gamma*/
  209.     '\002',    /*improper superset*/
  210.     '\003',    /*proportional to*/
  211.     '\004',    /*right hand*/
  212.     'x',    /*omega*/
  213.     '\0',    /*blank*/
  214.     '(',    /*gradient*/
  215.     '\0',    /*blank*/
  216.     'U',    /*Phi*/
  217.     'H',    /*Theta*/
  218.     'X',    /*Omega*/
  219.     '\005',    /*cup (union)*/
  220.     '\006',    /*root en*/
  221.     '\014',    /*terminal sigma*/
  222.     'K',    /*Lambda*/
  223.     '-',    /*minus*/
  224.     'C',    /*Gamma*/
  225.     '\015',    /*integral sign*/
  226.     'P',    /*Pi*/
  227.     '\032',    /*subset of*/
  228.     '\033',    /*superset of*/
  229.     '2',    /*approximates*/
  230.     'y',    /*partial derivative*/
  231.     'D',    /*Delta*/
  232.     '\013',    /*square root*/
  233.     'R',    /*Sigma*/
  234.     '1',    /*approx =*/
  235. /*    '\0',    /*blank*/
  236.     '>',    /*>*/
  237.     'N',    /*Xi*/
  238.     '<',    /*<*/
  239.     '\016',    /*slash (longer)*/
  240.     '\034',    /*cap (intersection)*/
  241.     'T',    /*Upsilon*/
  242.     '\035',    /*not*/
  243.     '\023',    /*right ceiling (rt of ")*/
  244.     '\024',    /*left top (of big curly)*/
  245.     '\017',    /*bold vertical*/
  246.     '\030',    /*left center of big curly bracket*/
  247.     '\025',    /*left bottom*/
  248.     '\026',    /*right top*/
  249.     '\031',    /*right center of big curly bracket*/
  250.     '\027',    /*right bot*/
  251.     '\021',    /*right floor (rb of ")*/
  252.     '\020',    /*left floor (left bot of big sq bract)*/
  253.     '\022',    /*left ceiling (lt of ")*/
  254.     '*',    /*multiply*/
  255.     '/',    /*divide*/
  256.     '\010',    /*plus-minus*/
  257.     '\011',    /*<=*/
  258.     '\012',    /*>=*/
  259.     '0',    /*identically equal*/
  260.     '3',    /*not equal*/
  261.     '{',    /*{*/
  262.     '}',    /*}*/
  263.     '\'',    /*' acute accent*/
  264.     '\`',    /*` grave accent*/
  265.     '^',    /*^*/
  266.     '#',    /*sharp*/
  267.     '\036',    /*left hand*/
  268.     '\037',    /*member of*/
  269.     '~',    /*~*/
  270.     'z',    /*empty set*/
  271.     '\0',    /*blank*/
  272.     'Y',    /*dbl dagger*/
  273.     'Z',    /*box rule*/
  274.     '9',    /*asterisk*/
  275.     '[',    /*improper subset*/
  276.     ']',    /*circle*/
  277.     '\0',    /*blank*/
  278.     '+',    /*eqn plus*/
  279.     '5',    /*right arrow*/
  280.     '8'    /*section mark*/
  281. };
  282.