summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-03-18 06:29:25 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-03-18 06:29:25 -0700
commit1ef8071c738db67214e7d20502496146d2a40821 (patch)
tree6b552ee894deab4c77915e45a8c96082ab42f850 /stream.h
parente84da36197b809c50a0c43cceb5c7b27b3d5733e (diff)
downloadtxr-1ef8071c738db67214e7d20502496146d2a40821.tar.gz
txr-1ef8071c738db67214e7d20502496146d2a40821.tar.bz2
txr-1ef8071c738db67214e7d20502496146d2a40821.zip
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.
Diffstat (limited to 'stream.h')
-rw-r--r--stream.h18
1 files changed, 10 insertions, 8 deletions
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)))