00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GRU_IOUTILS_H
00017 #define GRU_IOUTILS_H
00018
00019 #include <errno.h>
00020 #include <fcntl.h>
00021 #include <stdbool.h>
00022 #include <stdio.h>
00023
00024 #if !defined(_WIN32) && !defined(_WIN64)
00025 #include <unistd.h>
00026 #else
00027 #include <io.h>
00028 #endif
00029 #include <stdarg.h>
00030 #include <string.h>
00031
00032 #include <sys/stat.h>
00033 #include <sys/types.h>
00034
00035 #include "common/gru_portable.h"
00036 #include "common/gru_status.h"
00037 #include "gru_path.h"
00038
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00057 gru_export bool
00058 gru_io_remap(const char *dir, const char *name, FILE *fd, gru_status_t *status);
00059
00070 gru_export FILE *
00071 gru_io_open_file(const char *dir, const char *name, gru_status_t *status);
00072
00082 gru_export FILE *gru_io_open_file_path(const char *path, gru_status_t *status);
00083
00093 gru_export FILE *
00094 gru_io_open_file_read(const char *dir, const char *name, gru_status_t *status);
00095
00104 gru_export FILE *gru_io_open_file_read_path(const char *path, gru_status_t *status);
00105
00115 gru_export FILE *
00116 gru_io_open_unique_file(const char *dir, const char *name, gru_status_t *status);
00117
00127 gru_export size_t gru_io_read_text_into(char **dest, FILE *file, gru_status_t *status);
00128
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132
00133 #endif