home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / CMTEX330 / SOURCE / DVI.H < prev    next >
C/C++ Source or Header  |  1992-02-19  |  2KB  |  116 lines

  1.  
  2. /*
  3.  * %Y%:%M%:%I%:%Q%
  4.  *
  5.  * Copyright 1987,1988,1991 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  *
  11.  */
  12.  
  13. global    file    dvi_file;
  14. global    str    dvi_name;
  15.  
  16. #define SET_CHAR_0    0
  17. #define SET1        128
  18. #define SET_RULE    132
  19. #define PUT1        133
  20. #define PUT_RULE    137
  21. #define NOP        138
  22. #define BOP        139
  23. #define EOP        140
  24. #define PUSH        141
  25. #define POP        142
  26. #define RIGHT1        143
  27. #define W0        147
  28. #define W1        148
  29. #define X0        152
  30. #define X1        153
  31. #define DOWN1        157
  32. #define Y0        161
  33. #define Y1        162
  34. #define Z0        166
  35. #define Z1        167
  36. #define FNT_NUM_0    171
  37. #define FNT1        235
  38. #define XXX1        239
  39. #define XXX4        242
  40. #define FNT_DEF1    243
  41. #define PRE        247
  42. #define POST        248
  43. #define POST_POST    249
  44. #define ID_BYTE        2
  45.  
  46. global    int    dead_cycles;
  47. global    bool    doing_leaders;
  48. global    int    last_bop;
  49. global    scal    max_h;
  50. global    scal    max_v;
  51. global    int    max_push;
  52. global    scal    rule_ht;
  53. global    scal    rule_dp;
  54. global    scal    rule_wd;
  55.  
  56. global    fnt    dvi_f;
  57. global    scal    dvi_h;
  58. global    scal    dvi_v;
  59. global    scal    cur_h;
  60. global    scal    cur_v;
  61. global    int    cur_s;
  62.  
  63. global    ptr    down_ptr;
  64. global    ptr    right_ptr;
  65.  
  66. global    byte    *dvi_buf;
  67. global    ptr    dvi_limit; 
  68. global    ptr    dvi_ptr;
  69. global    int    dvi_offset;
  70. global    int    dvi_gone;
  71. global    bool    output_active;
  72. global    int    total_pages;
  73.  
  74. struct move_t {
  75.     mcell    node_field;
  76.     scal    movement_field;
  77.     int    location_field;
  78. };
  79. typedef struct move_t move_t;
  80.  
  81. #define MOVEMENT_NODE_SIZE    sizeof(move_t)
  82. #define move_amount(P)        ((move_t *) (P))->movement_field
  83. #define location(P)        ((move_t *) (P))->location_field
  84.  
  85. #define synch_h() \
  86.     {if (cur_h != dvi_h) {movement(cur_h - dvi_h, RIGHT1); dvi_h = cur_h;}}
  87.  
  88. #define synch_v() \
  89.     {if (cur_v != dvi_v) {movement(cur_v - dvi_v, DOWN1); dvi_v = cur_v;}}
  90.  
  91. #define dvi_out(B) \
  92.     {dvi_buf[dvi_ptr++] = B; if (dvi_ptr == dvi_limit) dvi_swap();}
  93.  
  94. #define write_dvi(a, b) \
  95.     {fwrite((char *)&dvi_buf[a], sizeof(dvi_buf[0]), b - a, dvi_file);}
  96.  
  97. void    ship_out();
  98. void    hlist_out();
  99. void    hskip_out();
  100. void    hrule_out();
  101. void    vlist_out();
  102. void    vskip_out();
  103. void    vrule_out();
  104. void    fnt_out();
  105. void    dvi_font_def();
  106. void    dvi_swap();
  107. void    dvi_four();
  108. void    dvi_pop();
  109. void    movement();
  110. void    prune_movements();
  111. void    start_dvi();
  112. void    fin_dvi();
  113.  
  114. void    _dvi_init();
  115. void    _dvi_init_once();
  116.