DataMuseum.dk

Presents historical artifacts from the history of:

Bogika Butler

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Bogika Butler

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦73ab77c1f⟧ TextFile

    Length: 5248 (0x1480)
    Types: TextFile
    Names: »TF2.PAS«

Derivation

└─⟦11e151dc0⟧ Bits:30009789/_.ft.Ibm2.50006589.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »TF2.PAS« 
└─⟦514567ecc⟧ Bits:30009789/_.ft.Ibm2.50006603.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »TF2.PAS« 
└─⟦59c2ecd8d⟧ Bits:30009789/_.ft.Ibm2.50006600.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »TF2.PAS« 

TextFile



(**************************************************************)
(*                                                            *)
(*                     MODULE 2 starts                        *)

type
  figure_line_type = record
                       line : f_string;
                       len  : index0;
                       line_spacing : integer;
                     end;

var
  in_figure, in_block, in_heading, after_heading,
    block_allows_break, heading_allows_break, glue : boolean;
  line_nr_in_par : integer;
  line_spacing : integer;

  line_buffer : f_string;
  len_buffer : index0;
  break_buffer : boolean;
  line_spacing_buffer : integer;
  buffer_full : boolean;

  figure_nr : integer;
  figure_height, spacing_above : integer;
  figure_file : file of figure_line_type;

procedure init_2;
begin
  in_figure := false; in_block := false;
  in_heading := false; after_heading := false;
  block_allows_break := true; heading_allows_break := true;
  glue := false;
  line_nr_in_par := 0; line_spacing := init_line_spacing;
  buffer_full := false;
  figure_nr := 0;
  init_3;
end;

procedure write_line_2(var line : f_string; len : index0);
  var break_allowed : boolean;
      fig : figure_line_type;
begin
  if in_figure then begin
    fig.line := line; fig.len := len;
    fig.line_spacing := line_spacing;
    write(figure_file, fig);
    figure_height := figure_height+line_spacing;
  end else begin
    break_allowed := block_allows_break and
                     heading_allows_break and
                     not glue;
    case line_nr_in_par of
      0, 1 : write_line_3(break_allowed, line, len, line_spacing);
      2    : write_line_3(false,         line, len, line_spacing);
      3    : begin
               line_buffer := line; len_buffer := len;
               break_buffer := break_allowed;
               line_spacing_buffer := line_spacing;
               buffer_full := true;
             end;
    else
      write_line_3(break_buffer, line_buffer, len_buffer,
                   line_spacing_buffer);
      line_buffer := line; len_buffer := len;
      break_buffer := break_allowed;
      line_spacing_buffer := line_spacing;
    end;
    glue := false;
    if len > 0 then after_heading := false;
    block_allows_break := not in_block;
    heading_allows_break := not in_heading and not after_heading;
    if line_nr_in_par > 0 then line_nr_in_par := line_nr_in_par+1;
  end;
end; (* write_line_2 *)

procedure command_2(command : command_type; param : integer);
  var fig_file_name : name;
begin
  if in_figure then begin
    case command of
      open_heading, close_heading, open_par, close_par :
        ;
      set_line_spacing :
        line_spacing := param;
      close_figure :
        begin
          close(figure_file);
          command_3(figure, spacing_above, figure_height,
                    param (* i.e. spacing below *), figure_nr);
          in_figure := false;
        end;
    end;
  end else begin (* not in a figure *)
    case command of
      open_par :
        line_nr_in_par := 1;
      close_par :
        begin
          line_nr_in_par := 0;
          if buffer_full then begin
            write_line_3(false, line_buffer, len_buffer,
                         line_spacing_buffer);
            buffer_full := false;
          end;
        end;
      open_heading :
        in_heading := true;
      close_heading :
        begin in_heading := false; after_heading := true end;
      set_line_spacing :
        line_spacing := param;
      open_figure :
        begin
          in_figure := true; spacing_above := param;
          figure_height := 0;
          figure_nr := figure_nr+1;
          fig_file_name := figure_file_name +
                           chr(ord('0') + figure_nr mod 10) +
                           chr(ord('0') + figure_nr div 10);
          assign(figure_file, fig_file_name);
          rewrite(figure_file);
        end;
      open_block :
        in_block := true;
      close_block :
        begin in_block := false; block_allows_break := true end;
      paste :
        glue := true;
      set_page_nr, set_hf_left, set_hf_right,
      set_hf_line_spacing, set_head_height, set_foot_height,
      set_page_height, eject :
        command_3(command, param, irrelevant, irrelevant, irrelevant);
    end; (* case *)
  end; (* non-figure case *)
end; (* command_2 *)

procedure text_command_2(placement : place; line_id : integer;
                         p : justification;
                         var text : f_string; len : index0);
begin
  text_command_3(placement, line_id, p, text, len);
end;

procedure terminate_2;
begin
  if buffer_full then
     write_line_3(false, line_buffer, len_buffer,
                  line_spacing_buffer);
  terminate_3;
end;


(*                       MODULE 2 ends                          *)
(*                                                              *)
(****************************************************************)




«eof»