diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-01 17:51:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-01 20:05:06 -0700 |
commit | b9d23bcf53ee7b041b511a25a36291ae7166c73b (patch) | |
tree | 36b5fe477b442176f91ca549d6080029c756b2b9 /stream.c | |
parent | 0f050c4f3d57605ad0692e5abf2f61d0e75f408e (diff) | |
download | txr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.tar.gz txr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.tar.bz2 txr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.zip |
Pass pretty flag to cobj print operation.
* hash.c (hash_print_op): Take third argument,
and call cobj_print_impl rather than cobj_print.
* lib.c (cobj_print_op): Take third argument. The object class is
* printed with obj_print_impl.
(obj_print_impl): Static function becomes extern. Passes its pretty
flag argument to cobj print virtual function.
* lib.h (cobj_ops): print takes third argument.
(cobj_print_op): Declaration updated.
(obj_print_impl): Declared.
* regex.c (regex_print): Takes third argument, and ignores it.
* stream.c (stream_print_op, stdio_stream_print, cat_stream_print):
Take third argument, and ignore it.
* stream.h (stream_print_op): Declaration updated.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -83,9 +83,10 @@ void strm_base_mark(struct strm_base *s) (void) s; } -void stream_print_op(val stream, val out) +void stream_print_op(val stream, val out, val pretty) { val name = stream_get_prop(stream, name_k); + (void) pretty; format(out, lit("#<~a ~p>"), name, stream, nao); } @@ -303,12 +304,14 @@ struct stdio_handle { unsigned is_real_time; }; -static void stdio_stream_print(val stream, val out) +static void stdio_stream_print(val stream, val out, val pretty) { struct stdio_handle *h = coerce(struct stdio_handle *, stream->co.handle); struct strm_ops *ops = coerce(struct strm_ops *, stream->co.ops); val name = static_str(ops->name); + (void) pretty; + if (h->pid) format(out, lit("#<~a ~s ~s ~p>"), name, h->descr, num(h->pid), stream, nao); else @@ -1693,12 +1696,14 @@ struct cat_strm { val streams; }; -static void cat_stream_print(val stream, val out) +static void cat_stream_print(val stream, val out, val pretty) { struct cat_strm *s = coerce(struct cat_strm *, stream->co.handle); struct strm_ops *ops = coerce(struct strm_ops *, stream->co.ops); val name = static_str(ops->name); + (void) pretty; + format(out, lit("#<~a ~s>"), name, s->streams, nao); } |