summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-01 17:51:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-01 20:05:06 -0700
commitb9d23bcf53ee7b041b511a25a36291ae7166c73b (patch)
tree36b5fe477b442176f91ca549d6080029c756b2b9 /lib.c
parent0f050c4f3d57605ad0692e5abf2f61d0e75f408e (diff)
downloadtxr-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 'lib.c')
-rw-r--r--lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib.c b/lib.c
index 05f94f15..5f2f3aa5 100644
--- a/lib.c
+++ b/lib.c
@@ -5575,10 +5575,10 @@ struct cobj_ops *cobj_ops(val cobj, val cls_sym)
return cobj->co.ops;
}
-void cobj_print_op(val obj, val out)
+void cobj_print_op(val obj, val out, val pretty)
{
put_string(lit("#<"), out);
- obj_print(obj->co.cls, out);
+ obj_print_impl(obj->co.cls, out, pretty);
format(out, lit(": ~p>"), coerce(val, obj->co.handle), nao);
}
@@ -6905,7 +6905,7 @@ static void obj_init(void)
prog_string = string(progname);
}
-static val obj_print_impl(val obj, val out, val pretty)
+val obj_print_impl(val obj, val out, val pretty)
{
val ret = obj;
@@ -7131,7 +7131,7 @@ finish:
obj_print_impl(obj->ls.prefix, out, pretty);
break;
case COBJ:
- obj->co.ops->print(obj, out);
+ obj->co.ops->print(obj, out, pretty);
break;
case ENV:
format(out, lit("#<environment: ~p>"), obj, nao);