diff options
| author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-10-19 22:22:23 +0100 |
|---|---|---|
| committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-10-19 22:25:10 +0100 |
| commit | cbfcf24ca27df81f51c0f17f6de0730d03e74655 (patch) | |
| tree | 855ad69b679bb7685296af4c88fa3e7988e7e45d /alisp.h | |
| parent | 030a289497db1fcbd22eafb99d7d8827bca94563 (diff) | |
| download | alisp-cbfcf24ca27df81f51c0f17f6de0730d03e74655.tar.gz alisp-cbfcf24ca27df81f51c0f17f6de0730d03e74655.tar.bz2 alisp-cbfcf24ca27df81f51c0f17f6de0730d03e74655.zip | |
stream: Introduce PIPE type
Main reason to have this at all is to make char-by-char reading
feasible. This occurs at `stream_chunk`, and previously if we passed
in STDIN for `stream_init_file`, STDIN will only terminate once
STREAM_DEFAULT_CHUNK number of characters have been fed into the pipe.
This isn't desirable for STDIN (we really want to read char-by-char
for expressions), nor would it necessarily be desirable in network
applications. So any stream marked STREAM_TYPE_PIPE will only chunk
character-by-character rather than genuine chunks.
Diffstat (limited to 'alisp.h')
| -rw-r--r-- | alisp.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -100,6 +100,7 @@ void sym_table_cleanup(sym_table_t *); typedef enum { STREAM_TYPE_STRING, + STREAM_TYPE_PIPE, STREAM_TYPE_FILE, } stream_type_t; @@ -133,6 +134,7 @@ typedef struct #define STREAM_DEFAULT_CHUNK 64 stream_err_t stream_init_string(stream_t *, char *, sv_t); +stream_err_t stream_init_pipe(stream_t *, char *, FILE *); stream_err_t stream_init_file(stream_t *, char *, FILE *); void stream_stop(stream_t *); |
