From 22a8fb03db5bdba75110f944b937678f21221fa7 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 6 Feb 2013 15:17:34 +0400 Subject: Introducing functions global_open() and global_fopen() for these purposes: - Removing duplicate code to generate error message text - In the future they will most likely check secure_file_priv directory. modified: storage/connect/filamdbf.cpp storage/connect/filamfix.cpp storage/connect/filamtxt.cpp storage/connect/filamvct.cpp storage/connect/libdoc.cpp storage/connect/maputil.cpp storage/connect/plgdbsem.h storage/connect/plgdbutl.cpp storage/connect/tabfmt.cpp storage/connect/tabmul.cpp storage/connect/tabxml.cpp storage/connect/xindex.cpp --- storage/connect/plgdbsem.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'storage/connect/plgdbsem.h') diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index e690a0e4efa..13d2f81cdc1 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -508,3 +508,16 @@ DllExport PSZ GetIniString(PGLOBAL, void *, LPCSTR, LPCSTR, LPCSTR, LPCSTR); DllExport int GetIniSize(char *, char *, char *, char *); DllExport bool WritePrivateProfileInt(LPCSTR, LPCSTR, int, LPCSTR); DllExport void NewPointer(PTABS, void *, void *); + + +#define MSGID_NONE 0 +#define MSGID_CANNOT_OPEN 1 +#define MSGID_OPEN_MODE_ERROR 2 +#define MSGID_OPEN_STRERROR 3 +#define MSGID_OPEN_ERROR_AND_STRERROR 4 +#define MSGID_OPEN_MODE_STRERROR 5 +#define MSGID_OPEN_EMPTY_FILE 6 + +FILE *global_fopen(GLOBAL *g, int msgid, const char *path, const char *mode); +int global_open(GLOBAL *g, int msgid, const char *filename, int flags); +int global_open(GLOBAL *g, int msgid, const char *filename, int flags, int mode); -- cgit v1.2.1