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. --- lib.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib.h') diff --git a/lib.h b/lib.h index caab6b2a..fbdc06a8 100644 --- a/lib.h +++ b/lib.h @@ -198,7 +198,7 @@ struct cobj { struct cobj_ops { val (*equal)(val self, val other); - void (*print)(val self, val stream); + void (*print)(val self, val stream, val pretty); void (*destroy)(val self); void (*mark)(val self); cnum (*hash)(val self); @@ -211,7 +211,7 @@ struct cobj_ops { * Default equal is eq */ -void cobj_print_op(val, val); +void cobj_print_op(val, val, val); void cobj_destroy_stub_op(val); void cobj_destroy_free_op(val); void cobj_mark_op(val); @@ -855,6 +855,7 @@ val search(val seq, val key, val from, val to); val where(val func, val seq); val sel(val seq, val where); val env(void); +val obj_print_impl(val obj, val out, val pretty); val obj_print(val obj, val stream); val obj_pprint(val obj, val stream); val tostring(val obj); -- cgit v1.2.3