summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwlemb <wlemb>2002-03-16 17:06:19 +0000
committerwlemb <wlemb>2002-03-16 17:06:19 +0000
commit0a1633afcc34945e7af0f441fc4dbc7a63e33319 (patch)
treeb2b1c4797d6e7830965d47734e57112c66e002e0 /src
parent232b35792b9a1de2c08f97428519198f74960e77 (diff)
downloadgroff-0a1633afcc34945e7af0f441fc4dbc7a63e33319.tar.gz
Added request `writec' in analogy to `tmc'.
* src/roff/troff/input.cc (write_request): Renamed to... (do_write_request): This. Added one parameter. (write_request, write_request_continue): New functions. (init_input_requests): Updated. * NEWS, man/groff.man, man/groff_diff.man: Document it.
Diffstat (limited to 'src')
-rw-r--r--src/roff/troff/input.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/roff/troff/input.cc b/src/roff/troff/input.cc
index c7389888..38743de9 100644
--- a/src/roff/troff/input.cc
+++ b/src/roff/troff/input.cc
@@ -5507,7 +5507,9 @@ void close_request()
skip_line();
}
-void write_request()
+// .write and .writec
+
+void do_write_request(int newline)
{
symbol stream = get_name(1);
if (stream.is_null()) {
@@ -5527,11 +5529,22 @@ void write_request()
c = get_copy(0);
for (; c != '\n' && c != EOF; c = get_copy(0))
fputs(asciify(c), fp);
- fputc('\n', fp);
+ if (newline)
+ fputc('\n', fp);
fflush(fp);
tok.next();
}
+void write_request()
+{
+ do_write_request(1);
+}
+
+void write_request_continue()
+{
+ do_write_request(0);
+}
+
void write_macro_request()
{
symbol stream = get_name(1);
@@ -6759,6 +6772,7 @@ void init_input_requests()
init_request("opena", opena_request);
init_request("close", close_request);
init_request("write", write_request);
+ init_request("writec", write_request_continue);
init_request("writem", write_macro_request);
init_request("trf", transparent_file);
#ifdef WIDOW_CONTROL