From b9d23bcf53ee7b041b511a25a36291ae7166c73b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 1 Aug 2015 17:51:51 -0700 Subject: 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. --- stream.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'stream.c') diff --git a/stream.c b/stream.c index 240db1eb..6e85012f 100644 --- a/stream.c +++ b/stream.c @@ -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); } -- cgit v1.2.3