summaryrefslogtreecommitdiffstats
path: root/lib.h
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.h
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.h')
-rw-r--r--lib.h5
1 files changed, 3 insertions, 2 deletions
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);