summaryrefslogtreecommitdiffstats
path: root/stream/stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream.h')
-rw-r--r--stream/stream.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/stream/stream.h b/stream/stream.h
index c127860ceb..58b55e1a43 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -32,6 +32,9 @@
// it's guaranteed that you can seek back by <= of this size again.
#define STREAM_BUFFER_SIZE 2048
+// Maximum size of a complete read.
+#define STREAM_MAX_READ_SIZE (INT_MAX - 1)
+
// flags for stream_open_ext (this includes STREAM_READ and STREAM_WRITE)
// stream->mode
@@ -109,7 +112,7 @@ typedef struct stream_info_st {
// opts is set from ->opts
int (*open)(struct stream *st);
// Alternative to open(). Only either open() or open2() can be set.
- int (*open2)(struct stream *st, struct stream_open_args *args);
+ int (*open2)(struct stream *st, const struct stream_open_args *args);
const char *const *protocols;
bool can_write; // correctly checks for READ/WRITE modes
bool local_fs; // supports STREAM_LOCAL_FS_ONLY
@@ -212,6 +215,7 @@ bool stream_seek_skip(stream_t *s, int64_t pos);
bool stream_seek(stream_t *s, int64_t pos);
int stream_read(stream_t *s, void *mem, int total);
int stream_read_partial(stream_t *s, void *buf, int buf_size);
+int stream_peek(stream_t *s, int forward_size);
int stream_read_peek(stream_t *s, void *buf, int buf_size);
void stream_drop_buffers(stream_t *s);
int64_t stream_get_size(stream_t *s);