From 8a316a12481282cb2ab966c4cbc770656c258383 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 30 Oct 2021 04:22:07 +0200 Subject: Add option to make mgl_file_load result null terminated --- include/mgl/graphics/texture.h | 2 +- include/mgl/system/fileutils.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mgl/graphics/texture.h b/include/mgl/graphics/texture.h index 7891dab..9e7a423 100644 --- a/include/mgl/graphics/texture.h +++ b/include/mgl/graphics/texture.h @@ -22,7 +22,7 @@ struct mgl_texture { }; typedef struct { - bool compressed; + bool compressed; /* false by default */ } mgl_texture_load_options; /* |load_options| can be null, in which case the default options are used */ diff --git a/include/mgl/system/fileutils.h b/include/mgl/system/fileutils.h index 71af147..7696679 100644 --- a/include/mgl/system/fileutils.h +++ b/include/mgl/system/fileutils.h @@ -2,13 +2,19 @@ #define MGL_FILEUTILS_H #include +#include typedef struct { unsigned char *data; size_t size; } mgl_filedata; -int mgl_load_file(const char *filepath, mgl_filedata *filedata); +typedef struct { + bool null_terminated; /* false by default */ +} mgl_file_load_options; + +/* |load_options| can be null, in which case the default options are used */ +int mgl_load_file(const char *filepath, mgl_filedata *filedata, mgl_file_load_options *load_options); void mgl_filedata_free(mgl_filedata *self); #endif /* MGL_FILEUTILS_H */ -- cgit v1.2.3