home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / stex2-18.zip / SeeTeX / libtex / dviclass.c < prev    next >
C/C++ Source or Header  |  1990-07-10  |  3KB  |  98 lines

  1. /*
  2.  * Copyright (c) 1987, 1989 University of Maryland
  3.  * Department of Computer Science.  All rights reserved.
  4.  * Permission to copy for any purpose is hereby granted
  5.  * so long as this copyright notice remains intact.
  6.  */
  7.  
  8. #ifndef lint
  9. static char rcsid[] = "$Header: /usr/src/local/tex/local/mctex/lib/RCS/dviclass.c,v 3.1 89/08/22 21:48:35 chris Exp $";
  10. #endif
  11.  
  12. /*
  13.  * dviclass - DVI code classification tables.
  14.  */
  15.  
  16. #include "dviclass.h"
  17.  
  18. /* shorthand---in lowercase for contrast (read on!) */
  19. #define    four(x)        x, x, x, x
  20. #define    six(x)        four(x), x, x
  21. #define    sixteen(x)    four(x), four(x), four(x), four(x)
  22. #define    sixty_four(x)    sixteen(x), sixteen(x), sixteen(x), sixteen(x)
  23. #define    one_twenty_eight(x)    sixty_four(x), sixty_four(x)
  24.  
  25. /*
  26.  * This table contains the byte length of the single operand, or DPL_NONE
  27.  * if no operand, or if it cannot be decoded this way.
  28.  *
  29.  * The sequences UNS1, UNS2, UNS3, SGN4 (`SEQ_U') and SGN1, SGN2, SGN3,
  30.  * SGN4 (`SEQ_S') are rather common, and so we define macros for these.
  31.  */
  32. #define    SEQ_U    DPL_UNS1, DPL_UNS2, DPL_UNS3, DPL_SGN4
  33. #define    SEQ_S    DPL_SGN1, DPL_SGN2, DPL_SGN3, DPL_SGN4
  34.  
  35. char dvi_oplen[256] = {
  36.     one_twenty_eight(DPL_NONE),
  37.                 /* characters 0 through 127 */
  38.     SEQ_U,            /* DVI_SET1 through DVI_SET4 */
  39.     DPL_NONE,        /* DVI_SETRULE */
  40.     SEQ_U,            /* DVI_PUT1 through DVI_PUT4 */
  41.     DPL_NONE,        /* DVI_PUTRULE */
  42.     DPL_NONE,        /* DVI_NOP */
  43.     DPL_NONE,        /* DVI_BOP */
  44.     DPL_NONE,        /* DVI_EOP */
  45.     DPL_NONE,        /* DVI_PUSH */
  46.     DPL_NONE,        /* DVI_POP */
  47.     SEQ_S,            /* DVI_RIGHT1 through DVI_RIGHT4 */
  48.     DPL_NONE,        /* DVI_W0 */
  49.     SEQ_S,            /* DVI_W1 through DVI_W4 */
  50.     DPL_NONE,        /* DVI_X0 */
  51.     SEQ_S,            /* DVI_X1 through DVI_X4 */
  52.     SEQ_S,            /* DVI_DOWN1 through DVI_DOWN4 */
  53.     DPL_NONE,        /* DVI_Y0 */
  54.     SEQ_S,            /* DVI_Y1 through DVI_Y4 */
  55.     DPL_NONE,        /* DVI_Z0 */
  56.     SEQ_S,            /* DVI_Z1 through DVI_Z4 */
  57.     sixty_four(DPL_NONE),    /* DVI_FNTNUM0 through DVI_FNTNUM63 */
  58.     SEQ_U,            /* DVI_FNT1 through DVI_FNT4 */
  59.     SEQ_U,            /* DVI_XXX1 through DVI_XXX4 */
  60.     SEQ_U,            /* DVI_FNTDEF1 through DVI_FNTDEF4 */
  61.     DPL_NONE,        /* DVI_PRE */
  62.     DPL_NONE,        /* DVI_POST */
  63.     DPL_NONE,        /* DVI_POSTPOST */
  64.     six(DPL_NONE)        /* 250 through 255 */
  65. };
  66.  
  67. char dvi_dt[256] = {
  68.     one_twenty_eight(DT_CHAR),
  69.                 /* characters 0 through 127 */
  70.     four(DT_SET),        /* DVI_SET1 through DVI_SET4 */
  71.     DT_SETRULE,        /* DVI_SETRULE */
  72.     four(DT_PUT),        /* DVI_PUT1 through DVI_PUT4 */
  73.     DT_PUTRULE,        /* DVI_PUTRULE */
  74.     DT_NOP,            /* DVI_NOP */
  75.     DT_BOP,            /* DVI_BOP */
  76.     DT_EOP,            /* DVI_EOP */
  77.     DT_PUSH,        /* DVI_PUSH */
  78.     DT_POP,            /* DVI_POP */
  79.     four(DT_RIGHT),        /* DVI_RIGHT1 through DVI_RIGHT4 */
  80.     DT_W0,            /* DVI_W0 */
  81.     four(DT_W),        /* DVI_W1 through DVI_W4 */
  82.     DT_X0,            /* DVI_X0 */
  83.     four(DT_X),        /* DVI_X1 through DVI_X4 */
  84.     four(DT_DOWN),        /* DVI_DOWN1 through DVI_DOWN4 */
  85.     DT_Y0,            /* DVI_Y0 */
  86.     four(DT_Y),        /* DVI_Y1 through DVI_Y4 */
  87.     DT_Z0,            /* DVI_Z0 */
  88.     four(DT_Z),        /* DVI_Z1 through DVI_Z4 */
  89.     sixty_four(DT_FNTNUM),    /* DVI_FNTNUM0 through DVI_FNTNUM63 */
  90.     four(DT_FNT),        /* DVI_FNT1 through DVI_FNT4 */
  91.     four(DT_XXX),        /* DVI_XXX1 through DVI_XXX4 */
  92.     four(DT_FNTDEF),    /* DVI_FNTDEF1 through DVI_FNTDEF4 */
  93.     DT_PRE,            /* DVI_PRE */
  94.     DT_POST,        /* DVI_POST */
  95.     DT_POSTPOST,        /* DVI_POSTPOST */
  96.     six(DT_UNDEF)        /* 250 through 255 */
  97. };
  98.