summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-05 23:18:35 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-05 23:18:35 -0800
commitf128b3e3f1ab9fb724d09486b59ae2a2b4cab29c (patch)
tree0f71acbb110df777c7e30b90c32525e8bd8a9d3e /stream.h
parent7563a6d0330a4ac02e3e0df169d35f9f395b8d71 (diff)
downloadtxr-f128b3e3f1ab9fb724d09486b59ae2a2b4cab29c.tar.gz
txr-f128b3e3f1ab9fb724d09486b59ae2a2b4cab29c.tar.bz2
txr-f128b3e3f1ab9fb724d09486b59ae2a2b4cab29c.zip
* eval.c (eval_init): Registered regex_parse as new
intrinsic function and std_null as new variable. * parser.h (yylex_destroy): Existing function declared. * parser.l (regex_parse): New function. New lexical syntax added which returns SECRET_ESCAPE_R. * parser.y (SECRET_ESCAPE_R): New token. (spec): Added syntactic variant which lets us smuggle a regex into the parser easily. * stream.c:x (std_null): New global variable. (null_stream_print): New static function. (null_ops): New static structure. (make_null_stream): New function. (stream_init): Protect and initialize std_null. * stream.h (std_null, make_null_stream): Declared. * txr.1: New features documented: regex-parse, *stdnull*. * txr.c (txr_main): Call yylex_destroy after parsing the program now that I know about this function; this can free up some memory.
Diffstat (limited to 'stream.h')
-rw-r--r--stream.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/stream.h b/stream.h
index 6bf7c5e6..604a5e78 100644
--- a/stream.h
+++ b/stream.h
@@ -24,7 +24,7 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-extern val std_input, std_output, std_debug, std_error;
+extern val std_input, std_output, std_debug, std_error, std_null;
extern val output_produced;
extern val dev_k, ino_k, mode_k, nlink_k, uid_k;
@@ -38,6 +38,7 @@ 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_null_stream(void);
val make_stdio_stream(FILE *, val descr);
val make_tail_stream(FILE *, val descr);
val make_pipe_stream(FILE *, val descr);