diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-01-29 21:59:05 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-01-29 21:59:05 -0800 |
commit | 9bb7ffe3ee931bbfebe38fec4f2b24d1b851aece (patch) | |
tree | 3f9875f3514cb6e98d60a3eb277fa62de8105db6 /stream.h | |
parent | 0ba5923568ef1bf13eee30012fbf2977fe8b5a7c (diff) | |
download | txr-9bb7ffe3ee931bbfebe38fec4f2b24d1b851aece.tar.gz txr-9bb7ffe3ee931bbfebe38fec4f2b24d1b851aece.tar.bz2 txr-9bb7ffe3ee931bbfebe38fec4f2b24d1b851aece.zip |
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.
Diffstat (limited to 'stream.h')
-rw-r--r-- | stream.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -47,6 +47,15 @@ struct strm_ops { val (*set_prop)(val, val ind, val); }; +#define strm_ops_init(cobj_init_macro, put_string, put_char, put_byte, \ + get_line, get_char, get_byte, unget_char, unget_byte, \ + close, flush, seek, get_prop, set_prop) \ +{ \ + cobj_init_macro, put_string, put_char, put_byte, get_line, \ + get_char, get_byte, unget_char, unget_byte, \ + close, flush, seek, get_prop, set_prop \ +} + #define std_input (deref(lookup_var_l(nil, stdin_s))) #define std_output (deref(lookup_var_l(nil, stdout_s))) #define std_debug (deref(lookup_var_l(nil, stddebug_s))) |