Provides an API very similar to fwrite and friends but uses a directory that can actually used for persistent file storage. This can later be read using the kinc_file_reader-functions and KINC_FILE_TYPE_SAVE.
More...
#include <kinc/global.h>
#include <stdbool.h>
Go to the source code of this file.
|
| KINC_FUNC bool | kinc_file_writer_open (kinc_file_writer_t *writer, const char *filepath) |
| | Opens a file for writing.
|
| KINC_FUNC void | kinc_file_writer_write (kinc_file_writer_t *writer, void *data, int size) |
| | Writes data to a file starting from the current writing-position and increases the writing-position accordingly.
|
| KINC_FUNC void | kinc_file_writer_close (kinc_file_writer_t *writer) |
| | Closes a file.
|
Provides an API very similar to fwrite and friends but uses a directory that can actually used for persistent file storage. This can later be read using the kinc_file_reader-functions and KINC_FILE_TYPE_SAVE.
◆ kinc_file_writer_close()
| KINC_FUNC void kinc_file_writer_close |
( |
kinc_file_writer_t * | writer | ) |
|
Closes a file.
- Parameters
-
◆ kinc_file_writer_open()
| KINC_FUNC bool kinc_file_writer_open |
( |
kinc_file_writer_t * | writer, |
|
|
const char * | filepath ) |
Opens a file for writing.
- Parameters
-
| reader | The writer to initialize for writing |
| filepath | A filepath to identify a file |
- Returns
- Whether the file could be opened
◆ kinc_file_writer_write()
| KINC_FUNC void kinc_file_writer_write |
( |
kinc_file_writer_t * | writer, |
|
|
void * | data, |
|
|
int | size ) |
Writes data to a file starting from the current writing-position and increases the writing-position accordingly.
- Parameters
-
| reader | The writer to write to |
| data | A pointer to read the data from |
| size | The amount of data to write in bytes |