From 42d1c82a0bfa615b832f5ecc2652edc290bf6e9c Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 15 Dec 2023 23:02:45 -0500 Subject: add json support and other things --- src/stream.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/stream.h') diff --git a/src/stream.h b/src/stream.h index e9fd920..d9a05ce 100644 --- a/src/stream.h +++ b/src/stream.h @@ -9,14 +9,19 @@ typedef struct { bool __alloc; } stream_t; -stream_t stream_open(char *path, char* mode); +stream_t stream_open(const char *path, const char* mode); void stream_close(stream_t *stream); -bool stream_read(stream_t *stream, void *res, size_t amount); -bool stream_read_i8(stream_t *stream, int8_t *res); -bool stream_read_i16(stream_t *stream, int16_t *res); -bool stream_read_i32(stream_t *stream, int32_t *res); -bool stream_read_i64(stream_t *stream, int64_t *res); +bool stream_read(const stream_t *stream, void *res, size_t amount); +bool stream_read_i8(const stream_t *stream, int8_t *res); +bool stream_read_i16(const stream_t *stream, int16_t *res); +bool stream_read_i32(const stream_t *stream, int32_t *res); +bool stream_read_i64(const stream_t *stream, int64_t *res); +bool stream_read_u16(const stream_t *stream, uint16_t *res); -bool stream_read_u16(stream_t *stream, uint16_t *res); -bool stream_read_u32(stream_t *stream, uint32_t *res); +bool stream_write(const stream_t *stream, const void *buf, size_t amount); +bool stream_write_i8(const stream_t *stream, int8_t b); +bool stream_write_i16(const stream_t *stream, int16_t s); +bool stream_write_i32(const stream_t *stream, int32_t i); +bool stream_write_i64(const stream_t *stream, int64_t l); +bool stream_write_u16(const stream_t *stream, uint16_t s); -- cgit v1.2.3-freya