diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-03-19 09:39:14 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-03-19 09:39:14 -0700 |
commit | 8d338fb27ee545c4f2fc90963f8d0c70af478b66 (patch) | |
tree | 3f01780645e6407e904e46be74565b7d77832073 /RELNOTES | |
parent | ea9ba58da58fc03e4b1ae1d6e277dad8189fa920 (diff) | |
download | txr-8d338fb27ee545c4f2fc90963f8d0c70af478b66.tar.gz txr-8d338fb27ee545c4f2fc90963f8d0c70af478b66.tar.bz2 txr-8d338fb27ee545c4f2fc90963f8d0c70af478b66.zip |
Permissive stream open mode strings.
There is more to this patch than just more permissive
mode strings. Now if a socket can be opened with mode
"l2" for instance, and these options are effectively applied
to the socket-specific "r+b" default, not to "r".
* stream.c (parse_mode): New argument specifying a default
mode. The syntax is relaxed, allowing previously required
elements to be omitted.
(normalize_mode): New argument specifying a default mode.
Format mode is always called now, because an input string
is no longer necessarily a valid fopen string even in cases
when it doesn't specify any extensions.
(open_file, open_fileno, open_tail, open_command,
open_process): Use new normalize_mode argument for defaulting;
normalize_mode no longer defaults to "r".
* stream.h (stdio_mode_init_trivial): Macro removed.
(stdio_mode_init_blank, stdio_mode_init_r,
stdio_mode_init_rpb): New initializer macros.
(parse_mode, normalize_mode): Declarations updated.
* socket.c (sock_accept): In datagram socket case, use new
parse_mode argument for defaulting using stdio_mode_init_rpb,
rather than overriding a missing string with "r+b".
(open_sockfd): Likewise, and use new normalize_mode
argument similarly for defaulting the mode on a stream socket.
* txr.1: Documented mode string permissiveness.
Diffstat (limited to 'RELNOTES')
0 files changed, 0 insertions, 0 deletions