mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixing MDEV-12149: compile errors on Windows with /Zc:strictStrings
Introduce typedef PCSZ and replace PSZ by it where it matters All done on CONNECT but compile still fails because of an included system file modified: storage/connect/array.cpp modified: storage/connect/catalog.h modified: storage/connect/colblk.cpp modified: storage/connect/colblk.h modified: storage/connect/domdoc.cpp modified: storage/connect/domdoc.h modified: storage/connect/filamdbf.cpp modified: storage/connect/filamdbf.h modified: storage/connect/filamfix.cpp modified: storage/connect/filamgz.cpp modified: storage/connect/filamvct.cpp modified: storage/connect/filamvct.h modified: storage/connect/ha_connect.cc modified: storage/connect/ha_connect.h modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h modified: storage/connect/json.cpp modified: storage/connect/json.h modified: storage/connect/jsonudf.cpp modified: storage/connect/jsonudf.h modified: storage/connect/libdoc.cpp modified: storage/connect/macutil.cpp modified: storage/connect/myconn.cpp modified: storage/connect/myutil.cpp modified: storage/connect/myutil.h modified: storage/connect/odbconn.cpp modified: storage/connect/odbconn.h modified: storage/connect/plgdbsem.h modified: storage/connect/plgdbutl.cpp modified: storage/connect/plgxml.cpp modified: storage/connect/plgxml.h modified: storage/connect/plugutil.cpp modified: storage/connect/preparse.h modified: storage/connect/reldef.cpp modified: storage/connect/reldef.h modified: storage/connect/tabdos.cpp modified: storage/connect/tabdos.h modified: storage/connect/tabext.cpp modified: storage/connect/tabext.h modified: storage/connect/tabfix.cpp modified: storage/connect/tabfix.h modified: storage/connect/tabfmt.cpp modified: storage/connect/tabfmt.h modified: storage/connect/tabjdbc.cpp modified: storage/connect/tabjdbc.h modified: storage/connect/tabjson.cpp modified: storage/connect/table.cpp modified: storage/connect/tabmac.cpp modified: storage/connect/tabmgo.cpp modified: storage/connect/tabmul.cpp 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/tabpivot.cpp modified: storage/connect/tabpivot.h modified: storage/connect/tabsys.cpp modified: storage/connect/tabsys.h modified: storage/connect/tabutil.cpp modified: storage/connect/tabutil.h modified: storage/connect/tabvir.cpp modified: storage/connect/tabvir.h modified: storage/connect/tabxml.cpp modified: storage/connect/tabxml.h modified: storage/connect/tabzip.cpp modified: storage/connect/tabzip.h modified: storage/connect/valblk.cpp modified: storage/connect/valblk.h modified: storage/connect/value.cpp modified: storage/connect/value.h modified: storage/connect/xindex.cpp modified: storage/connect/xobject.cpp modified: storage/connect/xobject.h modified: storage/connect/xtable.h
This commit is contained in:
@@ -977,7 +977,7 @@ PSZ ARRAY::MakeArrayList(PGLOBAL g)
|
|||||||
size_t z, len = 2;
|
size_t z, len = 2;
|
||||||
|
|
||||||
if (Type == TYPE_LIST)
|
if (Type == TYPE_LIST)
|
||||||
return "(?" "?" "?)"; // To be implemented
|
return (PSZ)("(?" "?" "?)"); // To be implemented
|
||||||
|
|
||||||
z = MY_MAX(24, GetTypeSize(Type, Len) + 4);
|
z = MY_MAX(24, GetTypeSize(Type, Len) + 4);
|
||||||
tp = (char*)PlugSubAlloc(g, NULL, z);
|
tp = (char*)PlugSubAlloc(g, NULL, z);
|
||||||
|
@@ -36,7 +36,7 @@ typedef struct _curtab {
|
|||||||
/* Defines the structure used to get column catalog info. */
|
/* Defines the structure used to get column catalog info. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
typedef struct _colinfo {
|
typedef struct _colinfo {
|
||||||
char *Name;
|
PCSZ Name;
|
||||||
int Type;
|
int Type;
|
||||||
int Offset;
|
int Offset;
|
||||||
int Length;
|
int Length;
|
||||||
@@ -45,9 +45,9 @@ typedef struct _colinfo {
|
|||||||
int Scale;
|
int Scale;
|
||||||
int Opt;
|
int Opt;
|
||||||
int Freq;
|
int Freq;
|
||||||
char *Remark;
|
PCSZ Remark;
|
||||||
char *Datefmt;
|
PCSZ Datefmt;
|
||||||
char *Fieldfmt;
|
PCSZ Fieldfmt;
|
||||||
ushort Flags; // Used by MariaDB CONNECT handlers
|
ushort Flags; // Used by MariaDB CONNECT handlers
|
||||||
} COLINFO, *PCOLINFO;
|
} COLINFO, *PCOLINFO;
|
||||||
|
|
||||||
|
@@ -377,7 +377,7 @@ PRTBLK::PRTBLK(PCOLUMN cp) : SPCBLK(cp)
|
|||||||
void PRTBLK::ReadColumn(PGLOBAL g)
|
void PRTBLK::ReadColumn(PGLOBAL g)
|
||||||
{
|
{
|
||||||
if (Pname == NULL) {
|
if (Pname == NULL) {
|
||||||
char *p;
|
const char *p;
|
||||||
|
|
||||||
Pname = To_Tdb->GetDef()->GetStringCatInfo(g, "partname", "?");
|
Pname = To_Tdb->GetDef()->GetStringCatInfo(g, "partname", "?");
|
||||||
p = strrchr(Pname, '#');
|
p = strrchr(Pname, '#');
|
||||||
@@ -407,7 +407,7 @@ SIDBLK::SIDBLK(PCOLUMN cp) : SPCBLK(cp)
|
|||||||
void SIDBLK::ReadColumn(PGLOBAL)
|
void SIDBLK::ReadColumn(PGLOBAL)
|
||||||
{
|
{
|
||||||
//if (Sname == NULL) {
|
//if (Sname == NULL) {
|
||||||
Sname = (char*)To_Tdb->GetServer();
|
Sname = To_Tdb->GetServer();
|
||||||
Value->SetValue_psz(Sname);
|
Value->SetValue_psz(Sname);
|
||||||
// } // endif Sname
|
// } // endif Sname
|
||||||
|
|
||||||
|
@@ -178,7 +178,7 @@ class DllExport TIDBLK : public SPCBLK {
|
|||||||
TIDBLK(void) {}
|
TIDBLK(void) {}
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
PSZ Tname; // The current table name
|
PCSZ Tname; // The current table name
|
||||||
}; // end of class TIDBLK
|
}; // end of class TIDBLK
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -201,7 +201,7 @@ class DllExport PRTBLK : public SPCBLK {
|
|||||||
PRTBLK(void) {}
|
PRTBLK(void) {}
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
PSZ Pname; // The current partition name
|
PCSZ Pname; // The current partition name
|
||||||
}; // end of class PRTBLK
|
}; // end of class PRTBLK
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -224,7 +224,7 @@ class DllExport SIDBLK : public SPCBLK {
|
|||||||
SIDBLK(void) {}
|
SIDBLK(void) {}
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
PSZ Sname; // The current server name
|
PCSZ Sname; // The current server name
|
||||||
}; // end of class SIDBLK
|
}; // end of class SIDBLK
|
||||||
|
|
||||||
#endif // __COLBLK__H
|
#endif // __COLBLK__H
|
||||||
|
@@ -155,7 +155,7 @@ PFBLOCK DOMDOC::LinkXblock(PGLOBAL g, MODE m, int rc, char *fn)
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Create the XML node. */
|
/* Create the XML node. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
bool DOMDOC::NewDoc(PGLOBAL g, char *ver)
|
bool DOMDOC::NewDoc(PGLOBAL g, PCSZ ver)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
MSXML2::IXMLDOMProcessingInstructionPtr pip;
|
MSXML2::IXMLDOMProcessingInstructionPtr pip;
|
||||||
@@ -490,9 +490,9 @@ PXATTR DOMNODE::GetAttribute(PGLOBAL g, char *name, PXATTR ap)
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Add a new element child node to this node and return it. */
|
/* Add a new element child node to this node and return it. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
PXNODE DOMNODE::AddChildNode(PGLOBAL g, char *name, PXNODE np)
|
PXNODE DOMNODE::AddChildNode(PGLOBAL g, PCSZ name, PXNODE np)
|
||||||
{
|
{
|
||||||
char *p, *pn;
|
const char *p, *pn;
|
||||||
// char *p, *pn, *epf, *pf = NULL;
|
// char *p, *pn, *epf, *pf = NULL;
|
||||||
MSXML2::IXMLDOMNodePtr ep;
|
MSXML2::IXMLDOMNodePtr ep;
|
||||||
// _bstr_t uri((wchar_t*)NULL);
|
// _bstr_t uri((wchar_t*)NULL);
|
||||||
@@ -585,7 +585,7 @@ PXATTR DOMNODE::AddProperty(PGLOBAL g, char *name, PXATTR ap)
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Add a new text node to this node. */
|
/* Add a new text node to this node. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
void DOMNODE::AddText(PGLOBAL g, char *txtp)
|
void DOMNODE::AddText(PGLOBAL g, PCSZ txtp)
|
||||||
{
|
{
|
||||||
MSXML2::IXMLDOMTextPtr tp= Docp->createTextNode((_bstr_t)txtp);
|
MSXML2::IXMLDOMTextPtr tp= Docp->createTextNode((_bstr_t)txtp);
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@ class DOMDOC : public XMLDOCUMENT {
|
|||||||
// Methods
|
// Methods
|
||||||
virtual bool Initialize(PGLOBAL g, PCSZ 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, PCSZ ver);
|
||||||
virtual void AddComment(PGLOBAL g, char *com);
|
virtual void AddComment(PGLOBAL g, char *com);
|
||||||
virtual PXNODE GetRoot(PGLOBAL g);
|
virtual PXNODE GetRoot(PGLOBAL g);
|
||||||
virtual PXNODE NewRoot(PGLOBAL g, char *name);
|
virtual PXNODE NewRoot(PGLOBAL g, char *name);
|
||||||
@@ -78,9 +78,9 @@ class DOMNODE : public XMLNODE {
|
|||||||
virtual PXLIST SelectNodes(PGLOBAL g, char *xp, PXLIST lp);
|
virtual PXLIST SelectNodes(PGLOBAL g, char *xp, PXLIST lp);
|
||||||
virtual PXNODE SelectSingleNode(PGLOBAL g, char *xp, PXNODE np);
|
virtual PXNODE SelectSingleNode(PGLOBAL g, char *xp, PXNODE np);
|
||||||
virtual PXATTR GetAttribute(PGLOBAL g, char *name, PXATTR ap);
|
virtual PXATTR GetAttribute(PGLOBAL g, char *name, PXATTR ap);
|
||||||
virtual PXNODE AddChildNode(PGLOBAL g, char *name, PXNODE np);
|
virtual PXNODE AddChildNode(PGLOBAL g, PCSZ name, PXNODE np);
|
||||||
virtual PXATTR AddProperty(PGLOBAL g, char *name, PXATTR ap);
|
virtual PXATTR AddProperty(PGLOBAL g, char *name, PXATTR ap);
|
||||||
virtual void AddText(PGLOBAL g, char *txtp);
|
virtual void AddText(PGLOBAL g, PCSZ txtp);
|
||||||
virtual void DeleteChild(PGLOBAL g, PXNODE dnp);
|
virtual void DeleteChild(PGLOBAL g, PXNODE dnp);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -186,7 +186,7 @@ static int dbfhead(PGLOBAL g, FILE *file, PCSZ fn, DBFHEADER *buf)
|
|||||||
/* DBFColumns: constructs the result blocks containing the description */
|
/* DBFColumns: constructs the result blocks containing the description */
|
||||||
/* of all the columns of a DBF file that will be retrieved by #GetData. */
|
/* of all the columns of a DBF file that will be retrieved by #GetData. */
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
PQRYRES DBFColumns(PGLOBAL g, char *dp, const char *fn, bool info)
|
PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info)
|
||||||
{
|
{
|
||||||
int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
|
int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
|
||||||
TYPE_INT, TYPE_INT, TYPE_SHORT};
|
TYPE_INT, TYPE_INT, TYPE_SHORT};
|
||||||
@@ -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, PCSZ fn, int lrecl, int *rln, PSZ defpath)
|
int DBFBASE::ScanHeader(PGLOBAL g, PCSZ fn, int lrecl, int *rln, PCSZ defpath)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
char filename[_MAX_PATH];
|
char filename[_MAX_PATH];
|
||||||
|
@@ -19,7 +19,7 @@ typedef class DBMFAM *PDBMFAM;
|
|||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* Functions used externally. */
|
/* Functions used externally. */
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
PQRYRES DBFColumns(PGLOBAL g, char *dp, const char *fn, bool info);
|
PQRYRES DBFColumns(PGLOBAL g, PCSZ dp, PCSZ fn, bool info);
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* This is the base class for dBASE file access methods. */
|
/* This is the base class for dBASE file access methods. */
|
||||||
@@ -31,7 +31,7 @@ class DllExport DBFBASE {
|
|||||||
DBFBASE(PDBF txfp);
|
DBFBASE(PDBF txfp);
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
int ScanHeader(PGLOBAL g, PCSZ fname, int lrecl, int *rlen, PSZ defpath);
|
int ScanHeader(PGLOBAL g, PCSZ fname, int lrecl, int *rlen, PCSZ defpath);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Default constructor, not to be used
|
// Default constructor, not to be used
|
||||||
|
@@ -761,7 +761,8 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req)
|
|||||||
htrc("after write req=%d brc=%d nbw=%d\n", req, brc, nbw);
|
htrc("after write req=%d brc=%d nbw=%d\n", req, brc, nbw);
|
||||||
|
|
||||||
if (!brc || nbw != len) {
|
if (!brc || nbw != len) {
|
||||||
char buf[256], *fn = (h == Hfile) ? To_File : "Tempfile";
|
char buf[256];
|
||||||
|
PCSZ fn = (h == Hfile) ? To_File : "Tempfile";
|
||||||
|
|
||||||
if (brc)
|
if (brc)
|
||||||
strcpy(buf, MSG(BAD_BYTE_NUM));
|
strcpy(buf, MSG(BAD_BYTE_NUM));
|
||||||
|
@@ -920,7 +920,7 @@ int ZLBFAM::GetFileLength(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool ZLBFAM::AllocateBuffer(PGLOBAL g)
|
bool ZLBFAM::AllocateBuffer(PGLOBAL g)
|
||||||
{
|
{
|
||||||
char *msg;
|
PCSZ msg;
|
||||||
int n, zrc;
|
int n, zrc;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@@ -880,7 +880,8 @@ int VCTFAM::DeleteRecords(PGLOBAL g, int irc)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool VCTFAM::OpenTempFile(PGLOBAL g)
|
bool VCTFAM::OpenTempFile(PGLOBAL g)
|
||||||
{
|
{
|
||||||
char *opmode, tempname[_MAX_PATH];
|
PCSZ opmode;
|
||||||
|
char tempname[_MAX_PATH];
|
||||||
bool rc = false;
|
bool rc = false;
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
@@ -1998,7 +1999,7 @@ bool VECFAM::OpenTableFile(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Open the file corresponding to one column. */
|
/* Open the file corresponding to one column. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool VECFAM::OpenColumnFile(PGLOBAL g, char *opmode, int i)
|
bool VECFAM::OpenColumnFile(PGLOBAL g, PCSZ opmode, int i)
|
||||||
{
|
{
|
||||||
char filename[_MAX_PATH];
|
char filename[_MAX_PATH];
|
||||||
PDBUSER dup = PlgGetUser(g);
|
PDBUSER dup = PlgGetUser(g);
|
||||||
@@ -3143,7 +3144,8 @@ bool BGVFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req)
|
|||||||
htrc("after write req=%d brc=%d nbw=%d\n", req, brc, nbw);
|
htrc("after write req=%d brc=%d nbw=%d\n", req, brc, nbw);
|
||||||
|
|
||||||
if (!brc || nbw != len) {
|
if (!brc || nbw != len) {
|
||||||
char buf[256], *fn = (h == Hfile) ? To_File : "Tempfile";
|
char buf[256];
|
||||||
|
PCSZ fn = (h == Hfile) ? To_File : "Tempfile";
|
||||||
|
|
||||||
if (brc)
|
if (brc)
|
||||||
strcpy(buf, MSG(BAD_BYTE_NUM));
|
strcpy(buf, MSG(BAD_BYTE_NUM));
|
||||||
@@ -3329,7 +3331,7 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn)
|
|||||||
PlugSetPath(filename, fn, Tdbp->GetPath());
|
PlugSetPath(filename, fn, Tdbp->GetPath());
|
||||||
|
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
char *p;
|
PCSZ p;
|
||||||
DWORD rc;
|
DWORD rc;
|
||||||
bool brc;
|
bool brc;
|
||||||
LARGE_INTEGER of;
|
LARGE_INTEGER of;
|
||||||
|
@@ -160,7 +160,7 @@ class DllExport VECFAM : public VCTFAM {
|
|||||||
virtual bool MoveLines(PGLOBAL g);
|
virtual bool MoveLines(PGLOBAL g);
|
||||||
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL);
|
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL);
|
||||||
virtual int RenameTempFile(PGLOBAL g);
|
virtual int RenameTempFile(PGLOBAL g);
|
||||||
bool OpenColumnFile(PGLOBAL g, char *opmode, int i);
|
bool OpenColumnFile(PGLOBAL g, PCSZ opmode, int i);
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
FILE* *Streams; // Points to Dos file structure array
|
FILE* *Streams; // Points to Dos file structure array
|
||||||
|
@@ -1972,7 +1972,8 @@ int ha_connect::CloseTable(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int ha_connect::MakeRecord(char *buf)
|
int ha_connect::MakeRecord(char *buf)
|
||||||
{
|
{
|
||||||
char *p, *fmt, val[32];
|
PCSZ fmt;
|
||||||
|
char *p, val[32];
|
||||||
int rc= 0;
|
int rc= 0;
|
||||||
Field* *field;
|
Field* *field;
|
||||||
Field *fp;
|
Field *fp;
|
||||||
@@ -2108,7 +2109,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *)
|
|||||||
{
|
{
|
||||||
char attr_buffer[1024];
|
char attr_buffer[1024];
|
||||||
char data_buffer[1024];
|
char data_buffer[1024];
|
||||||
char *fmt;
|
PCSZ fmt;
|
||||||
int rc= 0;
|
int rc= 0;
|
||||||
PCOL colp;
|
PCOL colp;
|
||||||
PVAL value, sdvalin;
|
PVAL value, sdvalin;
|
||||||
@@ -4234,16 +4235,16 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn, bool quick)
|
|||||||
case TAB_JSON:
|
case TAB_JSON:
|
||||||
if (options->filename && *options->filename) {
|
if (options->filename && *options->filename) {
|
||||||
if (!quick) {
|
if (!quick) {
|
||||||
char *s, path[FN_REFLEN], dbpath[FN_REFLEN];
|
char path[FN_REFLEN], dbpath[FN_REFLEN];
|
||||||
#if defined(__WIN__)
|
|
||||||
s= "\\";
|
|
||||||
#else // !__WIN__
|
|
||||||
s= "/";
|
|
||||||
#endif // !__WIN__
|
|
||||||
strcpy(dbpath, mysql_real_data_home);
|
strcpy(dbpath, mysql_real_data_home);
|
||||||
|
|
||||||
if (db)
|
if (db)
|
||||||
strcat(strcat(dbpath, db), s);
|
#if defined(__WIN__)
|
||||||
|
strcat(strcat(dbpath, db), "\\");
|
||||||
|
#else // !__WIN__
|
||||||
|
strcat(strcat(dbpath, db), "/");
|
||||||
|
#endif // !__WIN__
|
||||||
|
|
||||||
(void)fn_format(path, options->filename, dbpath, "",
|
(void)fn_format(path, options->filename, dbpath, "",
|
||||||
MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
|
MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
|
||||||
@@ -5597,7 +5598,8 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
} // endif src
|
} // endif src
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
char *cnm, *rem, *dft, *xtra, *key, *fmt;
|
const char *cnm, *rem;
|
||||||
|
char *dft, *xtra, *key, *fmt;
|
||||||
int i, len, prec, dec, typ, flg;
|
int i, len, prec, dec, typ, flg;
|
||||||
|
|
||||||
if (!(dpath = SetPath(g, table_s->db.str))) {
|
if (!(dpath = SetPath(g, table_s->db.str))) {
|
||||||
@@ -6583,7 +6585,8 @@ bool ha_connect::FileExists(const char *fn, bool bf)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (table) {
|
if (table) {
|
||||||
char *s, tfn[_MAX_PATH], filename[_MAX_PATH], path[_MAX_PATH];
|
const char *s;
|
||||||
|
char tfn[_MAX_PATH], filename[_MAX_PATH], path[_MAX_PATH];
|
||||||
bool b= false;
|
bool b= false;
|
||||||
int n;
|
int n;
|
||||||
struct stat info;
|
struct stat info;
|
||||||
|
@@ -187,8 +187,8 @@ 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(PCSZ name);
|
PCSZ GetDBName(PCSZ name);
|
||||||
const char *GetTableName(void);
|
PCSZ GetTableName(void);
|
||||||
char *GetPartName(void);
|
char *GetPartName(void);
|
||||||
//int GetColNameLen(Field *fp);
|
//int GetColNameLen(Field *fp);
|
||||||
//char *GetColName(Field *fp);
|
//char *GetColName(Field *fp);
|
||||||
@@ -197,7 +197,7 @@ public:
|
|||||||
bool IsSameIndex(PIXDEF xp1, PIXDEF xp2);
|
bool IsSameIndex(PIXDEF xp1, PIXDEF xp2);
|
||||||
bool IsPartitioned(void);
|
bool IsPartitioned(void);
|
||||||
bool IsUnique(uint n);
|
bool IsUnique(uint n);
|
||||||
char *GetDataPath(void) {return (char*)datapath;}
|
PCSZ GetDataPath(void) {return datapath;}
|
||||||
|
|
||||||
bool SetDataPath(PGLOBAL g, PCSZ path);
|
bool SetDataPath(PGLOBAL g, PCSZ path);
|
||||||
PTDB GetTDB(PGLOBAL g);
|
PTDB GetTDB(PGLOBAL g);
|
||||||
@@ -513,7 +513,7 @@ protected:
|
|||||||
ulong hnum; // The number of this handler
|
ulong hnum; // The number of this handler
|
||||||
query_id_t valid_query_id; // The one when tdbp was allocated
|
query_id_t valid_query_id; // The one when tdbp was allocated
|
||||||
query_id_t creat_query_id; // The one when handler was allocated
|
query_id_t creat_query_id; // The one when handler was allocated
|
||||||
char *datapath; // Is the Path of DB data directory
|
PCSZ datapath; // Is the Path of DB data directory
|
||||||
PTDB tdbp; // To table class object
|
PTDB tdbp; // To table class object
|
||||||
PVAL sdvalin1; // Used to convert date values
|
PVAL sdvalin1; // Used to convert date values
|
||||||
PVAL sdvalin2; // Used to convert date values
|
PVAL sdvalin2; // Used to convert date values
|
||||||
|
@@ -1845,7 +1845,7 @@ bool JDBConn::SetParam(JDBCCOL *colp)
|
|||||||
PGLOBAL& g = m_G;
|
PGLOBAL& g = m_G;
|
||||||
// void *buffer;
|
// void *buffer;
|
||||||
int i, ncol;
|
int i, ncol;
|
||||||
PSZ fnc = "Unknown";
|
PCSZ fnc = "Unknown";
|
||||||
uint n;
|
uint n;
|
||||||
short len, tp;
|
short len, tp;
|
||||||
int crow = 0;
|
int crow = 0;
|
||||||
|
@@ -174,16 +174,10 @@ protected:
|
|||||||
jmethodID timfldid; // The TimeField method ID
|
jmethodID timfldid; // The TimeField method ID
|
||||||
jmethodID tspfldid; // The TimestampField method ID
|
jmethodID tspfldid; // The TimestampField method ID
|
||||||
jmethodID bigfldid; // The BigintField method ID
|
jmethodID bigfldid; // The BigintField method ID
|
||||||
//DWORD m_LoginTimeout;
|
PCSZ Msg;
|
||||||
//DWORD m_QueryTimeout;
|
|
||||||
//DWORD m_UpdateOptions;
|
|
||||||
char *Msg;
|
|
||||||
char *m_Wrap;
|
char *m_Wrap;
|
||||||
char m_IDQuoteChar[2];
|
char m_IDQuoteChar[2];
|
||||||
//PSZ m_Driver;
|
PCSZ m_Pwd;
|
||||||
//PSZ m_Url;
|
|
||||||
//PSZ m_User;
|
|
||||||
PSZ m_Pwd;
|
|
||||||
int m_Ncol;
|
int m_Ncol;
|
||||||
int m_Aff;
|
int m_Aff;
|
||||||
int m_Rows;
|
int m_Rows;
|
||||||
|
@@ -936,7 +936,7 @@ return false;
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Add a new pair to an Object. */
|
/* Add a new pair to an Object. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PJPR JOBJECT::AddPair(PGLOBAL g, PSZ key)
|
PJPR JOBJECT::AddPair(PGLOBAL g, PCSZ key)
|
||||||
{
|
{
|
||||||
PJPR jpp = new(g) JPAIR(key);
|
PJPR jpp = new(g) JPAIR(key);
|
||||||
|
|
||||||
@@ -1022,7 +1022,7 @@ bool JOBJECT::Merge(PGLOBAL g, PJSON jsp)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set or add a value corresponding to the given key. */
|
/* Set or add a value corresponding to the given key. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void JOBJECT::SetValue(PGLOBAL g, PJVAL jvp, PSZ key)
|
void JOBJECT::SetValue(PGLOBAL g, PJVAL jvp, PCSZ key)
|
||||||
{
|
{
|
||||||
PJPR jp;
|
PJPR jp;
|
||||||
|
|
||||||
@@ -1042,7 +1042,7 @@ void JOBJECT::SetValue(PGLOBAL g, PJVAL jvp, PSZ key)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Delete a value corresponding to the given key. */
|
/* Delete a value corresponding to the given key. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void JOBJECT::DeleteKey(PSZ key)
|
void JOBJECT::DeleteKey(PCSZ key)
|
||||||
{
|
{
|
||||||
PJPR jp, *pjp = &First;
|
PJPR jp, *pjp = &First;
|
||||||
|
|
||||||
@@ -1221,10 +1221,10 @@ JVALUE::JVALUE(PGLOBAL g, PVAL valp) : JSON()
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Constructor for a given string. */
|
/* Constructor for a given string. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
JVALUE::JVALUE(PGLOBAL g, PSZ strp) : JSON()
|
JVALUE::JVALUE(PGLOBAL g, PCSZ strp) : JSON()
|
||||||
{
|
{
|
||||||
Jsp = NULL;
|
Jsp = NULL;
|
||||||
Value = AllocateValue(g, strp, TYPE_STRING);
|
Value = AllocateValue(g, (void*)strp, TYPE_STRING);
|
||||||
Next = NULL;
|
Next = NULL;
|
||||||
Del = false;
|
Del = false;
|
||||||
} // end of JVALUE constructor
|
} // end of JVALUE constructor
|
||||||
|
@@ -125,14 +125,14 @@ class JPAIR : public BLOCK {
|
|||||||
friend PJOB ParseObject(PGLOBAL, int&, STRG&, bool*);
|
friend PJOB ParseObject(PGLOBAL, int&, STRG&, bool*);
|
||||||
friend bool SerializeObject(JOUT *, PJOB);
|
friend bool SerializeObject(JOUT *, PJOB);
|
||||||
public:
|
public:
|
||||||
JPAIR(PSZ key) : BLOCK() {Key = key; Val = NULL; Next = NULL;}
|
JPAIR(PCSZ key) : BLOCK() {Key = key; Val = NULL; Next = NULL;}
|
||||||
|
|
||||||
inline PSZ GetKey(void) {return Key;}
|
inline PCSZ GetKey(void) {return Key;}
|
||||||
inline PJVAL GetVal(void) {return Val;}
|
inline PJVAL GetVal(void) {return Val;}
|
||||||
inline PJPR GetNext(void) {return Next;}
|
inline PJPR GetNext(void) {return Next;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PSZ Key; // This pair key name
|
PCSZ Key; // This pair key name
|
||||||
PJVAL Val; // To the value of the pair
|
PJVAL Val; // To the value of the pair
|
||||||
PJPR Next; // To the next pair
|
PJPR Next; // To the next pair
|
||||||
}; // end of class JPAIR
|
}; // end of class JPAIR
|
||||||
@@ -150,7 +150,7 @@ class JSON : public BLOCK {
|
|||||||
virtual JTYP GetValType(void) {X return TYPE_JSON;}
|
virtual JTYP GetValType(void) {X return TYPE_JSON;}
|
||||||
virtual void InitArray(PGLOBAL g) {X}
|
virtual void InitArray(PGLOBAL g) {X}
|
||||||
//virtual PJVAL AddValue(PGLOBAL g, PJVAL jvp = NULL, int *x = NULL) {X return NULL;}
|
//virtual PJVAL AddValue(PGLOBAL g, PJVAL jvp = NULL, int *x = NULL) {X return NULL;}
|
||||||
virtual PJPR AddPair(PGLOBAL g, PSZ key) {X return NULL;}
|
virtual PJPR AddPair(PGLOBAL g, PCSZ key) {X return NULL;}
|
||||||
virtual PJAR GetKeyList(PGLOBAL g) {X return NULL;}
|
virtual PJAR GetKeyList(PGLOBAL g) {X return NULL;}
|
||||||
virtual PJVAL GetValue(const char *key) {X return NULL;}
|
virtual PJVAL GetValue(const char *key) {X return NULL;}
|
||||||
virtual PJOB GetObject(void) {return NULL;}
|
virtual PJOB GetObject(void) {return NULL;}
|
||||||
@@ -166,13 +166,13 @@ class JSON : public BLOCK {
|
|||||||
virtual PSZ GetText(PGLOBAL g, PSZ text) {X return NULL;}
|
virtual PSZ GetText(PGLOBAL g, PSZ text) {X return NULL;}
|
||||||
virtual bool Merge(PGLOBAL g, PJSON jsp) { X return true; }
|
virtual bool Merge(PGLOBAL g, PJSON jsp) { X return true; }
|
||||||
virtual bool SetValue(PGLOBAL g, PJVAL jvp, int i) { X return true; }
|
virtual bool SetValue(PGLOBAL g, PJVAL jvp, int i) { X return true; }
|
||||||
virtual void SetValue(PGLOBAL g, PJVAL jvp, PSZ key) {X}
|
virtual void SetValue(PGLOBAL g, PJVAL jvp, PCSZ key) {X}
|
||||||
virtual void SetValue(PVAL valp) {X}
|
virtual void SetValue(PVAL valp) {X}
|
||||||
virtual void SetValue(PJSON jsp) {X}
|
virtual void SetValue(PJSON jsp) {X}
|
||||||
virtual void SetString(PGLOBAL g, PSZ s, short c) {X}
|
virtual void SetString(PGLOBAL g, PSZ s, short c) {X}
|
||||||
virtual void SetInteger(PGLOBAL g, int n) {X}
|
virtual void SetInteger(PGLOBAL g, int n) {X}
|
||||||
virtual void SetFloat(PGLOBAL g, double f) {X}
|
virtual void SetFloat(PGLOBAL g, double f) {X}
|
||||||
virtual void DeleteKey(char *k) {X}
|
virtual void DeleteKey(PCSZ k) {X}
|
||||||
virtual bool DeleteValue(int i) {X return true;}
|
virtual bool DeleteValue(int i) {X return true;}
|
||||||
virtual bool IsNull(void) {X return true;}
|
virtual bool IsNull(void) {X return true;}
|
||||||
|
|
||||||
@@ -195,14 +195,14 @@ class JOBJECT : public JSON {
|
|||||||
virtual void Clear(void) {First = Last = NULL; Size = 0;}
|
virtual void Clear(void) {First = Last = NULL; Size = 0;}
|
||||||
virtual JTYP GetType(void) {return TYPE_JOB;}
|
virtual JTYP GetType(void) {return TYPE_JOB;}
|
||||||
virtual PJPR GetFirst(void) {return First;}
|
virtual PJPR GetFirst(void) {return First;}
|
||||||
virtual PJPR AddPair(PGLOBAL g, PSZ key);
|
virtual PJPR AddPair(PGLOBAL g, PCSZ key);
|
||||||
virtual PJOB GetObject(void) {return this;}
|
virtual PJOB GetObject(void) {return this;}
|
||||||
virtual PJVAL GetValue(const char* key);
|
virtual PJVAL GetValue(const char* key);
|
||||||
virtual PJAR GetKeyList(PGLOBAL g);
|
virtual PJAR GetKeyList(PGLOBAL g);
|
||||||
virtual PSZ GetText(PGLOBAL g, PSZ text);
|
virtual PSZ GetText(PGLOBAL g, PSZ text);
|
||||||
virtual bool Merge(PGLOBAL g, PJSON jsp);
|
virtual bool Merge(PGLOBAL g, PJSON jsp);
|
||||||
virtual void SetValue(PGLOBAL g, PJVAL jvp, PSZ key);
|
virtual void SetValue(PGLOBAL g, PJVAL jvp, PCSZ key);
|
||||||
virtual void DeleteKey(char *k);
|
virtual void DeleteKey(PCSZ k);
|
||||||
virtual bool IsNull(void);
|
virtual bool IsNull(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -253,7 +253,7 @@ class JVALUE : public JSON {
|
|||||||
JVALUE(PJSON jsp) : JSON()
|
JVALUE(PJSON jsp) : JSON()
|
||||||
{Jsp = jsp; Value = NULL; Next = NULL; Del = false;}
|
{Jsp = jsp; Value = NULL; Next = NULL; Del = false;}
|
||||||
JVALUE(PGLOBAL g, PVAL valp);
|
JVALUE(PGLOBAL g, PVAL valp);
|
||||||
JVALUE(PGLOBAL g, PSZ strp);
|
JVALUE(PGLOBAL g, PCSZ strp);
|
||||||
|
|
||||||
using JSON::GetValue;
|
using JSON::GetValue;
|
||||||
using JSON::SetValue;
|
using JSON::SetValue;
|
||||||
|
@@ -1496,7 +1496,7 @@ static PSZ MakePSZ(PGLOBAL g, UDF_ARGS *args, int i)
|
|||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/* Make a valid key from the passed argument. */
|
/* Make a valid key from the passed argument. */
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
static PSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
|
static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
|
||||||
{
|
{
|
||||||
if (args->arg_count > (unsigned)i) {
|
if (args->arg_count > (unsigned)i) {
|
||||||
int j = 0, n = args->attribute_lengths[i];
|
int j = 0, n = args->attribute_lengths[i];
|
||||||
@@ -2253,7 +2253,8 @@ my_bool json_object_add_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
|||||||
char *json_object_add(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
char *json_object_add(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
||||||
unsigned long *res_length, char *is_null, char *error)
|
unsigned long *res_length, char *is_null, char *error)
|
||||||
{
|
{
|
||||||
char *key, *str = NULL;
|
PCSZ key;
|
||||||
|
char *str = NULL;
|
||||||
PGLOBAL g = (PGLOBAL)initid->ptr;
|
PGLOBAL g = (PGLOBAL)initid->ptr;
|
||||||
|
|
||||||
if (g->Xchk) {
|
if (g->Xchk) {
|
||||||
@@ -2358,7 +2359,7 @@ char *json_object_delete(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
} // endif Xchk
|
} // endif Xchk
|
||||||
|
|
||||||
if (!CheckMemory(g, initid, args, 1, false, true, true)) {
|
if (!CheckMemory(g, initid, args, 1, false, true, true)) {
|
||||||
char *key;
|
PCSZ key;
|
||||||
PJOB jobp;
|
PJOB jobp;
|
||||||
PJSON jsp, top;
|
PJSON jsp, top;
|
||||||
PJVAL jvp = MakeValue(g, args, 0, &top);
|
PJVAL jvp = MakeValue(g, args, 0, &top);
|
||||||
@@ -4541,7 +4542,7 @@ char *jbin_object_add(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
} // endif bsp
|
} // endif bsp
|
||||||
|
|
||||||
if (!CheckMemory(g, initid, args, 2, false, true, true)) {
|
if (!CheckMemory(g, initid, args, 2, false, true, true)) {
|
||||||
char *key;
|
PCSZ key;
|
||||||
PJOB jobp;
|
PJOB jobp;
|
||||||
PJVAL jvp = MakeValue(g, args, 0, &top);
|
PJVAL jvp = MakeValue(g, args, 0, &top);
|
||||||
PJSON jsp = jvp->GetJson();
|
PJSON jsp = jvp->GetJson();
|
||||||
@@ -4621,7 +4622,7 @@ char *jbin_object_delete(UDF_INIT *initid, UDF_ARGS *args, char *result,
|
|||||||
} // endif bsp
|
} // endif bsp
|
||||||
|
|
||||||
if (!CheckMemory(g, initid, args, 1, false, true, true)) {
|
if (!CheckMemory(g, initid, args, 1, false, true, true)) {
|
||||||
char *key;
|
PCSZ key;
|
||||||
PJOB jobp;
|
PJOB jobp;
|
||||||
PJVAL jvp = MakeValue(g, args, 0, &top);
|
PJVAL jvp = MakeValue(g, args, 0, &top);
|
||||||
PJSON jsp = jvp->GetJson();
|
PJSON jsp = jvp->GetJson();
|
||||||
|
@@ -232,7 +232,7 @@ extern "C" {
|
|||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
typedef struct _jpn {
|
typedef struct _jpn {
|
||||||
enum JTYP Type;
|
enum JTYP Type;
|
||||||
PSZ Key;
|
PCSZ Key;
|
||||||
int N;
|
int N;
|
||||||
} JPN, *PJPN;
|
} JPN, *PJPN;
|
||||||
|
|
||||||
|
@@ -68,9 +68,9 @@ class LIBXMLDOC : public XMLDOCUMENT {
|
|||||||
virtual void SetNofree(bool b) {Nofreelist = b;}
|
virtual void SetNofree(bool b) {Nofreelist = b;}
|
||||||
|
|
||||||
// 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, PCSZ ver);
|
||||||
virtual void AddComment(PGLOBAL g, char *com);
|
virtual void AddComment(PGLOBAL g, char *com);
|
||||||
virtual PXNODE GetRoot(PGLOBAL g);
|
virtual PXNODE GetRoot(PGLOBAL g);
|
||||||
virtual PXNODE NewRoot(PGLOBAL g, char *name);
|
virtual PXNODE NewRoot(PGLOBAL g, char *name);
|
||||||
@@ -119,9 +119,9 @@ class XML2NODE : public XMLNODE {
|
|||||||
virtual PXLIST SelectNodes(PGLOBAL g, char *xp, PXLIST lp);
|
virtual PXLIST SelectNodes(PGLOBAL g, char *xp, PXLIST lp);
|
||||||
virtual PXNODE SelectSingleNode(PGLOBAL g, char *xp, PXNODE np);
|
virtual PXNODE SelectSingleNode(PGLOBAL g, char *xp, PXNODE np);
|
||||||
virtual PXATTR GetAttribute(PGLOBAL g, char *name, PXATTR ap);
|
virtual PXATTR GetAttribute(PGLOBAL g, char *name, PXATTR ap);
|
||||||
virtual PXNODE AddChildNode(PGLOBAL g, char *name, PXNODE np);
|
virtual PXNODE AddChildNode(PGLOBAL g, PCSZ name, PXNODE np);
|
||||||
virtual PXATTR AddProperty(PGLOBAL g, char *name, PXATTR ap);
|
virtual PXATTR AddProperty(PGLOBAL g, char *name, PXATTR ap);
|
||||||
virtual void AddText(PGLOBAL g, char *txtp);
|
virtual void AddText(PGLOBAL g, PCSZ txtp);
|
||||||
virtual void DeleteChild(PGLOBAL g, PXNODE dnp);
|
virtual void DeleteChild(PGLOBAL g, PXNODE dnp);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -373,7 +373,7 @@ LIBXMLDOC::LIBXMLDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp)
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Initialize XML parser and check library compatibility. */
|
/* Initialize XML parser and check library compatibility. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
bool LIBXMLDOC::Initialize(PGLOBAL g, char *entry, bool zipped)
|
bool LIBXMLDOC::Initialize(PGLOBAL g, PCSZ entry, bool zipped)
|
||||||
{
|
{
|
||||||
if (zipped && InitZip(g, entry))
|
if (zipped && InitZip(g, entry))
|
||||||
return true;
|
return true;
|
||||||
@@ -434,7 +434,7 @@ PFBLOCK LIBXMLDOC::LinkXblock(PGLOBAL g, MODE m, int rc, char *fn)
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Construct and add the XML processing instruction node. */
|
/* Construct and add the XML processing instruction node. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
bool LIBXMLDOC::NewDoc(PGLOBAL g, char *ver)
|
bool LIBXMLDOC::NewDoc(PGLOBAL g, PCSZ ver)
|
||||||
{
|
{
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("NewDoc\n");
|
htrc("NewDoc\n");
|
||||||
@@ -863,14 +863,13 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
|
|||||||
xmlFree(Content);
|
xmlFree(Content);
|
||||||
|
|
||||||
if ((Content = xmlNodeGetContent(Nodep))) {
|
if ((Content = xmlNodeGetContent(Nodep))) {
|
||||||
char *extra = " \t\r\n";
|
|
||||||
char *p1 = (char*)Content, *p2 = buf;
|
char *p1 = (char*)Content, *p2 = buf;
|
||||||
bool b = false;
|
bool b = false;
|
||||||
|
|
||||||
// Copy content eliminating extra characters
|
// Copy content eliminating extra characters
|
||||||
for (; *p1; p1++)
|
for (; *p1; p1++)
|
||||||
if ((p2 - buf) < len) {
|
if ((p2 - buf) < len) {
|
||||||
if (strchr(extra, *p1)) {
|
if (strchr(" \t\r\n", *p1)) {
|
||||||
if (b) {
|
if (b) {
|
||||||
// This to have one blank between sub-nodes
|
// This to have one blank between sub-nodes
|
||||||
*p2++ = ' ';
|
*p2++ = ' ';
|
||||||
@@ -1020,19 +1019,19 @@ PXATTR XML2NODE::GetAttribute(PGLOBAL g, char *name, PXATTR ap)
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Add a new child node to this node and return it. */
|
/* Add a new child node to this node and return it. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
PXNODE XML2NODE::AddChildNode(PGLOBAL g, char *name, PXNODE np)
|
PXNODE XML2NODE::AddChildNode(PGLOBAL g, PCSZ name, PXNODE np)
|
||||||
{
|
{
|
||||||
char *p, *pn, *pf = NULL;
|
char *p, *pn, *pf = NULL, *nmp = PlugDup(g, name);
|
||||||
|
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("AddChildNode: %s\n", name);
|
htrc("AddChildNode: %s\n", name);
|
||||||
|
|
||||||
// Is a prefix specified
|
// Is a prefix specified
|
||||||
if ((pn = strchr(name, ':'))) {
|
if ((pn = strchr(nmp, ':'))) {
|
||||||
pf = name;
|
pf = nmp;
|
||||||
*pn++ = '\0'; // Separate name from prefix
|
*pn++ = '\0'; // Separate name from prefix
|
||||||
} else
|
} else
|
||||||
pn = name;
|
pn = nmp;
|
||||||
|
|
||||||
// If name has the format m[n] only m is taken as node name
|
// If name has the format m[n] only m is taken as node name
|
||||||
if ((p = strchr(pn, '[')))
|
if ((p = strchr(pn, '[')))
|
||||||
@@ -1096,7 +1095,7 @@ PXATTR XML2NODE::AddProperty(PGLOBAL g, char *name, PXATTR ap)
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Add a new text node to this node. */
|
/* Add a new text node to this node. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
void XML2NODE::AddText(PGLOBAL g, char *txtp)
|
void XML2NODE::AddText(PGLOBAL g, PCSZ txtp)
|
||||||
{
|
{
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("AddText: %s\n", txtp);
|
htrc("AddText: %s\n", txtp);
|
||||||
|
@@ -192,7 +192,7 @@ bool MACINFO::GetOneInfo(PGLOBAL g, int flag, void *v, int lv)
|
|||||||
case 23:
|
case 23:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
p = "";
|
p = PlugDup(g, "");
|
||||||
} // endswitch flag
|
} // endswitch flag
|
||||||
|
|
||||||
} else switch (flag) {
|
} else switch (flag) {
|
||||||
|
@@ -137,7 +137,8 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db,
|
|||||||
FLD_CHARSET};
|
FLD_CHARSET};
|
||||||
//unsigned int length[] = {0, 4, 16, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0};
|
//unsigned int length[] = {0, 4, 16, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0};
|
||||||
unsigned int length[] = {0, 4, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0};
|
unsigned int length[] = {0, 4, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0};
|
||||||
char *fld, *colname, *chset, *fmt, v, buf[128], uns[16], zero[16];
|
PCSZ fmt;
|
||||||
|
char *fld, *colname, *chset, v, buf[128], uns[16], zero[16];
|
||||||
int i, n, nf, ncol = sizeof(buftyp) / sizeof(int);
|
int i, n, nf, ncol = sizeof(buftyp) / sizeof(int);
|
||||||
int len, type, prec, rc, k = 0;
|
int len, type, prec, rc, k = 0;
|
||||||
bool b;
|
bool b;
|
||||||
@@ -874,7 +875,8 @@ MYSQL_FIELD *MYSQLC::GetNextField(void)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
|
PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
|
||||||
{
|
{
|
||||||
char *fmt, v;
|
PCSZ fmt;
|
||||||
|
char *name, v;
|
||||||
int n;
|
int n;
|
||||||
bool uns;
|
bool uns;
|
||||||
PCOLRES *pcrp, crp;
|
PCOLRES *pcrp, crp;
|
||||||
@@ -912,8 +914,9 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
|
|||||||
memset(crp, 0, sizeof(COLRES));
|
memset(crp, 0, sizeof(COLRES));
|
||||||
crp->Ncol = ++qrp->Nbcol;
|
crp->Ncol = ++qrp->Nbcol;
|
||||||
|
|
||||||
crp->Name = (char*)PlugSubAlloc(g, NULL, fld->name_length + 1);
|
name = (char*)PlugSubAlloc(g, NULL, fld->name_length + 1);
|
||||||
strcpy(crp->Name, fld->name);
|
strcpy(name, fld->name);
|
||||||
|
crp->Name = name;
|
||||||
|
|
||||||
if ((crp->Type = MYSQLtoPLG(fld->type, &v)) == TYPE_ERROR) {
|
if ((crp->Type = MYSQLtoPLG(fld->type, &v)) == TYPE_ERROR) {
|
||||||
sprintf(g->Message, "Type %d not supported for column %s",
|
sprintf(g->Message, "Type %d not supported for column %s",
|
||||||
|
@@ -269,9 +269,9 @@ int MYSQLtoPLG(int mytype, char *var)
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Returns the format corresponding to a MySQL date type number. */
|
/* Returns the format corresponding to a MySQL date type number. */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
char *MyDateFmt(int mytype)
|
PCSZ MyDateFmt(int mytype)
|
||||||
{
|
{
|
||||||
char *fmt;
|
PCSZ fmt;
|
||||||
|
|
||||||
switch (mytype) {
|
switch (mytype) {
|
||||||
case MYSQL_TYPE_TIMESTAMP:
|
case MYSQL_TYPE_TIMESTAMP:
|
||||||
@@ -297,9 +297,9 @@ char *MyDateFmt(int mytype)
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Returns the format corresponding to a MySQL date type name. */
|
/* Returns the format corresponding to a MySQL date type name. */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
char *MyDateFmt(char *typname)
|
PCSZ MyDateFmt(char *typname)
|
||||||
{
|
{
|
||||||
char *fmt;
|
PCSZ fmt;
|
||||||
|
|
||||||
if (!stricmp(typname, "datetime") || !stricmp(typname, "timestamp"))
|
if (!stricmp(typname, "datetime") || !stricmp(typname, "timestamp"))
|
||||||
fmt = "YYYY-MM-DD hh:mm:ss";
|
fmt = "YYYY-MM-DD hh:mm:ss";
|
||||||
|
@@ -8,7 +8,7 @@ enum enum_field_types PLGtoMYSQL(int type, bool dbf, char var = 0);
|
|||||||
const char *PLGtoMYSQLtype(int type, bool dbf, char var = 0);
|
const char *PLGtoMYSQLtype(int type, bool dbf, char var = 0);
|
||||||
int MYSQLtoPLG(char *typname, char *var = NULL);
|
int MYSQLtoPLG(char *typname, char *var = NULL);
|
||||||
int MYSQLtoPLG(int mytype, char *var = NULL);
|
int MYSQLtoPLG(int mytype, char *var = NULL);
|
||||||
char *MyDateFmt(int mytype);
|
PCSZ MyDateFmt(int mytype);
|
||||||
char *MyDateFmt(char *typname);
|
PCSZ MyDateFmt(char *typname);
|
||||||
|
|
||||||
#endif // __MYUTIL__H
|
#endif // __MYUTIL__H
|
||||||
|
@@ -875,7 +875,7 @@ PQRYRES ODBCStatistics(PGLOBAL g, ODBConn *op, char *dsn, char *pat,
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Implementation of DBX class. */
|
/* Implementation of DBX class. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
DBX::DBX(RETCODE rc, PSZ msg)
|
DBX::DBX(RETCODE rc, PCSZ msg)
|
||||||
{
|
{
|
||||||
m_RC = rc;
|
m_RC = rc;
|
||||||
m_Msg = msg;
|
m_Msg = msg;
|
||||||
@@ -1016,7 +1016,7 @@ bool ODBConn::Check(RETCODE rc)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* DB exception throw routines. */
|
/* DB exception throw routines. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void ODBConn::ThrowDBX(RETCODE rc, PSZ msg, HSTMT hstmt)
|
void ODBConn::ThrowDBX(RETCODE rc, PCSZ msg, HSTMT hstmt)
|
||||||
{
|
{
|
||||||
DBX* xp = new(m_G) DBX(rc, msg);
|
DBX* xp = new(m_G) DBX(rc, msg);
|
||||||
|
|
||||||
@@ -1026,7 +1026,7 @@ void ODBConn::ThrowDBX(RETCODE rc, PSZ msg, HSTMT hstmt)
|
|||||||
|
|
||||||
} // end of ThrowDBX
|
} // end of ThrowDBX
|
||||||
|
|
||||||
void ODBConn::ThrowDBX(PSZ msg)
|
void ODBConn::ThrowDBX(PCSZ msg)
|
||||||
{
|
{
|
||||||
DBX* xp = new(m_G) DBX(0, "Error");
|
DBX* xp = new(m_G) DBX(0, "Error");
|
||||||
|
|
||||||
@@ -2240,7 +2240,7 @@ int ODBConn::GetCatInfo(CATPARM *cap)
|
|||||||
void *buffer;
|
void *buffer;
|
||||||
int i, irc;
|
int i, irc;
|
||||||
bool b;
|
bool b;
|
||||||
PSZ fnc = "Unknown";
|
PCSZ fnc = "Unknown";
|
||||||
UWORD n;
|
UWORD n;
|
||||||
SWORD ncol, len, tp;
|
SWORD ncol, len, tp;
|
||||||
SQLULEN crow = 0;
|
SQLULEN crow = 0;
|
||||||
|
@@ -80,23 +80,23 @@ class DBX : public BLOCK {
|
|||||||
friend class ODBConn;
|
friend class ODBConn;
|
||||||
// Construction (by ThrowDBX only) -- destruction
|
// Construction (by ThrowDBX only) -- destruction
|
||||||
protected:
|
protected:
|
||||||
DBX(RETCODE rc, PSZ msg = NULL);
|
DBX(RETCODE rc, PCSZ msg = NULL);
|
||||||
public:
|
public:
|
||||||
//virtual ~DBX() {}
|
//virtual ~DBX() {}
|
||||||
//void operator delete(void*, PGLOBAL, void*) {};
|
//void operator delete(void*, PGLOBAL, void*) {};
|
||||||
|
|
||||||
// Implementation (use ThrowDBX to create)
|
// Implementation (use ThrowDBX to create)
|
||||||
RETCODE GetRC(void) {return m_RC;}
|
RETCODE GetRC(void) {return m_RC;}
|
||||||
PSZ GetMsg(void) {return m_Msg;}
|
PCSZ GetMsg(void) {return m_Msg;}
|
||||||
const char *GetErrorMessage(int i);
|
PCSZ GetErrorMessage(int i);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool BuildErrorMessage(ODBConn* pdb, HSTMT hstmt = SQL_NULL_HSTMT);
|
bool BuildErrorMessage(ODBConn* pdb, HSTMT hstmt = SQL_NULL_HSTMT);
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
RETCODE m_RC;
|
RETCODE m_RC;
|
||||||
PSZ m_Msg;
|
PCSZ m_Msg;
|
||||||
PSZ m_ErrMsg[MAX_NUM_OF_MSG];
|
PCSZ m_ErrMsg[MAX_NUM_OF_MSG];
|
||||||
}; // end of DBX class definition
|
}; // end of DBX class definition
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -162,8 +162,8 @@ class ODBConn : public BLOCK {
|
|||||||
// ODBC operations
|
// ODBC operations
|
||||||
protected:
|
protected:
|
||||||
bool Check(RETCODE rc);
|
bool Check(RETCODE rc);
|
||||||
void ThrowDBX(RETCODE rc, PSZ msg, HSTMT hstmt = SQL_NULL_HSTMT);
|
void ThrowDBX(RETCODE rc, PCSZ msg, HSTMT hstmt = SQL_NULL_HSTMT);
|
||||||
void ThrowDBX(PSZ msg);
|
void ThrowDBX(PCSZ msg);
|
||||||
void AllocConnect(DWORD dwOptions);
|
void AllocConnect(DWORD dwOptions);
|
||||||
void Connect(void);
|
void Connect(void);
|
||||||
bool DriverConnect(DWORD Options);
|
bool DriverConnect(DWORD Options);
|
||||||
|
@@ -555,7 +555,7 @@ typedef struct _qryres {
|
|||||||
typedef struct _colres {
|
typedef struct _colres {
|
||||||
PCOLRES Next; /* To next result column */
|
PCOLRES Next; /* To next result column */
|
||||||
PCOL Colp; /* To matching column block */
|
PCOL Colp; /* To matching column block */
|
||||||
PSZ Name; /* Column header */
|
PCSZ Name; /* Column header */
|
||||||
PVBLK Kdata; /* Column block of values */
|
PVBLK Kdata; /* Column block of values */
|
||||||
char *Nulls; /* Column null value array */
|
char *Nulls; /* Column null value array */
|
||||||
int Type; /* Internal type */
|
int Type; /* Internal type */
|
||||||
@@ -585,7 +585,7 @@ void PlugLineDB(PGLOBAL, PSZ, short, void *, uint);
|
|||||||
char *SetPath(PGLOBAL g, const char *path);
|
char *SetPath(PGLOBAL g, const char *path);
|
||||||
char *ExtractFromPath(PGLOBAL, char *, char *, OPVAL);
|
char *ExtractFromPath(PGLOBAL, char *, char *, OPVAL);
|
||||||
void AddPointer(PTABS, void *);
|
void AddPointer(PTABS, void *);
|
||||||
PDTP MakeDateFormat(PGLOBAL, PSZ, bool, bool, int);
|
PDTP MakeDateFormat(PGLOBAL, PCSZ, bool, bool, int);
|
||||||
int ExtractDate(char *, PDTP, int, int val[6]);
|
int ExtractDate(char *, PDTP, int, int val[6]);
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@@ -399,9 +399,9 @@ char *SetPath(PGLOBAL g, const char *path)
|
|||||||
|
|
||||||
if (*path != '.') {
|
if (*path != '.') {
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
char *s = "\\";
|
const char *s = "\\";
|
||||||
#else // !__WIN__
|
#else // !__WIN__
|
||||||
char *s = "/";
|
const char *s = "/";
|
||||||
#endif // !__WIN__
|
#endif // !__WIN__
|
||||||
strcat(strcat(strcat(strcpy(buf, "."), s), path), s);
|
strcat(strcat(strcat(strcpy(buf, "."), s), path), s);
|
||||||
} else
|
} else
|
||||||
@@ -673,7 +673,7 @@ void PlugConvertConstant(PGLOBAL g, void* & value, short& type)
|
|||||||
/* format and a Strftime output format. Flag if not 0 indicates that */
|
/* format and a Strftime output format. Flag if not 0 indicates that */
|
||||||
/* non quoted blanks are not included in the output format. */
|
/* non quoted blanks are not included in the output format. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PDTP MakeDateFormat(PGLOBAL g, PSZ dfmt, bool in, bool out, int flag)
|
PDTP MakeDateFormat(PGLOBAL g, PCSZ dfmt, bool in, bool out, int flag)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
PDTP pdp = (PDTP)PlugSubAlloc(g, NULL, sizeof(DATPAR));
|
PDTP pdp = (PDTP)PlugSubAlloc(g, NULL, sizeof(DATPAR));
|
||||||
@@ -682,7 +682,7 @@ PDTP MakeDateFormat(PGLOBAL g, PSZ dfmt, bool in, bool out, int flag)
|
|||||||
htrc("MakeDateFormat: dfmt=%s\n", dfmt);
|
htrc("MakeDateFormat: dfmt=%s\n", dfmt);
|
||||||
|
|
||||||
memset(pdp, 0, sizeof(DATPAR));
|
memset(pdp, 0, sizeof(DATPAR));
|
||||||
pdp->Format = pdp->Curp = dfmt;
|
pdp->Format = pdp->Curp = PlugDup(g, dfmt);
|
||||||
pdp->Outsize = 2 * strlen(dfmt) + 1;
|
pdp->Outsize = 2 * strlen(dfmt) + 1;
|
||||||
|
|
||||||
if (in)
|
if (in)
|
||||||
@@ -724,7 +724,8 @@ PDTP MakeDateFormat(PGLOBAL g, PSZ dfmt, bool in, bool out, int flag)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int ExtractDate(char *dts, PDTP pdp, int defy, int val[6])
|
int ExtractDate(char *dts, PDTP pdp, int defy, int val[6])
|
||||||
{
|
{
|
||||||
char *fmt, c, d, e, W[8][12];
|
PCSZ fmt;
|
||||||
|
char c, d, e, W[8][12];
|
||||||
int i, k, m, numval;
|
int i, k, m, numval;
|
||||||
int n, y = 30;
|
int n, y = 30;
|
||||||
bool b = true; // true for null dates
|
bool b = true; // true for null dates
|
||||||
|
@@ -173,7 +173,7 @@ void XMLNODE::Delete(PXNODE dnp)
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Store a string in Buf, enventually reallocating it. */
|
/* Store a string in Buf, enventually reallocating it. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
char *XMLNODE::BufAlloc(PGLOBAL g, char *p, int n)
|
char *XMLNODE::BufAlloc(PGLOBAL g, const char *p, int n)
|
||||||
{
|
{
|
||||||
if (Len < n) {
|
if (Len < n) {
|
||||||
Len = n;
|
Len = n;
|
||||||
|
@@ -78,7 +78,7 @@ class XMLDOCUMENT : public BLOCK {
|
|||||||
// Methods
|
// Methods
|
||||||
virtual bool Initialize(PGLOBAL, PCSZ, 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, PCSZ) = 0;
|
||||||
virtual void AddComment(PGLOBAL, char *) = 0;
|
virtual void AddComment(PGLOBAL, char *) = 0;
|
||||||
virtual PXNODE GetRoot(PGLOBAL) = 0;
|
virtual PXNODE GetRoot(PGLOBAL) = 0;
|
||||||
virtual PXNODE NewRoot(PGLOBAL, char *) = 0;
|
virtual PXNODE NewRoot(PGLOBAL, char *) = 0;
|
||||||
@@ -131,15 +131,15 @@ class XMLNODE : public BLOCK {
|
|||||||
virtual PXLIST SelectNodes(PGLOBAL, char *, PXLIST = NULL) = 0;
|
virtual PXLIST SelectNodes(PGLOBAL, char *, PXLIST = NULL) = 0;
|
||||||
virtual PXNODE SelectSingleNode(PGLOBAL, char *, PXNODE = NULL) = 0;
|
virtual PXNODE SelectSingleNode(PGLOBAL, char *, PXNODE = NULL) = 0;
|
||||||
virtual PXATTR GetAttribute(PGLOBAL, char *, PXATTR = NULL) = 0;
|
virtual PXATTR GetAttribute(PGLOBAL, char *, PXATTR = NULL) = 0;
|
||||||
virtual PXNODE AddChildNode(PGLOBAL, char *, PXNODE = NULL) = 0;
|
virtual PXNODE AddChildNode(PGLOBAL, PCSZ, PXNODE = NULL) = 0;
|
||||||
virtual PXATTR AddProperty(PGLOBAL, char *, PXATTR = NULL) = 0;
|
virtual PXATTR AddProperty(PGLOBAL, char *, PXATTR = NULL) = 0;
|
||||||
virtual void AddText(PGLOBAL, char *) = 0;
|
virtual void AddText(PGLOBAL, PCSZ) = 0;
|
||||||
virtual void DeleteChild(PGLOBAL, PXNODE) = 0;
|
virtual void DeleteChild(PGLOBAL, PXNODE) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PXNODE NewChild(PXNODE ncp);
|
PXNODE NewChild(PXNODE ncp);
|
||||||
void Delete(PXNODE dnp);
|
void Delete(PXNODE dnp);
|
||||||
char *BufAlloc(PGLOBAL g, char *p, int n);
|
char *BufAlloc(PGLOBAL g, const char *p, int n);
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
XMLNODE(PXDOC dp);
|
XMLNODE(PXDOC dp);
|
||||||
|
@@ -517,7 +517,7 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
|
|||||||
memp, size, pph->To_Free, pph->FreeBlk);
|
memp, size, pph->To_Free, pph->FreeBlk);
|
||||||
|
|
||||||
if ((uint)size > pph->FreeBlk) { /* Not enough memory left in pool */
|
if ((uint)size > pph->FreeBlk) { /* Not enough memory left in pool */
|
||||||
char *pname = "Work";
|
PCSZ pname = "Work";
|
||||||
|
|
||||||
sprintf(g->Message,
|
sprintf(g->Message,
|
||||||
"Not enough memory in %s area for request of %u (used=%d free=%d)",
|
"Not enough memory in %s area for request of %u (used=%d free=%d)",
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
/* Struct of variables used by the date format pre-parser. */
|
/* Struct of variables used by the date format pre-parser. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
typedef struct _datpar {
|
typedef struct _datpar {
|
||||||
char *Format; // Points to format to decode
|
const char *Format; // Points to format to decode
|
||||||
char *Curp; // Points to current parsing position
|
char *Curp; // Points to current parsing position
|
||||||
char *InFmt; // Start of input format
|
char *InFmt; // Start of input format
|
||||||
char *OutFmt; // Start of output format
|
char *OutFmt; // Start of output format
|
||||||
|
@@ -116,7 +116,7 @@ bool RELDEF::GetBoolCatInfo(PCSZ what, bool bdef)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* This function returns size catalog information. */
|
/* This function returns size catalog information. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int RELDEF::GetSizeCatInfo(PCSZ what, PSZ sdef)
|
int RELDEF::GetSizeCatInfo(PCSZ what, PCSZ sdef)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
PCSZ s;
|
PCSZ s;
|
||||||
@@ -139,7 +139,7 @@ int RELDEF::GetSizeCatInfo(PCSZ what, PSZ sdef)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* This function sets char table information in buf. */
|
/* This function sets char table information in buf. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
int RELDEF::GetCharCatInfo(PCSZ what, PSZ sdef, char *buf, int size)
|
int RELDEF::GetCharCatInfo(PCSZ what, PCSZ sdef, char *buf, int size)
|
||||||
{
|
{
|
||||||
PCSZ s= Hc->GetStringOption(what);
|
PCSZ s= Hc->GetStringOption(what);
|
||||||
|
|
||||||
@@ -253,9 +253,9 @@ bool TABDEF::Define(PGLOBAL g, PCATLG cat,
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* This function returns the database data path. */
|
/* This function returns the database data path. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PSZ TABDEF::GetPath(void)
|
PCSZ TABDEF::GetPath(void)
|
||||||
{
|
{
|
||||||
return (Database) ? (PSZ)Database : (Hc) ? Hc->GetDataPath() : NULL;
|
return (Database) ? Database : (Hc) ? Hc->GetDataPath() : NULL;
|
||||||
} // end of GetPath
|
} // end of GetPath
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
@@ -46,8 +46,8 @@ class DllExport RELDEF : public BLOCK { // Relation definition block
|
|||||||
bool SetIntCatInfo(PCSZ what, int ival);
|
bool SetIntCatInfo(PCSZ what, int ival);
|
||||||
bool Partitioned(void);
|
bool Partitioned(void);
|
||||||
int GetIntCatInfo(PCSZ what, int idef);
|
int GetIntCatInfo(PCSZ what, int idef);
|
||||||
int GetSizeCatInfo(PCSZ what, PSZ sdef);
|
int GetSizeCatInfo(PCSZ what, PCSZ sdef);
|
||||||
int GetCharCatInfo(PCSZ what, PSZ sdef, char *buf, int size);
|
int GetCharCatInfo(PCSZ what, PCSZ sdef, char *buf, int size);
|
||||||
char *GetStringCatInfo(PGLOBAL g, PCSZ what, PCSZ 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,
|
||||||
@@ -84,7 +84,7 @@ public:
|
|||||||
void SetNext(PTABDEF tdfp) {Next = tdfp;}
|
void SetNext(PTABDEF tdfp) {Next = tdfp;}
|
||||||
int GetMultiple(void) {return Multiple;}
|
int GetMultiple(void) {return Multiple;}
|
||||||
int GetPseudo(void) {return Pseudo;}
|
int GetPseudo(void) {return Pseudo;}
|
||||||
PSZ GetPath(void);
|
PCSZ GetPath(void);
|
||||||
//PSZ GetPath(void)
|
//PSZ GetPath(void)
|
||||||
// {return (Database) ? (PSZ)Database : Cat->GetDataPath();}
|
// {return (Database) ? (PSZ)Database : Cat->GetDataPath();}
|
||||||
bool SepIndex(void) {return GetBoolCatInfo("SepIndex", false);}
|
bool SepIndex(void) {return GetBoolCatInfo("SepIndex", false);}
|
||||||
|
@@ -184,7 +184,7 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool DOSDEF::GetOptFileName(PGLOBAL g, char *filename)
|
bool DOSDEF::GetOptFileName(PGLOBAL g, char *filename)
|
||||||
{
|
{
|
||||||
char *ftype;
|
PCSZ ftype;
|
||||||
|
|
||||||
switch (Recfm) {
|
switch (Recfm) {
|
||||||
case RECFM_VAR: ftype = ".dop"; break;
|
case RECFM_VAR: ftype = ".dop"; break;
|
||||||
@@ -241,7 +241,7 @@ void DOSDEF::RemoveOptValues(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
|
bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf)
|
||||||
{
|
{
|
||||||
char *ftype;
|
PCSZ ftype;
|
||||||
char filename[_MAX_PATH];
|
char filename[_MAX_PATH];
|
||||||
bool sep, rc = false;
|
bool sep, rc = false;
|
||||||
|
|
||||||
@@ -2310,7 +2310,7 @@ void TDBDOS::CloseDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* DOSCOL public constructor (also called by MAPCOL). */
|
/* DOSCOL public constructor (also called by MAPCOL). */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
DOSCOL::DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am)
|
DOSCOL::DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PCSZ am)
|
||||||
: COLBLK(cdp, tp, i)
|
: COLBLK(cdp, tp, i)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
@@ -214,7 +214,7 @@ class DllExport DOSCOL : public COLBLK {
|
|||||||
friend class TDBFIX;
|
friend class TDBFIX;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am = "DOS");
|
DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PCSZ am = "DOS");
|
||||||
DOSCOL(DOSCOL *colp, PTDB tdbp); // Constructor used in copy process
|
DOSCOL(DOSCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@@ -295,7 +295,7 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
|||||||
if (Srcdef) {
|
if (Srcdef) {
|
||||||
if ((catp = strstr(Srcdef, "%s"))) {
|
if ((catp = strstr(Srcdef, "%s"))) {
|
||||||
char *fil1, *fil2;
|
char *fil1, *fil2;
|
||||||
PSZ ph = ((EXTDEF*)To_Def)->Phpos;
|
PCSZ ph = ((EXTDEF*)To_Def)->Phpos;
|
||||||
|
|
||||||
if (!ph)
|
if (!ph)
|
||||||
ph = (strstr(catp + 2, "%s")) ? "WH" : "W";
|
ph = (strstr(catp + 2, "%s")) ? "WH" : "W";
|
||||||
@@ -565,7 +565,7 @@ int TDBEXT::GetProgMax(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* EXTCOL public constructor. */
|
/* EXTCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
EXTCOL::EXTCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
EXTCOL::EXTCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
|
@@ -115,7 +115,7 @@ public:
|
|||||||
virtual bool IsRemote(void) { return true; }
|
virtual bool IsRemote(void) { return true; }
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual PSZ GetServer(void) { return "Remote"; }
|
virtual PCSZ GetServer(void) { return "Remote"; }
|
||||||
virtual int GetRecpos(void);
|
virtual int GetRecpos(void);
|
||||||
|
|
||||||
// Database routines
|
// Database routines
|
||||||
@@ -170,7 +170,7 @@ class DllExport EXTCOL : public COLBLK {
|
|||||||
friend class TDBEXT;
|
friend class TDBEXT;
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
EXTCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am);
|
EXTCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am);
|
||||||
EXTCOL(PEXTCOL colp, PTDB tdbp); // Constructor used in copy process
|
EXTCOL(PEXTCOL colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@@ -373,7 +373,7 @@ int TDBFIX::WriteDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* BINCOL public constructor. */
|
/* BINCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am)
|
BINCOL::BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PCSZ am)
|
||||||
: DOSCOL(g, cdp, tp, cp, i, am)
|
: DOSCOL(g, cdp, tp, cp, i, am)
|
||||||
{
|
{
|
||||||
char c, *fmt = cdp->GetFmt();
|
char c, *fmt = cdp->GetFmt();
|
||||||
|
@@ -65,7 +65,7 @@ class DllExport BINCOL : public DOSCOL {
|
|||||||
friend class TDBFIX;
|
friend class TDBFIX;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am = "BIN");
|
BINCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PCSZ am = "BIN");
|
||||||
BINCOL(BINCOL *colp, PTDB tdbp); // Constructor used in copy process
|
BINCOL(BINCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@@ -81,7 +81,7 @@ USETEMP UseTemp(void);
|
|||||||
/* of types (TYPE_STRING < TYPE_DOUBLE < TYPE_INT) (1 < 2 < 7). */
|
/* of types (TYPE_STRING < TYPE_DOUBLE < TYPE_INT) (1 < 2 < 7). */
|
||||||
/* If these values are changed, this will have to be revisited. */
|
/* If these values are changed, this will have to be revisited. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PQRYRES CSVColumns(PGLOBAL g, char *dp, PTOS topt, bool info)
|
PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, 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};
|
||||||
|
@@ -13,7 +13,7 @@ typedef class TDBFMT *PTDBFMT;
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Functions used externally. */
|
/* Functions used externally. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PQRYRES CSVColumns(PGLOBAL g, char *dp, PTOS topt, bool info);
|
PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info);
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* CSV table. */
|
/* CSV table. */
|
||||||
@@ -21,7 +21,7 @@ PQRYRES CSVColumns(PGLOBAL g, char *dp, PTOS topt, bool info);
|
|||||||
class DllExport CSVDEF : public DOSDEF { /* Logical table description */
|
class DllExport CSVDEF : public DOSDEF { /* Logical table description */
|
||||||
friend class TDBCSV;
|
friend class TDBCSV;
|
||||||
friend class TDBCCL;
|
friend class TDBCCL;
|
||||||
friend PQRYRES CSVColumns(PGLOBAL, char *, PTOS, bool);
|
friend PQRYRES CSVColumns(PGLOBAL, PCSZ, PTOS, bool);
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
CSVDEF(void);
|
CSVDEF(void);
|
||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
class DllExport TDBCSV : public TDBDOS {
|
class DllExport TDBCSV : public TDBDOS {
|
||||||
friend class CSVCOL;
|
friend class CSVCOL;
|
||||||
friend class MAPFAM;
|
friend class MAPFAM;
|
||||||
friend PQRYRES CSVColumns(PGLOBAL, char *, PTOS, bool);
|
friend PQRYRES CSVColumns(PGLOBAL, PCSZ, PTOS, bool);
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
TDBCSV(PCSVDEF tdp, PTXF txfp);
|
TDBCSV(PCSVDEF tdp, PTXF txfp);
|
||||||
|
@@ -967,7 +967,7 @@ void TDBJDBC::CloseDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* JDBCCOL public constructor. */
|
/* JDBCCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
JDBCCOL::JDBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
JDBCCOL::JDBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: EXTCOL(cdp, tdbp, cprec, i, am)
|
: EXTCOL(cdp, tdbp, cprec, i, am)
|
||||||
{
|
{
|
||||||
} // end of JDBCCOL constructor
|
} // end of JDBCCOL constructor
|
||||||
@@ -1212,7 +1212,7 @@ int TDBXJDC::DeleteDB(PGLOBAL g, int irc)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* JSRCCOL public constructor. */
|
/* JSRCCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
JSRCCOL::JSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
JSRCCOL::JSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: JDBCCOL(cdp, tdbp, cprec, i, am)
|
: JDBCCOL(cdp, tdbp, cprec, i, am)
|
||||||
{
|
{
|
||||||
// Set additional JDBC access method information for column.
|
// Set additional JDBC access method information for column.
|
||||||
|
@@ -67,7 +67,7 @@ public:
|
|||||||
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 void ResetSize(void);
|
virtual void ResetSize(void);
|
||||||
virtual PSZ GetServer(void) { return "JDBC"; }
|
virtual PCSZ GetServer(void) { return "JDBC"; }
|
||||||
virtual int Indexable(void) { return 2; }
|
virtual int Indexable(void) { return 2; }
|
||||||
|
|
||||||
// Database routines
|
// Database routines
|
||||||
@@ -103,7 +103,7 @@ class JDBCCOL : public EXTCOL {
|
|||||||
friend class TDBJDBC;
|
friend class TDBJDBC;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
JDBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "JDBC");
|
JDBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "JDBC");
|
||||||
JDBCCOL(JDBCCOL *colp, PTDB tdbp); // Constructor used in copy process
|
JDBCCOL(JDBCCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
@@ -165,7 +165,7 @@ class JSRCCOL : public JDBCCOL {
|
|||||||
friend class TDBXJDC;
|
friend class TDBXJDC;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
JSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "JDBC");
|
JSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "JDBC");
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
virtual int GetAmType(void) {return TYPE_AM_JDBC;}
|
virtual int GetAmType(void) {return TYPE_AM_JDBC;}
|
||||||
|
@@ -362,7 +362,7 @@ PQRYRES JSONColumns(PGLOBAL g, char *db, char *dsn, PTOS topt, bool info)
|
|||||||
|
|
||||||
skipit:
|
skipit:
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("CSVColumns: n=%d len=%d\n", n, length[0]);
|
htrc("JSONColumns: n=%d len=%d\n", n, length[0]);
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
/* Allocate the structures used to refer to the result set. */
|
/* Allocate the structures used to refer to the result set. */
|
||||||
|
@@ -99,7 +99,7 @@ CHARSET_INFO *TDB::data_charset(void)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Return the datapath of the DB this table belongs to. */
|
/* Return the datapath of the DB this table belongs to. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PSZ TDB::GetPath(void)
|
PCSZ TDB::GetPath(void)
|
||||||
{
|
{
|
||||||
return To_Def->GetPath();
|
return To_Def->GetPath();
|
||||||
} // end of GetPath
|
} // end of GetPath
|
||||||
|
@@ -329,7 +329,7 @@ void MACCOL::ReadColumn(PGLOBAL g)
|
|||||||
n = 0;
|
n = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
p = "";
|
p = PlugDup(g, "");
|
||||||
} // endswitch Flag
|
} // endswitch Flag
|
||||||
|
|
||||||
} else switch (Flag) {
|
} else switch (Flag) {
|
||||||
|
@@ -69,7 +69,7 @@ PQRYRES MGOColumns(PGLOBAL g, char *db, PTOS topt, bool info)
|
|||||||
|
|
||||||
skipit:
|
skipit:
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("CSVColumns: n=%d len=%d\n", n, length[0]);
|
htrc("MGOColumns: n=%d len=%d\n", n, length[0]);
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
/* Allocate the structures used to refer to the result set. */
|
/* Allocate the structures used to refer to the result set. */
|
||||||
|
@@ -924,7 +924,7 @@ void TDBDIR::CloseDB(PGLOBAL)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* DIRCOL public constructor. */
|
/* DIRCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
DIRCOL::DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ)
|
DIRCOL::DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
@@ -1556,7 +1556,7 @@ void TDBDHR::CloseDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* DHRCOL public constructor. */
|
/* DHRCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
DHRCOL::DHRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
DHRCOL::DHRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
|
@@ -226,7 +226,7 @@ class TDBSDR : public TDBDIR {
|
|||||||
class DIRCOL : public COLBLK {
|
class DIRCOL : public COLBLK {
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "DIR");
|
DIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "DIR");
|
||||||
DIRCOL(DIRCOL *colp, PTDB tdbp); // Constructor used in copy process
|
DIRCOL(DIRCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@@ -588,7 +588,7 @@ bool TDBMYSQL::MakeSelect(PGLOBAL g, bool mx)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool TDBMYSQL::MakeInsert(PGLOBAL g)
|
bool TDBMYSQL::MakeInsert(PGLOBAL g)
|
||||||
{
|
{
|
||||||
char *tk = "`";
|
const char *tk = "`";
|
||||||
uint len = 0;
|
uint len = 0;
|
||||||
bool oom, b = false;
|
bool oom, b = false;
|
||||||
PCOL colp;
|
PCOL colp;
|
||||||
@@ -1240,7 +1240,7 @@ void TDBMYSQL::CloseDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* MYSQLCOL public constructor. */
|
/* MYSQLCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
MYSQLCOL::MYSQLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
MYSQLCOL::MYSQLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
@@ -1266,7 +1266,7 @@ MYSQLCOL::MYSQLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* MYSQLCOL public constructor. */
|
/* MYSQLCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
MYSQLCOL::MYSQLCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PSZ am)
|
MYSQLCOL::MYSQLCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PCSZ am)
|
||||||
: COLBLK(NULL, tdbp, i)
|
: COLBLK(NULL, tdbp, i)
|
||||||
{
|
{
|
||||||
const char *chset = get_charset_name(fld->charsetnr);
|
const char *chset = get_charset_name(fld->charsetnr);
|
||||||
@@ -1675,7 +1675,7 @@ int TDBMYEXC::WriteDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* MYXCOL public constructor. */
|
/* MYXCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
MYXCOL::MYXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
MYXCOL::MYXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: MYSQLCOL(cdp, tdbp, cprec, i, am)
|
: MYSQLCOL(cdp, tdbp, cprec, i, am)
|
||||||
{
|
{
|
||||||
// Set additional EXEC MYSQL access method information for column.
|
// Set additional EXEC MYSQL access method information for column.
|
||||||
@@ -1685,7 +1685,7 @@ MYXCOL::MYXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* MYSQLCOL public constructor. */
|
/* MYSQLCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
MYXCOL::MYXCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PSZ am)
|
MYXCOL::MYXCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PCSZ am)
|
||||||
: MYSQLCOL(fld, tdbp, i, am)
|
: MYSQLCOL(fld, tdbp, i, am)
|
||||||
{
|
{
|
||||||
if (trace)
|
if (trace)
|
||||||
|
@@ -86,7 +86,7 @@ class TDBMYSQL : public TDBEXT {
|
|||||||
virtual void ResetDB(void) {N = 0;}
|
virtual void ResetDB(void) {N = 0;}
|
||||||
virtual int RowNumber(PGLOBAL g, bool b = false);
|
virtual int RowNumber(PGLOBAL g, bool b = false);
|
||||||
virtual bool IsView(void) {return Isview;}
|
virtual bool IsView(void) {return Isview;}
|
||||||
virtual PSZ GetServer(void) {return Server;}
|
virtual PCSZ GetServer(void) {return Server;}
|
||||||
void SetDatabase(LPCSTR db) {Schema = (char*)db;}
|
void SetDatabase(LPCSTR db) {Schema = (char*)db;}
|
||||||
|
|
||||||
// Schema routines
|
// Schema routines
|
||||||
@@ -146,8 +146,8 @@ class MYSQLCOL : public COLBLK {
|
|||||||
friend class TDBMYSQL;
|
friend class TDBMYSQL;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
MYSQLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "MYSQL");
|
MYSQLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "MYSQL");
|
||||||
MYSQLCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PSZ am = "MYSQL");
|
MYSQLCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PCSZ am = "MYSQL");
|
||||||
MYSQLCOL(MYSQLCOL *colp, PTDB tdbp); // Constructor used in copy process
|
MYSQLCOL(MYSQLCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
@@ -215,8 +215,8 @@ class MYXCOL : public MYSQLCOL {
|
|||||||
friend class TDBMYEXC;
|
friend class TDBMYEXC;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
MYXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "MYSQL");
|
MYXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "MYSQL");
|
||||||
MYXCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PSZ am = "MYSQL");
|
MYXCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PCSZ am = "MYSQL");
|
||||||
MYXCOL(MYXCOL *colp, PTDB tdbp); // Constructor used in copy process
|
MYXCOL(MYXCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
|
@@ -884,7 +884,7 @@ void TDBODBC::CloseDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* ODBCCOL public constructor. */
|
/* ODBCCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
ODBCCOL::ODBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
ODBCCOL::ODBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: EXTCOL(cdp, tdbp, cprec, i, am)
|
: EXTCOL(cdp, tdbp, cprec, i, am)
|
||||||
{
|
{
|
||||||
// Set additional ODBC access method information for column.
|
// Set additional ODBC access method information for column.
|
||||||
@@ -1302,7 +1302,7 @@ int TDBXDBC::DeleteDB(PGLOBAL g, int irc)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* XSRCCOL public constructor. */
|
/* XSRCCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
XSRCCOL::XSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
XSRCCOL::XSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: ODBCCOL(cdp, tdbp, cprec, i, am)
|
: ODBCCOL(cdp, tdbp, cprec, i, am)
|
||||||
{
|
{
|
||||||
// Set additional ODBC access method information for column.
|
// Set additional ODBC access method information for column.
|
||||||
|
@@ -73,7 +73,7 @@ class TDBODBC : public TDBEXT {
|
|||||||
virtual PCSZ 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 PCSZ GetServer(void) {return "ODBC";}
|
||||||
virtual int Indexable(void) {return 2;}
|
virtual int Indexable(void) {return 2;}
|
||||||
|
|
||||||
// Database routines
|
// Database routines
|
||||||
@@ -108,7 +108,7 @@ class ODBCCOL : public EXTCOL {
|
|||||||
friend class TDBODBC;
|
friend class TDBODBC;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
ODBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "ODBC");
|
ODBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "ODBC");
|
||||||
ODBCCOL(ODBCCOL *colp, PTDB tdbp); // Constructor used in copy process
|
ODBCCOL(ODBCCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
@@ -179,7 +179,7 @@ class XSRCCOL : public ODBCCOL {
|
|||||||
friend class TDBXDBC;
|
friend class TDBXDBC;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
XSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "ODBC");
|
XSRCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "ODBC");
|
||||||
XSRCCOL(XSRCCOL *colp, PTDB tdbp); // Constructor used in copy process
|
XSRCCOL(XSRCCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@@ -138,7 +138,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
|
|||||||
strcpy(g->Message, MSG(SRC_TABLE_UNDEF));
|
strcpy(g->Message, MSG(SRC_TABLE_UNDEF));
|
||||||
goto err;
|
goto err;
|
||||||
} else
|
} else
|
||||||
query = Tabsrc;
|
query = (char*)Tabsrc;
|
||||||
|
|
||||||
// Open a MySQL connection for this table
|
// Open a MySQL connection for this table
|
||||||
if (!Myc.Open(g, Host, Database, User, Pwd, Port)) {
|
if (!Myc.Open(g, Host, Database, User, Pwd, Port)) {
|
||||||
|
@@ -32,16 +32,16 @@ class PIVAID : public CSORT {
|
|||||||
protected:
|
protected:
|
||||||
// Members
|
// Members
|
||||||
MYSQLC Myc; // MySQL connection class
|
MYSQLC Myc; // MySQL connection class
|
||||||
char *Host; // Host machine to use
|
PCSZ Host; // Host machine to use
|
||||||
char *User; // User logon info
|
PCSZ User; // User logon info
|
||||||
char *Pwd; // Password logon info
|
PCSZ Pwd; // Password logon info
|
||||||
char *Database; // Database to be used by server
|
PCSZ Database; // Database to be used by server
|
||||||
PQRYRES Qryp; // Points to Query result block
|
PQRYRES Qryp; // Points to Query result block
|
||||||
char *Tabname; // Name of source table
|
PCSZ Tabname; // Name of source table
|
||||||
char *Tabsrc; // SQL of source table
|
PCSZ Tabsrc; // SQL of source table
|
||||||
char *Picol; // Pivot column name
|
PCSZ Picol; // Pivot column name
|
||||||
char *Fncol; // Function column name
|
PCSZ Fncol; // Function column name
|
||||||
char *Skcol; // Skipped columns
|
PCSZ Skcol; // Skipped columns
|
||||||
PVBLK Rblkp; // The value block of the pivot column
|
PVBLK Rblkp; // The value block of the pivot column
|
||||||
int Port; // MySQL port number
|
int Port; // MySQL port number
|
||||||
}; // end of class PIVAID
|
}; // end of class PIVAID
|
||||||
|
@@ -355,7 +355,7 @@ void TDBINI::CloseDB(PGLOBAL)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* INICOL public constructor. */
|
/* INICOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
INICOL::INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ)
|
INICOL::INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
@@ -769,7 +769,7 @@ int TDBXIN::DeleteDB(PGLOBAL g, int irc)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* XINCOL public constructor. */
|
/* XINCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
XINCOL::XINCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
XINCOL::XINCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: INICOL(cdp, tdbp, cprec, i, am)
|
: INICOL(cdp, tdbp, cprec, i, am)
|
||||||
{
|
{
|
||||||
} // end of XINCOL constructor
|
} // end of XINCOL constructor
|
||||||
|
@@ -93,7 +93,7 @@ class TDBINI : public TDBASE {
|
|||||||
class INICOL : public COLBLK {
|
class INICOL : public COLBLK {
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "INI");
|
INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "INI");
|
||||||
INICOL(INICOL *colp, PTDB tdbp); // Constructor used in copy process
|
INICOL(INICOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
@@ -165,7 +165,7 @@ class TDBXIN : public TDBINI {
|
|||||||
class XINCOL : public INICOL {
|
class XINCOL : public INICOL {
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
XINCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "INI");
|
XINCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "INI");
|
||||||
XINCOL(XINCOL *colp, PTDB tdbp); // Constructor used in copy process
|
XINCOL(XINCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@@ -119,7 +119,8 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
|
|||||||
FLD_LENGTH, FLD_SCALE, FLD_RADIX, FLD_NULL,
|
FLD_LENGTH, FLD_SCALE, FLD_RADIX, FLD_NULL,
|
||||||
FLD_REM, FLD_NO, FLD_CHARSET};
|
FLD_REM, FLD_NO, FLD_CHARSET};
|
||||||
unsigned int length[] = {0, 4, 16, 4, 4, 4, 4, 4, 0, 32, 32};
|
unsigned int length[] = {0, 4, 16, 4, 4, 4, 4, 4, 0, 32, 32};
|
||||||
char *pn, *tn, *fld, *colname, *chset, *fmt, v;
|
PCSZ fmt;
|
||||||
|
char *pn, *tn, *fld, *colname, *chset, v;
|
||||||
int i, n, ncol = sizeof(buftyp) / sizeof(int);
|
int i, n, ncol = sizeof(buftyp) / sizeof(int);
|
||||||
int prec, len, type, scale;
|
int prec, len, type, scale;
|
||||||
int zconv = GetConvSize();
|
int zconv = GetConvSize();
|
||||||
@@ -227,7 +228,7 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
|
|||||||
fmt = MyDateFmt(fp->type());
|
fmt = MyDateFmt(fp->type());
|
||||||
prec = len = strlen(fmt);
|
prec = len = strlen(fmt);
|
||||||
} else {
|
} else {
|
||||||
fmt = (char*)fp->option_struct->dateformat;
|
fmt = (PCSZ)fp->option_struct->dateformat;
|
||||||
prec = len = fp->field_length;
|
prec = len = fp->field_length;
|
||||||
} // endif mysql
|
} // endif mysql
|
||||||
|
|
||||||
@@ -314,7 +315,7 @@ bool PRXDEF::DefineAM(PGLOBAL g, LPCSTR, int)
|
|||||||
strcpy(g->Message, "Missing object table definition");
|
strcpy(g->Message, "Missing object table definition");
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else
|
||||||
tab = "Noname";
|
tab = PlugDup(g, "Noname");
|
||||||
|
|
||||||
} else
|
} else
|
||||||
// Analyze the table name, it may have the format: [dbname.]tabname
|
// Analyze the table name, it may have the format: [dbname.]tabname
|
||||||
@@ -626,7 +627,7 @@ void TDBPRX::RemoveNext(PTABLE tp)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* PRXCOL public constructor. */
|
/* PRXCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PRXCOL::PRXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
PRXCOL::PRXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
|
@@ -71,7 +71,7 @@ class DllExport TDBPRX : public TDBASE {
|
|||||||
virtual int GetRecpos(void) {return Tdbp->GetRecpos();}
|
virtual int GetRecpos(void) {return Tdbp->GetRecpos();}
|
||||||
virtual void ResetDB(void) {Tdbp->ResetDB();}
|
virtual void ResetDB(void) {Tdbp->ResetDB();}
|
||||||
virtual int RowNumber(PGLOBAL g, bool b = FALSE);
|
virtual int RowNumber(PGLOBAL g, bool b = FALSE);
|
||||||
virtual PSZ GetServer(void) {return (Tdbp) ? Tdbp->GetServer() : (PSZ)"?";}
|
virtual PCSZ GetServer(void) {return (Tdbp) ? Tdbp->GetServer() : (PSZ)"?";}
|
||||||
|
|
||||||
// Database routines
|
// Database routines
|
||||||
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n);
|
||||||
@@ -101,7 +101,7 @@ class DllExport PRXCOL : public COLBLK {
|
|||||||
friend class TDBOCCUR;
|
friend class TDBOCCUR;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
PRXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "PRX");
|
PRXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "PRX");
|
||||||
PRXCOL(PRXCOL *colp, PTDB tdbp); // Constructor used in copy process
|
PRXCOL(PRXCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@@ -269,7 +269,7 @@ int TDBVIR::DeleteDB(PGLOBAL g, int)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* VIRCOL public constructor. */
|
/* VIRCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
VIRCOL::VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ)
|
VIRCOL::VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
|
@@ -76,7 +76,7 @@ class VIRCOL : public COLBLK {
|
|||||||
friend class TDBVIR;
|
friend class TDBVIR;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "VIRTUAL");
|
VIRCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "VIRTUAL");
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
virtual int GetAmType(void) {return TYPE_AM_VIR;}
|
virtual int GetAmType(void) {return TYPE_AM_VIR;}
|
||||||
|
@@ -363,7 +363,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
|
|||||||
|
|
||||||
skipit:
|
skipit:
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("CSVColumns: n=%d len=%d\n", n, length[0]);
|
htrc("XMLColumns: n=%d len=%d\n", n, length[0]);
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
/* Allocate the structures used to refer to the result set. */
|
/* Allocate the structures used to refer to the result set. */
|
||||||
@@ -452,7 +452,8 @@ XMLDEF::XMLDEF(void)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
|
bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
|
||||||
{
|
{
|
||||||
char *defrow, *defcol, buf[10];
|
PCSZ defrow, defcol;
|
||||||
|
char buf[10];
|
||||||
|
|
||||||
Fn = GetStringCatInfo(g, "Filename", NULL);
|
Fn = GetStringCatInfo(g, "Filename", NULL);
|
||||||
Encoding = GetStringCatInfo(g, "Encoding", "UTF-8");
|
Encoding = GetStringCatInfo(g, "Encoding", "UTF-8");
|
||||||
@@ -1361,7 +1362,7 @@ void TDBXML::CloseDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* XMLCOL public constructor. */
|
/* XMLCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
XMLCOL::XMLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
XMLCOL::XMLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
|
@@ -155,7 +155,7 @@ class DllExport TDBXML : public TDBASE {
|
|||||||
class XMLCOL : public COLBLK {
|
class XMLCOL : public COLBLK {
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
XMLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "XML");
|
XMLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "XML");
|
||||||
XMLCOL(XMLCOL *colp, PTDB tdbp); // Constructor used in copy process
|
XMLCOL(XMLCOL *colp, PTDB tdbp); // Constructor used in copy process
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@@ -195,7 +195,7 @@ void TDBZIP::CloseDB(PGLOBAL g)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* ZIPCOL public constructor. */
|
/* ZIPCOL public constructor. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
ZIPCOL::ZIPCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am)
|
ZIPCOL::ZIPCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
||||||
: COLBLK(cdp, tdbp, i)
|
: COLBLK(cdp, tdbp, i)
|
||||||
{
|
{
|
||||||
if (cprec) {
|
if (cprec) {
|
||||||
|
@@ -82,7 +82,7 @@ class DllExport ZIPCOL : public COLBLK {
|
|||||||
friend class TDBZIP;
|
friend class TDBZIP;
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
ZIPCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "ZIP");
|
ZIPCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "ZIP");
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
virtual int GetAmType(void) { return TYPE_AM_ZIP; }
|
virtual int GetAmType(void) { return TYPE_AM_ZIP; }
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/************ Valblk C++ Functions Source Code File (.CPP) *************/
|
/************ Valblk C++ Functions Source Code File (.CPP) *************/
|
||||||
/* Name: VALBLK.CPP Version 2.2 */
|
/* Name: VALBLK.CPP Version 2.3 */
|
||||||
/* */
|
/* */
|
||||||
/* (C) Copyright to the author Olivier BERTRAND 2005-2017 */
|
/* (C) Copyright to the author Olivier BERTRAND 2005-2017 */
|
||||||
/* */
|
/* */
|
||||||
@@ -145,7 +145,7 @@ PSZ VALBLK::GetCharValue(int)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set format so formatted dates can be converted on input. */
|
/* Set format so formatted dates can be converted on input. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool VALBLK::SetFormat(PGLOBAL g, PSZ, int, int)
|
bool VALBLK::SetFormat(PGLOBAL g, PCSZ, int, int)
|
||||||
{
|
{
|
||||||
sprintf(g->Message, MSG(NO_DATE_FMT), Type);
|
sprintf(g->Message, MSG(NO_DATE_FMT), Type);
|
||||||
return true;
|
return true;
|
||||||
@@ -335,7 +335,7 @@ uchar TYPBLK<uchar>::GetTypedValue(PVAL valp)
|
|||||||
/* Set one value in a block from a zero terminated string. */
|
/* Set one value in a block from a zero terminated string. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
template <class TYPE>
|
template <class TYPE>
|
||||||
void TYPBLK<TYPE>::SetValue(PSZ p, int n)
|
void TYPBLK<TYPE>::SetValue(PCSZ p, int n)
|
||||||
{
|
{
|
||||||
ChkIndx(n);
|
ChkIndx(n);
|
||||||
|
|
||||||
@@ -385,7 +385,7 @@ template <>
|
|||||||
ulonglong TYPBLK<ulonglong>::MaxVal(void) {return ULONGLONG_MAX;}
|
ulonglong TYPBLK<ulonglong>::MaxVal(void) {return ULONGLONG_MAX;}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void TYPBLK<double>::SetValue(PSZ p, int n)
|
void TYPBLK<double>::SetValue(PCSZ p, int n)
|
||||||
{
|
{
|
||||||
ChkIndx(n);
|
ChkIndx(n);
|
||||||
|
|
||||||
@@ -403,7 +403,7 @@ void TYPBLK<double>::SetValue(PSZ p, int n)
|
|||||||
/* Set one value in a block from an array of characters. */
|
/* Set one value in a block from an array of characters. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
template <class TYPE>
|
template <class TYPE>
|
||||||
void TYPBLK<TYPE>::SetValue(char *sp, uint len, int n)
|
void TYPBLK<TYPE>::SetValue(PCSZ sp, uint len, int n)
|
||||||
{
|
{
|
||||||
PGLOBAL& g = Global;
|
PGLOBAL& g = Global;
|
||||||
PSZ spz = (PSZ)PlugSubAlloc(g, NULL, 0); // Temporary
|
PSZ spz = (PSZ)PlugSubAlloc(g, NULL, 0); // Temporary
|
||||||
@@ -778,7 +778,7 @@ void CHRBLK::SetValue(PVAL valp, int n)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set one value in a block from a zero terminated string. */
|
/* Set one value in a block from a zero terminated string. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void CHRBLK::SetValue(PSZ sp, int n)
|
void CHRBLK::SetValue(PCSZ sp, int n)
|
||||||
{
|
{
|
||||||
uint len = (sp) ? strlen(sp) : 0;
|
uint len = (sp) ? strlen(sp) : 0;
|
||||||
SetValue(sp, len, n);
|
SetValue(sp, len, n);
|
||||||
@@ -787,7 +787,7 @@ void CHRBLK::SetValue(PSZ sp, int n)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set one value in a block from an array of characters. */
|
/* Set one value in a block from an array of characters. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void CHRBLK::SetValue(char *sp, uint len, int n)
|
void CHRBLK::SetValue(const char *sp, uint len, int n)
|
||||||
{
|
{
|
||||||
char *p = Chrp + n * Long;
|
char *p = Chrp + n * Long;
|
||||||
|
|
||||||
@@ -1152,7 +1152,7 @@ void STRBLK::SetValue(PVAL valp, int n)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set one value in a block from a zero terminated string. */
|
/* Set one value in a block from a zero terminated string. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void STRBLK::SetValue(PSZ p, int n)
|
void STRBLK::SetValue(PCSZ p, int n)
|
||||||
{
|
{
|
||||||
if (p) {
|
if (p) {
|
||||||
if (!Sorted || !n || !Strp[n-1] || strcmp(p, Strp[n-1]))
|
if (!Sorted || !n || !Strp[n-1] || strcmp(p, Strp[n-1]))
|
||||||
@@ -1168,7 +1168,7 @@ void STRBLK::SetValue(PSZ p, int n)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set one value in a block from an array of characters. */
|
/* Set one value in a block from an array of characters. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void STRBLK::SetValue(char *sp, uint len, int n)
|
void STRBLK::SetValue(const char *sp, uint len, int n)
|
||||||
{
|
{
|
||||||
PSZ p;
|
PSZ p;
|
||||||
|
|
||||||
@@ -1316,7 +1316,7 @@ DATBLK::DATBLK(void *mp, int nval) : TYPBLK<int>(mp, nval, TYPE_INT)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set format so formatted dates can be converted on input. */
|
/* Set format so formatted dates can be converted on input. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool DATBLK::SetFormat(PGLOBAL g, PSZ fmt, int len, int year)
|
bool DATBLK::SetFormat(PGLOBAL g, PCSZ fmt, int len, int year)
|
||||||
{
|
{
|
||||||
if (!(Dvalp = AllocateValue(g, TYPE_DATE, len, year, false, fmt)))
|
if (!(Dvalp = AllocateValue(g, TYPE_DATE, len, year, false, fmt)))
|
||||||
return true;
|
return true;
|
||||||
@@ -1343,7 +1343,7 @@ char *DATBLK::GetCharString(char *p, int n)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set one value in a block from a char string. */
|
/* Set one value in a block from a char string. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void DATBLK::SetValue(PSZ p, int n)
|
void DATBLK::SetValue(PCSZ p, int n)
|
||||||
{
|
{
|
||||||
if (Dvalp) {
|
if (Dvalp) {
|
||||||
// Decode the string according to format
|
// Decode the string according to format
|
||||||
|
@@ -91,7 +91,7 @@ class VALBLK : public BLOCK {
|
|||||||
virtual char *GetCharString(char *p, int n) = 0;
|
virtual char *GetCharString(char *p, int n) = 0;
|
||||||
virtual void ReAlloc(void *mp, int n) {Blkp = mp; Nval = n;}
|
virtual void ReAlloc(void *mp, int n) {Blkp = mp; Nval = n;}
|
||||||
virtual void Reset(int n) = 0;
|
virtual void Reset(int n) = 0;
|
||||||
virtual bool SetFormat(PGLOBAL g, PSZ fmt, int len, int year = 0);
|
virtual bool SetFormat(PGLOBAL g, PCSZ fmt, int len, int year = 0);
|
||||||
virtual void SetPrec(int p) {}
|
virtual void SetPrec(int p) {}
|
||||||
virtual bool IsCi(void) {return false;}
|
virtual bool IsCi(void) {return false;}
|
||||||
|
|
||||||
@@ -105,8 +105,8 @@ class VALBLK : public BLOCK {
|
|||||||
virtual void SetValue(double, int) {assert(false);}
|
virtual void SetValue(double, int) {assert(false);}
|
||||||
virtual void SetValue(char, int) {assert(false);}
|
virtual void SetValue(char, int) {assert(false);}
|
||||||
virtual void SetValue(uchar, int) {assert(false);}
|
virtual void SetValue(uchar, int) {assert(false);}
|
||||||
virtual void SetValue(PSZ, int) {assert(false);}
|
virtual void SetValue(PCSZ, int) {assert(false);}
|
||||||
virtual void SetValue(char *, uint, int) {assert(false);}
|
virtual void SetValue(const char *, uint, int) {assert(false);}
|
||||||
virtual void SetValue(PVAL valp, int n) = 0;
|
virtual void SetValue(PVAL valp, int n) = 0;
|
||||||
virtual void SetValue(PVBLK pv, int n1, int n2) = 0;
|
virtual void SetValue(PVBLK pv, int n1, int n2) = 0;
|
||||||
virtual void SetMin(PVAL valp, int n) = 0;
|
virtual void SetMin(PVAL valp, int n) = 0;
|
||||||
@@ -165,8 +165,8 @@ class TYPBLK : public VALBLK {
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
using VALBLK::SetValue;
|
using VALBLK::SetValue;
|
||||||
virtual void SetValue(PSZ sp, int n);
|
virtual void SetValue(PCSZ sp, int n);
|
||||||
virtual void SetValue(char *sp, uint len, int n);
|
virtual void SetValue(const char *sp, uint len, int n);
|
||||||
virtual void SetValue(short sval, int n)
|
virtual void SetValue(short sval, int n)
|
||||||
{Typp[n] = (TYPE)sval; SetNull(n, false);}
|
{Typp[n] = (TYPE)sval; SetNull(n, false);}
|
||||||
virtual void SetValue(ushort sval, int n)
|
virtual void SetValue(ushort sval, int n)
|
||||||
@@ -236,8 +236,8 @@ class CHRBLK : public VALBLK {
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
using VALBLK::SetValue;
|
using VALBLK::SetValue;
|
||||||
virtual void SetValue(PSZ sp, int n);
|
virtual void SetValue(PCSZ sp, int n);
|
||||||
virtual void SetValue(char *sp, uint len, int n);
|
virtual void SetValue(const char *sp, uint len, int n);
|
||||||
virtual void SetValue(PVAL valp, int n);
|
virtual void SetValue(PVAL valp, int n);
|
||||||
virtual void SetValue(PVBLK pv, int n1, int n2);
|
virtual void SetValue(PVBLK pv, int n1, int n2);
|
||||||
virtual void SetMin(PVAL valp, int n);
|
virtual void SetMin(PVAL valp, int n);
|
||||||
@@ -290,8 +290,8 @@ class STRBLK : public VALBLK {
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
using VALBLK::SetValue;
|
using VALBLK::SetValue;
|
||||||
virtual void SetValue(PSZ sp, int n);
|
virtual void SetValue(PCSZ sp, int n);
|
||||||
virtual void SetValue(char *sp, uint len, int n);
|
virtual void SetValue(const char *sp, uint len, int n);
|
||||||
virtual void SetValue(PVAL valp, int n);
|
virtual void SetValue(PVAL valp, int n);
|
||||||
virtual void SetValue(PVBLK pv, int n1, int n2);
|
virtual void SetValue(PVBLK pv, int n1, int n2);
|
||||||
virtual void SetMin(PVAL valp, int n);
|
virtual void SetMin(PVAL valp, int n);
|
||||||
@@ -322,12 +322,12 @@ class DATBLK : public TYPBLK<int> {
|
|||||||
DATBLK(void *mp, int size);
|
DATBLK(void *mp, int size);
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
virtual bool SetFormat(PGLOBAL g, PSZ fmt, int len, int year = 0);
|
virtual bool SetFormat(PGLOBAL g, PCSZ fmt, int len, int year = 0);
|
||||||
virtual char *GetCharString(char *p, int n);
|
virtual char *GetCharString(char *p, int n);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
using TYPBLK<int>::SetValue;
|
using TYPBLK<int>::SetValue;
|
||||||
virtual void SetValue(PSZ sp, int n);
|
virtual void SetValue(PCSZ sp, int n);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Members
|
// Members
|
||||||
@@ -352,7 +352,7 @@ class PTRBLK : public STRBLK {
|
|||||||
// Methods
|
// Methods
|
||||||
using STRBLK::SetValue;
|
using STRBLK::SetValue;
|
||||||
using STRBLK::CompVal;
|
using STRBLK::CompVal;
|
||||||
virtual void SetValue(PSZ p, int n) {Strp[n] = p;}
|
virtual void SetValue(PCSZ p, int n) {Strp[n] = (char*)p;}
|
||||||
virtual int CompVal(int i1, int i2);
|
virtual int CompVal(int i1, int i2);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/************* Value C++ Functions Source Code File (.CPP) *************/
|
/************* Value C++ Functions Source Code File (.CPP) *************/
|
||||||
/* Name: VALUE.CPP Version 2.7 */
|
/* Name: VALUE.CPP Version 2.8 */
|
||||||
/* */
|
/* */
|
||||||
/* (C) Copyright to the author Olivier BERTRAND 2001-2017 */
|
/* (C) Copyright to the author Olivier BERTRAND 2001-2017 */
|
||||||
/* */
|
/* */
|
||||||
@@ -94,10 +94,10 @@ PSZ strlwr(PSZ s);
|
|||||||
/* OUT minus: Set to true if the number is negative */
|
/* OUT minus: Set to true if the number is negative */
|
||||||
/* Returned val: The resulting number */
|
/* Returned val: The resulting number */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
ulonglong CharToNumber(char *p, int n, ulonglong maxval,
|
ulonglong CharToNumber(const char *p, int n, ulonglong maxval,
|
||||||
bool un, bool *minus, bool *rc)
|
bool un, bool *minus, bool *rc)
|
||||||
{
|
{
|
||||||
char *p2;
|
const char *p2;
|
||||||
uchar c;
|
uchar c;
|
||||||
ulonglong val;
|
ulonglong val;
|
||||||
|
|
||||||
@@ -138,9 +138,9 @@ ulonglong CharToNumber(char *p, int n, ulonglong maxval,
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* GetTypeName: returns the PlugDB internal type name. */
|
/* GetTypeName: returns the PlugDB internal type name. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PSZ GetTypeName(int type)
|
PCSZ GetTypeName(int type)
|
||||||
{
|
{
|
||||||
PSZ name;
|
PCSZ name;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TYPE_STRING: name = "CHAR"; break;
|
case TYPE_STRING: name = "CHAR"; break;
|
||||||
@@ -184,9 +184,9 @@ int GetTypeSize(int type, int len)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* GetFormatType: returns the FORMAT character(s) according to type. */
|
/* GetFormatType: returns the FORMAT character(s) according to type. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
char *GetFormatType(int type)
|
const char *GetFormatType(int type)
|
||||||
{
|
{
|
||||||
char *c = "X";
|
const char *c = "X";
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TYPE_STRING: c = "C"; break;
|
case TYPE_STRING: c = "C"; break;
|
||||||
@@ -370,7 +370,7 @@ PVAL AllocateValue(PGLOBAL g, void *value, short type, short prec)
|
|||||||
/* Allocate a variable Value according to type, length and precision. */
|
/* Allocate a variable Value according to type, length and precision. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PVAL AllocateValue(PGLOBAL g, int type, int len, int prec,
|
PVAL AllocateValue(PGLOBAL g, int type, int len, int prec,
|
||||||
bool uns, PSZ fmt)
|
bool uns, PCSZ fmt)
|
||||||
{
|
{
|
||||||
PVAL valp;
|
PVAL valp;
|
||||||
|
|
||||||
@@ -714,7 +714,7 @@ uchar TYPVAL<uchar>::GetTypedValue(PVAL valp)
|
|||||||
/* TYPVAL SetValue: convert chars extracted from a line to TYPE value.*/
|
/* TYPVAL SetValue: convert chars extracted from a line to TYPE value.*/
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
template <class TYPE>
|
template <class TYPE>
|
||||||
bool TYPVAL<TYPE>::SetValue_char(char *p, int n)
|
bool TYPVAL<TYPE>::SetValue_char(const char *p, int n)
|
||||||
{
|
{
|
||||||
bool rc, minus;
|
bool rc, minus;
|
||||||
ulonglong maxval = MaxVal();
|
ulonglong maxval = MaxVal();
|
||||||
@@ -736,7 +736,7 @@ bool TYPVAL<TYPE>::SetValue_char(char *p, int n)
|
|||||||
} // end of SetValue
|
} // end of SetValue
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
bool TYPVAL<double>::SetValue_char(char *p, int n)
|
bool TYPVAL<double>::SetValue_char(const char *p, int n)
|
||||||
{
|
{
|
||||||
if (p && n > 0) {
|
if (p && n > 0) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
@@ -764,7 +764,7 @@ bool TYPVAL<double>::SetValue_char(char *p, int n)
|
|||||||
/* TYPVAL SetValue: fill a typed value from a string. */
|
/* TYPVAL SetValue: fill a typed value from a string. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
template <class TYPE>
|
template <class TYPE>
|
||||||
void TYPVAL<TYPE>::SetValue_psz(PSZ s)
|
void TYPVAL<TYPE>::SetValue_psz(PCSZ s)
|
||||||
{
|
{
|
||||||
if (s) {
|
if (s) {
|
||||||
SetValue_char(s, (int)strlen(s));
|
SetValue_char(s, (int)strlen(s));
|
||||||
@@ -1202,7 +1202,7 @@ bool TYPVAL<TYPE>::Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op)
|
|||||||
/* This function assumes that the format matches the value type. */
|
/* This function assumes that the format matches the value type. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
template <class TYPE>
|
template <class TYPE>
|
||||||
bool TYPVAL<TYPE>::FormatValue(PVAL vp, char *fmt)
|
bool TYPVAL<TYPE>::FormatValue(PVAL vp, PCSZ fmt)
|
||||||
{
|
{
|
||||||
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
||||||
int n = sprintf(buf, fmt, Tval);
|
int n = sprintf(buf, fmt, Tval);
|
||||||
@@ -1362,25 +1362,25 @@ bool TYPVAL<PSZ>::SetValue_pval(PVAL valp, bool chktype)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* STRING SetValue: fill string with chars extracted from a line. */
|
/* STRING SetValue: fill string with chars extracted from a line. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool TYPVAL<PSZ>::SetValue_char(char *p, int n)
|
bool TYPVAL<PSZ>::SetValue_char(const char *cp, int n)
|
||||||
{
|
{
|
||||||
bool rc = false;
|
bool rc = false;
|
||||||
|
|
||||||
if (!p || n == 0) {
|
if (!cp || n == 0) {
|
||||||
Reset();
|
Reset();
|
||||||
Null = Nullable;
|
Null = Nullable;
|
||||||
} else if (p != Strp) {
|
} else if (cp != Strp) {
|
||||||
rc = n > Len;
|
const char *p = cp + n - 1;
|
||||||
|
|
||||||
if ((n = MY_MIN(n, Len))) {
|
for (p; p >= cp; p--, n--)
|
||||||
strncpy(Strp, p, n);
|
|
||||||
|
|
||||||
// for (p = Strp + n - 1; p >= Strp && (*p == ' ' || *p == '\0'); p--) ;
|
|
||||||
for (p = Strp + n - 1; p >= Strp; p--)
|
|
||||||
if (*p && *p != ' ')
|
if (*p && *p != ' ')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
*(++p) = '\0';
|
rc = n > Len;
|
||||||
|
|
||||||
|
if ((n = MY_MIN(n, Len))) {
|
||||||
|
strncpy(Strp, cp, n);
|
||||||
|
Strp[n] = '\0';
|
||||||
|
|
||||||
if (trace > 1)
|
if (trace > 1)
|
||||||
htrc(" Setting string to: '%s'\n", Strp);
|
htrc(" Setting string to: '%s'\n", Strp);
|
||||||
@@ -1397,7 +1397,7 @@ bool TYPVAL<PSZ>::SetValue_char(char *p, int n)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* STRING SetValue: fill string with another string. */
|
/* STRING SetValue: fill string with another string. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void TYPVAL<PSZ>::SetValue_psz(PSZ s)
|
void TYPVAL<PSZ>::SetValue_psz(PCSZ s)
|
||||||
{
|
{
|
||||||
if (!s) {
|
if (!s) {
|
||||||
Reset();
|
Reset();
|
||||||
@@ -1560,7 +1560,7 @@ void TYPVAL<PSZ>::SetValue(uchar c)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void TYPVAL<PSZ>::SetBinValue(void *p)
|
void TYPVAL<PSZ>::SetBinValue(void *p)
|
||||||
{
|
{
|
||||||
SetValue_char((char *)p, Len);
|
SetValue_char((const char *)p, Len);
|
||||||
} // end of SetBinValue
|
} // end of SetBinValue
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -1690,7 +1690,7 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
|
|||||||
/* constructed from its own value formated using the fmt format. */
|
/* constructed from its own value formated using the fmt format. */
|
||||||
/* This function assumes that the format matches the value type. */
|
/* This function assumes that the format matches the value type. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool TYPVAL<PSZ>::FormatValue(PVAL vp, char *fmt)
|
bool TYPVAL<PSZ>::FormatValue(PVAL vp, PCSZ fmt)
|
||||||
{
|
{
|
||||||
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
||||||
int n = sprintf(buf, fmt, Strp);
|
int n = sprintf(buf, fmt, Strp);
|
||||||
@@ -1810,102 +1810,6 @@ bool DECVAL::GetBinValue(void *buf, int buflen, bool go)
|
|||||||
return false;
|
return false;
|
||||||
} // end of GetBinValue
|
} // end of GetBinValue
|
||||||
|
|
||||||
#if 0
|
|
||||||
/***********************************************************************/
|
|
||||||
/* DECIMAL SetValue: copy the value of another Value object. */
|
|
||||||
/***********************************************************************/
|
|
||||||
bool DECVAL::SetValue_pval(PVAL valp, bool chktype)
|
|
||||||
{
|
|
||||||
if (chktype && (valp->GetType() != Type || valp->GetSize() > Len))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
char buf[64];
|
|
||||||
|
|
||||||
if (!(Null = valp->IsNull() && Nullable))
|
|
||||||
strncpy(Strp, valp->GetCharString(buf), Len);
|
|
||||||
else
|
|
||||||
Reset();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
} // end of SetValue_pval
|
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
/* DECIMAL SetValue: fill string with chars extracted from a line. */
|
|
||||||
/***********************************************************************/
|
|
||||||
bool DECVAL::SetValue_char(char *p, int n)
|
|
||||||
{
|
|
||||||
bool rc;
|
|
||||||
|
|
||||||
if (p && n > 0) {
|
|
||||||
rc = n > Len;
|
|
||||||
|
|
||||||
if ((n = MY_MIN(n, Len))) {
|
|
||||||
strncpy(Strp, p, n);
|
|
||||||
|
|
||||||
// for (p = Strp + n - 1; p >= Strp && (*p == ' ' || *p == '\0'); p--) ;
|
|
||||||
for (p = Strp + n - 1; p >= Strp; p--)
|
|
||||||
if (*p && *p != ' ')
|
|
||||||
break;
|
|
||||||
|
|
||||||
*(++p) = '\0';
|
|
||||||
|
|
||||||
if (trace > 1)
|
|
||||||
htrc(" Setting string to: '%s'\n", Strp);
|
|
||||||
|
|
||||||
} else
|
|
||||||
Reset();
|
|
||||||
|
|
||||||
Null = false;
|
|
||||||
} else {
|
|
||||||
rc = false;
|
|
||||||
Reset();
|
|
||||||
Null = Nullable;
|
|
||||||
} // endif p
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
} // end of SetValue_char
|
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
/* DECIMAL SetValue: fill string with another string. */
|
|
||||||
/***********************************************************************/
|
|
||||||
void DECVAL::SetValue_psz(PSZ s)
|
|
||||||
{
|
|
||||||
if (s) {
|
|
||||||
strncpy(Strp, s, Len);
|
|
||||||
Null = false;
|
|
||||||
} else {
|
|
||||||
Reset();
|
|
||||||
Null = Nullable;
|
|
||||||
} // endif s
|
|
||||||
|
|
||||||
} // end of SetValue_psz
|
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
/* DECIMAL SetValue: fill string with a string extracted from a block.*/
|
|
||||||
/***********************************************************************/
|
|
||||||
void DECVAL::SetValue_pvblk(PVBLK blk, int n)
|
|
||||||
{
|
|
||||||
// STRBLK's can return a NULL pointer
|
|
||||||
SetValue_psz(blk->GetCharValue(n));
|
|
||||||
} // end of SetValue_pvblk
|
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
/* DECIMAL SetBinValue: fill string with chars extracted from a line. */
|
|
||||||
/***********************************************************************/
|
|
||||||
void DECVAL::SetBinValue(void *p)
|
|
||||||
{
|
|
||||||
SetValue_char((char *)p, Len);
|
|
||||||
} // end of SetBinValue
|
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
/* DECIMAL GetCharString: get string representation of a char value. */
|
|
||||||
/***********************************************************************/
|
|
||||||
char *DECVAL::GetCharString(char *p)
|
|
||||||
{
|
|
||||||
return Strp;
|
|
||||||
} // end of GetCharString
|
|
||||||
#endif // 0
|
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* DECIMAL compare value with another Value. */
|
/* DECIMAL compare value with another Value. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -1940,32 +1844,6 @@ int DECVAL::CompareValue(PVAL vp)
|
|||||||
return (f > n) ? 1 : (f < n) ? (-1) : 0;
|
return (f > n) ? 1 : (f < n) ? (-1) : 0;
|
||||||
} // end of CompareValue
|
} // end of CompareValue
|
||||||
|
|
||||||
#if 0
|
|
||||||
/***********************************************************************/
|
|
||||||
/* FormatValue: This function set vp (a STRING value) to the string */
|
|
||||||
/* constructed from its own value formated using the fmt format. */
|
|
||||||
/* This function assumes that the format matches the value type. */
|
|
||||||
/***********************************************************************/
|
|
||||||
bool DECVAL::FormatValue(PVAL vp, char *fmt)
|
|
||||||
{
|
|
||||||
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
|
||||||
int n = sprintf(buf, fmt, Strp);
|
|
||||||
|
|
||||||
return (n > vp->GetValLen());
|
|
||||||
} // end of FormatValue
|
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
/* DECIMAL SetFormat function (used to set SELECT output format). */
|
|
||||||
/***********************************************************************/
|
|
||||||
bool DECVAL::SetConstFormat(PGLOBAL g, FORMAT& fmt)
|
|
||||||
{
|
|
||||||
fmt.Type[0] = 'C';
|
|
||||||
fmt.Length = Len;
|
|
||||||
fmt.Prec = 0;
|
|
||||||
return false;
|
|
||||||
} // end of SetConstFormat
|
|
||||||
#endif // 0
|
|
||||||
|
|
||||||
/* -------------------------- Class BINVAL --------------------------- */
|
/* -------------------------- Class BINVAL --------------------------- */
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -2123,7 +2001,7 @@ bool BINVAL::SetValue_pval(PVAL valp, bool chktype)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* BINVAL SetValue: fill value with chars extracted from a line. */
|
/* BINVAL SetValue: fill value with chars extracted from a line. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool BINVAL::SetValue_char(char *p, int n)
|
bool BINVAL::SetValue_char(const char *p, int n)
|
||||||
{
|
{
|
||||||
bool rc;
|
bool rc;
|
||||||
|
|
||||||
@@ -2144,7 +2022,7 @@ bool BINVAL::SetValue_char(char *p, int n)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* BINVAL SetValue: fill value with another string. */
|
/* BINVAL SetValue: fill value with another string. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void BINVAL::SetValue_psz(PSZ s)
|
void BINVAL::SetValue_psz(PCSZ s)
|
||||||
{
|
{
|
||||||
if (s) {
|
if (s) {
|
||||||
Len = MY_MIN(Clen, (signed)strlen(s));
|
Len = MY_MIN(Clen, (signed)strlen(s));
|
||||||
@@ -2370,7 +2248,7 @@ bool BINVAL::IsEqual(PVAL vp, bool chktype)
|
|||||||
/* constructed from its own value formated using the fmt format. */
|
/* constructed from its own value formated using the fmt format. */
|
||||||
/* This function assumes that the format matches the value type. */
|
/* This function assumes that the format matches the value type. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool BINVAL::FormatValue(PVAL vp, char *fmt)
|
bool BINVAL::FormatValue(PVAL vp, PCSZ fmt)
|
||||||
{
|
{
|
||||||
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
||||||
int n = sprintf(buf, fmt, Len, Binp);
|
int n = sprintf(buf, fmt, Len, Binp);
|
||||||
@@ -2394,7 +2272,7 @@ bool BINVAL::SetConstFormat(PGLOBAL, FORMAT& fmt)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* DTVAL public constructor for new void values. */
|
/* DTVAL public constructor for new void values. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
DTVAL::DTVAL(PGLOBAL g, int n, int prec, PSZ fmt)
|
DTVAL::DTVAL(PGLOBAL g, int n, int prec, PCSZ fmt)
|
||||||
: TYPVAL<int>((int)0, TYPE_DATE)
|
: TYPVAL<int>((int)0, TYPE_DATE)
|
||||||
{
|
{
|
||||||
if (!fmt) {
|
if (!fmt) {
|
||||||
@@ -2423,7 +2301,7 @@ DTVAL::DTVAL(int n) : TYPVAL<int>(n, TYPE_DATE)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* Set format so formatted dates can be converted on input/output. */
|
/* Set format so formatted dates can be converted on input/output. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool DTVAL::SetFormat(PGLOBAL g, PSZ fmt, int len, int year)
|
bool DTVAL::SetFormat(PGLOBAL g, PCSZ fmt, int len, int year)
|
||||||
{
|
{
|
||||||
Pdtp = MakeDateFormat(g, fmt, true, true, (year > 9999) ? 1 : 0);
|
Pdtp = MakeDateFormat(g, fmt, true, true, (year > 9999) ? 1 : 0);
|
||||||
Sdate = (char*)PlugSubAlloc(g, NULL, len + 1);
|
Sdate = (char*)PlugSubAlloc(g, NULL, len + 1);
|
||||||
@@ -2699,12 +2577,12 @@ bool DTVAL::SetValue_pval(PVAL valp, bool chktype)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* SetValue: convert chars extracted from a line to date value. */
|
/* SetValue: convert chars extracted from a line to date value. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool DTVAL::SetValue_char(char *p, int n)
|
bool DTVAL::SetValue_char(const char *p, int n)
|
||||||
{
|
{
|
||||||
bool rc= 0;
|
bool rc= 0;
|
||||||
|
|
||||||
if (Pdtp) {
|
if (Pdtp) {
|
||||||
char *p2;
|
const char *p2;
|
||||||
int ndv;
|
int ndv;
|
||||||
int dval[6];
|
int dval[6];
|
||||||
|
|
||||||
@@ -2738,7 +2616,7 @@ bool DTVAL::SetValue_char(char *p, int n)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* SetValue: convert a char string to date value. */
|
/* SetValue: convert a char string to date value. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
void DTVAL::SetValue_psz(PSZ p)
|
void DTVAL::SetValue_psz(PCSZ p)
|
||||||
{
|
{
|
||||||
if (Pdtp) {
|
if (Pdtp) {
|
||||||
int ndv;
|
int ndv;
|
||||||
@@ -2832,8 +2710,10 @@ char *DTVAL::ShowValue(char *buf, int len)
|
|||||||
strncat(p, "Error", m);
|
strncat(p, "Error", m);
|
||||||
} // endif n
|
} // endif n
|
||||||
|
|
||||||
} else
|
} else {
|
||||||
p = ""; // DEFAULT VALUE ???
|
p = buf;
|
||||||
|
*p = '\0'; // DEFAULT VALUE ???
|
||||||
|
} // endif Null
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
} else
|
} else
|
||||||
@@ -2898,7 +2778,7 @@ bool DTVAL::WeekNum(PGLOBAL g, int& nval)
|
|||||||
/* constructed from its own value formated using the fmt format. */
|
/* constructed from its own value formated using the fmt format. */
|
||||||
/* This function assumes that the format matches the value type. */
|
/* This function assumes that the format matches the value type. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool DTVAL::FormatValue(PVAL vp, char *fmt)
|
bool DTVAL::FormatValue(PVAL vp, PCSZ fmt)
|
||||||
{
|
{
|
||||||
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
char *buf = (char*)vp->GetTo_Val(); // Should be big enough
|
||||||
struct tm tm, *ptm = GetGmTime(&tm);
|
struct tm tm, *ptm = GetGmTime(&tm);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/**************** Value H Declares Source Code File (.H) ***************/
|
/**************** Value H Declares Source Code File (.H) ***************/
|
||||||
/* Name: VALUE.H Version 2.2 */
|
/* Name: VALUE.H Version 2.3 */
|
||||||
/* */
|
/* */
|
||||||
/* (C) Copyright to the author Olivier BERTRAND 2001-2016 */
|
/* (C) Copyright to the author Olivier BERTRAND 2001-2017 */
|
||||||
/* */
|
/* */
|
||||||
/* This file contains the VALUE and derived classes declares. */
|
/* This file contains the VALUE and derived classes declares. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -40,14 +40,14 @@ typedef struct _datpar *PDTP; // For DTVAL
|
|||||||
/* Utilities used to test types and to allocated values. */
|
/* Utilities used to test types and to allocated values. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
// Exported functions
|
// Exported functions
|
||||||
DllExport PSZ GetTypeName(int);
|
DllExport PCSZ GetTypeName(int);
|
||||||
DllExport int GetTypeSize(int, int);
|
DllExport int GetTypeSize(int, int);
|
||||||
#ifdef ODBC_SUPPORT
|
#ifdef ODBC_SUPPORT
|
||||||
/* This function is exported for use in OEM table type DLLs */
|
/* This function is exported for use in OEM table type DLLs */
|
||||||
DllExport int TranslateSQLType(int stp, int prec,
|
DllExport int TranslateSQLType(int stp, int prec,
|
||||||
int& len, char& v, bool& w);
|
int& len, char& v, bool& w);
|
||||||
#endif
|
#endif
|
||||||
DllExport char *GetFormatType(int);
|
DllExport const char *GetFormatType(int);
|
||||||
DllExport int GetFormatType(char);
|
DllExport int GetFormatType(char);
|
||||||
DllExport bool IsTypeChar(int type);
|
DllExport bool IsTypeChar(int type);
|
||||||
DllExport bool IsTypeNum(int type);
|
DllExport bool IsTypeNum(int type);
|
||||||
@@ -55,8 +55,8 @@ DllExport int ConvertType(int, int, CONV, bool match = false);
|
|||||||
DllExport PVAL AllocateValue(PGLOBAL, void *, short, short = 2);
|
DllExport PVAL AllocateValue(PGLOBAL, void *, short, short = 2);
|
||||||
DllExport PVAL AllocateValue(PGLOBAL, PVAL, int = TYPE_VOID, int = 0);
|
DllExport PVAL AllocateValue(PGLOBAL, PVAL, int = TYPE_VOID, int = 0);
|
||||||
DllExport PVAL AllocateValue(PGLOBAL, int, int len = 0, int prec = 0,
|
DllExport PVAL AllocateValue(PGLOBAL, int, int len = 0, int prec = 0,
|
||||||
bool uns = false, PSZ fmt = NULL);
|
bool uns = false, PCSZ fmt = NULL);
|
||||||
DllExport ulonglong CharToNumber(char *, int, ulonglong, bool,
|
DllExport ulonglong CharToNumber(PCSZ, int, ulonglong, bool,
|
||||||
bool *minus = NULL, bool *rc = NULL);
|
bool *minus = NULL, bool *rc = NULL);
|
||||||
DllExport BYTE OpBmp(PGLOBAL g, OPVAL opc);
|
DllExport BYTE OpBmp(PGLOBAL g, OPVAL opc);
|
||||||
|
|
||||||
@@ -100,8 +100,8 @@ class DllExport VALUE : public BLOCK {
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual bool SetValue_pval(PVAL valp, bool chktype = false) = 0;
|
virtual bool SetValue_pval(PVAL valp, bool chktype = false) = 0;
|
||||||
virtual bool SetValue_char(char *p, int n) = 0;
|
virtual bool SetValue_char(const char *p, int n) = 0;
|
||||||
virtual void SetValue_psz(PSZ s) = 0;
|
virtual void SetValue_psz(PCSZ s) = 0;
|
||||||
virtual void SetValue_bool(bool) {assert(FALSE);}
|
virtual void SetValue_bool(bool) {assert(FALSE);}
|
||||||
virtual int CompareValue(PVAL vp) = 0;
|
virtual int CompareValue(PVAL vp) = 0;
|
||||||
virtual BYTE TestValue(PVAL vp);
|
virtual BYTE TestValue(PVAL vp);
|
||||||
@@ -121,7 +121,7 @@ class DllExport VALUE : public BLOCK {
|
|||||||
virtual char *GetCharString(char *p) = 0;
|
virtual char *GetCharString(char *p) = 0;
|
||||||
virtual bool IsEqual(PVAL vp, bool chktype) = 0;
|
virtual bool IsEqual(PVAL vp, bool chktype) = 0;
|
||||||
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
|
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
|
||||||
virtual bool FormatValue(PVAL vp, char *fmt) = 0;
|
virtual bool FormatValue(PVAL vp, PCSZ fmt) = 0;
|
||||||
virtual void Print(PGLOBAL g, FILE *, uint);
|
virtual void Print(PGLOBAL g, FILE *, uint);
|
||||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||||
|
|
||||||
@@ -213,8 +213,8 @@ class DllExport TYPVAL : public VALUE {
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual bool SetValue_pval(PVAL valp, bool chktype);
|
virtual bool SetValue_pval(PVAL valp, bool chktype);
|
||||||
virtual bool SetValue_char(char *p, int n);
|
virtual bool SetValue_char(const char *p, int n);
|
||||||
virtual void SetValue_psz(PSZ s);
|
virtual void SetValue_psz(PCSZ s);
|
||||||
virtual void SetValue_bool(bool b) {Tval = (b) ? 1 : 0;}
|
virtual void SetValue_bool(bool b) {Tval = (b) ? 1 : 0;}
|
||||||
virtual int CompareValue(PVAL vp);
|
virtual int CompareValue(PVAL vp);
|
||||||
virtual void SetValue(char c) {Tval = (TYPE)c; Null = false;}
|
virtual void SetValue(char c) {Tval = (TYPE)c; Null = false;}
|
||||||
@@ -234,7 +234,7 @@ class DllExport TYPVAL : public VALUE {
|
|||||||
virtual bool IsEqual(PVAL vp, bool chktype);
|
virtual bool IsEqual(PVAL vp, bool chktype);
|
||||||
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
|
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
|
||||||
virtual bool SetConstFormat(PGLOBAL, FORMAT&);
|
virtual bool SetConstFormat(PGLOBAL, FORMAT&);
|
||||||
virtual bool FormatValue(PVAL vp, char *fmt);
|
virtual bool FormatValue(PVAL vp, PCSZ fmt);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static TYPE MinMaxVal(bool b);
|
static TYPE MinMaxVal(bool b);
|
||||||
@@ -287,8 +287,8 @@ class DllExport TYPVAL<PSZ>: public VALUE {
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual bool SetValue_pval(PVAL valp, bool chktype);
|
virtual bool SetValue_pval(PVAL valp, bool chktype);
|
||||||
virtual bool SetValue_char(char *p, int n);
|
virtual bool SetValue_char(const char *p, int n);
|
||||||
virtual void SetValue_psz(PSZ s);
|
virtual void SetValue_psz(PCSZ s);
|
||||||
virtual void SetValue_pvblk(PVBLK blk, int n);
|
virtual void SetValue_pvblk(PVBLK blk, int n);
|
||||||
virtual void SetValue(char c);
|
virtual void SetValue(char c);
|
||||||
virtual void SetValue(uchar c);
|
virtual void SetValue(uchar c);
|
||||||
@@ -306,7 +306,7 @@ class DllExport TYPVAL<PSZ>: public VALUE {
|
|||||||
virtual char *GetCharString(char *p);
|
virtual char *GetCharString(char *p);
|
||||||
virtual bool IsEqual(PVAL vp, bool chktype);
|
virtual bool IsEqual(PVAL vp, bool chktype);
|
||||||
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
|
virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op);
|
||||||
virtual bool FormatValue(PVAL vp, char *fmt);
|
virtual bool FormatValue(PVAL vp, PCSZ fmt);
|
||||||
virtual bool SetConstFormat(PGLOBAL, FORMAT&);
|
virtual bool SetConstFormat(PGLOBAL, FORMAT&);
|
||||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||||
|
|
||||||
@@ -372,8 +372,8 @@ class DllExport BINVAL: public VALUE {
|
|||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
virtual bool SetValue_pval(PVAL valp, bool chktype);
|
virtual bool SetValue_pval(PVAL valp, bool chktype);
|
||||||
virtual bool SetValue_char(char *p, int n);
|
virtual bool SetValue_char(const char *p, int n);
|
||||||
virtual void SetValue_psz(PSZ s);
|
virtual void SetValue_psz(PCSZ s);
|
||||||
virtual void SetValue_pvblk(PVBLK blk, int n);
|
virtual void SetValue_pvblk(PVBLK blk, int n);
|
||||||
virtual void SetValue(char c);
|
virtual void SetValue(char c);
|
||||||
virtual void SetValue(uchar c);
|
virtual void SetValue(uchar c);
|
||||||
@@ -390,7 +390,7 @@ class DllExport BINVAL: public VALUE {
|
|||||||
virtual char *ShowValue(char *buf, int);
|
virtual char *ShowValue(char *buf, int);
|
||||||
virtual char *GetCharString(char *p);
|
virtual char *GetCharString(char *p);
|
||||||
virtual bool IsEqual(PVAL vp, bool chktype);
|
virtual bool IsEqual(PVAL vp, bool chktype);
|
||||||
virtual bool FormatValue(PVAL vp, char *fmt);
|
virtual bool FormatValue(PVAL vp, PCSZ fmt);
|
||||||
virtual bool SetConstFormat(PGLOBAL, FORMAT&);
|
virtual bool SetConstFormat(PGLOBAL, FORMAT&);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -406,18 +406,18 @@ class DllExport BINVAL: public VALUE {
|
|||||||
class DllExport DTVAL : public TYPVAL<int> {
|
class DllExport DTVAL : public TYPVAL<int> {
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
DTVAL(PGLOBAL g, int n, int p, PSZ fmt);
|
DTVAL(PGLOBAL g, int n, int p, PCSZ fmt);
|
||||||
DTVAL(int n);
|
DTVAL(int n);
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
virtual bool SetValue_pval(PVAL valp, bool chktype);
|
virtual bool SetValue_pval(PVAL valp, bool chktype);
|
||||||
virtual bool SetValue_char(char *p, int n);
|
virtual bool SetValue_char(const char *p, int n);
|
||||||
virtual void SetValue_psz(PSZ s);
|
virtual void SetValue_psz(PCSZ s);
|
||||||
virtual void SetValue_pvblk(PVBLK blk, int n);
|
virtual void SetValue_pvblk(PVBLK blk, int n);
|
||||||
virtual char *GetCharString(char *p);
|
virtual char *GetCharString(char *p);
|
||||||
virtual char *ShowValue(char *buf, int);
|
virtual char *ShowValue(char *buf, int);
|
||||||
virtual bool FormatValue(PVAL vp, char *fmt);
|
virtual bool FormatValue(PVAL vp, PCSZ fmt);
|
||||||
bool SetFormat(PGLOBAL g, PSZ fmt, int len, int year = 0);
|
bool SetFormat(PGLOBAL g, PCSZ fmt, int len, int year = 0);
|
||||||
bool SetFormat(PGLOBAL g, PVAL valp);
|
bool SetFormat(PGLOBAL g, PVAL valp);
|
||||||
bool IsFormatted(void) {return Pdtp != NULL;}
|
bool IsFormatted(void) {return Pdtp != NULL;}
|
||||||
bool MakeTime(struct tm *ptm);
|
bool MakeTime(struct tm *ptm);
|
||||||
|
@@ -819,7 +819,7 @@ bool XINDEX::Reorder(PGLOBAL g __attribute__((unused)))
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool XINDEX::SaveIndex(PGLOBAL g, PIXDEF sxp)
|
bool XINDEX::SaveIndex(PGLOBAL g, PIXDEF sxp)
|
||||||
{
|
{
|
||||||
char *ftype;
|
PCSZ ftype;
|
||||||
char fn[_MAX_PATH];
|
char fn[_MAX_PATH];
|
||||||
int n[NZ], nof = (Mul) ? (Ndif + 1) : 0;
|
int n[NZ], nof = (Mul) ? (Ndif + 1) : 0;
|
||||||
int id = -1, size = 0;
|
int id = -1, size = 0;
|
||||||
@@ -948,7 +948,7 @@ bool XINDEX::Init(PGLOBAL g)
|
|||||||
/* Table will be accessed through an index table. */
|
/* Table will be accessed through an index table. */
|
||||||
/* If sorting is required, this will be done later. */
|
/* If sorting is required, this will be done later. */
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
char *ftype;
|
PCSZ ftype;
|
||||||
char fn[_MAX_PATH];
|
char fn[_MAX_PATH];
|
||||||
int k, n, nv[NZ], id = -1;
|
int k, n, nv[NZ], id = -1;
|
||||||
bool estim = false;
|
bool estim = false;
|
||||||
@@ -1412,7 +1412,7 @@ err:
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool XINDEX::GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk)
|
bool XINDEX::GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk)
|
||||||
{
|
{
|
||||||
char *ftype;
|
PCSZ ftype;
|
||||||
char fn[_MAX_PATH];
|
char fn[_MAX_PATH];
|
||||||
int nv[NZ], id = -1; // n
|
int nv[NZ], id = -1; // n
|
||||||
//bool estim = false;
|
//bool estim = false;
|
||||||
@@ -2320,7 +2320,7 @@ XFILE::XFILE(void) : XLOAD()
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode)
|
bool XFILE::Open(PGLOBAL g, char *filename, int id, MODE mode)
|
||||||
{
|
{
|
||||||
char *pmod;
|
PCSZ pmod;
|
||||||
bool rc;
|
bool rc;
|
||||||
IOFF noff[MAX_INDX];
|
IOFF noff[MAX_INDX];
|
||||||
|
|
||||||
|
@@ -192,7 +192,7 @@ void CONSTANT::Print(PGLOBAL g, char *ps, uint z)
|
|||||||
/* STRING public constructor for new char values. Alloc Size must be */
|
/* STRING public constructor for new char values. Alloc Size must be */
|
||||||
/* calculated because PlugSubAlloc rounds up size to multiple of 8. */
|
/* calculated because PlugSubAlloc rounds up size to multiple of 8. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
STRING::STRING(PGLOBAL g, uint n, PSZ str)
|
STRING::STRING(PGLOBAL g, uint n, PCSZ str)
|
||||||
{
|
{
|
||||||
G = g;
|
G = g;
|
||||||
Length = (str) ? strlen(str) : 0;
|
Length = (str) ? strlen(str) : 0;
|
||||||
|
@@ -123,7 +123,7 @@ class DllExport CONSTANT : public XOBJECT {
|
|||||||
class DllExport STRING : public BLOCK {
|
class DllExport STRING : public BLOCK {
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
STRING(PGLOBAL g, uint n, PSZ str = NULL);
|
STRING(PGLOBAL g, uint n, PCSZ str = NULL);
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
inline int GetLength(void) {return (int)Length;}
|
inline int GetLength(void) {return (int)Length;}
|
||||||
|
@@ -89,7 +89,7 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block.
|
|||||||
virtual bool IsSpecial(PSZ name);
|
virtual bool IsSpecial(PSZ name);
|
||||||
virtual bool IsReadOnly(void) {return Read_Only;}
|
virtual bool IsReadOnly(void) {return Read_Only;}
|
||||||
virtual bool IsView(void) {return FALSE;}
|
virtual bool IsView(void) {return FALSE;}
|
||||||
virtual PSZ GetPath(void);
|
virtual PCSZ GetPath(void);
|
||||||
virtual RECFM GetFtype(void) {return RECFM_NAF;}
|
virtual RECFM GetFtype(void) {return RECFM_NAF;}
|
||||||
virtual bool GetBlockValues(PGLOBAL) { return false; }
|
virtual bool GetBlockValues(PGLOBAL) { return false; }
|
||||||
virtual int Cardinality(PGLOBAL) {return 0;}
|
virtual int Cardinality(PGLOBAL) {return 0;}
|
||||||
@@ -111,7 +111,7 @@ class DllExport TDB: public BLOCK { // Table Descriptor Block.
|
|||||||
{fprintf(f, "%s AM(%d)\n", m, GetAmType());}
|
{fprintf(f, "%s AM(%d)\n", m, GetAmType());}
|
||||||
virtual void Print(PGLOBAL g, FILE *f, uint n);
|
virtual void Print(PGLOBAL g, FILE *f, uint n);
|
||||||
virtual void Print(PGLOBAL g, char *ps, uint z);
|
virtual void Print(PGLOBAL g, char *ps, uint z);
|
||||||
virtual PSZ GetServer(void) = 0;
|
virtual PCSZ GetServer(void) = 0;
|
||||||
virtual int GetBadLines(void) {return 0;}
|
virtual int GetBadLines(void) {return 0;}
|
||||||
virtual CHARSET_INFO *data_charset(void);
|
virtual CHARSET_INFO *data_charset(void);
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ class DllExport TDBASE : public TDB {
|
|||||||
virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);}
|
virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);}
|
||||||
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 PCSZ GetServer(void) {return "Current";}
|
||||||
|
|
||||||
// Database routines
|
// Database routines
|
||||||
virtual int MakeIndex(PGLOBAL g, PIXDEF, bool)
|
virtual int MakeIndex(PGLOBAL g, PIXDEF, bool)
|
||||||
|
Reference in New Issue
Block a user