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

  1.  
  2. /*
  3.  * %Y%:%M%:%I%:%Q%
  4.  *
  5.  * Copyright 1987,1988,1991,1992 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  *
  11.  */
  12.  
  13. struct passive_t {
  14.     mcell    node_field;
  15.     ptr    cur_break_field;
  16.     ptr    prev_break_field;
  17. };
  18. typedef struct passive_t passive_t;
  19.  
  20. #define PASSIVE_NODE_SIZE    sizeof(passive_t)
  21. #define serial            info
  22. #define cur_break(P)        ((passive_t *) (P))->cur_break_field
  23. #define prev_break(P)        ((passive_t *) (P))->prev_break_field
  24. #define next_break        prev_break
  25.  
  26. global    ptr    passive;
  27.  
  28. struct active_t {
  29.     mcell    node_field;
  30.     ptr    break_node_field;
  31.     int    line_number_field;
  32.     int    total_demerits_field;
  33. };
  34. typedef struct active_t active_t;
  35.  
  36. #define ACTIVE_NODE_SIZE    sizeof(active_t)
  37. #define UNHYPHENATED        0
  38. #define HYPHENATED        1
  39. #define fitness            subtype
  40. #define VERY_LOOSE_FIT        0
  41. #define LOOSE_FIT        1
  42. #define DECENT_FIT        2
  43. #define TIGHT_FIT        3
  44. #define break_node(P)        ((active_t *) (P))->break_node_field
  45. #define line_number(P)        ((active_t *) (P))->line_number_field
  46. #define total_demerits(P)    ((active_t *) (P))->total_demerits_field
  47.  
  48. global    ptr    active;
  49. #define last_active        active
  50.  
  51. #define DELTA_NODE        2
  52.  
  53. struct delta_t {
  54.     mcell    node_field;
  55.     scal    delta_field[7];
  56. };
  57. typedef struct delta_t delta_t;
  58.  
  59. #define DELTA_NODE_SIZE        sizeof(delta_t)
  60. #define deltas(P)        ((delta_t *) (P))->delta_field
  61.  
  62. #define do_all_six(F) \
  63.     {F(1); F(2); F(3); F(4); F(5); F(6);}
  64.  
  65. global    ptr    just_box;
  66.  
  67. void    line_break();
  68.  
  69. global    ptr    printed_node;
  70. global    int    pass_number;
  71.  
  72. global    scal    active_width[];
  73. global    scal    cur_active_width[];
  74. global    scal    background[];
  75. global    scal    break_width[];
  76. global    bool    no_shrink_error_yet;
  77.  
  78. ptr    finite_shrink();
  79.  
  80. global    ptr    cur_p;
  81. global    bool    second_pass;
  82. global    bool    final_pass;
  83. global    int    threshold;
  84.  
  85. void    try_break();
  86.  
  87. #define AWFUL_BAD        07777777777
  88.  
  89. global    int    fit_class;
  90. global    int    minimal_demerits[];
  91. global    int    minimum_demerits;
  92. global    ptr    best_place[];
  93. global    int    best_pl_line[];
  94.  
  95. global    int    easy_line;
  96. global    int    last_special_line;
  97. global    scal    first_width;
  98. global    scal    second_width;
  99. global    scal    first_indent;
  100. global    scal    second_indent;
  101. global    scal    line_width;
  102. global    scal    disc_width;
  103. global    ptr    best_bet;
  104. global    int    fewest_demerits;
  105. global    int    best_line;
  106. global    int    line_diff;
  107. global    int    actual_looseness;
  108.  
  109. void    post_line_break();
  110.  
  111. void    set_disc_width();
  112. void    set_act_width();
  113. void    set_break_width();
  114. int    get_best_bet();
  115. int    get_badness();
  116. void    get_active_nodes();
  117. ptr    get_break_node();
  118. void    show_break_node();
  119. void    show_break_status();
  120. void    update_printed_node();
  121.  
  122. void    _par_init();
  123. void    _par_init_once();
  124.