diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-12-10 08:19:11 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-12-10 08:19:11 -0800 |
commit | 7bccff13730eb4997a570532c6e190e7bc7ea9f2 (patch) | |
tree | 20e897ab8a6239ebcaf348127b01ee2ca566add7 /stream.c | |
parent | b698bb706067d911c62385b477684efea6aa983a (diff) | |
download | txr-7bccff13730eb4997a570532c6e190e7bc7ea9f2.tar.gz txr-7bccff13730eb4997a570532c6e190e7bc7ea9f2.tar.bz2 txr-7bccff13730eb4997a570532c6e190e7bc7ea9f2.zip |
* eval.c (eval_init): Register streamp, real_time_stream_p,
stream_get_prop and stream_set_prop as intrinsics.
* stream.c (stream_get_prop): New function.
* stream.h (stream_get_prop): Declared.
* syslog.c (syslog_get_prop): Bugfix: check for prio_k not real_time_k.
* txr.1: Updated.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1051,6 +1051,18 @@ val stream_set_prop(val stream, val ind, val prop) } } +val stream_get_prop(val stream, val ind) +{ + type_check (stream, COBJ); + type_assert (stream->co.cls == stream_s, (lit("~a is not a stream"), + stream, nao)); + + { + struct strm_ops *ops = (struct strm_ops *) stream->co.ops; + return ops->get_prop ? ops->get_prop(stream, ind) : nil; + } +} + val real_time_stream_p(val obj) { if (streamp(obj)) { |