diff options
author | dhasenan <dhasenan@gmail.com> | 2018-04-30 20:41:53 -0700 |
---|---|---|
committer | dhasenan <dhasenan@gmail.com> | 2018-04-30 20:46:36 -0700 |
commit | 0d8deb59afda2a03a28f9144d81f1ae62c4813ea (patch) | |
tree | 028cb0e3f7af405b638cc60ef9789c6b23ae5c5e /src/file.h | |
parent | b9f6dfd77e420a068038be828a6e9fb40528346d (diff) |
Don't clobber startup message w/ err opening file
When we opened a file with an unrecognized extension, this was reported
as the same type of failure as if you had specified a file that didn't
exist. The "this is a new file" message clobbered the "failed to read
this file" message.
Fixes #250
Diffstat (limited to 'src/file.h')
-rw-r--r-- | src/file.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -53,7 +53,14 @@ void write_fd(register FILE *f, int r0, int c0, int rn, int cn); void write_cells(register FILE *f, int r0, int c0, int rn, int cn, int dr, int dc); void write_marks(register FILE *f); void write_franges(register FILE *f); -int readfile(char *fname, int eraseflg); + +typedef enum { + SC_READFILE_ERROR = 0, + SC_READFILE_SUCCESS = 1, + SC_READFILE_DOESNTEXIST = 2 +} sc_readfile_result; +sc_readfile_result readfile(char *fname, int eraseflg); + int file_exists(const char * fname); char * findhome(char *path); int backup_file(char *path); |