1#ifndef KORE_IO_FILEREADER_HEADER
2#define KORE_IO_FILEREADER_HEADER
19#define KORE_DEBUGDIR "deployment"
25typedef struct __sFILE FILE;
28typedef enum kore_file_type { KORE_FILE_TYPE_ASSET, KORE_FILE_TYPE_SAVE } kore_file_type;
183void kore_internal_set_files_location(
char *dir);
184char *kore_internal_get_files_location(
void);
185bool kore_internal_file_reader_callback(
kore_file_reader *reader,
const char *filename, kore_file_type type);
186bool kore_internal_file_reader_open(
kore_file_reader *reader,
const char *filename, kore_file_type type);
KORE_FUNC int32_t kore_read_s32le(uint8_t *data)
Interprets four bytes starting at the provided pointer as a little-endian int32.
KORE_FUNC uint8_t kore_read_u8(uint8_t *data)
Interprets one byte starting at the provided pointer as a uint8.
KORE_FUNC size_t kore_file_reader_pos(kore_file_reader *reader)
Figures out the current reading-position in the file.
KORE_FUNC int8_t kore_read_s8(uint8_t *data)
Interprets one byte starting at the provided pointer as an int8.
KORE_FUNC int32_t kore_read_s32be(uint8_t *data)
Interprets four bytes starting at the provided pointer as a big-endian int32.
KORE_FUNC uint64_t kore_read_u64le(uint8_t *data)
Interprets eight bytes starting at the provided pointer as a little-endian uint64.
KORE_FUNC uint32_t kore_read_u32le(uint8_t *data)
Interprets four bytes starting at the provided pointer as a little-endian uint32.
KORE_FUNC int64_t kore_read_s64be(uint8_t *data)
Interprets eight bytes starting at the provided pointer as a big-endian int64.
KORE_FUNC bool kore_file_reader_close(kore_file_reader *reader)
Closes a file.
KORE_FUNC uint32_t kore_read_u32be(uint8_t *data)
Interprets four bytes starting at the provided pointer as a big-endian uint32.
KORE_FUNC bool kore_file_reader_seek(kore_file_reader *reader, size_t pos)
Sets the reading-position manually.
KORE_FUNC void kore_file_reader_set_callback(bool(*callback)(kore_file_reader *reader, const char *filename, kore_file_type type))
Registers a file reader callback.
KORE_FUNC bool kore_file_reader_from_memory(kore_file_reader *reader, void *data, size_t size)
Opens a memory area for reading using the file reader API.
KORE_FUNC int64_t kore_read_s64le(uint8_t *data)
Interprets eight bytes starting at the provided pointer as a little-endian int64.
KORE_FUNC int16_t kore_read_s16le(uint8_t *data)
Interprets two bytes starting at the provided pointer as a little-endian int16.
KORE_FUNC uint16_t kore_read_u16le(uint8_t *data)
Interprets two bytes starting at the provided pointer as a little-endian uint16.
KORE_FUNC float kore_read_f32be(uint8_t *data)
Interprets four bytes starting at the provided pointer as a big-endian float.
KORE_FUNC uint64_t kore_read_u64be(uint8_t *data)
Interprets eight bytes starting at the provided pointer as a big-endian uint64.
KORE_FUNC size_t kore_file_reader_read(kore_file_reader *reader, void *data, size_t size)
Reads data from a file starting from the current reading-position and increases the reading-position ...
KORE_FUNC uint16_t kore_read_u16be(uint8_t *data)
Interprets two bytes starting at the provided pointer as a big-endian uint16.
KORE_FUNC int16_t kore_read_s16be(uint8_t *data)
Interprets two bytes starting at the provided pointer as a big-endian int16.
KORE_FUNC bool kore_file_reader_open(kore_file_reader *reader, const char *filepath, kore_file_type type)
Opens a file for reading.
KORE_FUNC float kore_read_f32le(uint8_t *data)
Interprets four bytes starting at the provided pointer as a little-endian float.
KORE_FUNC size_t kore_file_reader_size(kore_file_reader *reader)
Figures out the size of a file.
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
Definition filereader.h:30