summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-11-27 21:05:51 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-11-27 21:05:51 -0800
commit5285db54f7199cf75c0b740faaeee15cc9cc8c6a (patch)
tree98afe773267c450f14759e02724a0fa9c2b89c7d /stream.h
parent6fedaccfe790e33bb7a71d8a5f776e4cfa7e6c62 (diff)
downloadtxr-5285db54f7199cf75c0b740faaeee15cc9cc8c6a.tar.gz
txr-5285db54f7199cf75c0b740faaeee15cc9cc8c6a.tar.bz2
txr-5285db54f7199cf75c0b740faaeee15cc9cc8c6a.zip
* configure: Added check to detect POSIX sleep function.
* eval.c (eval_init): Register new open_tail function as intrinsic. * match.c (complex_snarf, complex_stream): Update calls to make_stdio_stream and make_pipe_stream to take fewer arguments. (match_files): Support a stream object as a data source specification in place of a string. * parser.l (parse_reset): Update call to make_stdio_stream to take fewer arguments. * stream.c: Inclusion of <unistd.h> made properly conditional. (struct stdio_handle): pid member defined as pid_t only if we have fork functionality, otherwise defined as int. (tail_get_line, tail_get_char, tail_get_byte): New static functions. (tail_ops): New static structure. (make_stdio_stream_common): New static structure. (make_stdio_stream, make_pipe_stream): These functions lose the input and output parameters, which ended up never used. Reimplemented in terms of new common function. (make_tail_stream): New function. (make_pipevp_stream): Reimplemented in terms of new common function. (open_file, open_command): Simplified by removal of useless local variables and their computation, which used to be extra arguments to make_stdio_stream and make_pipe_stream. (open_tail): New function. (stream_init): Calls to make_stdio_stream updated. * stream.h (make_stdio_stream, make_pipe_stream): Declarations updated. (make_tail_stream, open_tail): Declared. * txr.c (txr_main): Calls to make_stdio_stream updated.
Diffstat (limited to 'stream.h')
-rw-r--r--stream.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/stream.h b/stream.h
index 1cf0281d..efd3e912 100644
--- a/stream.h
+++ b/stream.h
@@ -37,8 +37,9 @@ extern val s_ifchr, s_ififo, s_isuid, s_isgid, s_isvtx, s_irwxu;
extern val s_irusr, s_iwusr, s_ixusr, s_irwxg, s_irgrp, s_iwgrp;
extern val s_ixgrp, s_irwxo, s_iroth, s_iwoth, s_ixoth;
-val make_stdio_stream(FILE *, val descr, val input, val output);
-val make_pipe_stream(FILE *, val descr, val input, val output);
+val make_stdio_stream(FILE *, val descr);
+val make_tail_stream(FILE *, val descr);
+val make_pipe_stream(FILE *, val descr);
val make_string_input_stream(val);
val make_string_byte_input_stream(val);
val make_string_output_stream(void);
@@ -64,6 +65,7 @@ val seek_stream(val stream, val offset, val whence);
val statf(val path);
val open_directory(val path);
val open_file(val path, val mode_str);
+val open_tail(val path, val mode_str, val seek_end_p);
val open_command(val path, val mode_str);
val open_process(val path, val mode_str, val args);