diff options
author | Alexander Barkov <bar@mariadb.org> | 2013-07-08 11:05:59 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2013-07-08 11:05:59 +0400 |
commit | e46f8f3d0aa59e71c40e0f2bd7d67414b2b8628b (patch) | |
tree | 5fdc6f58c27f879f5d9a0aa2423b6a46f5c3818d /storage/connect/libdoc.h | |
parent | f9ba8073548a26d03cfd28b723425574c884b1b1 (diff) | |
download | mariadb-git-e46f8f3d0aa59e71c40e0f2bd7d67414b2b8628b.tar.gz |
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
Diffstat (limited to 'storage/connect/libdoc.h')
-rw-r--r-- | storage/connect/libdoc.h | 152 |
1 files changed, 6 insertions, 146 deletions
diff --git a/storage/connect/libdoc.h b/storage/connect/libdoc.h index 7971f4d1395..a0cead4e904 100644 --- a/storage/connect/libdoc.h +++ b/storage/connect/libdoc.h @@ -1,146 +1,6 @@ -/******************************************************************/ -/* 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 +#ifndef LIBDOC_H_INCLUDED +#define LIBDOC_H_INCLUDED +void XmlInitParserLib(void); +void XmlCleanupParserLib(void); +void CloseXML2File(PGLOBAL, PFBLOCK, bool); +#endif |