nbtvis/src/stream.h

23 lines
606 B
C
Raw Normal View History

2023-12-14 23:08:16 +00:00
#pragma once
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
typedef struct {
FILE *__file;
bool __alloc;
} stream_t;
stream_t stream_open(char *path, 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_u16(stream_t *stream, uint16_t *res);
bool stream_read_u32(stream_t *stream, uint32_t *res);