1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Prepare fixing MDEV-12149

compile errors on Windows with /Zc:strictStrings
Introduce typedef PCSZ and replace PSZ by it where it matters
  modified:    storage/connect/colblk.h
  modified:    storage/connect/connect.cc
  modified:    storage/connect/domdoc.cpp
  modified:    storage/connect/domdoc.h
  modified:    storage/connect/filamdbf.cpp
  modified:    storage/connect/filamdbf.h
  modified:    storage/connect/filamtxt.h
  modified:    storage/connect/filamvct.cpp
  modified:    storage/connect/filamvct.h
  modified:    storage/connect/filamzip.cpp
  modified:    storage/connect/filamzip.h
  modified:    storage/connect/ha_connect.cc
  modified:    storage/connect/ha_connect.h
  modified:    storage/connect/jdbccat.h
  modified:    storage/connect/jdbconn.cpp
  modified:    storage/connect/jdbconn.h
  modified:    storage/connect/odbccat.h
  modified:    storage/connect/odbconn.cpp
  modified:    storage/connect/odbconn.h
  modified:    storage/connect/os.h
  modified:    storage/connect/plgdbsem.h
  modified:    storage/connect/plgxml.cpp
  modified:    storage/connect/plgxml.h
  modified:    storage/connect/reldef.cpp
  modified:    storage/connect/reldef.h
  modified:    storage/connect/tabdos.h
  modified:    storage/connect/tabext.cpp
  modified:    storage/connect/tabext.h
  modified:    storage/connect/tabfix.h
  modified:    storage/connect/tabfmt.cpp
  modified:    storage/connect/tabjdbc.cpp
  modified:    storage/connect/tabjdbc.h
  modified:    storage/connect/tabjson.cpp
  modified:    storage/connect/tabjson.h
  modified:    storage/connect/tabmgo.h
  modified:    storage/connect/tabmul.h
  modified:    storage/connect/tabmysql.cpp
  modified:    storage/connect/tabmysql.h
  modified:    storage/connect/tabodbc.cpp
  modified:    storage/connect/tabodbc.h
  modified:    storage/connect/tabsys.h
  modified:    storage/connect/tabwmi.cpp
  modified:    storage/connect/tabwmi.h
  modified:    storage/connect/tabxml.cpp
  modified:    storage/connect/tabxml.h
  modified:    storage/connect/tabzip.h
  modified:    storage/connect/xobject.cpp
  modified:    storage/connect/xobject.h
  modified:    storage/connect/xtable.h
This commit is contained in:
Olivier Bertrand
2017-05-06 23:43:02 +02:00
parent d75d61cd6f
commit e7d91cd783
49 changed files with 345 additions and 376 deletions

View File

@@ -154,7 +154,7 @@ class DllExport FIDBLK : public SPCBLK {
virtual void ReadColumn(PGLOBAL g); virtual void ReadColumn(PGLOBAL g);
protected: protected:
PSZ Fn; // The current To_File of the table PCSZ Fn; // The current To_File of the table
OPVAL Op; // The file part operator OPVAL Op; // The file part operator
}; // end of class FIDBLK }; // end of class FIDBLK

View File

@@ -168,7 +168,7 @@ bool CntInfo(PGLOBAL g, PTDB tp, PXF info)
// info->mean_rec_length= tdbp->GetLrecl(); // info->mean_rec_length= tdbp->GetLrecl();
info->mean_rec_length= 0; info->mean_rec_length= 0;
info->data_file_name= (b) ? NULL : tdbp->GetFile(g); info->data_file_name= (b) ? NULL : (char*)tdbp->GetFile(g);
return true; return true;
} else { } else {
info->data_file_length= 0; info->data_file_length= 0;

View File

@@ -89,7 +89,7 @@ DOMDOC::DOMDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp)
/******************************************************************/ /******************************************************************/
/* Initialize XML parser and check library compatibility. */ /* Initialize XML parser and check library compatibility. */
/******************************************************************/ /******************************************************************/
bool DOMDOC::Initialize(PGLOBAL g, char *entry, bool zipped) bool DOMDOC::Initialize(PGLOBAL g, PCSZ entry, bool zipped)
{ {
if (zipped && InitZip(g, entry)) if (zipped && InitZip(g, entry))
return true; return true;

View File

@@ -37,7 +37,7 @@ class DOMDOC : public XMLDOCUMENT {
virtual void SetNofree(bool b) {} // Only libxml2 virtual void SetNofree(bool b) {} // Only libxml2
// Methods // Methods
virtual bool Initialize(PGLOBAL g, char *entry, bool zipped); virtual bool Initialize(PGLOBAL g, PCSZ entry, bool zipped);
virtual bool ParseFile(PGLOBAL g, char *fn); virtual bool ParseFile(PGLOBAL g, char *fn);
virtual bool NewDoc(PGLOBAL g, char *ver); virtual bool NewDoc(PGLOBAL g, char *ver);
virtual void AddComment(PGLOBAL g, char *com); virtual void AddComment(PGLOBAL g, char *com);

View File

@@ -128,7 +128,7 @@ typedef struct _descriptor {
/* Moves file pointer to byte 32; fills buffer at buf with */ /* Moves file pointer to byte 32; fills buffer at buf with */
/* first 32 bytes of file. */ /* first 32 bytes of file. */
/****************************************************************************/ /****************************************************************************/
static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf) static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf)
{ {
char endmark[2]; char endmark[2];
int dbc = 2, rc = RC_OK; int dbc = 2, rc = RC_OK;
@@ -393,7 +393,7 @@ DBFBASE::DBFBASE(DBFBASE *txfp)
/* and header length. Set Records, check that Reclen is equal to lrecl and */ /* and header length. Set Records, check that Reclen is equal to lrecl and */
/* return the header length or 0 in case of error. */ /* return the header length or 0 in case of error. */
/****************************************************************************/ /****************************************************************************/
int DBFBASE::ScanHeader(PGLOBAL g, PSZ fn, int lrecl, int *rln, char *defpath) int DBFBASE::ScanHeader(PGLOBAL g, PCSZ fn, int lrecl, int *rln, PSZ defpath)
{ {
int rc; int rc;
char filename[_MAX_PATH]; char filename[_MAX_PATH];

View File

@@ -31,7 +31,7 @@ class DllExport DBFBASE {
DBFBASE(PDBF txfp); DBFBASE(PDBF txfp);
// Implementation // Implementation
int ScanHeader(PGLOBAL g, PSZ fname, int lrecl, int *rlen, char *defpath); int ScanHeader(PGLOBAL g, PCSZ fname, int lrecl, int *rlen, PSZ defpath);
protected: protected:
// Default constructor, not to be used // Default constructor, not to be used

View File

@@ -80,7 +80,7 @@ class DllExport TXTFAM : public BLOCK {
protected: protected:
// Members // Members
PTDBDOS Tdbp; // To table class PTDBDOS Tdbp; // To table class
PSZ To_File; // Points to table file name PCSZ To_File; // Points to table file name
PFBLOCK To_Fb; // Pointer to file block PFBLOCK To_Fb; // Pointer to file block
PPARM To_Pos; // Pointer to position list PPARM To_Pos; // Pointer to position list
PPARM To_Sos; // Pointer to start position list PPARM To_Sos; // Pointer to start position list

View File

@@ -143,9 +143,9 @@ int VCTFAM::GetFileLength(PGLOBAL g)
{ {
if (Split) { if (Split) {
// Get the total file length // Get the total file length
char filename[_MAX_PATH]; char filename[_MAX_PATH];
char *savfile = To_File; PCSZ savfile = To_File;
int i, len = 0; int i, len = 0;
// Initialize the array of file structures // Initialize the array of file structures
if (!Colfn) { if (!Colfn) {
@@ -313,8 +313,8 @@ int VCTFAM::Cardinality(PGLOBAL g)
// and Last must be set from the file cardinality. // and Last must be set from the file cardinality.
// Only happens when called by sub classes. // Only happens when called by sub classes.
char filename[_MAX_PATH]; char filename[_MAX_PATH];
PSZ savfn = To_File; PCSZ savfn = To_File;
int len, clen, card = -1; int len, clen, card = -1;
PCOLDEF cdp = Tdbp->GetDef()->GetCols(); PCOLDEF cdp = Tdbp->GetDef()->GetCols();
if (!Colfn) { if (!Colfn) {
@@ -368,7 +368,7 @@ int VCTFAM::GetRowID(void)
/***********************************************************************/ /***********************************************************************/
/* VCT Create an empty file for Vector formatted tables. */ /* VCT Create an empty file for Vector formatted tables. */
/***********************************************************************/ /***********************************************************************/
bool VCTFAM::MakeEmptyFile(PGLOBAL g, char *fn) bool VCTFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn)
{ {
// Vector formatted file: this will create an empty file of the // Vector formatted file: this will create an empty file of the
// required length if it does not exists yet. // required length if it does not exists yet.
@@ -3319,7 +3319,7 @@ bool BGVFAM::SetBlockInfo(PGLOBAL g)
/***********************************************************************/ /***********************************************************************/
/* VEC Create an empty file for new Vector formatted tables. */ /* VEC Create an empty file for new Vector formatted tables. */
/***********************************************************************/ /***********************************************************************/
bool BGVFAM::MakeEmptyFile(PGLOBAL g, char *fn) bool BGVFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn)
{ {
// Vector formatted file this will create an empty file of the // Vector formatted file this will create an empty file of the
// required length if it does not exists yet. // required length if it does not exists yet.

View File

@@ -61,7 +61,7 @@ class DllExport VCTFAM : public FIXFAM {
virtual bool WriteBlock(PGLOBAL g, PVCTCOL colp); virtual bool WriteBlock(PGLOBAL g, PVCTCOL colp);
protected: protected:
virtual bool MakeEmptyFile(PGLOBAL g, char *fn); virtual bool MakeEmptyFile(PGLOBAL g, PCSZ fn);
virtual bool OpenTempFile(PGLOBAL g); virtual bool OpenTempFile(PGLOBAL g);
virtual bool MoveLines(PGLOBAL g) {return false;} virtual bool MoveLines(PGLOBAL g) {return false;}
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL);
@@ -235,7 +235,7 @@ class BGVFAM : public VCTFAM {
bool BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, bool b = false); bool BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, bool b = false);
bool BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req); bool BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req);
bool BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req); bool BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req);
virtual bool MakeEmptyFile(PGLOBAL g, char *fn); virtual bool MakeEmptyFile(PGLOBAL g, PCSZ fn);
virtual bool OpenTempFile(PGLOBAL g); virtual bool OpenTempFile(PGLOBAL g);
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL);
virtual bool CleanUnusedSpace(PGLOBAL g); virtual bool CleanUnusedSpace(PGLOBAL g);

View File

@@ -45,12 +45,12 @@
#define WRITEBUFFERSIZE (16384) #define WRITEBUFFERSIZE (16384)
bool ZipLoadFile(PGLOBAL g, char *zfn, char *fn, char *entry, bool append, bool mul); bool ZipLoadFile(PGLOBAL g, PCSZ zfn, PCSZ fn, PCSZ entry, bool append, bool mul);
/***********************************************************************/ /***********************************************************************/
/* Compress a file in zip when creating a table. */ /* Compress a file in zip when creating a table. */
/***********************************************************************/ /***********************************************************************/
static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, char *fn, char *entry, char *buf) static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, PCSZ fn, PCSZ entry, char *buf)
{ {
int rc = RC_OK, size_read, size_buf = WRITEBUFFERSIZE; int rc = RC_OK, size_read, size_buf = WRITEBUFFERSIZE;
FILE *fin; FILE *fin;
@@ -88,7 +88,7 @@ static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, char *fn, char *entry, char *buf)
/***********************************************************************/ /***********************************************************************/
/* Find and Compress several files in zip when creating a table. */ /* Find and Compress several files in zip when creating a table. */
/***********************************************************************/ /***********************************************************************/
static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, char *pat, char *buf) static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf)
{ {
char filename[_MAX_PATH]; char filename[_MAX_PATH];
int rc; int rc;
@@ -203,7 +203,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, char *pat, char *buf)
/***********************************************************************/ /***********************************************************************/
/* Load and Compress a file in zip when creating a table. */ /* Load and Compress a file in zip when creating a table. */
/***********************************************************************/ /***********************************************************************/
bool ZipLoadFile(PGLOBAL g, char *zfn, char *fn, char *entry, bool append, bool mul) bool ZipLoadFile(PGLOBAL g, PCSZ zfn, PCSZ fn, PCSZ entry, bool append, bool mul)
{ {
char *buf; char *buf;
bool err; bool err;
@@ -228,7 +228,7 @@ bool ZipLoadFile(PGLOBAL g, char *zfn, char *fn, char *entry, bool append, bool
/***********************************************************************/ /***********************************************************************/
/* Constructors. */ /* Constructors. */
/***********************************************************************/ /***********************************************************************/
ZIPUTIL::ZIPUTIL(PSZ tgt) ZIPUTIL::ZIPUTIL(PCSZ tgt)
{ {
zipfile = NULL; zipfile = NULL;
target = tgt; target = tgt;
@@ -269,7 +269,7 @@ void ZIPUTIL::getTime(tm_zip& tmZip)
/* append: set true to append the zip file */ /* append: set true to append the zip file */
/* return: true if open, false otherwise. */ /* return: true if open, false otherwise. */
/***********************************************************************/ /***********************************************************************/
bool ZIPUTIL::open(PGLOBAL g, char *filename, bool append) bool ZIPUTIL::open(PGLOBAL g, PCSZ filename, bool append)
{ {
if (!zipfile && !(zipfile = zipOpen64(filename, if (!zipfile && !(zipfile = zipOpen64(filename,
append ? APPEND_STATUS_ADDINZIP append ? APPEND_STATUS_ADDINZIP
@@ -295,7 +295,7 @@ void ZIPUTIL::close()
/***********************************************************************/ /***********************************************************************/
/* OpenTableFile: Open a DOS/UNIX table file from a ZIP file. */ /* OpenTableFile: Open a DOS/UNIX table file from a ZIP file. */
/***********************************************************************/ /***********************************************************************/
bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append) bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, PCSZ fn, bool append)
{ {
/*********************************************************************/ /*********************************************************************/
/* The file will be compressed. */ /* The file will be compressed. */
@@ -338,7 +338,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, char *fn, bool append)
/***********************************************************************/ /***********************************************************************/
/* Add target in zip file. */ /* Add target in zip file. */
/***********************************************************************/ /***********************************************************************/
bool ZIPUTIL::addEntry(PGLOBAL g, char *entry) bool ZIPUTIL::addEntry(PGLOBAL g, PCSZ entry)
{ {
//?? we dont need the stinking time //?? we dont need the stinking time
zip_fileinfo zi = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; zip_fileinfo zi = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@@ -382,7 +382,7 @@ void ZIPUTIL::closeEntry()
/***********************************************************************/ /***********************************************************************/
/* Constructors. */ /* Constructors. */
/***********************************************************************/ /***********************************************************************/
UNZIPUTL::UNZIPUTL(PSZ tgt, bool mul) UNZIPUTL::UNZIPUTL(PCSZ tgt, bool mul)
{ {
zipfile = NULL; zipfile = NULL;
target = tgt; target = tgt;
@@ -439,8 +439,8 @@ UNZIPUTL::UNZIPUTL(PZIPUTIL zutp)
/* This code is the copyright property of Alessandro Felice Cantatore. */ /* This code is the copyright property of Alessandro Felice Cantatore. */
/* http://xoomer.virgilio.it/acantato/dev/wildcard/wildmatch.html */ /* http://xoomer.virgilio.it/acantato/dev/wildcard/wildmatch.html */
/***********************************************************************/ /***********************************************************************/
bool UNZIPUTL::WildMatch(PSZ pat, PSZ str) { bool UNZIPUTL::WildMatch(PCSZ pat, PCSZ str) {
PSZ s, p; PCSZ s, p;
bool star = FALSE; bool star = FALSE;
loopStart: loopStart:
@@ -474,7 +474,7 @@ starCheck:
/* param: filename path and the filename of the zip file to open. */ /* param: filename path and the filename of the zip file to open. */
/* return: true if open, false otherwise. */ /* return: true if open, false otherwise. */
/***********************************************************************/ /***********************************************************************/
bool UNZIPUTL::open(PGLOBAL g, char *filename) bool UNZIPUTL::open(PGLOBAL g, PCSZ filename)
{ {
if (!zipfile && !(zipfile = unzOpen64(filename))) if (!zipfile && !(zipfile = unzOpen64(filename)))
sprintf(g->Message, "Zipfile open error on %s", filename); sprintf(g->Message, "Zipfile open error on %s", filename);
@@ -564,7 +564,7 @@ int UNZIPUTL::nextEntry(PGLOBAL g)
/***********************************************************************/ /***********************************************************************/
/* OpenTableFile: Open a DOS/UNIX table file from a ZIP file. */ /* OpenTableFile: Open a DOS/UNIX table file from a ZIP file. */
/***********************************************************************/ /***********************************************************************/
bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, char *fn) bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, PCSZ fn)
{ {
/*********************************************************************/ /*********************************************************************/
/* The file will be decompressed into virtual memory. */ /* The file will be decompressed into virtual memory. */
@@ -636,7 +636,7 @@ bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, char *fn)
/***********************************************************************/ /***********************************************************************/
/* Insert only if the entry does not exist. */ /* Insert only if the entry does not exist. */
/***********************************************************************/ /***********************************************************************/
bool UNZIPUTL::IsInsertOk(PGLOBAL g, char *fn) bool UNZIPUTL::IsInsertOk(PGLOBAL g, PCSZ fn)
{ {
bool ok = true, b = open(g, fn); bool ok = true, b = open(g, fn);

View File

@@ -27,16 +27,13 @@ typedef class ZPXFAM *PZPXFAM;
class DllExport ZIPUTIL : public BLOCK { class DllExport ZIPUTIL : public BLOCK {
public: public:
// Constructor // Constructor
ZIPUTIL(PSZ tgt); ZIPUTIL(PCSZ tgt);
//ZIPUTIL(ZIPUTIL *zutp); //ZIPUTIL(ZIPUTIL *zutp);
// Implementation
//PTXF Duplicate(PGLOBAL g) { return (PTXF) new(g)UNZFAM(this); }
// Methods // Methods
bool OpenTable(PGLOBAL g, MODE mode, char *fn, bool append); bool OpenTable(PGLOBAL g, MODE mode, PCSZ fn, bool append);
bool open(PGLOBAL g, char *fn, bool append); bool open(PGLOBAL g, PCSZ fn, bool append);
bool addEntry(PGLOBAL g, char *entry); bool addEntry(PGLOBAL g, PCSZ entry);
void close(void); void close(void);
void closeEntry(void); void closeEntry(void);
int writeEntry(PGLOBAL g, char *buf, int len); int writeEntry(PGLOBAL g, char *buf, int len);
@@ -44,16 +41,10 @@ class DllExport ZIPUTIL : public BLOCK {
// Members // Members
zipFile zipfile; // The ZIP container file zipFile zipfile; // The ZIP container file
PSZ target; // The target file name PCSZ target; // The target file name
PSZ pwd; // The ZIP file password PCSZ pwd; // The ZIP file password
//unz_file_info finfo; // The current file info
PFBLOCK fp; PFBLOCK fp;
//char *memory;
//uint size;
//int multiple; // Multiple targets
bool entryopen; // True when open current entry bool entryopen; // True when open current entry
//char fn[FILENAME_MAX]; // The current entry file name
//char mapCaseTable[256];
}; // end of ZIPUTIL }; // end of ZIPUTIL
/***********************************************************************/ /***********************************************************************/
@@ -62,27 +53,27 @@ class DllExport ZIPUTIL : public BLOCK {
class DllExport UNZIPUTL : public BLOCK { class DllExport UNZIPUTL : public BLOCK {
public: public:
// Constructor // Constructor
UNZIPUTL(PSZ tgt, bool mul); UNZIPUTL(PCSZ tgt, bool mul);
UNZIPUTL(PDOSDEF tdp); UNZIPUTL(PDOSDEF tdp);
// Implementation // Implementation
//PTXF Duplicate(PGLOBAL g) { return (PTXF) new(g)UNZFAM(this); } //PTXF Duplicate(PGLOBAL g) { return (PTXF) new(g)UNZFAM(this); }
// Methods // Methods
bool OpenTable(PGLOBAL g, MODE mode, char *fn); bool OpenTable(PGLOBAL g, MODE mode, PCSZ fn);
bool open(PGLOBAL g, char *fn); bool open(PGLOBAL g, PCSZ fn);
bool openEntry(PGLOBAL g); bool openEntry(PGLOBAL g);
void close(void); void close(void);
void closeEntry(void); void closeEntry(void);
bool WildMatch(PSZ pat, PSZ str); bool WildMatch(PCSZ pat, PCSZ str);
int findEntry(PGLOBAL g, bool next); int findEntry(PGLOBAL g, bool next);
int nextEntry(PGLOBAL g); int nextEntry(PGLOBAL g);
bool IsInsertOk(PGLOBAL g, char *fn); bool IsInsertOk(PGLOBAL g, PCSZ fn);
// Members // Members
unzFile zipfile; // The ZIP container file unzFile zipfile; // The ZIP container file
PSZ target; // The target file name PCSZ target; // The target file name
PSZ pwd; // The ZIP file password PCSZ pwd; // The ZIP file password
unz_file_info finfo; // The current file info unz_file_info finfo; // The current file info
PFBLOCK fp; PFBLOCK fp;
char *memory; char *memory;
@@ -123,8 +114,6 @@ class DllExport UNZFAM : public MAPFAM {
// Members // Members
UNZIPUTL *zutp; UNZIPUTL *zutp;
PDOSDEF tdfp; PDOSDEF tdfp;
//PSZ target;
//bool mul;
}; // end of UNZFAM }; // end of UNZFAM
/***********************************************************************/ /***********************************************************************/
@@ -152,8 +141,6 @@ class DllExport UZXFAM : public MPXFAM {
// Members // Members
UNZIPUTL *zutp; UNZIPUTL *zutp;
PDOSDEF tdfp; PDOSDEF tdfp;
//PSZ target;
//bool mul;
}; // end of UZXFAM }; // end of UZXFAM
/***********************************************************************/ /***********************************************************************/
@@ -180,7 +167,7 @@ class DllExport ZIPFAM : public DOSFAM {
protected: protected:
// Members // Members
ZIPUTIL *zutp; ZIPUTIL *zutp;
PSZ target; PCSZ target;
bool append; bool append;
//bool replace; //bool replace;
}; // end of ZIPFAM }; // end of ZIPFAM
@@ -206,7 +193,7 @@ class DllExport ZPXFAM : public FIXFAM {
protected: protected:
// Members // Members
ZIPUTIL *zutp; ZIPUTIL *zutp;
PSZ target; PCSZ target;
bool append; bool append;
}; // end of ZPXFAM }; // end of ZPXFAM

View File

@@ -216,9 +216,9 @@ PQRYRES MGOColumns(PGLOBAL g, char *db, PTOS topt, bool info);
#endif // MONGO_SUPPORT #endif // MONGO_SUPPORT
int TranslateJDBCType(int stp, char *tn, int prec, int& len, char& v); int TranslateJDBCType(int stp, char *tn, int prec, int& len, char& v);
void PushWarning(PGLOBAL g, THD *thd, int level); void PushWarning(PGLOBAL g, THD *thd, int level);
bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host, bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, PCSZ host, PCSZ db,
const char *db, char *tab, const char *src, int port); PCSZ tab, PCSZ src, int port);
bool ZipLoadFile(PGLOBAL, char*, char*, char*, bool, bool); bool ZipLoadFile(PGLOBAL, PCSZ, PCSZ, PCSZ, bool, bool);
bool ExactInfo(void); bool ExactInfo(void);
void mongo_init(bool); void mongo_init(bool);
USETEMP UseTemp(void); USETEMP UseTemp(void);
@@ -1030,15 +1030,14 @@ ulonglong ha_connect::table_flags() const
/****************************************************************************/ /****************************************************************************/
/* Return the value of an option specified in an option list. */ /* Return the value of an option specified in an option list. */
/****************************************************************************/ /****************************************************************************/
char *GetListOption(PGLOBAL g, const char *opname, PCSZ GetListOption(PGLOBAL g, PCSZ opname, PCSZ oplist, PCSZ def)
const char *oplist, const char *def)
{ {
if (!oplist) if (!oplist)
return (char*)def; return (char*)def;
char key[16], val[256]; char key[16], val[256];
char *pk, *pv, *pn; char *pk, *pv, *pn;
char *opval= (char*)def; PCSZ opval= def;
int n; int n;
for (pk= (char*)oplist; pk; pk= ++pn) { for (pk= (char*)oplist; pk; pk= ++pn) {
@@ -1074,9 +1073,9 @@ char *GetListOption(PGLOBAL g, const char *opname,
/****************************************************************************/ /****************************************************************************/
/* Return the value of a string option or NULL if not specified. */ /* Return the value of a string option or NULL if not specified. */
/****************************************************************************/ /****************************************************************************/
char *GetStringTableOption(PGLOBAL g, PTOS options, char *opname, char *sdef) PCSZ GetStringTableOption(PGLOBAL g, PTOS options, PCSZ opname, PCSZ sdef)
{ {
const char *opval= NULL; PCSZ opval= NULL;
if (!options) if (!options)
return sdef; return sdef;
@@ -1119,10 +1118,10 @@ char *GetStringTableOption(PGLOBAL g, PTOS options, char *opname, char *sdef)
/****************************************************************************/ /****************************************************************************/
/* Return the value of a Boolean option or bdef if not specified. */ /* Return the value of a Boolean option or bdef if not specified. */
/****************************************************************************/ /****************************************************************************/
bool GetBooleanTableOption(PGLOBAL g, PTOS options, char *opname, bool bdef) bool GetBooleanTableOption(PGLOBAL g, PTOS options, PCSZ opname, bool bdef)
{ {
bool opval= bdef; bool opval= bdef;
char *pv; PCSZ pv;
if (!options) if (!options)
return bdef; return bdef;
@@ -1150,7 +1149,7 @@ bool GetBooleanTableOption(PGLOBAL g, PTOS options, char *opname, bool bdef)
/****************************************************************************/ /****************************************************************************/
/* Return the value of an integer option or NO_IVAL if not specified. */ /* Return the value of an integer option or NO_IVAL if not specified. */
/****************************************************************************/ /****************************************************************************/
int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef) int GetIntegerTableOption(PGLOBAL g, PTOS options, PCSZ opname, int idef)
{ {
ulonglong opval= (ulonglong) NO_IVAL; ulonglong opval= (ulonglong) NO_IVAL;
@@ -1172,10 +1171,10 @@ int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef)
opval= (options->compressed); opval= (options->compressed);
if ((ulonglong) opval == (ulonglong)NO_IVAL) { if ((ulonglong) opval == (ulonglong)NO_IVAL) {
char *pv; PCSZ pv;
if ((pv= GetListOption(g, opname, options->oplist))) if ((pv= GetListOption(g, opname, options->oplist)))
opval= CharToNumber(pv, strlen(pv), ULONGLONG_MAX, true); opval= CharToNumber((char*)pv, strlen(pv), ULONGLONG_MAX, true);
else else
return idef; return idef;
@@ -1200,7 +1199,7 @@ PTOS ha_connect::GetTableOptionStruct(TABLE_SHARE *s)
/****************************************************************************/ /****************************************************************************/
/* Return the string eventually formatted with partition name. */ /* Return the string eventually formatted with partition name. */
/****************************************************************************/ /****************************************************************************/
char *ha_connect::GetRealString(const char *s) char *ha_connect::GetRealString(PCSZ s)
{ {
char *sv; char *sv;
@@ -1217,10 +1216,10 @@ char *ha_connect::GetRealString(const char *s)
/****************************************************************************/ /****************************************************************************/
/* Return the value of a string option or sdef if not specified. */ /* Return the value of a string option or sdef if not specified. */
/****************************************************************************/ /****************************************************************************/
char *ha_connect::GetStringOption(char *opname, char *sdef) PCSZ ha_connect::GetStringOption(PCSZ opname, PCSZ sdef)
{ {
char *opval= NULL; PCSZ opval= NULL;
PTOS options= GetTableOptionStruct(); PTOS options= GetTableOptionStruct();
if (!stricmp(opname, "Connect")) { if (!stricmp(opname, "Connect")) {
LEX_STRING cnc= (tshp) ? tshp->connect_string LEX_STRING cnc= (tshp) ? tshp->connect_string
@@ -1279,7 +1278,7 @@ char *ha_connect::GetStringOption(char *opname, char *sdef)
/****************************************************************************/ /****************************************************************************/
/* Return the value of a Boolean option or bdef if not specified. */ /* Return the value of a Boolean option or bdef if not specified. */
/****************************************************************************/ /****************************************************************************/
bool ha_connect::GetBooleanOption(char *opname, bool bdef) bool ha_connect::GetBooleanOption(PCSZ opname, bool bdef)
{ {
bool opval; bool opval;
PTOS options= GetTableOptionStruct(); PTOS options= GetTableOptionStruct();
@@ -1296,7 +1295,7 @@ bool ha_connect::GetBooleanOption(char *opname, bool bdef)
/* Set the value of the opname option (does not work for oplist options) */ /* Set the value of the opname option (does not work for oplist options) */
/* Currently used only to set the Sepindex value. */ /* Currently used only to set the Sepindex value. */
/****************************************************************************/ /****************************************************************************/
bool ha_connect::SetBooleanOption(char *opname, bool b) bool ha_connect::SetBooleanOption(PCSZ opname, bool b)
{ {
PTOS options= GetTableOptionStruct(); PTOS options= GetTableOptionStruct();
@@ -1314,7 +1313,7 @@ bool ha_connect::SetBooleanOption(char *opname, bool b)
/****************************************************************************/ /****************************************************************************/
/* Return the value of an integer option or NO_IVAL if not specified. */ /* Return the value of an integer option or NO_IVAL if not specified. */
/****************************************************************************/ /****************************************************************************/
int ha_connect::GetIntegerOption(char *opname) int ha_connect::GetIntegerOption(PCSZ opname)
{ {
int opval; int opval;
PTOS options= GetTableOptionStruct(); PTOS options= GetTableOptionStruct();
@@ -1334,7 +1333,7 @@ int ha_connect::GetIntegerOption(char *opname)
/* Set the value of the opname option (does not work for oplist options) */ /* Set the value of the opname option (does not work for oplist options) */
/* Currently used only to set the Lrecl value. */ /* Currently used only to set the Lrecl value. */
/****************************************************************************/ /****************************************************************************/
bool ha_connect::SetIntegerOption(char *opname, int n) bool ha_connect::SetIntegerOption(PCSZ opname, int n)
{ {
PTOS options= GetTableOptionStruct(); PTOS options= GetTableOptionStruct();
@@ -1534,7 +1533,7 @@ PXOS ha_connect::GetIndexOptionStruct(KEY *kp)
/****************************************************************************/ /****************************************************************************/
/* Return a Boolean index option or false if not specified. */ /* Return a Boolean index option or false if not specified. */
/****************************************************************************/ /****************************************************************************/
bool ha_connect::GetIndexOption(KEY *kp, char *opname) bool ha_connect::GetIndexOption(KEY *kp, PCSZ opname)
{ {
bool opval= false; bool opval= false;
PXOS options= GetIndexOptionStruct(kp); PXOS options= GetIndexOptionStruct(kp);
@@ -1546,7 +1545,7 @@ bool ha_connect::GetIndexOption(KEY *kp, char *opname)
opval= options->mapped; opval= options->mapped;
} else if (kp->comment.str && kp->comment.length) { } else if (kp->comment.str && kp->comment.length) {
char *pv, *oplist= strz(xp->g, kp->comment); PCSZ pv, oplist= strz(xp->g, kp->comment);
if ((pv= GetListOption(xp->g, opname, oplist))) if ((pv= GetListOption(xp->g, opname, oplist)))
opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0); opval= (!*pv || *pv == 'y' || *pv == 'Y' || atoi(pv) != 0);
@@ -5036,8 +5035,8 @@ ha_rows ha_connect::records_in_range(uint inx, key_range *min_key,
} // end of records_in_range } // end of records_in_range
// Used to check whether a MYSQL table is created on itself // Used to check whether a MYSQL table is created on itself
bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host, bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, PCSZ host,
const char *db, char *tab, const char *src, int port) PCSZ db, PCSZ tab, PCSZ src, int port)
{ {
if (src) if (src)
return false; return false;
@@ -5273,41 +5272,41 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
TABLE_SHARE *table_s, TABLE_SHARE *table_s,
HA_CREATE_INFO *create_info) HA_CREATE_INFO *create_info)
{ {
char v=0; char v=0;
const char *fncn= "?"; PCSZ fncn= "?";
const char *user, *fn, *db, *host, *pwd, *sep, *tbl, *src; PCSZ user, fn, db, host, pwd, sep, tbl, src;
const char *col, *ocl, *rnk, *pic, *fcl, *skc, *zfn; PCSZ col, ocl, rnk, pic, fcl, skc, zfn;
char *tab, *dsn, *shm, *dpath; char *tab, *dsn, *shm, *dpath;
#if defined(__WIN__) #if defined(__WIN__)
char *nsp= NULL, *cls= NULL; PCSZ nsp= NULL, cls= NULL;
#endif // __WIN__ #endif // __WIN__
//int hdr, mxe; //int hdr, mxe;
int port = 0, mxr = 0, rc = 0, mul = 0, lrecl = 0; int port = 0, mxr = 0, rc = 0, mul = 0, lrecl = 0;
#if defined(ODBC_SUPPORT) #if defined(ODBC_SUPPORT)
POPARM sop= NULL; POPARM sop= NULL;
char *ucnc= NULL; PCSZ ucnc= NULL;
bool cnc= false; bool cnc= false;
int cto= -1, qto= -1; int cto= -1, qto= -1;
#endif // ODBC_SUPPORT #endif // ODBC_SUPPORT
#if defined(JDBC_SUPPORT) #if defined(JDBC_SUPPORT)
PJPARM sjp= NULL; PJPARM sjp= NULL;
char *driver= NULL; PCSZ driver= NULL;
char *url= NULL; char *url= NULL;
//char *prop= NULL; //char *prop= NULL;
char *tabtyp= NULL; PCSZ tabtyp= NULL;
#endif // JDBC_SUPPORT #endif // JDBC_SUPPORT
uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL); uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL);
bool bif, ok= false, dbf= false; bool bif, ok= false, dbf= false;
TABTYPE ttp= TAB_UNDEF; TABTYPE ttp= TAB_UNDEF;
PQRYRES qrp= NULL; PQRYRES qrp= NULL;
PCOLRES crp; PCOLRES crp;
PCONNECT xp= NULL; PCONNECT xp= NULL;
PGLOBAL g= GetPlug(thd, xp); PGLOBAL g= GetPlug(thd, xp);
PDBUSER dup= PlgGetUser(g); PDBUSER dup= PlgGetUser(g);
PCATLG cat= (dup) ? dup->Catalog : NULL; PCATLG cat= (dup) ? dup->Catalog : NULL;
PTOS topt= table_s->option_struct; PTOS topt= table_s->option_struct;
char buf[1024]; char buf[1024];
String sql(buf, sizeof(buf), system_charset_info); String sql(buf, sizeof(buf), system_charset_info);
sql.copy(STRING_WITH_LEN("CREATE TABLE whatever ("), system_charset_info); sql.copy(STRING_WITH_LEN("CREATE TABLE whatever ("), system_charset_info);
@@ -5472,7 +5471,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
ok = true; ok = true;
} else if (rc == RC_NF) { } else if (rc == RC_NF) {
if (jdef->GetTabname()) if (jdef->GetTabname())
tab = jdef->GetTabname(); tab = (char*)jdef->GetTabname();
ok = jdef->SetParms(sjp); ok = jdef->SetParms(sjp);
} // endif rc } // endif rc
@@ -5518,7 +5517,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
db = mydef->GetTabschema(); db = mydef->GetTabschema();
if (mydef->GetTabname()) if (mydef->GetTabname())
tab = mydef->GetTabname(); tab = (char*)mydef->GetTabname();
if (mydef->GetPortnumber()) if (mydef->GetPortnumber())
port = mydef->GetPortnumber(); port = mydef->GetPortnumber();
@@ -6143,8 +6142,8 @@ int ha_connect::create(const char *name, TABLE *table_arg,
if (!part_info) if (!part_info)
#endif // WITH_PARTITION_STORAGE_ENGINE #endif // WITH_PARTITION_STORAGE_ENGINE
{const char *src= options->srcdef; {const char *src= options->srcdef;
char *host, *db, *tab= (char*)options->tabname; PCSZ host, db, tab= options->tabname;
int port; int port;
host= GetListOption(g, "host", options->oplist, NULL); host= GetListOption(g, "host", options->oplist, NULL);
db= GetStringOption("database", NULL); db= GetStringOption("database", NULL);
@@ -6188,8 +6187,8 @@ int ha_connect::create(const char *name, TABLE *table_arg,
} // endswitch ttp } // endswitch ttp
if (type == TAB_XML) { if (type == TAB_XML) {
bool dom; // True: MS-DOM, False libxml2 bool dom; // True: MS-DOM, False libxml2
char *xsup= GetListOption(g, "Xmlsup", options->oplist, "*"); PCSZ xsup= GetListOption(g, "Xmlsup", options->oplist, "*");
// Note that if no support is specified, the default is MS-DOM // Note that if no support is specified, the default is MS-DOM
// on Windows and libxml2 otherwise // on Windows and libxml2 otherwise
@@ -6449,15 +6448,15 @@ int ha_connect::create(const char *name, TABLE *table_arg,
if (options->zipped) { if (options->zipped) {
// Check whether the zip entry must be made from a file // Check whether the zip entry must be made from a file
char *fn = GetListOption(g, "Load", options->oplist, NULL); PCSZ fn = GetListOption(g, "Load", options->oplist, NULL);
if (fn) { if (fn) {
char zbuf[_MAX_PATH], buf[_MAX_PATH], dbpath[_MAX_PATH]; char zbuf[_MAX_PATH], buf[_MAX_PATH], dbpath[_MAX_PATH];
char *entry = GetListOption(g, "Entry", options->oplist, NULL); PCSZ entry = GetListOption(g, "Entry", options->oplist, NULL);
char *a = GetListOption(g, "Append", options->oplist, "NO"); PCSZ a = GetListOption(g, "Append", options->oplist, "NO");
bool append = *a == '1' || *a == 'Y' || *a == 'y' || !stricmp(a, "ON"); bool append = *a == '1' || *a == 'Y' || *a == 'y' || !stricmp(a, "ON");
char *m = GetListOption(g, "Mulentries", options->oplist, "NO"); PCSZ m = GetListOption(g, "Mulentries", options->oplist, "NO");
bool mul = *m == '1' || *m == 'Y' || *m == 'y' || !stricmp(m, "ON"); bool mul = *m == '1' || *m == 'Y' || *m == 'y' || !stricmp(m, "ON");
if (!entry && !mul) { if (!entry && !mul) {
my_message(ER_UNKNOWN_ERROR, "Missing entry name", MYF(0)); my_message(ER_UNKNOWN_ERROR, "Missing entry name", MYF(0));
@@ -6642,9 +6641,9 @@ bool ha_connect::CheckString(const char *str1, const char *str2)
/** /**
check whether a string option have changed check whether a string option have changed
*/ */
bool ha_connect::SameString(TABLE *tab, char *opn) bool ha_connect::SameString(TABLE *tab, PCSZ opn)
{ {
char *str1, *str2; PCSZ str1, str2;
tshp= tab->s; // The altered table tshp= tab->s; // The altered table
str1= GetStringOption(opn); str1= GetStringOption(opn);
@@ -6656,7 +6655,7 @@ bool ha_connect::SameString(TABLE *tab, char *opn)
/** /**
check whether a Boolean option have changed check whether a Boolean option have changed
*/ */
bool ha_connect::SameBool(TABLE *tab, char *opn) bool ha_connect::SameBool(TABLE *tab, PCSZ opn)
{ {
bool b1, b2; bool b1, b2;
@@ -6670,7 +6669,7 @@ bool ha_connect::SameBool(TABLE *tab, char *opn)
/** /**
check whether an integer option have changed check whether an integer option have changed
*/ */
bool ha_connect::SameInt(TABLE *tab, char *opn) bool ha_connect::SameInt(TABLE *tab, PCSZ opn)
{ {
int i1, i2; int i1, i2;
@@ -6849,7 +6848,7 @@ ha_connect::check_if_supported_inplace_alter(TABLE *altered_table,
// Conversion to outward table is only allowed for file based // Conversion to outward table is only allowed for file based
// tables whose file does not exist. // tables whose file does not exist.
tshp= altered_table->s; tshp= altered_table->s;
char *fn= GetStringOption("filename"); PCSZ fn= GetStringOption("filename");
tshp= NULL; tshp= NULL;
if (FileExists(fn, false)) { if (FileExists(fn, false)) {

View File

@@ -61,7 +61,7 @@ public:
oldopn= newopn= NULL; oldopn= newopn= NULL;
oldpix= newpix= NULL;} oldpix= newpix= NULL;}
inline char *SetName(PGLOBAL g, char *name) {return PlugDup(g, name);} inline char *SetName(PGLOBAL g, PCSZ name) {return PlugDup(g, name);}
bool oldsep; // Sepindex before create/alter bool oldsep; // Sepindex before create/alter
bool newsep; // Sepindex after create/alter bool newsep; // Sepindex after create/alter
@@ -168,18 +168,18 @@ public:
static bool connect_init(void); static bool connect_init(void);
static bool connect_end(void); static bool connect_end(void);
TABTYPE GetRealType(PTOS pos= NULL); TABTYPE GetRealType(PTOS pos= NULL);
char *GetRealString(const char *s); char *GetRealString(PCSZ s);
char *GetStringOption(char *opname, char *sdef= NULL); PCSZ GetStringOption(PCSZ opname, PCSZ sdef= NULL);
PTOS GetTableOptionStruct(TABLE_SHARE *s= NULL); PTOS GetTableOptionStruct(TABLE_SHARE *s= NULL);
bool GetBooleanOption(char *opname, bool bdef); bool GetBooleanOption(PCSZ opname, bool bdef);
bool SetBooleanOption(char *opname, bool b); bool SetBooleanOption(PCSZ opname, bool b);
int GetIntegerOption(char *opname); int GetIntegerOption(PCSZ opname);
bool GetIndexOption(KEY *kp, char *opname); bool GetIndexOption(KEY *kp, PCSZ opname);
bool CheckString(const char *str1, const char *str2); bool CheckString(PCSZ str1, PCSZ str2);
bool SameString(TABLE *tab, char *opn); bool SameString(TABLE *tab, PCSZ opn);
bool SetIntegerOption(char *opname, int n); bool SetIntegerOption(PCSZ opname, int n);
bool SameInt(TABLE *tab, char *opn); bool SameInt(TABLE *tab, PCSZ opn);
bool SameBool(TABLE *tab, char *opn); bool SameBool(TABLE *tab, PCSZ opn);
bool FileExists(const char *fn, bool bf); bool FileExists(const char *fn, bool bf);
bool NoFieldOptionChange(TABLE *tab); bool NoFieldOptionChange(TABLE *tab);
PFOS GetFieldOptionStruct(Field *fp); PFOS GetFieldOptionStruct(Field *fp);
@@ -187,7 +187,7 @@ public:
PXOS GetIndexOptionStruct(KEY *kp); PXOS GetIndexOptionStruct(KEY *kp);
PIXDEF GetIndexInfo(TABLE_SHARE *s= NULL); PIXDEF GetIndexInfo(TABLE_SHARE *s= NULL);
bool CheckVirtualIndex(TABLE_SHARE *s); bool CheckVirtualIndex(TABLE_SHARE *s);
const char *GetDBName(const char *name); const char *GetDBName(PCSZ name);
const char *GetTableName(void); const char *GetTableName(void);
char *GetPartName(void); char *GetPartName(void);
//int GetColNameLen(Field *fp); //int GetColNameLen(Field *fp);
@@ -199,7 +199,7 @@ public:
bool IsUnique(uint n); bool IsUnique(uint n);
char *GetDataPath(void) {return (char*)datapath;} char *GetDataPath(void) {return (char*)datapath;}
bool SetDataPath(PGLOBAL g, const char *path); bool SetDataPath(PGLOBAL g, PCSZ path);
PTDB GetTDB(PGLOBAL g); PTDB GetTDB(PGLOBAL g);
int OpenTable(PGLOBAL g, bool del= false); int OpenTable(PGLOBAL g, bool del= false);
bool CheckColumnList(PGLOBAL g); bool CheckColumnList(PGLOBAL g);

View File

@@ -4,10 +4,10 @@
typedef struct jdbc_parms { typedef struct jdbc_parms {
int CheckSize(int rows); int CheckSize(int rows);
char *Driver; // JDBC driver PCSZ Driver; // JDBC driver
char *Url; // Driver URL PCSZ Url; // Driver URL
char *User; // User connect info PCSZ User; // User connect info
char *Pwd; // Password connect info PCSZ Pwd; // Password connect info
//char *Properties; // Connection property list //char *Properties; // Connection property list
//int Cto; // Connect timeout //int Cto; // Connect timeout
//int Qto; // Query timeout //int Qto; // Query timeout
@@ -19,12 +19,12 @@ typedef struct jdbc_parms {
/* JDBC catalog function prototypes. */ /* JDBC catalog function prototypes. */
/***********************************************************************/ /***********************************************************************/
#if defined(PROMPT_OK) #if defined(PROMPT_OK)
char *JDBCCheckConnection(PGLOBAL g, char *dsn, int cop); char *JDBCCheckConnection(PGLOBAL g, PCSZ dsn, int cop);
#endif // PROMPT_OK #endif // PROMPT_OK
//PQRYRES JDBCDataSources(PGLOBAL g, int maxres, bool info); //PQRYRES JDBCDataSources(PGLOBAL g, int maxres, bool info);
PQRYRES JDBCColumns(PGLOBAL g, char *db, char *table, PQRYRES JDBCColumns(PGLOBAL g, PCSZ db, PCSZ table,
char *colpat, int maxres, bool info, PJPARM sop); PCSZ colpat, int maxres, bool info, PJPARM sop);
PQRYRES JDBCSrcCols(PGLOBAL g, char *src, PJPARM sop); PQRYRES JDBCSrcCols(PGLOBAL g, PCSZ src, PJPARM sop);
PQRYRES JDBCTables(PGLOBAL g, char *db, char *tabpat, PQRYRES JDBCTables(PGLOBAL g, PCSZ db, PCSZ tabpat,
char *tabtyp, int maxres, bool info, PJPARM sop); PCSZ tabtyp, int maxres, bool info, PJPARM sop);
PQRYRES JDBCDrivers(PGLOBAL g, int maxres, bool info); PQRYRES JDBCDrivers(PGLOBAL g, int maxres, bool info);

View File

@@ -189,8 +189,8 @@ int TranslateJDBCType(int stp, char *tn, int prec, int& len, char& v)
/***********************************************************************/ /***********************************************************************/
/* Allocate the structure used to refer to the result set. */ /* Allocate the structure used to refer to the result set. */
/***********************************************************************/ /***********************************************************************/
static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, char *db, static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, PCSZ db,
char *tab, PQRYRES qrp) PCSZ tab, PQRYRES qrp)
{ {
JCATPARM *cap; JCATPARM *cap;
@@ -213,7 +213,7 @@ static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, char *db,
/* JDBCColumns: constructs the result blocks containing all columns */ /* JDBCColumns: constructs the result blocks containing all columns */
/* of a JDBC table that will be retrieved by GetData commands. */ /* of a JDBC table that will be retrieved by GetData commands. */
/***********************************************************************/ /***********************************************************************/
PQRYRES JDBCColumns(PGLOBAL g, char *db, char *table, char *colpat, PQRYRES JDBCColumns(PGLOBAL g, PCSZ db, PCSZ table, PCSZ colpat,
int maxres, bool info, PJPARM sjp) int maxres, bool info, PJPARM sjp)
{ {
int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING,
@@ -316,7 +316,7 @@ PQRYRES JDBCColumns(PGLOBAL g, char *db, char *table, char *colpat,
/* JDBCSrcCols: constructs the result blocks containing the */ /* JDBCSrcCols: constructs the result blocks containing the */
/* description of all the columns of a Srcdef option. */ /* description of all the columns of a Srcdef option. */
/**************************************************************************/ /**************************************************************************/
PQRYRES JDBCSrcCols(PGLOBAL g, char *src, PJPARM sjp) PQRYRES JDBCSrcCols(PGLOBAL g, PCSZ src, PJPARM sjp)
{ {
char *sqry; char *sqry;
PQRYRES qrp; PQRYRES qrp;
@@ -330,7 +330,7 @@ PQRYRES JDBCSrcCols(PGLOBAL g, char *src, PJPARM sjp)
sqry = (char*)PlugSubAlloc(g, NULL, strlen(src) + 2); sqry = (char*)PlugSubAlloc(g, NULL, strlen(src) + 2);
sprintf(sqry, src, "1=1"); // dummy where clause sprintf(sqry, src, "1=1"); // dummy where clause
} else } else
sqry = src; sqry = (char*)src;
qrp = jcp->GetMetaData(g, sqry); qrp = jcp->GetMetaData(g, sqry);
jcp->Close(); jcp->Close();
@@ -341,7 +341,7 @@ PQRYRES JDBCSrcCols(PGLOBAL g, char *src, PJPARM sjp)
/* JDBCTables: constructs the result blocks containing all tables in */ /* JDBCTables: constructs the result blocks containing all tables in */
/* an JDBC database that will be retrieved by GetData commands. */ /* an JDBC database that will be retrieved by GetData commands. */
/**************************************************************************/ /**************************************************************************/
PQRYRES JDBCTables(PGLOBAL g, char *db, char *tabpat, char *tabtyp, PQRYRES JDBCTables(PGLOBAL g, PCSZ db, PCSZ tabpat, PCSZ tabtyp,
int maxres, bool info, PJPARM sjp) int maxres, bool info, PJPARM sjp)
{ {
int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
@@ -1059,7 +1059,7 @@ int JDBConn::Open(PJPARM sop)
/***********************************************************************/ /***********************************************************************/
/* Execute an SQL command. */ /* Execute an SQL command. */
/***********************************************************************/ /***********************************************************************/
int JDBConn::ExecSQLcommand(char *sql) int JDBConn::ExecSQLcommand(PCSZ sql)
{ {
int rc; int rc;
jint n; jint n;
@@ -1142,7 +1142,7 @@ int JDBConn::Fetch(int pos)
/***********************************************************************/ /***********************************************************************/
/* Restart from beginning of result set */ /* Restart from beginning of result set */
/***********************************************************************/ /***********************************************************************/
int JDBConn::Rewind(char *sql) int JDBConn::Rewind(PCSZ sql)
{ {
int rbuf = -1; int rbuf = -1;
@@ -1326,7 +1326,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val)
/***********************************************************************/ /***********************************************************************/
/* Prepare an SQL statement for insert. */ /* Prepare an SQL statement for insert. */
/***********************************************************************/ /***********************************************************************/
bool JDBConn::PrepareSQL(char *sql) bool JDBConn::PrepareSQL(PCSZ sql)
{ {
bool b = true; bool b = true;
PGLOBAL& g = m_G; PGLOBAL& g = m_G;
@@ -1349,7 +1349,7 @@ bool JDBConn::PrepareSQL(char *sql)
/***********************************************************************/ /***********************************************************************/
/* Execute an SQL query that returns a result set. */ /* Execute an SQL query that returns a result set. */
/***********************************************************************/ /***********************************************************************/
int JDBConn::ExecuteQuery(char *sql) int JDBConn::ExecuteQuery(PCSZ sql)
{ {
int rc = RC_FX; int rc = RC_FX;
jint ncol; jint ncol;
@@ -1377,7 +1377,7 @@ int JDBConn::ExecuteQuery(char *sql)
/***********************************************************************/ /***********************************************************************/
/* Execute an SQL query and get the affected rows. */ /* Execute an SQL query and get the affected rows. */
/***********************************************************************/ /***********************************************************************/
int JDBConn::ExecuteUpdate(char *sql) int JDBConn::ExecuteUpdate(PCSZ sql)
{ {
int rc = RC_FX; int rc = RC_FX;
jint n; jint n;
@@ -1405,7 +1405,7 @@ int JDBConn::ExecuteUpdate(char *sql)
/***********************************************************************/ /***********************************************************************/
/* Get the number of lines of the result set. */ /* Get the number of lines of the result set. */
/***********************************************************************/ /***********************************************************************/
int JDBConn::GetResultSize(char *sql, JDBCCOL *colp) int JDBConn::GetResultSize(PCSZ sql, JDBCCOL *colp)
{ {
int rc, n = 0; int rc, n = 0;
@@ -1643,7 +1643,7 @@ bool JDBConn::SetParam(JDBCCOL *colp)
/* GetMetaData: constructs the result blocks containing the */ /* GetMetaData: constructs the result blocks containing the */
/* description of all the columns of an SQL command. */ /* description of all the columns of an SQL command. */
/**************************************************************************/ /**************************************************************************/
PQRYRES JDBConn::GetMetaData(PGLOBAL g, char *src) PQRYRES JDBConn::GetMetaData(PGLOBAL g, PCSZ src)
{ {
static int buftyp[] = {TYPE_STRING, TYPE_INT, TYPE_INT, static int buftyp[] = {TYPE_STRING, TYPE_INT, TYPE_INT,
TYPE_INT, TYPE_INT}; TYPE_INT, TYPE_INT};

View File

@@ -46,9 +46,9 @@ enum JCATINFO {
typedef struct tagJCATPARM { typedef struct tagJCATPARM {
JCATINFO Id; // Id to indicate function JCATINFO Id; // Id to indicate function
PQRYRES Qrp; // Result set pointer PQRYRES Qrp; // Result set pointer
char *DB; // Database (Schema) PCSZ DB; // Database (Schema)
char *Tab; // Table name or pattern PCSZ Tab; // Table name or pattern
char *Pat; // Table type or column pattern PCSZ Pat; // Table type or column pattern
} JCATPARM; } JCATPARM;
typedef jint(JNICALL *CRTJVM) (JavaVM **, void **, void *); typedef jint(JNICALL *CRTJVM) (JavaVM **, void **, void *);
@@ -77,7 +77,7 @@ public:
JDBConn(PGLOBAL g, TDBJDBC *tdbp); JDBConn(PGLOBAL g, TDBJDBC *tdbp);
int Open(PJPARM sop); int Open(PJPARM sop);
int Rewind(char *sql); int Rewind(PCSZ sql);
void Close(void); void Close(void);
PQRYRES AllocateResult(PGLOBAL g); PQRYRES AllocateResult(PGLOBAL g);
@@ -96,19 +96,19 @@ public:
//void SetQueryTimeout(DWORD sec) {m_QueryTimeout = sec;} //void SetQueryTimeout(DWORD sec) {m_QueryTimeout = sec;}
//void SetUserName(PSZ user) {m_User = user;} //void SetUserName(PSZ user) {m_User = user;}
//void SetUserPwd(PSZ pwd) {m_Pwd = pwd;} //void SetUserPwd(PSZ pwd) {m_Pwd = pwd;}
int GetResultSize(char *sql, JDBCCOL *colp); int GetResultSize(PCSZ sql, JDBCCOL *colp);
int ExecuteQuery(char *sql); int ExecuteQuery(PCSZ sql);
int ExecuteUpdate(char *sql); int ExecuteUpdate(PCSZ sql);
int Fetch(int pos = 0); int Fetch(int pos = 0);
bool PrepareSQL(char *sql); bool PrepareSQL(PCSZ sql);
int ExecuteSQL(void); int ExecuteSQL(void);
bool SetParam(JDBCCOL *colp); bool SetParam(JDBCCOL *colp);
int ExecSQLcommand(char *sql); int ExecSQLcommand(PCSZ sql);
void SetColumnValue(int rank, PSZ name, PVAL val); void SetColumnValue(int rank, PSZ name, PVAL val);
int GetCatInfo(JCATPARM *cap); int GetCatInfo(JCATPARM *cap);
//bool GetDataSources(PQRYRES qrp); //bool GetDataSources(PQRYRES qrp);
bool GetDrivers(PQRYRES qrp); bool GetDrivers(PQRYRES qrp);
PQRYRES GetMetaData(PGLOBAL g, char *src); PQRYRES GetMetaData(PGLOBAL g, PCSZ src);
public: public:
// Set static variables // Set static variables

View File

@@ -3,11 +3,11 @@
#define DEFAULT_QUERY_TIMEOUT -1 // means do not set #define DEFAULT_QUERY_TIMEOUT -1 // means do not set
typedef struct odbc_parms { typedef struct odbc_parms {
char *User; // User connect info PCSZ User; // User connect info
char *Pwd; // Password connect info PCSZ Pwd; // Password connect info
int Cto; // Connect timeout int Cto; // Connect timeout
int Qto; // Query timeout int Qto; // Query timeout
bool UseCnc; // Use SQLConnect (!SQLDriverConnect) bool UseCnc; // Use SQLConnect (!SQLDriverConnect)
} ODBCPARM, *POPARM; } ODBCPARM, *POPARM;
/***********************************************************************/ /***********************************************************************/
@@ -17,9 +17,9 @@ typedef struct odbc_parms {
char *ODBCCheckConnection(PGLOBAL g, char *dsn, int cop); char *ODBCCheckConnection(PGLOBAL g, char *dsn, int cop);
#endif // PROMPT_OK #endif // PROMPT_OK
PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info); PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info);
PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table, PQRYRES ODBCColumns(PGLOBAL g, PCSZ dsn, PCSZ db, PCSZ table,
char *colpat, int maxres, bool info, POPARM sop); PCSZ colpat, int maxres, bool info, POPARM sop);
PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, POPARM sop); PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, POPARM sop);
PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat, PQRYRES ODBCTables(PGLOBAL g, PCSZ dsn, PCSZ db, PCSZ tabpat,
char *tabtyp, int maxres, bool info, POPARM sop); PCSZ tabtyp, int maxres, bool info, POPARM sop);
PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info); PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info);

View File

@@ -239,8 +239,8 @@ char *ODBCCheckConnection(PGLOBAL g, char *dsn, int cop)
/***********************************************************************/ /***********************************************************************/
/* Allocate the structure used to refer to the result set. */ /* Allocate the structure used to refer to the result set. */
/***********************************************************************/ /***********************************************************************/
static CATPARM *AllocCatInfo(PGLOBAL g, CATINFO fid, char *db, static CATPARM *AllocCatInfo(PGLOBAL g, CATINFO fid, PCSZ db,
char *tab, PQRYRES qrp) PCSZ tab, PQRYRES qrp)
{ {
size_t i, m, n; size_t i, m, n;
CATPARM *cap; CATPARM *cap;
@@ -256,8 +256,8 @@ static CATPARM *AllocCatInfo(PGLOBAL g, CATINFO fid, char *db,
memset(cap, 0, sizeof(CATPARM)); memset(cap, 0, sizeof(CATPARM));
cap->Id = fid; cap->Id = fid;
cap->Qrp = qrp; cap->Qrp = qrp;
cap->DB = (PUCHAR)db; cap->DB = db;
cap->Tab = (PUCHAR)tab; cap->Tab = tab;
cap->Vlen = (SQLLEN* *)PlugSubAlloc(g, NULL, n * sizeof(SQLLEN *)); cap->Vlen = (SQLLEN* *)PlugSubAlloc(g, NULL, n * sizeof(SQLLEN *));
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
@@ -305,8 +305,8 @@ static void ResetNullValues(CATPARM *cap)
/* ODBCColumns: constructs the result blocks containing all columns */ /* ODBCColumns: constructs the result blocks containing all columns */
/* of an ODBC table that will be retrieved by GetData commands. */ /* of an ODBC table that will be retrieved by GetData commands. */
/***********************************************************************/ /***********************************************************************/
PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table, PQRYRES ODBCColumns(PGLOBAL g, PCSZ dsn, PCSZ db, PCSZ table,
char *colpat, int maxres, bool info, POPARM sop) PCSZ colpat, int maxres, bool info, POPARM sop)
{ {
int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_SHORT, TYPE_STRING, TYPE_INT, TYPE_INT, TYPE_SHORT, TYPE_STRING, TYPE_INT, TYPE_INT,
@@ -379,7 +379,7 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table,
if (!(cap = AllocCatInfo(g, CAT_COL, db, table, qrp))) if (!(cap = AllocCatInfo(g, CAT_COL, db, table, qrp)))
return NULL; return NULL;
cap->Pat = (PUCHAR)colpat; cap->Pat = colpat;
/************************************************************************/ /************************************************************************/
/* Now get the results into blocks. */ /* Now get the results into blocks. */
@@ -614,8 +614,8 @@ PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info)
/* ODBCTables: constructs the result blocks containing all tables in */ /* ODBCTables: constructs the result blocks containing all tables in */
/* an ODBC database that will be retrieved by GetData commands. */ /* an ODBC database that will be retrieved by GetData commands. */
/**************************************************************************/ /**************************************************************************/
PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat, PQRYRES ODBCTables(PGLOBAL g, PCSZ dsn, PCSZ db, PCSZ tabpat, PCSZ tabtyp,
char *tabtyp, int maxres, bool info, POPARM sop) int maxres, bool info, POPARM sop)
{ {
int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING}; TYPE_STRING, TYPE_STRING};
@@ -677,7 +677,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp))) if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp)))
return NULL; return NULL;
cap->Pat = (PUCHAR)tabtyp; cap->Pat = tabtyp;
if (trace) if (trace)
htrc("Getting table results ncol=%d\n", cap->Qrp->Nbcol); htrc("Getting table results ncol=%d\n", cap->Qrp->Nbcol);
@@ -1106,7 +1106,7 @@ void ODBConn::OnSetOptions(HSTMT hstmt)
/***********************************************************************/ /***********************************************************************/
/* Open: connect to a data source. */ /* Open: connect to a data source. */
/***********************************************************************/ /***********************************************************************/
int ODBConn::Open(PSZ ConnectString, POPARM sop, DWORD options) int ODBConn::Open(PCSZ ConnectString, POPARM sop, DWORD options)
{ {
PGLOBAL& g = m_G; PGLOBAL& g = m_G;
//ASSERT_VALID(this); //ASSERT_VALID(this);
@@ -1917,7 +1917,7 @@ bool ODBConn::ExecSQLcommand(char *sql)
/* GetMetaData: constructs the result blocks containing the */ /* GetMetaData: constructs the result blocks containing the */
/* description of all the columns of an SQL command. */ /* description of all the columns of an SQL command. */
/**************************************************************************/ /**************************************************************************/
PQRYRES ODBConn::GetMetaData(PGLOBAL g, char *dsn, char *src) PQRYRES ODBConn::GetMetaData(PGLOBAL g, PCSZ dsn, PCSZ src)
{ {
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_INT, static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_INT,
TYPE_SHORT, TYPE_SHORT}; TYPE_SHORT, TYPE_SHORT};
@@ -2279,22 +2279,20 @@ int ODBConn::GetCatInfo(CATPARM *cap)
// Now do call the proper ODBC API // Now do call the proper ODBC API
switch (cap->Id) { switch (cap->Id) {
case CAT_TAB: case CAT_TAB:
// rc = SQLSetStmtAttr(hstmt, SQL_ATTR_METADATA_ID,
// (SQLPOINTER)false, 0);
fnc = "SQLTables"; fnc = "SQLTables";
rc = SQLTables(hstmt, name.ptr(2), name.length(2), rc = SQLTables(hstmt, name.ptr(2), name.length(2),
name.ptr(1), name.length(1), name.ptr(1), name.length(1),
name.ptr(0), name.length(0), name.ptr(0), name.length(0),
cap->Pat, cap->Pat ? SQL_NTS : 0); (SQLCHAR *)cap->Pat,
cap->Pat ? SQL_NTS : 0);
break; break;
case CAT_COL: case CAT_COL:
// rc = SQLSetStmtAttr(hstmt, SQL_ATTR_METADATA_ID,
// (SQLPOINTER)true, 0);
fnc = "SQLColumns"; fnc = "SQLColumns";
rc = SQLColumns(hstmt, name.ptr(2), name.length(2), rc = SQLColumns(hstmt, name.ptr(2), name.length(2),
name.ptr(1), name.length(1), name.ptr(1), name.length(1),
name.ptr(0), name.length(0), name.ptr(0), name.length(0),
cap->Pat, cap->Pat ? SQL_NTS : 0); (SQLCHAR *)cap->Pat,
cap->Pat ? SQL_NTS : 0);
break; break;
case CAT_KEY: case CAT_KEY:
fnc = "SQLPrimaryKeys"; fnc = "SQLPrimaryKeys";

View File

@@ -54,9 +54,9 @@ enum CATINFO {CAT_TAB = 1, /* SQLTables */
typedef struct tagCATPARM { typedef struct tagCATPARM {
CATINFO Id; // Id to indicate function CATINFO Id; // Id to indicate function
PQRYRES Qrp; // Result set pointer PQRYRES Qrp; // Result set pointer
PUCHAR DB; // Database (Schema) PCSZ DB; // Database (Schema)
PUCHAR Tab; // Table name or pattern PCSZ Tab; // Table name or pattern
PUCHAR Pat; // Table type or column pattern PCSZ Pat; // Table type or column pattern
SQLLEN* *Vlen; // To array of indicator values SQLLEN* *Vlen; // To array of indicator values
UWORD *Status; // To status block UWORD *Status; // To status block
// For SQLStatistics // For SQLStatistics
@@ -119,7 +119,7 @@ class ODBConn : public BLOCK {
noOdbcDialog = 0x0008, // Don't display ODBC Connect dialog noOdbcDialog = 0x0008, // Don't display ODBC Connect dialog
forceOdbcDialog = 0x0010}; // Always display ODBC connect dialog forceOdbcDialog = 0x0010}; // Always display ODBC connect dialog
int Open(PSZ ConnectString, POPARM sop, DWORD Options = 0); int Open(PCSZ ConnectString, POPARM sop, DWORD Options = 0);
int Rewind(char *sql, ODBCCOL *tocols); int Rewind(char *sql, ODBCCOL *tocols);
void Close(void); void Close(void);
PQRYRES AllocateResult(PGLOBAL g); PQRYRES AllocateResult(PGLOBAL g);
@@ -131,7 +131,7 @@ class ODBConn : public BLOCK {
bool IsOpen(void) {return m_hdbc != SQL_NULL_HDBC;} bool IsOpen(void) {return m_hdbc != SQL_NULL_HDBC;}
PSZ GetStringInfo(ushort infotype); PSZ GetStringInfo(ushort infotype);
int GetMaxValue(ushort infotype); int GetMaxValue(ushort infotype);
PSZ GetConnect(void) {return m_Connect;} PCSZ GetConnect(void) {return m_Connect;}
public: public:
// Operations // Operations
@@ -149,7 +149,7 @@ class ODBConn : public BLOCK {
int GetCatInfo(CATPARM *cap); int GetCatInfo(CATPARM *cap);
bool GetDataSources(PQRYRES qrp); bool GetDataSources(PQRYRES qrp);
bool GetDrivers(PQRYRES qrp); bool GetDrivers(PQRYRES qrp);
PQRYRES GetMetaData(PGLOBAL g, char *dsn, char *src); PQRYRES GetMetaData(PGLOBAL g, PCSZ dsn, PCSZ src);
public: public:
// Set special options // Set special options
@@ -187,9 +187,9 @@ class ODBConn : public BLOCK {
DWORD m_UpdateOptions; DWORD m_UpdateOptions;
DWORD m_RowsetSize; DWORD m_RowsetSize;
char m_IDQuoteChar[2]; char m_IDQuoteChar[2];
PSZ m_Connect; PCSZ m_Connect;
PSZ m_User; PCSZ m_User;
PSZ m_Pwd; PCSZ m_Pwd;
int m_Catver; int m_Catver;
int m_Rows; int m_Rows;
int m_Fetch; int m_Fetch;

View File

@@ -24,6 +24,8 @@ typedef longlong BIGINT;
#define FILE_END SEEK_END #define FILE_END SEEK_END
#endif // !__WIN__ #endif // !__WIN__
typedef _Null_terminated_ const char *PCSZ;
#if !defined(__WIN__) #if !defined(__WIN__)
typedef const void *LPCVOID; typedef const void *LPCVOID;
typedef const char *LPCTSTR; typedef const char *LPCTSTR;

View File

@@ -617,11 +617,10 @@ DllExport void *PlgDBrealloc(PGLOBAL, void *, MBLOCK&, size_t);
DllExport void NewPointer(PTABS, void *, void *); DllExport void NewPointer(PTABS, void *, void *);
//lExport char *GetIni(int n= 0); // Not used anymore //lExport char *GetIni(int n= 0); // Not used anymore
DllExport void SetTrc(void); DllExport void SetTrc(void);
DllExport char *GetListOption(PGLOBAL, const char *, const char *, DllExport PCSZ GetListOption(PGLOBAL, PCSZ, PCSZ, PCSZ def=NULL);
const char *def=NULL); DllExport PCSZ GetStringTableOption(PGLOBAL, PTOS, PCSZ, PCSZ);
DllExport char *GetStringTableOption(PGLOBAL, PTOS, char *, char *); DllExport bool GetBooleanTableOption(PGLOBAL, PTOS, PCSZ, bool);
DllExport bool GetBooleanTableOption(PGLOBAL, PTOS, char *, bool); DllExport int GetIntegerTableOption(PGLOBAL, PTOS, PCSZ, int);
DllExport int GetIntegerTableOption(PGLOBAL, PTOS, char *, int);
#define MSGID_NONE 0 #define MSGID_NONE 0
#define MSGID_CANNOT_OPEN 1 #define MSGID_CANNOT_OPEN 1

View File

@@ -45,7 +45,7 @@ XMLDOCUMENT::XMLDOCUMENT(char *nsl, char *nsdf, char *enc)
/******************************************************************/ /******************************************************************/
/* Initialize zipped file processing. */ /* Initialize zipped file processing. */
/******************************************************************/ /******************************************************************/
bool XMLDOCUMENT::InitZip(PGLOBAL g, char *entry) bool XMLDOCUMENT::InitZip(PGLOBAL g, PCSZ entry)
{ {
#if defined(ZIP_SUPPORT) #if defined(ZIP_SUPPORT)
bool mul = (entry) ? strchr(entry, '*') || strchr(entry, '?') : false; bool mul = (entry) ? strchr(entry, '*') || strchr(entry, '?') : false;

View File

@@ -76,7 +76,7 @@ class XMLDOCUMENT : public BLOCK {
virtual void SetNofree(bool b) = 0; virtual void SetNofree(bool b) = 0;
// Methods // Methods
virtual bool Initialize(PGLOBAL, char *, bool) = 0; virtual bool Initialize(PGLOBAL, PCSZ, bool) = 0;
virtual bool ParseFile(PGLOBAL, char *) = 0; virtual bool ParseFile(PGLOBAL, char *) = 0;
virtual bool NewDoc(PGLOBAL, char *) = 0; virtual bool NewDoc(PGLOBAL, char *) = 0;
virtual void AddComment(PGLOBAL, char *) = 0; virtual void AddComment(PGLOBAL, char *) = 0;
@@ -95,7 +95,7 @@ class XMLDOCUMENT : public BLOCK {
// Utility // Utility
bool MakeNSlist(PGLOBAL g); bool MakeNSlist(PGLOBAL g);
bool InitZip(PGLOBAL g, char *entry); bool InitZip(PGLOBAL g, PCSZ entry);
char *GetMemDoc(PGLOBAL g, char *fn); char *GetMemDoc(PGLOBAL g, char *fn);
void CloseZip(void); void CloseZip(void);

View File

@@ -88,7 +88,7 @@ PTOS RELDEF::GetTopt(void)
/***********************************************************************/ /***********************************************************************/
/* This function sets an integer table information. */ /* This function sets an integer table information. */
/***********************************************************************/ /***********************************************************************/
bool RELDEF::SetIntCatInfo(PSZ what, int n) bool RELDEF::SetIntCatInfo(PCSZ what, int n)
{ {
return Hc->SetIntegerOption(what, n); return Hc->SetIntegerOption(what, n);
} // end of SetIntCatInfo } // end of SetIntCatInfo
@@ -96,7 +96,7 @@ bool RELDEF::SetIntCatInfo(PSZ what, int n)
/***********************************************************************/ /***********************************************************************/
/* This function returns integer table information. */ /* This function returns integer table information. */
/***********************************************************************/ /***********************************************************************/
int RELDEF::GetIntCatInfo(PSZ what, int idef) int RELDEF::GetIntCatInfo(PCSZ what, int idef)
{ {
int n= Hc->GetIntegerOption(what); int n= Hc->GetIntegerOption(what);
@@ -106,7 +106,7 @@ int RELDEF::GetIntCatInfo(PSZ what, int idef)
/***********************************************************************/ /***********************************************************************/
/* This function returns Boolean table information. */ /* This function returns Boolean table information. */
/***********************************************************************/ /***********************************************************************/
bool RELDEF::GetBoolCatInfo(PSZ what, bool bdef) bool RELDEF::GetBoolCatInfo(PCSZ what, bool bdef)
{ {
bool b= Hc->GetBooleanOption(what, bdef); bool b= Hc->GetBooleanOption(what, bdef);
@@ -116,9 +116,10 @@ bool RELDEF::GetBoolCatInfo(PSZ what, bool bdef)
/***********************************************************************/ /***********************************************************************/
/* This function returns size catalog information. */ /* This function returns size catalog information. */
/***********************************************************************/ /***********************************************************************/
int RELDEF::GetSizeCatInfo(PSZ what, PSZ sdef) int RELDEF::GetSizeCatInfo(PCSZ what, PSZ sdef)
{ {
char * s, c; char c;
PCSZ s;
int i, n= 0; int i, n= 0;
if (!(s= Hc->GetStringOption(what))) if (!(s= Hc->GetStringOption(what)))
@@ -138,9 +139,9 @@ int RELDEF::GetSizeCatInfo(PSZ what, PSZ sdef)
/***********************************************************************/ /***********************************************************************/
/* This function sets char table information in buf. */ /* This function sets char table information in buf. */
/***********************************************************************/ /***********************************************************************/
int RELDEF::GetCharCatInfo(PSZ what, PSZ sdef, char *buf, int size) int RELDEF::GetCharCatInfo(PCSZ what, PSZ sdef, char *buf, int size)
{ {
char *s= Hc->GetStringOption(what); PCSZ s= Hc->GetStringOption(what);
strncpy(buf, ((s) ? s : sdef), size); strncpy(buf, ((s) ? s : sdef), size);
return size; return size;
@@ -158,9 +159,10 @@ bool RELDEF::Partitioned(void)
/* This function returns string table information. */ /* This function returns string table information. */
/* Default parameter is "*" to get the handler default. */ /* Default parameter is "*" to get the handler default. */
/***********************************************************************/ /***********************************************************************/
char *RELDEF::GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef) char *RELDEF::GetStringCatInfo(PGLOBAL g, PCSZ what, PCSZ sdef)
{ {
char *name, *sval= NULL, *s= Hc->GetStringOption(what, sdef); char *sval = NULL;
PCSZ name, s= Hc->GetStringOption(what, sdef);
if (s) { if (s) {
if (!Hc->IsPartitioned() || if (!Hc->IsPartitioned() ||
@@ -168,12 +170,12 @@ char *RELDEF::GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef)
&& stricmp(what, "connect"))) && stricmp(what, "connect")))
sval= PlugDup(g, s); sval= PlugDup(g, s);
else else
sval= s; sval= (char*)s;
} else if (!stricmp(what, "filename")) { } else if (!stricmp(what, "filename")) {
// Return default file name // Return default file name
char *ftype= Hc->GetStringOption("Type", "*"); PCSZ ftype= Hc->GetStringOption("Type", "*");
int i, n; int i, n;
if (IsFileType(GetTypeID(ftype))) { if (IsFileType(GetTypeID(ftype))) {
name= Hc->GetPartName(); name= Hc->GetPartName();
@@ -615,9 +617,10 @@ bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int)
if (!*Module) if (!*Module)
Module = Subtype; Module = Subtype;
Desc = (char*)PlugSubAlloc(g, NULL, strlen(Module) char *desc = (char*)PlugSubAlloc(g, NULL, strlen(Module)
+ strlen(Subtype) + 3); + strlen(Subtype) + 3);
sprintf(Desc, "%s(%s)", Module, Subtype); sprintf(desc, "%s(%s)", Module, Subtype);
Desc = desc;
return false; return false;
} // end of DefineAM } // end of DefineAM

View File

@@ -42,13 +42,13 @@ class DllExport RELDEF : public BLOCK { // Relation definition block
// Methods // Methods
PTOS GetTopt(void); PTOS GetTopt(void);
bool GetBoolCatInfo(PSZ what, bool bdef); bool GetBoolCatInfo(PCSZ what, bool bdef);
bool SetIntCatInfo(PSZ what, int ival); bool SetIntCatInfo(PCSZ what, int ival);
bool Partitioned(void); bool Partitioned(void);
int GetIntCatInfo(PSZ what, int idef); int GetIntCatInfo(PCSZ what, int idef);
int GetSizeCatInfo(PSZ what, PSZ sdef); int GetSizeCatInfo(PCSZ what, PSZ sdef);
int GetCharCatInfo(PSZ what, PSZ sdef, char *buf, int size); int GetCharCatInfo(PCSZ what, PSZ sdef, char *buf, int size);
char *GetStringCatInfo(PGLOBAL g, PSZ what, PSZ sdef); char *GetStringCatInfo(PGLOBAL g, PCSZ what, PCSZ sdef);
virtual int Indexable(void) {return 0;} virtual int Indexable(void) {return 0;}
virtual bool Define(PGLOBAL g, PCATLG cat, virtual bool Define(PGLOBAL g, PCATLG cat,
LPCSTR name, LPCSTR schema, LPCSTR am) = 0; LPCSTR name, LPCSTR schema, LPCSTR am) = 0;
@@ -105,8 +105,8 @@ public:
protected: protected:
// Members // Members
PSZ Schema; /* Table schema (for ODBC) */ PCSZ Schema; /* Table schema (for ODBC) */
PSZ Desc; /* Table description */ PCSZ Desc; /* Table description */
uint Catfunc; /* Catalog function ID */ uint Catfunc; /* Catalog function ID */
int Card; /* (max) number of rows in table */ int Card; /* (max) number of rows in table */
int Elemt; /* Number of rows in blocks or rowset */ int Elemt; /* Number of rows in blocks or rowset */

View File

@@ -39,9 +39,9 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */
virtual PIXDEF GetIndx(void) {return To_Indx;} virtual PIXDEF GetIndx(void) {return To_Indx;}
virtual void SetIndx(PIXDEF xdp) {To_Indx = xdp;} virtual void SetIndx(PIXDEF xdp) {To_Indx = xdp;}
virtual bool IsHuge(void) {return Huge;} virtual bool IsHuge(void) {return Huge;}
PSZ GetFn(void) {return Fn;} PCSZ GetFn(void) {return Fn;}
PSZ GetOfn(void) {return Ofn;} PCSZ GetOfn(void) {return Ofn;}
PSZ GetEntry(void) {return Entry;} PCSZ GetEntry(void) {return Entry;}
bool GetMul(void) {return Mulentries;} bool GetMul(void) {return Mulentries;}
bool GetAppend(void) {return Append;} bool GetAppend(void) {return Append;}
void SetBlock(int block) { Block = block; } void SetBlock(int block) { Block = block; }
@@ -74,10 +74,10 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */
//virtual bool Erase(char *filename); //virtual bool Erase(char *filename);
// Members // Members
PSZ Fn; /* Path/Name of corresponding file */ PCSZ Fn; /* Path/Name of corresponding file */
PSZ Ofn; /* Base Path/Name of matching index files*/ PCSZ Ofn; /* Base Path/Name of matching index files*/
PSZ Entry; /* Zip entry name or pattern */ PCSZ Entry; /* Zip entry name or pattern */
PSZ Pwd; /* Zip password */ PCSZ Pwd; /* Zip password */
PIXDEF To_Indx; /* To index definitions blocks */ PIXDEF To_Indx; /* To index definitions blocks */
RECFM Recfm; /* 0:VAR, 1:FIX, 2:BIN, 3:VCT, 6:DBF */ RECFM Recfm; /* 0:VAR, 1:FIX, 2:BIN, 3:VCT, 6:DBF */
bool Mapped; /* 0: disk file, 1: memory mapped file */ bool Mapped; /* 0: disk file, 1: memory mapped file */
@@ -133,8 +133,8 @@ class DllExport TDBDOS : public TDBASE {
// Implementation // Implementation
virtual AMT GetAmType(void) {return Txfp->GetAmType();} virtual AMT GetAmType(void) {return Txfp->GetAmType();}
virtual PSZ GetFile(PGLOBAL) {return Txfp->To_File;} virtual PCSZ GetFile(PGLOBAL) {return Txfp->To_File;}
virtual void SetFile(PGLOBAL, PSZ fn) {Txfp->To_File = fn;} virtual void SetFile(PGLOBAL, PCSZ fn) {Txfp->To_File = fn;}
virtual void SetAbort(bool b) {Abort = b;} virtual void SetAbort(bool b) {Abort = b;}
virtual RECFM GetFtype(void) {return Ftype;} virtual RECFM GetFtype(void) {return Ftype;}
virtual bool SkipHeader(PGLOBAL) {return false;} virtual bool SkipHeader(PGLOBAL) {return false;}

View File

@@ -61,7 +61,7 @@ int CONDFIL::Init(PGLOBAL g, PHC hc)
bool h; bool h;
if (options) if (options)
alt = GetListOption(g, "Alias", options->oplist, NULL); alt = (char*)GetListOption(g, "Alias", options->oplist, NULL);
while (alt) { while (alt) {
if (!(p = strchr(alt, '='))) { if (!(p = strchr(alt, '='))) {
@@ -267,7 +267,7 @@ TDBEXT::TDBEXT(PTDBEXT tdbp) : TDB(tdbp)
/******************************************************************/ /******************************************************************/
/* Convert an UTF-8 string to latin characters. */ /* Convert an UTF-8 string to latin characters. */
/******************************************************************/ /******************************************************************/
int TDBEXT::Decode(char *txt, char *buf, size_t n) int TDBEXT::Decode(PCSZ txt, char *buf, size_t n)
{ {
uint dummy_errors; uint dummy_errors;
uint32 len = copy_and_convert(buf, n, &my_charset_latin1, uint32 len = copy_and_convert(buf, n, &my_charset_latin1,
@@ -285,7 +285,8 @@ int TDBEXT::Decode(char *txt, char *buf, size_t n)
/***********************************************************************/ /***********************************************************************/
bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt) bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
{ {
char *schmp = NULL, *catp = NULL, buf[NAM_LEN * 3]; PCSZ schmp = NULL;
char *catp = NULL, buf[NAM_LEN * 3];
int len; int len;
bool first = true; bool first = true;
PTABLE tablep = To_Table; PTABLE tablep = To_Table;
@@ -435,7 +436,8 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
/***********************************************************************/ /***********************************************************************/
bool TDBEXT::MakeCommand(PGLOBAL g) bool TDBEXT::MakeCommand(PGLOBAL g)
{ {
char *p, *stmt, name[132], *body = NULL, *schmp = NULL; PCSZ schmp = NULL;
char *p, *stmt, name[132], *body = NULL;
char *qrystr = (char*)PlugSubAlloc(g, NULL, strlen(Qrystr) + 1); char *qrystr = (char*)PlugSubAlloc(g, NULL, strlen(Qrystr) + 1);
bool qtd = Quoted > 0; bool qtd = Quoted > 0;
char q = qtd ? *Quote : ' '; char q = qtd ? *Quote : ' ';

View File

@@ -60,10 +60,10 @@ public:
// Implementation // Implementation
virtual const char *GetType(void) { return "EXT"; } virtual const char *GetType(void) { return "EXT"; }
inline PSZ GetTabname(void) { return Tabname; } inline PCSZ GetTabname(void) { return Tabname; }
inline PSZ GetTabschema(void) { return Tabschema; } inline PCSZ GetTabschema(void) { return Tabschema; }
inline PSZ GetUsername(void) { return Username; }; inline PCSZ GetUsername(void) { return Username; };
inline PSZ GetPassword(void) { return Password; }; inline PCSZ GetPassword(void) { return Password; };
inline PSZ GetTabcat(void) { return Tabcat; } inline PSZ GetTabcat(void) { return Tabcat; }
inline PSZ GetSrcdef(void) { return Srcdef; } inline PSZ GetSrcdef(void) { return Srcdef; }
inline char GetSep(void) { return (Sep) ? *Sep : 0; } inline char GetSep(void) { return (Sep) ? *Sep : 0; }
@@ -76,10 +76,10 @@ public:
protected: protected:
// Members // Members
PSZ Tabname; /* External table name */ PCSZ Tabname; /* External table name */
PSZ Tabschema; /* External table schema */ PCSZ Tabschema; /* External table schema */
PSZ Username; /* User connect name */ PCSZ Username; /* User connect name */
PSZ Password; /* Password connect info */ PCSZ Password; /* Password connect info */
PSZ Tabcat; /* External table catalog */ PSZ Tabcat; /* External table catalog */
PSZ Tabtyp; /* Catalog table type */ PSZ Tabtyp; /* Catalog table type */
PSZ Colpat; /* Catalog column pattern */ PSZ Colpat; /* Catalog column pattern */
@@ -127,19 +127,19 @@ protected:
virtual bool MakeSQL(PGLOBAL g, bool cnt); virtual bool MakeSQL(PGLOBAL g, bool cnt);
//virtual bool MakeInsert(PGLOBAL g); //virtual bool MakeInsert(PGLOBAL g);
virtual bool MakeCommand(PGLOBAL g); virtual bool MakeCommand(PGLOBAL g);
int Decode(char *utf, char *buf, size_t n); int Decode(PCSZ utf, char *buf, size_t n);
// Members // Members
PQRYRES Qrp; // Points to storage result PQRYRES Qrp; // Points to storage result
PSTRG Query; // Constructed SQL query PSTRG Query; // Constructed SQL query
char *TableName; // Points to ODBC table name PCSZ TableName; // Points to ODBC table name
char *Schema; // Points to ODBC table Schema PCSZ Schema; // Points to ODBC table Schema
char *User; // User connect info PCSZ User; // User connect info
char *Pwd; // Password connect info PCSZ Pwd; // Password connect info
char *Catalog; // Points to ODBC table Catalog char *Catalog; // Points to ODBC table Catalog
char *Srcdef; // The source table SQL definition char *Srcdef; // The source table SQL definition
char *Count; // Points to count(*) SQL statement char *Count; // Points to count(*) SQL statement
//char *Where; // Points to local where clause //char *Where; // Points to local where clause
char *Quote; // The identifier quoting character char *Quote; // The identifier quoting character
char *MulConn; // Used for multiple ODBC tables char *MulConn; // Used for multiple ODBC tables
char *DBQ; // The address part of Connect string char *DBQ; // The address part of Connect string

View File

@@ -108,7 +108,7 @@ class TDBDCL : public TDBCAT {
{return DBFColumns(g, ((PTABDEF)To_Def)->GetPath(), Fn, false);} {return DBFColumns(g, ((PTABDEF)To_Def)->GetPath(), Fn, false);}
// Members // Members
char *Fn; // The DBF file (path) name PCSZ Fn; // The DBF file (path) name
}; // end of class TDBOCL }; // end of class TDBOCL

View File

@@ -153,7 +153,7 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, PTOS topt, bool info)
tdp->Lrecl = 4096; tdp->Lrecl = 4096;
tdp->Multiple = GetIntegerTableOption(g, topt, "Multiple", 0); tdp->Multiple = GetIntegerTableOption(g, topt, "Multiple", 0);
p = GetStringTableOption(g, topt, "Separator", ","); p = (char*)GetStringTableOption(g, topt, "Separator", ",");
tdp->Sep = (strlen(p) == 2 && p[0] == '\\' && p[1] == 't') ? '\t' : *p; tdp->Sep = (strlen(p) == 2 && p[0] == '\\' && p[1] == 't') ? '\t' : *p;
#if defined(__WIN__) #if defined(__WIN__)
@@ -167,7 +167,7 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, PTOS topt, bool info)
sep = tdp->Sep; sep = tdp->Sep;
tdp->Quoted = GetIntegerTableOption(g, topt, "Quoted", -1); tdp->Quoted = GetIntegerTableOption(g, topt, "Quoted", -1);
p = GetStringTableOption(g, topt, "Qchar", ""); p = (char*)GetStringTableOption(g, topt, "Qchar", "");
tdp->Qot = *p; tdp->Qot = *p;
if (tdp->Qot && tdp->Quoted < 0) if (tdp->Qot && tdp->Quoted < 0)

View File

@@ -365,7 +365,8 @@ PCOL TDBJDBC::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
/***********************************************************************/ /***********************************************************************/
bool TDBJDBC::MakeInsert(PGLOBAL g) bool TDBJDBC::MakeInsert(PGLOBAL g)
{ {
char *schmp = NULL, *catp = NULL, buf[NAM_LEN * 3]; PCSZ schmp = NULL;
char *catp = NULL, buf[NAM_LEN * 3];
int len = 0; int len = 0;
uint pos; uint pos;
bool b = false; bool b = false;

View File

@@ -210,9 +210,9 @@ protected:
virtual PQRYRES GetResult(PGLOBAL g); virtual PQRYRES GetResult(PGLOBAL g);
// Members // Members
char *Schema; // Points to schema name or NULL PCSZ Schema; // Points to schema name or NULL
char *Tab; // Points to JDBC table name or pattern PCSZ Tab; // Points to JDBC table name or pattern
char *Tabtype; // Points to JDBC table type PCSZ Tabtype; // Points to JDBC table type
JDBCPARM Ops; // Additional parameters JDBCPARM Ops; // Additional parameters
}; // end of class TDBJTB }; // end of class TDBJTB
@@ -229,7 +229,7 @@ protected:
virtual PQRYRES GetResult(PGLOBAL g); virtual PQRYRES GetResult(PGLOBAL g);
// Members // Members
char *Colpat; // Points to catalog column pattern PCSZ Colpat; // Points to catalog column pattern
}; // end of class TDBJDBCL }; // end of class TDBJDBCL
#endif // !NJDBC #endif // !NJDBC

View File

@@ -136,7 +136,7 @@ PQRYRES JSONColumns(PGLOBAL g, char *db, char *dsn, PTOS topt, bool info)
tdp->Collname = GetStringTableOption(g, topt, "Name", NULL); tdp->Collname = GetStringTableOption(g, topt, "Name", NULL);
tdp->Collname = GetStringTableOption(g, topt, "Tabname", tdp->Collname); tdp->Collname = GetStringTableOption(g, topt, "Tabname", tdp->Collname);
tdp->Schema = GetStringTableOption(g, topt, "Dbname", "test"); tdp->Schema = GetStringTableOption(g, topt, "Dbname", "test");
tdp->Options = GetStringTableOption(g, topt, "Colist", NULL); tdp->Options = (char*)GetStringTableOption(g, topt, "Colist", NULL);
tdp->Pipe = GetBooleanTableOption(g, topt, "Pipeline", false); tdp->Pipe = GetBooleanTableOption(g, topt, "Pipeline", false);
tdp->Pretty = 0; tdp->Pretty = 0;
#else // !MONGO_SUPPORT #else // !MONGO_SUPPORT

View File

@@ -54,8 +54,8 @@ public:
protected: protected:
// Members // Members
JMODE Jmode; /* MODE_OBJECT by default */ JMODE Jmode; /* MODE_OBJECT by default */
char *Objname; /* Name of first level object */ PCSZ Objname; /* Name of first level object */
char *Xcol; /* Name of expandable column */ PCSZ Xcol; /* Name of expandable column */
int Limit; /* Limit of multiple values */ int Limit; /* Limit of multiple values */
int Pretty; /* Depends on file structure */ int Pretty; /* Depends on file structure */
int Level; /* Used for catalog table */ int Level; /* Used for catalog table */
@@ -63,8 +63,8 @@ public:
bool Strict; /* Strict syntax checking */ bool Strict; /* Strict syntax checking */
const char *Uri; /* MongoDB connection URI */ const char *Uri; /* MongoDB connection URI */
#if defined(MONGO_SUPPORT) #if defined(MONGO_SUPPORT)
PSZ Collname; /* External collection name */ PCSZ Collname; /* External collection name */
PSZ Schema; /* External schema (DB) name */ PCSZ Schema; /* External schema (DB) name */
PSZ Options; /* Colist ; filter */ PSZ Options; /* Colist ; filter */
bool Pipe; /* True if Colist is a pipeline */ bool Pipe; /* True if Colist is a pipeline */
#endif // MONGO_SUPPORT #endif // MONGO_SUPPORT
@@ -122,8 +122,8 @@ public:
PJSON Val; // The value of the current row PJSON Val; // The value of the current row
PJCOL Colp; // The multiple column PJCOL Colp; // The multiple column
JMODE Jmode; // MODE_OBJECT by default JMODE Jmode; // MODE_OBJECT by default
char *Objname; // The table object name PCSZ Objname; // The table object name
char *Xcol; // Name of expandable column PCSZ Xcol; // Name of expandable column
int Fpos; // The current row index int Fpos; // The current row index
int N; // The current Rownum int N; // The current Rownum
int M; // Index of multiple value int M; // Index of multiple value

View File

@@ -83,8 +83,8 @@ public:
protected: protected:
// Members // Members
const char *Uri; /* MongoDB connection URI */ PCSZ Uri; /* MongoDB connection URI */
char *Colist; /* Options list */ PCSZ Colist; /* Options list */
char *Filter; /* Filtering query */ char *Filter; /* Filtering query */
int Level; /* Used for catalog table */ int Level; /* Used for catalog table */
int Base; /* The array index base */ int Base; /* The array index base */

View File

@@ -39,7 +39,7 @@ class DllExport TDBMUL : public TDBASE {
virtual void ResetDB(void); virtual void ResetDB(void);
virtual PTDB Clone(PTABS t); virtual PTDB Clone(PTABS t);
virtual bool IsSame(PTDB tp) {return tp == (PTDB)Tdbp;} virtual bool IsSame(PTDB tp) {return tp == (PTDB)Tdbp;}
virtual PSZ GetFile(PGLOBAL g) {return Tdbp->GetFile(g);} virtual PCSZ GetFile(PGLOBAL g) {return Tdbp->GetFile(g);}
virtual int GetRecpos(void) {return 0;} virtual int GetRecpos(void) {return 0;}
virtual PCOL ColDB(PGLOBAL g, PSZ name, int num); virtual PCOL ColDB(PGLOBAL g, PSZ name, int num);
bool InitFileNames(PGLOBAL g); bool InitFileNames(PGLOBAL g);

View File

@@ -68,8 +68,8 @@ void PrintResult(PGLOBAL, PSEM, PQRYRES);
#endif // _CONSOLE #endif // _CONSOLE
// Used to check whether a MYSQL table is created on itself // Used to check whether a MYSQL table is created on itself
bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host, bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, PCSZ host, PCSZ db,
const char *db, char *tab, const char *src, int port); PCSZ tab, PCSZ src, int port);
/***********************************************************************/ /***********************************************************************/
/* External function. */ /* External function. */
@@ -183,19 +183,22 @@ bool MYSQLDEF::GetServerInfo(PGLOBAL g, const char *server_name)
/***********************************************************************/ /***********************************************************************/
bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b) bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b)
{ {
char *tabn, *pwd, *schema;
if ((!strstr(url, "://") && (!strchr(url, '@')))) { if ((!strstr(url, "://") && (!strchr(url, '@')))) {
// No :// or @ in connection string. Must be a straight // No :// or @ in connection string. Must be a straight
// connection name of either "server" or "server/table" // connection name of either "server" or "server/table"
// ok, so we do a little parsing, but not completely! // ok, so we do a little parsing, but not completely!
if ((Tabname= strchr(url, '/'))) { if ((tabn= strchr(url, '/'))) {
// If there is a single '/' in the connection string, // If there is a single '/' in the connection string,
// this means the user is specifying a table name // this means the user is specifying a table name
*Tabname++= '\0'; *tabn++= '\0';
// there better not be any more '/'s ! // there better not be any more '/'s !
if (strchr(Tabname, '/')) if (strchr(tabn, '/'))
return true; return true;
Tabname = tabn;
} else } else
// Otherwise, straight server name, // Otherwise, straight server name,
Tabname = (b) ? GetStringCatInfo(g, "Tabname", Name) : NULL; Tabname = (b) ? GetStringCatInfo(g, "Tabname", Name) : NULL;
@@ -223,7 +226,7 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b)
Username += 3; Username += 3;
if (!(Hostname = strchr(Username, '@'))) { if (!(Hostname = (char*)strchr(Username, '@'))) {
strcpy(g->Message, "No host specified in URL"); strcpy(g->Message, "No host specified in URL");
return true; return true;
} else { } else {
@@ -231,11 +234,11 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b)
Server = Hostname; Server = Hostname;
} // endif Hostname } // endif Hostname
if ((Password = strchr(Username, ':'))) { if ((pwd = (char*)strchr(Username, ':'))) {
*Password++ = 0; // End username *pwd++ = 0; // End username
// Make sure there isn't an extra / or @ // Make sure there isn't an extra /
if ((strchr(Password, '/') || strchr(Hostname, '@'))) { if (strchr(pwd, '/')) {
strcpy(g->Message, "Syntax error in URL"); strcpy(g->Message, "Syntax error in URL");
return true; return true;
} // endif } // endif
@@ -243,8 +246,10 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b)
// Found that if the string is: // Found that if the string is:
// user:@hostname:port/db/table // user:@hostname:port/db/table
// Then password is a null string, so set to NULL // Then password is a null string, so set to NULL
if ((Password[0] == 0)) if ((pwd[0] == 0))
Password = NULL; Password = NULL;
else
Password = pwd;
} // endif password } // endif password
@@ -254,21 +259,23 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b)
return true; return true;
} // endif } // endif
if ((Tabschema = strchr(Hostname, '/'))) { if ((schema = strchr(Hostname, '/'))) {
*Tabschema++ = 0; *schema++ = 0;
if ((Tabname = strchr(Tabschema, '/'))) { if ((tabn = strchr(schema, '/'))) {
*Tabname++ = 0; *tabn++ = 0;
// Make sure there's not an extra / // Make sure there's not an extra /
if ((strchr(Tabname, '/'))) { if ((strchr(tabn, '/'))) {
strcpy(g->Message, "Syntax error in URL"); strcpy(g->Message, "Syntax error in URL");
return true; return true;
} // endif / } // endif /
Tabname = tabn;
} // endif TableName } // endif TableName
} // endif database Tabschema = schema;
} // endif database
if ((sport = strchr(Hostname, ':'))) if ((sport = strchr(Hostname, ':')))
*sport++ = 0; *sport++ = 0;
@@ -349,7 +356,7 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
Portnumber = GetIntCatInfo("Port", GetDefaultPort()); Portnumber = GetIntCatInfo("Port", GetDefaultPort());
Server = Hostname; Server = Hostname;
} else { } else {
char *locdb = Tabschema; PCSZ locdb = Tabschema;
if (ParseURL(g, url)) if (ParseURL(g, url))
return true; return true;

View File

@@ -242,10 +242,10 @@ class TDBMCL : public TDBCAT {
virtual PQRYRES GetResult(PGLOBAL g); virtual PQRYRES GetResult(PGLOBAL g);
// Members // Members
PSZ Host; // Host machine to use PCSZ Host; // Host machine to use
PSZ Db; // Database to be used by server PCSZ Db; // Database to be used by server
PSZ Tab; // External table name PCSZ Tab; // External table name
PSZ User; // User logon name PCSZ User; // User logon name
PSZ Pwd; // Password logon info PCSZ Pwd; // Password logon info
int Port; // MySQL port number (0 = default) int Port; // MySQL port number (0 = default)
}; // end of class TDBMCL }; // end of class TDBMCL

View File

@@ -231,7 +231,7 @@ PCOL TDBODBC::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
/* This used for Multiple(1) tables. Also prepare a connect string */ /* This used for Multiple(1) tables. Also prepare a connect string */
/* with a place holder to be used by SetFile. */ /* with a place holder to be used by SetFile. */
/***********************************************************************/ /***********************************************************************/
PSZ TDBODBC::GetFile(PGLOBAL g) PCSZ TDBODBC::GetFile(PGLOBAL g)
{ {
if (Connect) { if (Connect) {
char *p1, *p2; char *p1, *p2;
@@ -297,7 +297,8 @@ void TDBODBC::SetFile(PGLOBAL g, PSZ fn)
/***********************************************************************/ /***********************************************************************/
bool TDBODBC::MakeInsert(PGLOBAL g) bool TDBODBC::MakeInsert(PGLOBAL g)
{ {
char *schmp = NULL, *catp = NULL, buf[NAM_LEN * 3]; PCSZ schmp = NULL;
char *catp = NULL, buf[NAM_LEN * 3];
int len = 0; int len = 0;
bool oom, b = false; bool oom, b = false;
PTABLE tablep = To_Table; PTABLE tablep = To_Table;

View File

@@ -70,7 +70,7 @@ class TDBODBC : public TDBEXT {
// Methods // Methods
virtual PTDB Clone(PTABS t); virtual PTDB Clone(PTABS t);
virtual bool SetRecpos(PGLOBAL g, int recpos); virtual bool SetRecpos(PGLOBAL g, int recpos);
virtual PSZ GetFile(PGLOBAL g); virtual PCSZ GetFile(PGLOBAL g);
virtual void SetFile(PGLOBAL g, PSZ fn); virtual void SetFile(PGLOBAL g, PSZ fn);
virtual void ResetSize(void); virtual void ResetSize(void);
virtual PSZ GetServer(void) {return "ODBC";} virtual PSZ GetServer(void) {return "ODBC";}
@@ -239,10 +239,10 @@ class TDBOTB : public TDBDRV {
virtual PQRYRES GetResult(PGLOBAL g); virtual PQRYRES GetResult(PGLOBAL g);
// Members // Members
char *Dsn; // Points to connection string PCSZ Dsn; // Points to connection string
char *Schema; // Points to schema name or NULL PCSZ Schema; // Points to schema name or NULL
char *Tab; // Points to ODBC table name or pattern PCSZ Tab; // Points to ODBC table name or pattern
char *Tabtyp; // Points to ODBC table type PCSZ Tabtyp; // Points to ODBC table type
ODBCPARM Ops; // Additional parameters ODBCPARM Ops; // Additional parameters
}; // end of class TDBOTB }; // end of class TDBOTB

View File

@@ -61,7 +61,7 @@ class TDBINI : public TDBASE {
virtual int GetRecpos(void) {return N;} virtual int GetRecpos(void) {return N;}
virtual int GetProgCur(void) {return N;} virtual int GetProgCur(void) {return N;}
//virtual int GetAffectedRows(void) {return 0;} //virtual int GetAffectedRows(void) {return 0;}
virtual PSZ GetFile(PGLOBAL g) {return Ifile;} virtual PCSZ GetFile(PGLOBAL g) {return Ifile;}
virtual void SetFile(PGLOBAL g, PSZ fn) {Ifile = fn;} virtual void SetFile(PGLOBAL g, PSZ fn) {Ifile = fn;}
virtual void ResetDB(void) {Seclist = Section = NULL; N = 0;} virtual void ResetDB(void) {Seclist = Section = NULL; N = 0;}
virtual void ResetSize(void) {MaxSize = -1; Seclist = NULL;} virtual void ResetSize(void) {MaxSize = -1; Seclist = NULL;}

View File

@@ -27,7 +27,7 @@
/***********************************************************************/ /***********************************************************************/
/* Initialize WMI operations. */ /* Initialize WMI operations. */
/***********************************************************************/ /***********************************************************************/
PWMIUT InitWMI(PGLOBAL g, char *nsp, char *classname) PWMIUT InitWMI(PGLOBAL g, PCSZ nsp, PCSZ classname)
{ {
IWbemLocator *loc; IWbemLocator *loc;
char *p; char *p;
@@ -132,7 +132,7 @@ PWMIUT InitWMI(PGLOBAL g, char *nsp, char *classname)
/* WMIColumns: constructs the result blocks containing the description */ /* WMIColumns: constructs the result blocks containing the description */
/* of all the columns of a WMI table of a specified class. */ /* of all the columns of a WMI table of a specified class. */
/***********************************************************************/ /***********************************************************************/
PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info) PQRYRES WMIColumns(PGLOBAL g, PCSZ nsp, PCSZ cls, bool info)
{ {
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
TYPE_INT, TYPE_INT, TYPE_SHORT}; TYPE_INT, TYPE_INT, TYPE_SHORT};

View File

@@ -27,7 +27,7 @@ typedef struct _WMIutil {
/***********************************************************************/ /***********************************************************************/
/* Functions used externally. */ /* Functions used externally. */
/***********************************************************************/ /***********************************************************************/
PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info); PQRYRES WMIColumns(PGLOBAL g, PCSZ nsp, PCSZ cls, bool info);
/* -------------------------- WMI classes ---------------------------- */ /* -------------------------- WMI classes ---------------------------- */

View File

@@ -118,10 +118,11 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, FLD_PREC, static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME, FLD_PREC,
FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT}; FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT};
static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0}; static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0};
char *fn, *op, colname[65], fmt[129], buf[512]; char colname[65], fmt[129], buf[512];
int i, j, lvl, n = 0; int i, j, lvl, n = 0;
int ncol = sizeof(buftyp) / sizeof(int); int ncol = sizeof(buftyp) / sizeof(int);
bool ok = true; bool ok = true;
PCSZ fn, op;
PXCL xcol, xcp, fxcp = NULL, pxcp = NULL; PXCL xcol, xcp, fxcp = NULL, pxcp = NULL;
PLVL *lvlp, vp; PLVL *lvlp, vp;
PXNODE node = NULL; PXNODE node = NULL;

View File

@@ -31,7 +31,7 @@ class DllExport XMLDEF : public TABDEF { /* Logical table description */
protected: protected:
// Members // Members
char *Fn; /* Path/Name of corresponding file */ PCSZ Fn; /* Path/Name of corresponding file */
char *Encoding; /* New XML table file encoding */ char *Encoding; /* New XML table file encoding */
char *Tabname; /* Name of Table node */ char *Tabname; /* Name of Table node */
char *Rowname; /* Name of first level nodes */ char *Rowname; /* Name of first level nodes */
@@ -42,7 +42,7 @@ class DllExport XMLDEF : public TABDEF { /* Logical table description */
char *DefNs; /* Dummy name of default namespace */ char *DefNs; /* Dummy name of default namespace */
char *Attrib; /* Table node attributes */ char *Attrib; /* Table node attributes */
char *Hdattr; /* Header node attributes */ char *Hdattr; /* Header node attributes */
char *Entry; /* Zip entry name or pattern */ PCSZ Entry; /* Zip entry name or pattern */
int Coltype; /* Default column type */ int Coltype; /* Default column type */
int Limit; /* Limit of multiple values */ int Limit; /* Limit of multiple values */
int Header; /* n first rows are header rows */ int Header; /* n first rows are header rows */
@@ -74,7 +74,7 @@ class DllExport TDBXML : public TDBASE {
virtual PTDB Clone(PTABS t); virtual PTDB Clone(PTABS t);
virtual int GetRecpos(void); virtual int GetRecpos(void);
virtual int GetProgCur(void) {return N;} virtual int GetProgCur(void) {return N;}
virtual PSZ GetFile(PGLOBAL g) {return Xfile;} virtual PCSZ GetFile(PGLOBAL g) {return Xfile;}
virtual void SetFile(PGLOBAL g, PSZ fn) {Xfile = fn;} virtual void SetFile(PGLOBAL g, PSZ fn) {Xfile = fn;}
virtual void ResetDB(void) {N = 0;} virtual void ResetDB(void) {N = 0;}
virtual void ResetSize(void) {MaxSize = -1;} virtual void ResetSize(void) {MaxSize = -1;}
@@ -127,7 +127,7 @@ class DllExport TDBXML : public TDBASE {
bool Void; // True if the file does not exist bool Void; // True if the file does not exist
bool Zipped; // True if Zipped XML file(s) bool Zipped; // True if Zipped XML file(s)
bool Mulentries; // True if multiple entries in zip file bool Mulentries; // True if multiple entries in zip file
char *Xfile; // The XML file PCSZ Xfile; // The XML file
char *Enc; // New XML table file encoding char *Enc; // New XML table file encoding
char *Tabname; // Name of Table node char *Tabname; // Name of Table node
char *Rowname; // Name of first level nodes char *Rowname; // Name of first level nodes
@@ -138,7 +138,7 @@ class DllExport TDBXML : public TDBASE {
char *DefNs; // Dummy name of default namespace char *DefNs; // Dummy name of default namespace
char *Attrib; // Table node attribut(s) char *Attrib; // Table node attribut(s)
char *Hdattr; // Header node attribut(s) char *Hdattr; // Header node attribut(s)
char *Entry; // Zip entry name or pattern PCSZ Entry; // Zip entry name or pattern
int Coltype; // Default column type int Coltype; // Default column type
int Limit; // Limit of multiple values int Limit; // Limit of multiple values
int Header; // n first rows are header rows int Header; // n first rows are header rows

View File

@@ -34,7 +34,7 @@ public:
protected: protected:
// Members // Members
PSZ target; // The inside file to query PCSZ target; // The inside file to query
}; // end of ZIPDEF }; // end of ZIPDEF
/***********************************************************************/ /***********************************************************************/
@@ -68,7 +68,7 @@ protected:
// Members // Members
unzFile zipfile; // The ZIP container file unzFile zipfile; // The ZIP container file
PSZ zfn; // The ZIP file name PCSZ zfn; // The ZIP file name
//PSZ target; //PSZ target;
unz_file_info64 finfo; // The current file info unz_file_info64 finfo; // The current file info
char fn[FILENAME_MAX]; // The current file name char fn[FILENAME_MAX]; // The current file name

View File

@@ -246,7 +246,7 @@ char *STRING::Realloc(uint len)
/***********************************************************************/ /***********************************************************************/
/* Set a STRING new PSZ value. */ /* Set a STRING new PSZ value. */
/***********************************************************************/ /***********************************************************************/
bool STRING::Set(PSZ s) bool STRING::Set(PCSZ s)
{ {
if (!s) if (!s)
return false; return false;
@@ -336,9 +336,9 @@ bool STRING::Append(const char *s, uint ln, bool nq)
} // end of Append } // end of Append
/***********************************************************************/ /***********************************************************************/
/* Append a PSZ to a STRING. */ /* Append a PCSZ to a STRING. */
/***********************************************************************/ /***********************************************************************/
bool STRING::Append(PSZ s) bool STRING::Append(PCSZ s)
{ {
if (!s) if (!s)
return false; return false;
@@ -395,11 +395,11 @@ bool STRING::Append(char c)
/***********************************************************************/ /***********************************************************************/
/* Append a quoted PSZ to a STRING. */ /* Append a quoted PSZ to a STRING. */
/***********************************************************************/ /***********************************************************************/
bool STRING::Append_quoted(PSZ s) bool STRING::Append_quoted(PCSZ s)
{ {
bool b = Append('\''); bool b = Append('\'');
if (s) for (char *p = s; !b && *p; p++) if (s) for (const char *p = s; !b && *p; p++)
switch (*p) { switch (*p) {
case '\'': case '\'':
case '\\': case '\\':

View File

@@ -134,14 +134,14 @@ class DllExport STRING : public BLOCK {
// Methods // Methods
inline void Reset(void) {*Strp = 0;} inline void Reset(void) {*Strp = 0;}
bool Set(PSZ s); bool Set(PCSZ s);
bool Set(char *s, uint n); bool Set(char *s, uint n);
bool Append(const char *s, uint ln, bool nq = false); bool Append(const char *s, uint ln, bool nq = false);
bool Append(PSZ s); bool Append(PCSZ s);
bool Append(STRING &str); bool Append(STRING &str);
bool Append(char c); bool Append(char c);
bool Resize(uint n); bool Resize(uint n);
bool Append_quoted(PSZ s); bool Append_quoted(PCSZ s);
inline void Trim(void) {(void)Resize(Length + 1);} inline void Trim(void) {(void)Resize(Length + 1);}
inline void Chop(void) {if (Length) Strp[--Length] = 0;} inline void Chop(void) {if (Length) Strp[--Length] = 0;}
inline void RepLast(char c) {if (Length) Strp[Length-1] = c;} inline void RepLast(char c) {if (Length) Strp[Length-1] = c;}

View File

@@ -98,8 +98,8 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block.
virtual int GetMaxSize(PGLOBAL) = 0; virtual int GetMaxSize(PGLOBAL) = 0;
virtual int GetProgMax(PGLOBAL) = 0; virtual int GetProgMax(PGLOBAL) = 0;
virtual int GetProgCur(void) {return GetRecpos();} virtual int GetProgCur(void) {return GetRecpos();}
virtual PSZ GetFile(PGLOBAL) {return "Not a file";} virtual PCSZ GetFile(PGLOBAL) {return "Not a file";}
virtual void SetFile(PGLOBAL, PSZ) {} virtual void SetFile(PGLOBAL, PCSZ) {}
virtual void ResetDB(void) {} virtual void ResetDB(void) {}
virtual void ResetSize(void) {MaxSize = -1;} virtual void ResetSize(void) {MaxSize = -1;}
virtual int RowNumber(PGLOBAL g, bool b = false); virtual int RowNumber(PGLOBAL g, bool b = false);
@@ -168,9 +168,6 @@ class DllExport TDBASE : public TDB {
// Implementation // Implementation
inline int GetKnum(void) {return Knum;} inline int GetKnum(void) {return Knum;}
//inline PTABDEF GetDef(void) {return To_Def;}
//inline PCOL GetSetCols(void) {return To_SetCols;}
//inline void SetSetCols(PCOL colp) {To_SetCols = colp;}
inline void SetKey_Col(PCOL *cpp) {To_Key_Col = cpp;} inline void SetKey_Col(PCOL *cpp) {To_Key_Col = cpp;}
inline void SetXdp(PIXDEF xdp) {To_Xdp = xdp;} inline void SetXdp(PIXDEF xdp) {To_Xdp = xdp;}
inline void SetKindex(PKXBASE kxp) {To_Kindex = kxp;} inline void SetKindex(PKXBASE kxp) {To_Kindex = kxp;}
@@ -182,36 +179,14 @@ class DllExport TDBASE : public TDB {
// Methods // Methods
virtual bool IsUsingTemp(PGLOBAL) {return false;} virtual bool IsUsingTemp(PGLOBAL) {return false;}
//virtual bool IsIndexed(void) {return false;}
//virtual bool IsSpecial(PSZ name);
virtual PCATLG GetCat(void); virtual PCATLG GetCat(void);
//virtual PSZ GetPath(void);
virtual void PrintAM(FILE *f, char *m); virtual void PrintAM(FILE *f, char *m);
//virtual RECFM GetFtype(void) {return RECFM_NAF;}
//virtual int GetAffectedRows(void) {return -1;}
//virtual int GetRecpos(void) = 0;
//virtual bool SetRecpos(PGLOBAL g, int recpos);
//virtual bool IsReadOnly(void) {return Read_Only;}
//virtual bool IsView(void) {return FALSE;}
//virtual CHARSET_INFO *data_charset(void);
virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);} virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);}
//virtual int GetProgCur(void) {return GetRecpos();}
//virtual PSZ GetFile(PGLOBAL) {return "Not a file";}
//virtual int GetRemote(void) {return 0;}
//virtual void SetFile(PGLOBAL, PSZ) {}
//virtual void ResetDB(void) {}
//virtual void ResetSize(void) {MaxSize = -1;}
virtual void RestoreNrec(void) {} virtual void RestoreNrec(void) {}
virtual int ResetTableOpt(PGLOBAL g, bool dop, bool dox); virtual int ResetTableOpt(PGLOBAL g, bool dop, bool dox);
virtual PSZ GetServer(void) {return "Current";} virtual PSZ GetServer(void) {return "Current";}
// Database routines // Database routines
//virtual PCOL ColDB(PGLOBAL g, PSZ name, int num);
//virtual PCOL MakeCol(PGLOBAL, PCOLDEF, PCOL, int)
// {assert(false); return NULL;}
//virtual PCOL InsertSpecialColumn(PCOL colp);
//virtual PCOL InsertSpcBlk(PGLOBAL g, PCOLDEF cdp);
//virtual void MarkDB(PGLOBAL g, PTDB tdb2);
virtual int MakeIndex(PGLOBAL g, PIXDEF, bool) virtual int MakeIndex(PGLOBAL g, PIXDEF, bool)
{strcpy(g->Message, "Remote index"); return RC_INFO;} {strcpy(g->Message, "Remote index"); return RC_INFO;}
virtual bool ReadKey(PGLOBAL, OPVAL, const key_range *) virtual bool ReadKey(PGLOBAL, OPVAL, const key_range *)
@@ -222,18 +197,12 @@ class DllExport TDBASE : public TDB {
"This function should not be called for this table"); return true;} "This function should not be called for this table"); return true;}
// Members // Members
//PTABDEF To_Def; // Points to catalog description block
PXOB *To_Link; // Points to column of previous relations PXOB *To_Link; // Points to column of previous relations
PCOL *To_Key_Col; // Points to key columns in current file PCOL *To_Key_Col; // Points to key columns in current file
PKXBASE To_Kindex; // Points to table key index PKXBASE To_Kindex; // Points to table key index
PIXDEF To_Xdp; // To the index definition block PIXDEF To_Xdp; // To the index definition block
//PCOL To_SetCols; // Points to updated columns
RECFM Ftype; // File type: 0-var 1-fixed 2-binary (VCT) RECFM Ftype; // File type: 0-var 1-fixed 2-binary (VCT)
//int MaxSize; // Max size in number of lines
int Knum; // Size of key arrays int Knum; // Size of key arrays
//bool Read_Only; // True for read only tables
//const CHARSET_INFO *m_data_charset;
//const char *csname; // Table charset name
}; // end of class TDBASE }; // end of class TDBASE
/***********************************************************************/ /***********************************************************************/