From 9bb7ffe3ee931bbfebe38fec4f2b24d1b851aece Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 29 Jan 2015 21:59:05 -0800 Subject: Use macro to initialize strm_ops. * stream.h (strm_ops_init): New macro. * stream.c (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): Initialize using macro. * syslog.c (syslog_strm_ops): Likewise. --- syslog.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'syslog.c') diff --git a/syslog.c b/syslog.c index 51ad8c5c..1e208d7e 100644 --- a/syslog.c +++ b/syslog.c @@ -198,26 +198,18 @@ static val syslog_set_prop(val stream, val ind, val prop) return nil; } -static struct strm_ops syslog_strm_ops = { - { eq, - cobj_print_op, - cobj_destroy_stub_op, - syslog_mark, - cobj_hash_op }, - syslog_put_string, - syslog_put_char, - syslog_put_byte, - 0, /* get_line */ - 0, /* get_char */ - 0, /* get_byte */ - 0, /* unget_char */ - 0, /* unget_byte */ - 0, /* close */ - 0, /* flush */ - 0, /* seek */ - syslog_get_prop, - syslog_set_prop -}; +static struct strm_ops syslog_strm_ops = + strm_ops_init(cobj_ops_init(eq, + cobj_print_op, + cobj_destroy_stub_op, + syslog_mark, + cobj_hash_op), + syslog_put_string, + syslog_put_char, + syslog_put_byte, + 0, 0, 0, 0, 0, 0, 0, 0, + syslog_get_prop, + syslog_set_prop); val make_syslog_stream(val prio) { -- cgit v1.2.3