diff options
Diffstat (limited to 'plugins/SpellChecker/src/hunspell/filemgr.cxx')
-rw-r--r-- | plugins/SpellChecker/src/hunspell/filemgr.cxx | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/plugins/SpellChecker/src/hunspell/filemgr.cxx b/plugins/SpellChecker/src/hunspell/filemgr.cxx deleted file mode 100644 index f6f2c146b2..0000000000 --- a/plugins/SpellChecker/src/hunspell/filemgr.cxx +++ /dev/null @@ -1,45 +0,0 @@ -#include "..\commons.h" - -int FileMgr::fail(const char * err, const char * par) { - fprintf(stderr, err, par); - return -1; -} - -FileMgr::FileMgr(const char * file, const char * key) - : hin(NULL) - , linenum(0) -{ - in[0] = '\0'; - - fin = myfopen(file, "r"); - if (!fin) { - // check hzipped file - char * st = (char *) malloc(strlen(file) + strlen(HZIP_EXTENSION) + 1); - if (st) { - strcpy(st, file); - strcat(st, HZIP_EXTENSION); - hin = new Hunzip(st, key); - free(st); - } - } - if (!fin && !hin) fail(MSG_OPEN, file); -} - -FileMgr::~FileMgr() -{ - if (fin) fclose(fin); - if (hin) delete hin; -} - -char * FileMgr::getline() { - const char * l; - linenum++; - if (fin) return fgets(in, BUFSIZE - 1, fin); - if (hin && ((l = hin->getline()) != NULL)) return strcpy(in, l); - linenum--; - return NULL; -} - -int FileMgr::getlinenum() { - return linenum; -} |