From 98f29f8ad971da6e5d700f01b179c7ad87d5e0d4 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 25 Jul 2019 19:30:27 +0100 Subject: Remove deprecated DohClose in DOH --- Source/DOH/base.c | 19 ------------------- Source/DOH/doh.h | 7 ------- Source/DOH/dohint.h | 1 - Source/DOH/file.c | 22 ---------------------- Source/DOH/string.c | 1 - 5 files changed, 50 deletions(-) (limited to 'Source/DOH') diff --git a/Source/DOH/base.c b/Source/DOH/base.c index 12351dd09..f5e418893 100644 --- a/Source/DOH/base.c +++ b/Source/DOH/base.c @@ -755,25 +755,6 @@ int DohUngetc(int ch, DOH *obj) { return ungetc(ch, (FILE *) b); } -/* ----------------------------------------------------------------------------- - * DohClose() - * ----------------------------------------------------------------------------- */ - -/* -int DohClose(DOH *obj) { - DohBase *b = (DohBase *) obj; - DohObjInfo *objinfo; - if (DohCheck(obj)) { - objinfo = b->type; - if (objinfo->doh_file->doh_close) { - return (objinfo->doh_file->doh_close) (b); - } - return 0; - } - return fclose((FILE *) obj); -} -*/ - /* ----------------------------------------------------------------------------- * DohIsString() * ----------------------------------------------------------------------------- */ diff --git a/Source/DOH/doh.h b/Source/DOH/doh.h index 5a9bae2b3..7cc279ebc 100644 --- a/Source/DOH/doh.h +++ b/Source/DOH/doh.h @@ -103,7 +103,6 @@ #define DohNewFileFromFile DOH_NAMESPACE(NewFileFromFile) #define DohNewFileFromFd DOH_NAMESPACE(NewFileFromFd) #define DohFileErrorDisplay DOH_NAMESPACE(FileErrorDisplay) -#define DohClose DOH_NAMESPACE(Close) #define DohCopyto DOH_NAMESPACE(Copyto) #define DohNewList DOH_NAMESPACE(NewList) #define DohNewHash DOH_NAMESPACE(NewHash) @@ -307,10 +306,6 @@ extern DOHFile *DohNewFile(DOH *filename, const char *mode, DOHList *outfiles); extern DOHFile *DohNewFileFromFile(FILE *f); extern DOHFile *DohNewFileFromFd(int fd); extern void DohFileErrorDisplay(DOHString * filename); -/* - Deprecated, just use DohDelete -extern int DohClose(DOH *file); -*/ extern int DohCopyto(DOHFile * input, DOHFile * output); @@ -392,7 +387,6 @@ extern void DohMemoryDebug(void); /* #define StringChar DohStringChar */ /* #define StringEqual DohStringEqual */ -#define Close DohClose #define vPrintf DohvPrintf #define GetInt DohGetInt #define GetDouble DohGetDouble @@ -424,7 +418,6 @@ extern void DohMemoryDebug(void); #define NewFileFromFile DohNewFileFromFile #define NewFileFromFd DohNewFileFromFd #define FileErrorDisplay DohFileErrorDisplay -#define Close DohClose #define NewVoid DohNewVoid #define Keys DohKeys #define Strcmp DohStrcmp diff --git a/Source/DOH/dohint.h b/Source/DOH/dohint.h index c073bd95b..87def9d3d 100644 --- a/Source/DOH/dohint.h +++ b/Source/DOH/dohint.h @@ -49,7 +49,6 @@ typedef struct { int (*doh_ungetc) (DOH *obj, int ch); /* Unget character */ int (*doh_seek) (DOH *obj, long offset, int whence); /* Seek */ long (*doh_tell) (DOH *obj); /* Tell */ - int (*doh_close) (DOH *obj); /* Close */ } DohFileMethods; /* String methods */ diff --git a/Source/DOH/file.c b/Source/DOH/file.c index 5c56771d0..9fb661a36 100644 --- a/Source/DOH/file.c +++ b/Source/DOH/file.c @@ -166,27 +166,6 @@ static int File_ungetc(DOH *fo, int ch) { return -1; } -/* ----------------------------------------------------------------------------- - * File_close() - * - * Close the file - * ----------------------------------------------------------------------------- */ - -static int File_close(DOH *fo) { - int ret = 0; - DohFile *f = (DohFile *) ObjData(fo); - if (f->filep) { - ret = fclose(f->filep); - f->filep = 0; - } else if (f->fd) { -#ifdef DOH_INTFILE - ret = close(f->fd); - f->fd = 0; -#endif - } - return ret; -} - static DohFileMethods FileFileMethods = { File_read, File_write, @@ -195,7 +174,6 @@ static DohFileMethods FileFileMethods = { File_ungetc, File_seek, File_tell, - File_close, /* close */ }; static DohObjInfo DohFileType = { diff --git a/Source/DOH/string.c b/Source/DOH/string.c index 94d2737fa..6c6728578 100644 --- a/Source/DOH/string.c +++ b/Source/DOH/string.c @@ -987,7 +987,6 @@ static DohFileMethods StringFileMethods = { String_ungetc, String_seek, String_tell, - 0, /* close */ }; static DohStringMethods StringStringMethods = { -- cgit v1.2.3