diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2025-12-24 19:49:57 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2025-12-24 19:49:57 -0500 |
| commit | 939ac4319cb047a37ba46f84eff81948063f6954 (patch) | |
| tree | 5112cf8aad73125a13f5b52c0290a7f26f948b52 /jslinux-2019-12-21/tinyemu-2019-12-21/fbuf.h | |
| parent | 3a1b5ba15b89c907f9bf66a0761ffdd73b32208b (diff) | |
| download | unixv4-939ac4319cb047a37ba46f84eff81948063f6954.tar.gz unixv4-939ac4319cb047a37ba46f84eff81948063f6954.tar.xz | |
Add working webpage for unix v4
Diffstat (limited to 'jslinux-2019-12-21/tinyemu-2019-12-21/fbuf.h')
| -rw-r--r-- | jslinux-2019-12-21/tinyemu-2019-12-21/fbuf.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/jslinux-2019-12-21/tinyemu-2019-12-21/fbuf.h b/jslinux-2019-12-21/tinyemu-2019-12-21/fbuf.h new file mode 100644 index 0000000..9736a49 --- /dev/null +++ b/jslinux-2019-12-21/tinyemu-2019-12-21/fbuf.h @@ -0,0 +1,22 @@ +#ifndef FBUF_H +#define FBUF_H + +typedef struct { +#if defined(EMSCRIPTEN) + int handle; +#else + uint8_t *data; +#endif + size_t allocated_size; +} FileBuffer; + +void file_buffer_init(FileBuffer *bs); +void file_buffer_reset(FileBuffer *bs); +int file_buffer_resize(FileBuffer *bs, size_t new_size); +void file_buffer_write(FileBuffer *bs, size_t offset, const uint8_t *buf, + size_t size); +void file_buffer_set(FileBuffer *bs, size_t offset, int val, size_t size); +void file_buffer_read(FileBuffer *bs, size_t offset, uint8_t *buf, + size_t size); + +#endif /* FBUF_H */ |
