$darkmode
Centralized secure file loading utilities. More...
#include <stddef.h>Go to the source code of this file.
Functions | |
| char * | io_read_file (const char *path, size_t max_size, size_t *out_size) |
| Reads an entire file into a null-terminated string. More... | |
Centralized secure file loading utilities.
| char* io_read_file | ( | const char * | path, |
| size_t | max_size, | ||
| size_t * | out_size | ||
| ) |
Reads an entire file into a null-terminated string.
Performs security checks to prevent path traversal and applies size limits. The returned buffer must be freed by the caller.
| path | The path to the file to read. |
| max_size | Maximum allowed file size (0 for default MAX_SHADER_SOURCE_SIZE). |
| out_size | Optional pointer to store the actual file size. |