ROOT-Sim core
3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
|
File utilities. More...
Go to the source code of this file.
Functions | |
void * | file_memory_load (FILE *f, int64_t *f_size_p) |
Load a whole file content in a mm_alloc-ed memory buffer. More... | |
FILE * | file_open (const char *open_type, const char *fmt,...) |
A version of fopen() which accepts a printf style format string. More... | |
static void | file_write_chunk (FILE *f, const void *data, size_t data_size) |
Write the content of a memory buffer in a file. More... | |
File utilities.
Some file utility functions
void* file_memory_load | ( | FILE * | f, |
int64_t * | f_size_p | ||
) |
Load a whole file content in a mm_alloc-ed memory buffer.
[in] | f | the file to load |
[out] | f_size_p | a pointer to a variable which will contain with the loaded file size |
FILE* file_open | ( | const char * | open_type, |
const char * | fmt, | ||
... | |||
) |
A version of fopen() which accepts a printf style format string.
open_type | a string which controls how the file is opened (see fopen()) |
fmt | the file name expressed as a printf style format string |
... | the list of additional arguments used in fmt (see printf()) |
|
inlinestatic |
Write the content of a memory buffer in a file.
[in] | f | the file to write |
[in] | data | a pointer to the memory buffer containing the data to write to the file |
[in] | data_size | the size of the memory buffer pointed by data |
Very stupid convenience function which does basic error handling on the actual fwrite() call.