|
libpulsar
A modular compiler for the pulsar programming language
|
Defines safe file I/O functions. More...
#include "def.h"Go to the source code of this file.
Data Structures | |
| struct | ps_file_ctx |
| Information captured in a file necessary for effective info/error reporting. More... | |
Functions | |
| void | ps_file_ctx_init (struct ps_file_ctx *file_ctx, STR filename, char *buffer, usize length) |
Initializes file_ctx to describe the given file (filename, buffer, length). | |
| char * | ps_read_file_safe (STR filename, isize *length_ext) |
Reads the contents the file at filename. | |
Defines safe file I/O functions.
Definition in file io.h.
| void ps_file_ctx_init | ( | struct ps_file_ctx * | file_ctx, |
| STR | filename, | ||
| char * | buffer, | ||
| usize | length | ||
| ) |
Reads the contents the file at filename.
The length is reported via length_ext, which must be a valid pointer. The program exits on file I/O error.