From 1ef8071c738db67214e7d20502496146d2a40821 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 Mar 2016 06:29:25 -0700 Subject: New l and u letters in stream open mode strings. * stream.c (parse_mode): Recognize "l" and "u", and set new flags. (set_mode_props): More complicated behavior to integrate the new options with the line mode defaulting behavior of "i". * stream.h (struct stdio_mode): New members unbuf and linebuf. All members become bit fields of width 1. (stdio_mode_init_trivial): Initializers for new members. * txr.1: Documented. --- stream.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'stream.h') diff --git a/stream.h b/stream.h index b96a0ae6..2474ce13 100644 --- a/stream.h +++ b/stream.h @@ -83,16 +83,18 @@ struct strm_ops { } struct stdio_mode { - int malformed; - int read; - int write; - int create; - int append; - int binary; - int interactive; + unsigned malformed : 1; + unsigned read : 1; + unsigned write : 1; + unsigned create : 1; + unsigned append : 1; + unsigned binary : 1; + unsigned interactive : 1; + unsigned unbuf : 1; + unsigned linebuf : 1; }; -#define stdio_mode_init_trivial(read) { 0, read, 0, 0, 0, 0, 0 } +#define stdio_mode_init_trivial(read) { 0, read, 0, 0, 0, 0, 0, 0, 0 } #define std_input (deref(lookup_var_l(nil, stdin_s))) #define std_output (deref(lookup_var_l(nil, stdout_s))) -- cgit v1.2.3