stream: STREAM_TYPE_FILE will now read file upfront
No more having to chunk read - if ~stream_init_file~ is used, the constructor slurps the entire file into the cache. This pays up front for a bunch of checks essentially. ~stream_init_pipe~ should be used for chunked reading.
This commit is contained in:
@@ -53,6 +53,8 @@ typedef struct
|
||||
|
||||
stream_err_t stream_init_string(stream_t *, const char *, sv_t);
|
||||
stream_err_t stream_init_pipe(stream_t *, const char *, FILE *);
|
||||
// NOTE: stream_init_file will attempt to read all content from the FILE
|
||||
// descriptor. Use with caution.
|
||||
stream_err_t stream_init_file(stream_t *, const char *, FILE *);
|
||||
void stream_stop(stream_t *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user