mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixing warnings:
- no previous declaration for ‘void XmlCleanupParserLib()’ - no previous declaration for ‘void CloseXML2File’ - no previous declaration for ‘void XmlInitParserLib()’ modified: storage/connect/ha_connect.cc storage/connect/libdoc.cpp storage/connect/libdoc.h storage/connect/plgdbutl.cpp
This commit is contained in:
@@ -146,8 +146,7 @@
|
|||||||
#define my_stricmp(a,b) my_strcasecmp(default_charset_info, (a), (b))
|
#define my_stricmp(a,b) my_strcasecmp(default_charset_info, (a), (b))
|
||||||
|
|
||||||
#ifdef LIBXML2_SUPPORT
|
#ifdef LIBXML2_SUPPORT
|
||||||
void XmlInitParserLib(void);
|
#include "libdoc.h"
|
||||||
void XmlCleanupParserLib(void);
|
|
||||||
#endif // LIBXML2_SUPPORT
|
#endif // LIBXML2_SUPPORT
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
@@ -25,6 +25,155 @@
|
|||||||
|
|
||||||
#include "sql_string.h"
|
#include "sql_string.h"
|
||||||
|
|
||||||
|
/******************************************************************/
|
||||||
|
/* Declaration of XML document processing using libxml2 */
|
||||||
|
/* Author: Olivier Bertrand 2007-2012 */
|
||||||
|
/******************************************************************/
|
||||||
|
#include "plgxml.h"
|
||||||
|
|
||||||
|
typedef class LIBXMLDOC *PXDOC2;
|
||||||
|
typedef class XML2NODE *PNODE2;
|
||||||
|
typedef class XML2ATTR *PATTR2;
|
||||||
|
typedef class XML2NODELIST *PLIST2;
|
||||||
|
|
||||||
|
/******************************************************************/
|
||||||
|
/* XML2 block. Must have the same layout than FBLOCK up to Type. */
|
||||||
|
/******************************************************************/
|
||||||
|
typedef struct _x2block { /* Loaded XML file block */
|
||||||
|
struct _x2block *Next;
|
||||||
|
LPCSTR Fname; /* Point on file name */
|
||||||
|
size_t Length; /* Used to tell if read mode */
|
||||||
|
short Count; /* Nb of times file is used */
|
||||||
|
short Type; /* TYPE_FB_XML */
|
||||||
|
int Retcode; /* Return code from Load */
|
||||||
|
xmlDocPtr Docp; /* Document interface pointer */
|
||||||
|
// xmlXPathContextPtr Ctxp;
|
||||||
|
// xmlXPathObjectPtr Xop;
|
||||||
|
} X2BLOCK, *PX2BLOCK;
|
||||||
|
|
||||||
|
/******************************************************************/
|
||||||
|
/* Declaration of libxml2 document. */
|
||||||
|
/******************************************************************/
|
||||||
|
class LIBXMLDOC : public XMLDOCUMENT {
|
||||||
|
friend class XML2NODE;
|
||||||
|
friend class XML2ATTR;
|
||||||
|
public:
|
||||||
|
// Constructor
|
||||||
|
LIBXMLDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp);
|
||||||
|
|
||||||
|
// Properties
|
||||||
|
virtual short GetDocType(void) {return TYPE_FB_XML2;}
|
||||||
|
virtual void *GetDocPtr(void) {return Docp;}
|
||||||
|
virtual void SetNofree(bool b) {Nofreelist = b;}
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
virtual bool Initialize(PGLOBAL g);
|
||||||
|
virtual bool ParseFile(char *fn);
|
||||||
|
virtual bool NewDoc(PGLOBAL g, char *ver);
|
||||||
|
virtual void AddComment(PGLOBAL g, char *com);
|
||||||
|
virtual PXNODE GetRoot(PGLOBAL g);
|
||||||
|
virtual PXNODE NewRoot(PGLOBAL g, char *name);
|
||||||
|
virtual PXNODE NewPnode(PGLOBAL g, char *name);
|
||||||
|
virtual PXATTR NewPattr(PGLOBAL g);
|
||||||
|
virtual PXLIST NewPlist(PGLOBAL g);
|
||||||
|
virtual int DumpDoc(PGLOBAL g, char *ofn);
|
||||||
|
virtual void CloseDoc(PGLOBAL g, PFBLOCK xp);
|
||||||
|
virtual PFBLOCK LinkXblock(PGLOBAL g, MODE m, int rc, char *fn);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// bool CheckDocument(FILE *of, xmlNodePtr np);
|
||||||
|
xmlNodeSetPtr GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp);
|
||||||
|
int Decode(xmlChar *cnt, char *buf, int n);
|
||||||
|
xmlChar *Encode(PGLOBAL g, char *txt);
|
||||||
|
|
||||||
|
// Members
|
||||||
|
xmlDocPtr Docp;
|
||||||
|
xmlNodeSetPtr Nlist;
|
||||||
|
xmlXPathContextPtr Ctxp;
|
||||||
|
xmlXPathObjectPtr Xop;
|
||||||
|
char *Buf; // Temporary
|
||||||
|
bool Nofreelist;
|
||||||
|
}; // end of class LIBXMLDOC
|
||||||
|
|
||||||
|
/******************************************************************/
|
||||||
|
/* Declaration of libxml2 node. */
|
||||||
|
/******************************************************************/
|
||||||
|
class XML2NODE : public XMLNODE {
|
||||||
|
friend class LIBXMLDOC;
|
||||||
|
friend class XML2NODELIST;
|
||||||
|
public:
|
||||||
|
// Properties
|
||||||
|
virtual char *GetName(PGLOBAL g) {return (char*)Nodep->name;}
|
||||||
|
virtual int GetType(void);
|
||||||
|
virtual PXNODE GetNext(PGLOBAL g);
|
||||||
|
virtual PXNODE GetChild(PGLOBAL g);
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
virtual RCODE GetContent(PGLOBAL g, char *buf, int len);
|
||||||
|
virtual bool SetContent(PGLOBAL g, char *txtp, int len);
|
||||||
|
virtual PXNODE Clone(PGLOBAL g, PXNODE np);
|
||||||
|
virtual PXLIST GetChildElements(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 PXATTR GetAttribute(PGLOBAL g, char *name, PXATTR ap);
|
||||||
|
virtual PXNODE AddChildNode(PGLOBAL g, char *name, PXNODE np);
|
||||||
|
virtual PXATTR AddProperty(PGLOBAL g, char *name, PXATTR ap);
|
||||||
|
virtual void AddText(PGLOBAL g, char *txtp);
|
||||||
|
virtual void DeleteChild(PGLOBAL g, PXNODE dnp);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Constructor
|
||||||
|
XML2NODE(PXDOC dp, xmlNodePtr np);
|
||||||
|
|
||||||
|
// Members
|
||||||
|
xmlDocPtr Docp;
|
||||||
|
xmlChar *Content;
|
||||||
|
xmlNodePtr Nodep;
|
||||||
|
}; // end of class XML2NODE
|
||||||
|
|
||||||
|
/******************************************************************/
|
||||||
|
/* Declaration of libxml2 node list. */
|
||||||
|
/******************************************************************/
|
||||||
|
class XML2NODELIST : public XMLNODELIST {
|
||||||
|
friend class LIBXMLDOC;
|
||||||
|
friend class XML2NODE;
|
||||||
|
public:
|
||||||
|
// Methods
|
||||||
|
virtual int GetLength(void);
|
||||||
|
virtual PXNODE GetItem(PGLOBAL g, int n, PXNODE np);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Constructor
|
||||||
|
XML2NODELIST(PXDOC dp, xmlNodeSetPtr lp);
|
||||||
|
|
||||||
|
// Members
|
||||||
|
xmlNodeSetPtr Listp;
|
||||||
|
}; // end of class XML2NODELIST
|
||||||
|
|
||||||
|
/******************************************************************/
|
||||||
|
/* Declaration of libxml2 attribute. */
|
||||||
|
/******************************************************************/
|
||||||
|
class XML2ATTR : public XMLATTRIBUTE {
|
||||||
|
friend class LIBXMLDOC;
|
||||||
|
friend class XML2NODE;
|
||||||
|
public:
|
||||||
|
// Properties
|
||||||
|
//virtual char *GetText(void);
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
virtual bool SetText(PGLOBAL g, char *txtp, int len);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Constructor
|
||||||
|
XML2ATTR(PXDOC dp, xmlAttrPtr ap, xmlNodePtr np);
|
||||||
|
|
||||||
|
// Members
|
||||||
|
xmlAttrPtr Atrp;
|
||||||
|
xmlNodePtr Parent;
|
||||||
|
}; // end of class XML2ATTR
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
extern char version[];
|
extern char version[];
|
||||||
extern int trace;
|
extern int trace;
|
||||||
|
@@ -1,146 +1,6 @@
|
|||||||
/******************************************************************/
|
#ifndef LIBDOC_H_INCLUDED
|
||||||
/* Declaration of XML document processing using libxml2 */
|
#define LIBDOC_H_INCLUDED
|
||||||
/* Author: Olivier Bertrand 2007-2012 */
|
void XmlInitParserLib(void);
|
||||||
/******************************************************************/
|
void XmlCleanupParserLib(void);
|
||||||
#include "plgxml.h"
|
void CloseXML2File(PGLOBAL, PFBLOCK, bool);
|
||||||
|
#endif
|
||||||
typedef class LIBXMLDOC *PXDOC2;
|
|
||||||
typedef class XML2NODE *PNODE2;
|
|
||||||
typedef class XML2ATTR *PATTR2;
|
|
||||||
typedef class XML2NODELIST *PLIST2;
|
|
||||||
|
|
||||||
/******************************************************************/
|
|
||||||
/* XML2 block. Must have the same layout than FBLOCK up to Type. */
|
|
||||||
/******************************************************************/
|
|
||||||
typedef struct _x2block { /* Loaded XML file block */
|
|
||||||
struct _x2block *Next;
|
|
||||||
LPCSTR Fname; /* Point on file name */
|
|
||||||
size_t Length; /* Used to tell if read mode */
|
|
||||||
short Count; /* Nb of times file is used */
|
|
||||||
short Type; /* TYPE_FB_XML */
|
|
||||||
int Retcode; /* Return code from Load */
|
|
||||||
xmlDocPtr Docp; /* Document interface pointer */
|
|
||||||
// xmlXPathContextPtr Ctxp;
|
|
||||||
// xmlXPathObjectPtr Xop;
|
|
||||||
} X2BLOCK, *PX2BLOCK;
|
|
||||||
|
|
||||||
/******************************************************************/
|
|
||||||
/* Declaration of libxml2 document. */
|
|
||||||
/******************************************************************/
|
|
||||||
class LIBXMLDOC : public XMLDOCUMENT {
|
|
||||||
friend class XML2NODE;
|
|
||||||
friend class XML2ATTR;
|
|
||||||
public:
|
|
||||||
// Constructor
|
|
||||||
LIBXMLDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp);
|
|
||||||
|
|
||||||
// Properties
|
|
||||||
virtual short GetDocType(void) {return TYPE_FB_XML2;}
|
|
||||||
virtual void *GetDocPtr(void) {return Docp;}
|
|
||||||
virtual void SetNofree(bool b) {Nofreelist = b;}
|
|
||||||
|
|
||||||
// Methods
|
|
||||||
virtual bool Initialize(PGLOBAL g);
|
|
||||||
virtual bool ParseFile(char *fn);
|
|
||||||
virtual bool NewDoc(PGLOBAL g, char *ver);
|
|
||||||
virtual void AddComment(PGLOBAL g, char *com);
|
|
||||||
virtual PXNODE GetRoot(PGLOBAL g);
|
|
||||||
virtual PXNODE NewRoot(PGLOBAL g, char *name);
|
|
||||||
virtual PXNODE NewPnode(PGLOBAL g, char *name);
|
|
||||||
virtual PXATTR NewPattr(PGLOBAL g);
|
|
||||||
virtual PXLIST NewPlist(PGLOBAL g);
|
|
||||||
virtual int DumpDoc(PGLOBAL g, char *ofn);
|
|
||||||
virtual void CloseDoc(PGLOBAL g, PFBLOCK xp);
|
|
||||||
virtual PFBLOCK LinkXblock(PGLOBAL g, MODE m, int rc, char *fn);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// bool CheckDocument(FILE *of, xmlNodePtr np);
|
|
||||||
xmlNodeSetPtr GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp);
|
|
||||||
int Decode(xmlChar *cnt, char *buf, int n);
|
|
||||||
xmlChar *Encode(PGLOBAL g, char *txt);
|
|
||||||
|
|
||||||
// Members
|
|
||||||
xmlDocPtr Docp;
|
|
||||||
xmlNodeSetPtr Nlist;
|
|
||||||
xmlXPathContextPtr Ctxp;
|
|
||||||
xmlXPathObjectPtr Xop;
|
|
||||||
char *Buf; // Temporary
|
|
||||||
bool Nofreelist;
|
|
||||||
}; // end of class LIBXMLDOC
|
|
||||||
|
|
||||||
/******************************************************************/
|
|
||||||
/* Declaration of libxml2 node. */
|
|
||||||
/******************************************************************/
|
|
||||||
class XML2NODE : public XMLNODE {
|
|
||||||
friend class LIBXMLDOC;
|
|
||||||
friend class XML2NODELIST;
|
|
||||||
public:
|
|
||||||
// Properties
|
|
||||||
virtual char *GetName(PGLOBAL g) {return (char*)Nodep->name;}
|
|
||||||
virtual int GetType(void);
|
|
||||||
virtual PXNODE GetNext(PGLOBAL g);
|
|
||||||
virtual PXNODE GetChild(PGLOBAL g);
|
|
||||||
|
|
||||||
// Methods
|
|
||||||
virtual RCODE GetContent(PGLOBAL g, char *buf, int len);
|
|
||||||
virtual bool SetContent(PGLOBAL g, char *txtp, int len);
|
|
||||||
virtual PXNODE Clone(PGLOBAL g, PXNODE np);
|
|
||||||
virtual PXLIST GetChildElements(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 PXATTR GetAttribute(PGLOBAL g, char *name, PXATTR ap);
|
|
||||||
virtual PXNODE AddChildNode(PGLOBAL g, char *name, PXNODE np);
|
|
||||||
virtual PXATTR AddProperty(PGLOBAL g, char *name, PXATTR ap);
|
|
||||||
virtual void AddText(PGLOBAL g, char *txtp);
|
|
||||||
virtual void DeleteChild(PGLOBAL g, PXNODE dnp);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Constructor
|
|
||||||
XML2NODE(PXDOC dp, xmlNodePtr np);
|
|
||||||
|
|
||||||
// Members
|
|
||||||
xmlDocPtr Docp;
|
|
||||||
xmlChar *Content;
|
|
||||||
xmlNodePtr Nodep;
|
|
||||||
}; // end of class XML2NODE
|
|
||||||
|
|
||||||
/******************************************************************/
|
|
||||||
/* Declaration of libxml2 node list. */
|
|
||||||
/******************************************************************/
|
|
||||||
class XML2NODELIST : public XMLNODELIST {
|
|
||||||
friend class LIBXMLDOC;
|
|
||||||
friend class XML2NODE;
|
|
||||||
public:
|
|
||||||
// Methods
|
|
||||||
virtual int GetLength(void);
|
|
||||||
virtual PXNODE GetItem(PGLOBAL g, int n, PXNODE np);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Constructor
|
|
||||||
XML2NODELIST(PXDOC dp, xmlNodeSetPtr lp);
|
|
||||||
|
|
||||||
// Members
|
|
||||||
xmlNodeSetPtr Listp;
|
|
||||||
}; // end of class XML2NODELIST
|
|
||||||
|
|
||||||
/******************************************************************/
|
|
||||||
/* Declaration of libxml2 attribute. */
|
|
||||||
/******************************************************************/
|
|
||||||
class XML2ATTR : public XMLATTRIBUTE {
|
|
||||||
friend class LIBXMLDOC;
|
|
||||||
friend class XML2NODE;
|
|
||||||
public:
|
|
||||||
// Properties
|
|
||||||
//virtual char *GetText(void);
|
|
||||||
|
|
||||||
// Methods
|
|
||||||
virtual bool SetText(PGLOBAL g, char *txtp, int len);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Constructor
|
|
||||||
XML2ATTR(PXDOC dp, xmlAttrPtr ap, xmlNodePtr np);
|
|
||||||
|
|
||||||
// Members
|
|
||||||
xmlAttrPtr Atrp;
|
|
||||||
xmlNodePtr Parent;
|
|
||||||
}; // end of class XML2ATTR
|
|
||||||
|
@@ -127,7 +127,7 @@ void CloseXMLFile(PGLOBAL, PFBLOCK, bool);
|
|||||||
#endif // DOMDOC_SUPPORT
|
#endif // DOMDOC_SUPPORT
|
||||||
|
|
||||||
#ifdef LIBXML2_SUPPORT
|
#ifdef LIBXML2_SUPPORT
|
||||||
void CloseXML2File(PGLOBAL, PFBLOCK, bool);
|
#include "libdoc.h"
|
||||||
#endif // LIBXML2_SUPPORT
|
#endif // LIBXML2_SUPPORT
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user