summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2024-01-08 05:42:27 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2024-01-10 22:34:29 -0600
commit142f1eebdfb401d297a1600f411c52b6e52585bb (patch)
treef22c856c318414b2cc259ae01260853b699e1afa
parent30333bb2fa7e09716676e914d8f9e525af837dd5 (diff)
src/roff/troff/div.cpp: Update code style.
Wrap long line and add annotations.
-rw-r--r--src/roff/troff/div.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 6d313ab5d..da6a00282 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -391,15 +391,17 @@ const char *top_level_diversion::get_next_trap_name()
return next_trap->nm.contents();
}
+// This is used by more than just top-level diversions.
void top_level_diversion::output(node *nd, int retain_size,
- vunits vs, vunits post_vs, hunits width)
+ vunits vs, vunits post_vs,
+ hunits width)
{
no_space_mode = 0;
vunits next_trap_pos;
trap *next_trap = find_next_trap(&next_trap_pos);
if (before_first_page && begin_page())
- fatal("attempting output of top-level diversion before first page"
- " has started; invoke break or flush request earlier");
+ fatal("attempting diversion output before first page has started;"
+ " invoke break or flush request earlier");
vertical_size v(vs, post_vs);
for (node *tem = nd; tem != 0; tem = tem->next)
tem->set_vertical_size(&v);
@@ -441,10 +443,12 @@ void top_level_diversion::output(node *nd, int retain_size,
nl_reg_contents = vertical_position.to_units();
}
+// The next two member functions implement the internals of `.output`
+// and `\!`.
+
void top_level_diversion::transparent_output(unsigned char c)
{
if (before_first_page && begin_page())
- // This can only happen with the .output request.
fatal("attempting transparent output of top-level diversion before"
" first page has started; invoke break or flush request"
" earlier");
@@ -461,6 +465,7 @@ void top_level_diversion::transparent_output(node * /*n*/)
error("can't transparently output node at top level");
}
+// Implement the internals of `.cf`.
void top_level_diversion::copy_file(const char *filename)
{
if (before_first_page && begin_page())