4 /* Open file and return descriptor. Return -1 in case of error. */
5 int open_file_for_writing(const char *file
, _Bool truncate
);
7 /* Return 0, -1 in case of error */
8 int mmap_file(const char *file
, int *fd
, void **buffer
, size_t *length
);
10 /* Return 0, -1 in case of error */
11 int munmap_file(int fd
, void *buffer
, size_t length
);
13 /* Return 0, -1 in case of error.
14 * @length and @mime_type are optional. */
15 int load_data_from_file(const char *file
, void **data
, size_t *length
,
18 int save_data_to_file(const char *file
, const void *data
,
19 const size_t length
, const char *mime_type
);
21 /* Return 0 if @path is directory, 1 if not, -1 if error occured */
22 int is_directory(const char *path
);