Skip to content

Commit

Permalink
[CWEB] Reuse code for secondary output.
Browse files Browse the repository at this point in the history
We try to keep the total section count of CTANGLE (104) intact.

git-svn-id: svn://tug.org/texlive/trunk/Build/source@68343 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
Andreas Scherer committed Sep 22, 2023
1 parent e573b6b commit 13e43ac
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 159 deletions.
6 changes: 6 additions & 0 deletions texk/web2c/cwebdir/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2023-09-22 Andreas Scherer <https://ascherer.github.io>

* ctang-w2c.ch,
* ctangle.c,
* ctangle.w: Reuse code for secondary output.

2023-09-22 Andreas Scherer <https://ascherer.github.io>

* cwebacromac.tex: Factor out PDF/HINT macros.
Expand Down
16 changes: 4 additions & 12 deletions texk/web2c/cwebdir/ctang-w2c.ch
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,8 @@ for (an_output_file=end_output_files; an_output_file>cur_out_file;) {
@.Cannot open output file@>
if (show_progress) { printf("\n(%s)",output_file_name); update_terminal(); }
cur_line=1;
stack_ptr=stack+1;
cur_name=*an_output_file;
cur_repl=(text_pointer)cur_name->equiv;
cur_byte=cur_repl->tok_start;
while (stack_ptr > stack) get_output();
flush_buffer();
@<Initialize the secondary output@>@;
@<Output material...@>@;
}
@y
@<Write all the named output files@>=
Expand All @@ -147,12 +143,8 @@ for (an_output_file=end_output_files; an_output_file>cur_out_file;) {
}
if (show_progress) { printf("\n(%s)",output_file_name); update_terminal(); }
cur_line=1;
stack_ptr=stack+1;
cur_name=*an_output_file;
cur_repl=(text_pointer)cur_name->equiv;
cur_byte=cur_repl->tok_start;
while (stack_ptr > stack) get_output();
flush_buffer();
@<Initialize the secondary output@>@;
@<Output material...@>@;
if (check_for_change) {
fclose(C_file); C_file=NULL;
@<Update the secondary results when they have changed@>@;
Expand Down
Loading

0 comments on commit 13e43ac

Please sign in to comment.