Commit 79c1df4c authored by Olivier Bertrand's avatar Olivier Bertrand

- Change the connect_xtrace variable to from int to set

  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/libdoc.cpp
parent dd07e30c
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
#define JSONMAX 10 // JSON Default max grp size #define JSONMAX 10 // JSON Default max grp size
extern "C" { extern "C" {
char version[]= "Version 1.06.0006 January 30, 2018"; char version[]= "Version 1.06.0006 January 31, 2018";
#if defined(__WIN__) #if defined(__WIN__)
char compver[]= "Version 1.06.0006 " __DATE__ " " __TIME__; char compver[]= "Version 1.06.0006 " __DATE__ " " __TIME__;
char slash= '\\'; char slash= '\\';
......
...@@ -194,7 +194,7 @@ void xtrc(char const *fmt, ...) ...@@ -194,7 +194,7 @@ void xtrc(char const *fmt, ...)
{ {
va_list ap; va_list ap;
va_start (ap, fmt); va_start (ap, fmt);
;
//vfprintf(stderr, fmt, ap); //vfprintf(stderr, fmt, ap);
vsprintf(s, fmt, ap); vsprintf(s, fmt, ap);
if (s[strlen(s)-1] == '\n') if (s[strlen(s)-1] == '\n')
...@@ -210,7 +210,7 @@ static xmlStrdupFunc Strdup; ...@@ -210,7 +210,7 @@ static xmlStrdupFunc Strdup;
void xmlMyFree(void *mem) void xmlMyFree(void *mem)
{ {
if (trace) { if (trace(1)) {
htrc("%.4d Freeing at %p %s\n", ++m, mem, s); htrc("%.4d Freeing at %p %s\n", ++m, mem, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
...@@ -220,7 +220,7 @@ void xmlMyFree(void *mem) ...@@ -220,7 +220,7 @@ void xmlMyFree(void *mem)
void *xmlMyMalloc(size_t size) void *xmlMyMalloc(size_t size)
{ {
void *p = Malloc(size); void *p = Malloc(size);
if (trace) { if (trace(1)) {
htrc("%.4d Allocating %.5d at %p %s\n", ++m, size, p, s); htrc("%.4d Allocating %.5d at %p %s\n", ++m, size, p, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
...@@ -230,7 +230,7 @@ void *xmlMyMalloc(size_t size) ...@@ -230,7 +230,7 @@ void *xmlMyMalloc(size_t size)
void *xmlMyMallocAtomic(size_t size) void *xmlMyMallocAtomic(size_t size)
{ {
void *p = MallocA(size); void *p = MallocA(size);
if (trace) { if (trace(1)) {
htrc("%.4d Atom alloc %.5d at %p %s\n", ++m, size, p, s); htrc("%.4d Atom alloc %.5d at %p %s\n", ++m, size, p, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
...@@ -240,7 +240,7 @@ void *xmlMyMallocAtomic(size_t size) ...@@ -240,7 +240,7 @@ void *xmlMyMallocAtomic(size_t size)
void *xmlMyRealloc(void *mem, size_t size) void *xmlMyRealloc(void *mem, size_t size)
{ {
void *p = Realloc(mem, size); void *p = Realloc(mem, size);
if (trace) { if (trace(1)) {
htrc("%.4d ReAlloc %.5d to %p from %p %s\n", ++m, size, p, mem, s); htrc("%.4d ReAlloc %.5d to %p from %p %s\n", ++m, size, p, mem, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
...@@ -250,7 +250,7 @@ void *xmlMyRealloc(void *mem, size_t size) ...@@ -250,7 +250,7 @@ void *xmlMyRealloc(void *mem, size_t size)
char *xmlMyStrdup(const char *str) char *xmlMyStrdup(const char *str)
{ {
char *p = Strdup(str); char *p = Strdup(str);
if (trace) { if (trace(1)) {
htrc("%.4d Duplicating to %p from %p %s %s\n", ++m, p, str, str, s); htrc("%.4d Duplicating to %p from %p %s %s\n", ++m, p, str, str, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
...@@ -339,7 +339,7 @@ void CloseXML2File(PGLOBAL g, PFBLOCK fp, bool all) ...@@ -339,7 +339,7 @@ void CloseXML2File(PGLOBAL g, PFBLOCK fp, bool all)
{ {
PX2BLOCK xp = (PX2BLOCK)fp; PX2BLOCK xp = (PX2BLOCK)fp;
if (trace) if (trace(1))
htrc("CloseXML2File: xp=%p count=%d\n", xp, (xp) ? xp->Count : 0); htrc("CloseXML2File: xp=%p count=%d\n", xp, (xp) ? xp->Count : 0);
if (xp && xp->Count > 1 && !all) { if (xp && xp->Count > 1 && !all) {
...@@ -387,7 +387,7 @@ bool LIBXMLDOC::Initialize(PGLOBAL g, PCSZ entry, bool zipped) ...@@ -387,7 +387,7 @@ bool LIBXMLDOC::Initialize(PGLOBAL g, PCSZ entry, bool zipped)
/******************************************************************/ /******************************************************************/
bool LIBXMLDOC::ParseFile(PGLOBAL g, char *fn) bool LIBXMLDOC::ParseFile(PGLOBAL g, char *fn)
{ {
if (trace) if (trace(1))
htrc("ParseFile\n"); htrc("ParseFile\n");
if (zip) { if (zip) {
...@@ -436,7 +436,7 @@ PFBLOCK LIBXMLDOC::LinkXblock(PGLOBAL g, MODE m, int rc, char *fn) ...@@ -436,7 +436,7 @@ PFBLOCK LIBXMLDOC::LinkXblock(PGLOBAL g, MODE m, int rc, char *fn)
/******************************************************************/ /******************************************************************/
bool LIBXMLDOC::NewDoc(PGLOBAL g, PCSZ ver) bool LIBXMLDOC::NewDoc(PGLOBAL g, PCSZ ver)
{ {
if (trace) if (trace(1))
htrc("NewDoc\n"); htrc("NewDoc\n");
return ((Docp = xmlNewDoc(BAD_CAST ver)) == NULL); return ((Docp = xmlNewDoc(BAD_CAST ver)) == NULL);
...@@ -447,7 +447,7 @@ bool LIBXMLDOC::NewDoc(PGLOBAL g, PCSZ ver) ...@@ -447,7 +447,7 @@ bool LIBXMLDOC::NewDoc(PGLOBAL g, PCSZ ver)
/******************************************************************/ /******************************************************************/
void LIBXMLDOC::AddComment(PGLOBAL g, char *txtp) void LIBXMLDOC::AddComment(PGLOBAL g, char *txtp)
{ {
if (trace) if (trace(1))
htrc("AddComment: %s\n", txtp); htrc("AddComment: %s\n", txtp);
xmlNodePtr cp = xmlNewDocComment(Docp, BAD_CAST txtp); xmlNodePtr cp = xmlNewDocComment(Docp, BAD_CAST txtp);
...@@ -459,7 +459,7 @@ void LIBXMLDOC::AddComment(PGLOBAL g, char *txtp) ...@@ -459,7 +459,7 @@ void LIBXMLDOC::AddComment(PGLOBAL g, char *txtp)
/******************************************************************/ /******************************************************************/
PXNODE LIBXMLDOC::GetRoot(PGLOBAL g) PXNODE LIBXMLDOC::GetRoot(PGLOBAL g)
{ {
if (trace) if (trace(1))
htrc("GetRoot\n"); htrc("GetRoot\n");
xmlNodePtr root = xmlDocGetRootElement(Docp); xmlNodePtr root = xmlDocGetRootElement(Docp);
...@@ -475,7 +475,7 @@ PXNODE LIBXMLDOC::GetRoot(PGLOBAL g) ...@@ -475,7 +475,7 @@ PXNODE LIBXMLDOC::GetRoot(PGLOBAL g)
/******************************************************************/ /******************************************************************/
PXNODE LIBXMLDOC::NewRoot(PGLOBAL g, char *name) PXNODE LIBXMLDOC::NewRoot(PGLOBAL g, char *name)
{ {
if (trace) if (trace(1))
htrc("NewRoot: %s\n", name); htrc("NewRoot: %s\n", name);
xmlNodePtr root = xmlNewDocNode(Docp, NULL, BAD_CAST name, NULL); xmlNodePtr root = xmlNewDocNode(Docp, NULL, BAD_CAST name, NULL);
...@@ -493,7 +493,7 @@ PXNODE LIBXMLDOC::NewRoot(PGLOBAL g, char *name) ...@@ -493,7 +493,7 @@ PXNODE LIBXMLDOC::NewRoot(PGLOBAL g, char *name)
/******************************************************************/ /******************************************************************/
PXNODE LIBXMLDOC::NewPnode(PGLOBAL g, char *name) PXNODE LIBXMLDOC::NewPnode(PGLOBAL g, char *name)
{ {
if (trace) if (trace(1))
htrc("NewNode: %s\n", name); htrc("NewNode: %s\n", name);
xmlNodePtr nop; xmlNodePtr nop;
...@@ -534,7 +534,7 @@ int LIBXMLDOC::DumpDoc(PGLOBAL g, char *ofn) ...@@ -534,7 +534,7 @@ int LIBXMLDOC::DumpDoc(PGLOBAL g, char *ofn)
int rc = 0; int rc = 0;
FILE *of; FILE *of;
if (trace) if (trace(1))
htrc("DumpDoc: %s\n", ofn); htrc("DumpDoc: %s\n", ofn);
if (!(of= global_fopen(g, MSGID_CANNOT_OPEN, ofn, "w"))) if (!(of= global_fopen(g, MSGID_CANNOT_OPEN, ofn, "w")))
...@@ -576,7 +576,7 @@ int LIBXMLDOC::DumpDoc(PGLOBAL g, char *ofn) ...@@ -576,7 +576,7 @@ int LIBXMLDOC::DumpDoc(PGLOBAL g, char *ofn)
/******************************************************************/ /******************************************************************/
void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp) void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp)
{ {
if (trace) if (trace(1))
htrc("CloseDoc: xp=%p count=%d\n", xp, (xp) ? xp->Count : 0); htrc("CloseDoc: xp=%p count=%d\n", xp, (xp) ? xp->Count : 0);
//if (xp && xp->Count == 1) { //if (xp && xp->Count == 1) {
...@@ -630,24 +630,24 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp) ...@@ -630,24 +630,24 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
{ {
xmlNodeSetPtr nl; xmlNodeSetPtr nl;
if (trace) if (trace(1))
htrc("GetNodeList: %s np=%p\n", xp, np); htrc("GetNodeList: %s np=%p\n", xp, np);
if (!Ctxp) { if (!Ctxp) {
// Init Xpath // Init Xpath
if (trace) if (trace(1))
htrc("Calling xmlPathInit\n"); htrc("Calling xmlPathInit\n");
xmlXPathInit(); xmlXPathInit();
if (trace) if (trace(1))
htrc("Calling xmlXPathNewContext Docp=%p\n", Docp); htrc("Calling xmlXPathNewContext Docp=%p\n", Docp);
// Create xpath evaluation context // Create xpath evaluation context
if (!(Ctxp = xmlXPathNewContext(Docp))) { if (!(Ctxp = xmlXPathNewContext(Docp))) {
strcpy(g->Message, MSG(XPATH_CNTX_ERR)); strcpy(g->Message, MSG(XPATH_CNTX_ERR));
if (trace) if (trace(1))
htrc("Context error: %s\n", g->Message); htrc("Context error: %s\n", g->Message);
return NULL; return NULL;
...@@ -655,7 +655,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp) ...@@ -655,7 +655,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
// Register namespaces from list (if any) // Register namespaces from list (if any)
for (PNS nsp = Namespaces; nsp; nsp = nsp->Next) { for (PNS nsp = Namespaces; nsp; nsp = nsp->Next) {
if (trace) if (trace(1))
htrc("Calling xmlXPathRegisterNs Prefix=%s Uri=%s\n", htrc("Calling xmlXPathRegisterNs Prefix=%s Uri=%s\n",
nsp->Prefix, nsp->Uri); nsp->Prefix, nsp->Uri);
...@@ -663,7 +663,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp) ...@@ -663,7 +663,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
BAD_CAST nsp->Uri)) { BAD_CAST nsp->Uri)) {
sprintf(g->Message, MSG(REGISTER_ERR), nsp->Prefix, nsp->Uri); sprintf(g->Message, MSG(REGISTER_ERR), nsp->Prefix, nsp->Uri);
if (trace) if (trace(1))
htrc("Ns error: %s\n", g->Message); htrc("Ns error: %s\n", g->Message);
return NULL; return NULL;
...@@ -674,7 +674,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp) ...@@ -674,7 +674,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
} // endif Ctxp } // endif Ctxp
if (Xop) { if (Xop) {
if (trace) if (trace(1))
htrc("Calling xmlXPathFreeNodeSetList Xop=%p NOFREE=%d\n", htrc("Calling xmlXPathFreeNodeSetList Xop=%p NOFREE=%d\n",
Xop, Nofreelist); Xop, Nofreelist);
...@@ -698,21 +698,21 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp) ...@@ -698,21 +698,21 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
// Set the context to the calling node // Set the context to the calling node
Ctxp->node = np; Ctxp->node = np;
if (trace) if (trace(1))
htrc("Calling xmlXPathEval %s Ctxp=%p\n", xp, Ctxp); htrc("Calling xmlXPathEval %s Ctxp=%p\n", xp, Ctxp);
// Evaluate table xpath // Evaluate table xpath
if (!(Xop = xmlXPathEval(BAD_CAST xp, Ctxp))) { if (!(Xop = xmlXPathEval(BAD_CAST xp, Ctxp))) {
sprintf(g->Message, MSG(XPATH_EVAL_ERR), xp); sprintf(g->Message, MSG(XPATH_EVAL_ERR), xp);
if (trace) if (trace(1))
htrc("Path error: %s\n", g->Message); htrc("Path error: %s\n", g->Message);
return NULL; return NULL;
} else } else
nl = Xop->nodesetval; nl = Xop->nodesetval;
if (trace) if (trace(1))
htrc("GetNodeList nl=%p n=%p\n", nl, (nl) ? nl->nodeNr : 0); htrc("GetNodeList nl=%p n=%p\n", nl, (nl) ? nl->nodeNr : 0);
return nl; return nl;
...@@ -811,7 +811,7 @@ XML2NODE::XML2NODE(PXDOC dp, xmlNodePtr np) : XMLNODE(dp) ...@@ -811,7 +811,7 @@ XML2NODE::XML2NODE(PXDOC dp, xmlNodePtr np) : XMLNODE(dp)
int XML2NODE::GetType(void) int XML2NODE::GetType(void)
{ {
if (trace) if (trace(1))
htrc("GetType type=%d\n", Nodep->type); htrc("GetType type=%d\n", Nodep->type);
return Nodep->type; return Nodep->type;
...@@ -822,7 +822,7 @@ int XML2NODE::GetType(void) ...@@ -822,7 +822,7 @@ int XML2NODE::GetType(void)
/******************************************************************/ /******************************************************************/
PXNODE XML2NODE::GetNext(PGLOBAL g) PXNODE XML2NODE::GetNext(PGLOBAL g)
{ {
if (trace) if (trace(1))
htrc("GetNext\n"); htrc("GetNext\n");
if (!Nodep->next) if (!Nodep->next)
...@@ -838,7 +838,7 @@ PXNODE XML2NODE::GetNext(PGLOBAL g) ...@@ -838,7 +838,7 @@ PXNODE XML2NODE::GetNext(PGLOBAL g)
/******************************************************************/ /******************************************************************/
PXNODE XML2NODE::GetChild(PGLOBAL g) PXNODE XML2NODE::GetChild(PGLOBAL g)
{ {
if (trace) if (trace(1))
htrc("GetChild\n"); htrc("GetChild\n");
if (!Nodep->children) if (!Nodep->children)
...@@ -856,7 +856,7 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len) ...@@ -856,7 +856,7 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
{ {
RCODE rc = RC_OK; RCODE rc = RC_OK;
if (trace) if (trace(1))
htrc("GetContent\n"); htrc("GetContent\n");
if (Content) if (Content)
...@@ -888,7 +888,7 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len) ...@@ -888,7 +888,7 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
*p2 = 0; *p2 = 0;
if (trace) if (trace(1))
htrc("GetText buf='%s' len=%d\n", buf, len); htrc("GetText buf='%s' len=%d\n", buf, len);
xmlFree(Content); xmlFree(Content);
...@@ -896,7 +896,7 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len) ...@@ -896,7 +896,7 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
} else } else
*buf = '\0'; *buf = '\0';
if (trace) if (trace(1))
htrc("GetContent: %s\n", buf); htrc("GetContent: %s\n", buf);
return rc; return rc;
...@@ -907,12 +907,12 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len) ...@@ -907,12 +907,12 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
/******************************************************************/ /******************************************************************/
bool XML2NODE::SetContent(PGLOBAL g, char *txtp, int len) bool XML2NODE::SetContent(PGLOBAL g, char *txtp, int len)
{ {
if (trace) if (trace(1))
htrc("SetContent: %s\n", txtp); htrc("SetContent: %s\n", txtp);
xmlChar *buf = xmlEncodeEntitiesReentrant(Docp, BAD_CAST txtp); xmlChar *buf = xmlEncodeEntitiesReentrant(Docp, BAD_CAST txtp);
if (trace) if (trace(1))
htrc("SetContent: %s -> %s\n", txtp, buf); htrc("SetContent: %s -> %s\n", txtp, buf);
xmlNodeSetContent(Nodep, buf); xmlNodeSetContent(Nodep, buf);
...@@ -925,7 +925,7 @@ bool XML2NODE::SetContent(PGLOBAL g, char *txtp, int len) ...@@ -925,7 +925,7 @@ bool XML2NODE::SetContent(PGLOBAL g, char *txtp, int len)
/******************************************************************/ /******************************************************************/
PXNODE XML2NODE::Clone(PGLOBAL g, PXNODE np) PXNODE XML2NODE::Clone(PGLOBAL g, PXNODE np)
{ {
if (trace) if (trace(1))
htrc("Clone: np=%p\n", np); htrc("Clone: np=%p\n", np);
if (np) { if (np) {
...@@ -941,7 +941,7 @@ PXNODE XML2NODE::Clone(PGLOBAL g, PXNODE np) ...@@ -941,7 +941,7 @@ PXNODE XML2NODE::Clone(PGLOBAL g, PXNODE np)
/******************************************************************/ /******************************************************************/
PXLIST XML2NODE::GetChildElements(PGLOBAL g, char *xp, PXLIST lp) PXLIST XML2NODE::GetChildElements(PGLOBAL g, char *xp, PXLIST lp)
{ {
if (trace) if (trace(1))
htrc("GetChildElements: %s\n", xp); htrc("GetChildElements: %s\n", xp);
return SelectNodes(g, (xp) ? xp : (char*)"*", lp); return SelectNodes(g, (xp) ? xp : (char*)"*", lp);
...@@ -952,7 +952,7 @@ PXLIST XML2NODE::GetChildElements(PGLOBAL g, char *xp, PXLIST lp) ...@@ -952,7 +952,7 @@ PXLIST XML2NODE::GetChildElements(PGLOBAL g, char *xp, PXLIST lp)
/******************************************************************/ /******************************************************************/
PXLIST XML2NODE::SelectNodes(PGLOBAL g, char *xp, PXLIST lp) PXLIST XML2NODE::SelectNodes(PGLOBAL g, char *xp, PXLIST lp)
{ {
if (trace) if (trace(1))
htrc("SelectNodes: %s\n", xp); htrc("SelectNodes: %s\n", xp);
xmlNodeSetPtr nl = ((PXDOC2)Doc)->GetNodeList(g, Nodep, xp); xmlNodeSetPtr nl = ((PXDOC2)Doc)->GetNodeList(g, Nodep, xp);
...@@ -970,7 +970,7 @@ PXLIST XML2NODE::SelectNodes(PGLOBAL g, char *xp, PXLIST lp) ...@@ -970,7 +970,7 @@ PXLIST XML2NODE::SelectNodes(PGLOBAL g, char *xp, PXLIST lp)
/******************************************************************/ /******************************************************************/
PXNODE XML2NODE::SelectSingleNode(PGLOBAL g, char *xp, PXNODE np) PXNODE XML2NODE::SelectSingleNode(PGLOBAL g, char *xp, PXNODE np)
{ {
if (trace) if (trace(1))
htrc("SelectSingleNode: %s\n", xp); htrc("SelectSingleNode: %s\n", xp);
xmlNodeSetPtr nl = ((PXDOC2)Doc)->GetNodeList(g, Nodep, xp); xmlNodeSetPtr nl = ((PXDOC2)Doc)->GetNodeList(g, Nodep, xp);
...@@ -994,7 +994,7 @@ PXATTR XML2NODE::GetAttribute(PGLOBAL g, char *name, PXATTR ap) ...@@ -994,7 +994,7 @@ PXATTR XML2NODE::GetAttribute(PGLOBAL g, char *name, PXATTR ap)
{ {
xmlAttrPtr atp; xmlAttrPtr atp;
if (trace) if (trace(1))
htrc("GetAttribute: %s\n", SVP(name)); htrc("GetAttribute: %s\n", SVP(name));
if (name) if (name)
...@@ -1023,7 +1023,7 @@ PXNODE XML2NODE::AddChildNode(PGLOBAL g, PCSZ name, PXNODE np) ...@@ -1023,7 +1023,7 @@ PXNODE XML2NODE::AddChildNode(PGLOBAL g, PCSZ name, PXNODE np)
{ {
char *p, *pn, *pf = NULL, *nmp = PlugDup(g, name); char *p, *pn, *pf = NULL, *nmp = PlugDup(g, name);
if (trace) if (trace(1))
htrc("AddChildNode: %s\n", name); htrc("AddChildNode: %s\n", name);
// Is a prefix specified // Is a prefix specified
...@@ -1074,7 +1074,7 @@ PXNODE XML2NODE::AddChildNode(PGLOBAL g, PCSZ name, PXNODE np) ...@@ -1074,7 +1074,7 @@ PXNODE XML2NODE::AddChildNode(PGLOBAL g, PCSZ name, PXNODE np)
/******************************************************************/ /******************************************************************/
PXATTR XML2NODE::AddProperty(PGLOBAL g, char *name, PXATTR ap) PXATTR XML2NODE::AddProperty(PGLOBAL g, char *name, PXATTR ap)
{ {
if (trace) if (trace(1))
htrc("AddProperty: %s\n", name); htrc("AddProperty: %s\n", name);
xmlAttrPtr atp = xmlNewProp(Nodep, BAD_CAST name, NULL); xmlAttrPtr atp = xmlNewProp(Nodep, BAD_CAST name, NULL);
...@@ -1097,7 +1097,7 @@ PXATTR XML2NODE::AddProperty(PGLOBAL g, char *name, PXATTR ap) ...@@ -1097,7 +1097,7 @@ PXATTR XML2NODE::AddProperty(PGLOBAL g, char *name, PXATTR ap)
/******************************************************************/ /******************************************************************/
void XML2NODE::AddText(PGLOBAL g, PCSZ txtp) void XML2NODE::AddText(PGLOBAL g, PCSZ txtp)
{ {
if (trace) if (trace(1))
htrc("AddText: %s\n", txtp); htrc("AddText: %s\n", txtp);
// This is to avoid a blank line when inserting a new line // This is to avoid a blank line when inserting a new line
...@@ -1119,7 +1119,7 @@ void XML2NODE::DeleteChild(PGLOBAL g, PXNODE dnp) ...@@ -1119,7 +1119,7 @@ void XML2NODE::DeleteChild(PGLOBAL g, PXNODE dnp)
{ {
xmlErrorPtr xerr; xmlErrorPtr xerr;
if (trace) if (trace(1))
htrc("DeleteChild: node=%p\n", dnp); htrc("DeleteChild: node=%p\n", dnp);
xmlNodePtr np = ((PNODE2)dnp)->Nodep; xmlNodePtr np = ((PNODE2)dnp)->Nodep;
...@@ -1157,7 +1157,7 @@ void XML2NODE::DeleteChild(PGLOBAL g, PXNODE dnp) ...@@ -1157,7 +1157,7 @@ void XML2NODE::DeleteChild(PGLOBAL g, PXNODE dnp)
return; return;
err: err:
if (trace) if (trace(1))
htrc("DeleteChild: errmsg=%s\n", xerr->message); htrc("DeleteChild: errmsg=%s\n", xerr->message);
xmlResetError(xerr); xmlResetError(xerr);
...@@ -1187,7 +1187,7 @@ int XML2NODELIST::GetLength(void) ...@@ -1187,7 +1187,7 @@ int XML2NODELIST::GetLength(void)
/******************************************************************/ /******************************************************************/
PXNODE XML2NODELIST::GetItem(PGLOBAL g, int n, PXNODE np) PXNODE XML2NODELIST::GetItem(PGLOBAL g, int n, PXNODE np)
{ {
if (trace) if (trace(1))
htrc("GetItem: %d\n", n); htrc("GetItem: %d\n", n);
if (!Listp || Listp->nodeNr <= n) if (!Listp || Listp->nodeNr <= n)
...@@ -1206,7 +1206,7 @@ PXNODE XML2NODELIST::GetItem(PGLOBAL g, int n, PXNODE np) ...@@ -1206,7 +1206,7 @@ PXNODE XML2NODELIST::GetItem(PGLOBAL g, int n, PXNODE np)
/******************************************************************/ /******************************************************************/
bool XML2NODELIST::DropItem(PGLOBAL g, int n) bool XML2NODELIST::DropItem(PGLOBAL g, int n)
{ {
if (trace) if (trace(1))
htrc("DropItem: n=%d\n", n); htrc("DropItem: n=%d\n", n);
// We should do something here // We should do something here
...@@ -1234,7 +1234,7 @@ XML2ATTR::XML2ATTR(PXDOC dp, xmlAttrPtr ap, xmlNodePtr np) ...@@ -1234,7 +1234,7 @@ XML2ATTR::XML2ATTR(PXDOC dp, xmlAttrPtr ap, xmlNodePtr np)
/******************************************************************/ /******************************************************************/
PXATTR XML2ATTR::GetNext(PGLOBAL g) PXATTR XML2ATTR::GetNext(PGLOBAL g)
{ {
if (trace) if (trace(1))
htrc("Attr GetNext\n"); htrc("Attr GetNext\n");
if (!Atrp->next) if (!Atrp->next)
...@@ -1252,7 +1252,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len) ...@@ -1252,7 +1252,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len)
RCODE rc = RC_OK; RCODE rc = RC_OK;
xmlChar *txt; xmlChar *txt;
if (trace) if (trace(1))
htrc("GetText\n"); htrc("GetText\n");
if ((txt = xmlGetProp(Atrp->parent, Atrp->name))) { if ((txt = xmlGetProp(Atrp->parent, Atrp->name))) {
...@@ -1269,7 +1269,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len) ...@@ -1269,7 +1269,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len)
} else } else
*buf = '\0'; *buf = '\0';
if (trace) if (trace(1))
htrc("GetText: %s\n", buf); htrc("GetText: %s\n", buf);
return rc; return rc;
...@@ -1280,7 +1280,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len) ...@@ -1280,7 +1280,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len)
/******************************************************************/ /******************************************************************/
bool XML2ATTR::SetText(PGLOBAL g, char *txtp, int len) bool XML2ATTR::SetText(PGLOBAL g, char *txtp, int len)
{ {
if (trace) if (trace(1))
htrc("SetText: %s %d\n", txtp, len); htrc("SetText: %s %d\n", txtp, len);
xmlSetProp(Parent, Atrp->name, BAD_CAST txtp); xmlSetProp(Parent, Atrp->name, BAD_CAST txtp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment