summaryrefslogtreecommitdiffstats
path: root/syslog.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-07-07 06:45:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-07-07 06:45:45 -0700
commit2f792610c11dd2a82a5e9b35be55a227665e76d1 (patch)
tree2f0777fd1b4caa4d0c2f0364bcfb55b0120717d2 /syslog.c
parent1e1d6176ebac760a396caf705acfb2feab371068 (diff)
downloadtxr-2f792610c11dd2a82a5e9b35be55a227665e76d1.tar.gz
txr-2f792610c11dd2a82a5e9b35be55a227665e76d1.tar.bz2
txr-2f792610c11dd2a82a5e9b35be55a227665e76d1.zip
Improved printing of stream objects.
* stream.c (null_stream_print): Static function removed. (stream_print_op): New function. Prints stream's name and address. (null_get_prop): Pull stream name from strm_ops structure rather than hard-coding to "null-stream". (null_ops, stdio_ops, tail_ops, pipe_ops, string_in_ops, byte_in_ops, string_out_ops, strlist_out_ops, dir_ops, cat_stream_ops): Use stream_print_op in place of cobj_print_op. Initialize name. (stdio_stream_print): Use name from ops structure, and include object address. (string_in_get_prop): Likewise. (cat_stream_print): Likewise. * stream.h (struct strm_ops): New member, name. (strm_ops_init): Initialize name. (stream_print_op): Declared. * syslog.c (syslog_strm_ops): Use stream_print_op. Initialize name.
Diffstat (limited to 'syslog.c')
-rw-r--r--syslog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/syslog.c b/syslog.c
index cfc24cb8..4a603d2e 100644
--- a/syslog.c
+++ b/syslog.c
@@ -204,10 +204,11 @@ static val syslog_set_prop(val stream, val ind, val prop)
static struct strm_ops syslog_strm_ops =
strm_ops_init(cobj_ops_init(eq,
- cobj_print_op,
+ stream_print_op,
cobj_destroy_stub_op,
syslog_mark,
cobj_hash_op),
+ wli("syslog-stream"),
syslog_put_string,
syslog_put_char,
syslog_put_byte,