diff options
| author | Jan Sucan <jan@jansucan.com> | 2020-12-21 20:14:34 +0100 |
|---|---|---|
| committer | Jan Sucan <jan@jansucan.com> | 2020-12-21 20:14:34 +0100 |
| commit | dda3e054d7341d5e19542702bf970e653b467597 (patch) | |
| tree | 922cebac8ab63b29d66d34be3459b41f13dbc433 | |
| parent | 7ed1ec2d24a755fbdcf285ca7cdd367e5fb1c929 (diff) | |
Remove unnecessary function
| -rw-r--r-- | file.c | 8 | ||||
| -rw-r--r-- | file.h | 3 | ||||
| -rw-r--r-- | main.c | 6 |
3 files changed, 4 insertions, 13 deletions
@@ -22,11 +22,3 @@ file_size(FILE * const file) return size; } - -FILE * -file_open(const char * const path, const char * const mode) -{ - /* TODO: odstranit tuto funkciu? */ - FILE * f = fopen(path, mode); - return f; -} @@ -3,7 +3,6 @@ #include <stdio.h> -long file_size(FILE * const file); -FILE * file_open(const char * const path, const char * const mode); +long file_size(FILE * const file); #endif /* FILE_H */ @@ -30,13 +30,13 @@ open_files(const options_t * const opts, resources_t * const res, bool is_action { /* Open the input file */ if ((opts->in_file_path != NULL) && - ((res->in_file = file_open(opts->in_file_path, "r")) == NULL)) { + ((res->in_file = fopen(opts->in_file_path, "r")) == NULL)) { print_error("cannot open input file: %s", strerror(errno)); return 1; } /* Open the reference file */ - if ((res->ref_file = file_open(opts->ref_file_path, "r")) == NULL) { + if ((res->ref_file = fopen(opts->ref_file_path, "r")) == NULL) { print_error("cannot open reference file: %s", strerror(errno)); return 1; } @@ -56,7 +56,7 @@ open_files(const options_t * const opts, resources_t * const res, bool is_action out_mode[1] = '\0'; } - if ((res->out_file = file_open(opts->out_file_path, out_mode)) == NULL) { + if ((res->out_file = fopen(opts->out_file_path, out_mode)) == NULL) { print_error("cannot open output file: %s", strerror(errno)); return 1; } |
