Path: blob/master/venv/Lib/site-packages/lxml/includes/libxml/debugXML.h
811 views
/*1* Summary: Tree debugging APIs2* Description: Interfaces to a set of routines used for debugging the tree3* produced by the XML parser.4*5* Copy: See Copyright for the status of this software.6*7* Author: Daniel Veillard8*/910#ifndef __DEBUG_XML__11#define __DEBUG_XML__12#include <stdio.h>13#include <libxml/xmlversion.h>14#include <libxml/tree.h>1516#ifdef LIBXML_DEBUG_ENABLED1718#include <libxml/xpath.h>1920#ifdef __cplusplus21extern "C" {22#endif2324/*25* The standard Dump routines.26*/27XMLPUBFUN void XMLCALL28xmlDebugDumpString (FILE *output,29const xmlChar *str);30XMLPUBFUN void XMLCALL31xmlDebugDumpAttr (FILE *output,32xmlAttrPtr attr,33int depth);34XMLPUBFUN void XMLCALL35xmlDebugDumpAttrList (FILE *output,36xmlAttrPtr attr,37int depth);38XMLPUBFUN void XMLCALL39xmlDebugDumpOneNode (FILE *output,40xmlNodePtr node,41int depth);42XMLPUBFUN void XMLCALL43xmlDebugDumpNode (FILE *output,44xmlNodePtr node,45int depth);46XMLPUBFUN void XMLCALL47xmlDebugDumpNodeList (FILE *output,48xmlNodePtr node,49int depth);50XMLPUBFUN void XMLCALL51xmlDebugDumpDocumentHead(FILE *output,52xmlDocPtr doc);53XMLPUBFUN void XMLCALL54xmlDebugDumpDocument (FILE *output,55xmlDocPtr doc);56XMLPUBFUN void XMLCALL57xmlDebugDumpDTD (FILE *output,58xmlDtdPtr dtd);59XMLPUBFUN void XMLCALL60xmlDebugDumpEntities (FILE *output,61xmlDocPtr doc);6263/****************************************************************64* *65* Checking routines *66* *67****************************************************************/6869XMLPUBFUN int XMLCALL70xmlDebugCheckDocument (FILE * output,71xmlDocPtr doc);7273/****************************************************************74* *75* XML shell helpers *76* *77****************************************************************/7879XMLPUBFUN void XMLCALL80xmlLsOneNode (FILE *output, xmlNodePtr node);81XMLPUBFUN int XMLCALL82xmlLsCountNode (xmlNodePtr node);8384XMLPUBFUN const char * XMLCALL85xmlBoolToText (int boolval);8687/****************************************************************88* *89* The XML shell related structures and functions *90* *91****************************************************************/9293#ifdef LIBXML_XPATH_ENABLED94/**95* xmlShellReadlineFunc:96* @prompt: a string prompt97*98* This is a generic signature for the XML shell input function.99*100* Returns a string which will be freed by the Shell.101*/102typedef char * (* xmlShellReadlineFunc)(char *prompt);103104/**105* xmlShellCtxt:106*107* A debugging shell context.108* TODO: add the defined function tables.109*/110typedef struct _xmlShellCtxt xmlShellCtxt;111typedef xmlShellCtxt *xmlShellCtxtPtr;112struct _xmlShellCtxt {113char *filename;114xmlDocPtr doc;115xmlNodePtr node;116xmlXPathContextPtr pctxt;117int loaded;118FILE *output;119xmlShellReadlineFunc input;120};121122/**123* xmlShellCmd:124* @ctxt: a shell context125* @arg: a string argument126* @node: a first node127* @node2: a second node128*129* This is a generic signature for the XML shell functions.130*131* Returns an int, negative returns indicating errors.132*/133typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,134char *arg,135xmlNodePtr node,136xmlNodePtr node2);137138XMLPUBFUN void XMLCALL139xmlShellPrintXPathError (int errorType,140const char *arg);141XMLPUBFUN void XMLCALL142xmlShellPrintXPathResult(xmlXPathObjectPtr list);143XMLPUBFUN int XMLCALL144xmlShellList (xmlShellCtxtPtr ctxt,145char *arg,146xmlNodePtr node,147xmlNodePtr node2);148XMLPUBFUN int XMLCALL149xmlShellBase (xmlShellCtxtPtr ctxt,150char *arg,151xmlNodePtr node,152xmlNodePtr node2);153XMLPUBFUN int XMLCALL154xmlShellDir (xmlShellCtxtPtr ctxt,155char *arg,156xmlNodePtr node,157xmlNodePtr node2);158XMLPUBFUN int XMLCALL159xmlShellLoad (xmlShellCtxtPtr ctxt,160char *filename,161xmlNodePtr node,162xmlNodePtr node2);163#ifdef LIBXML_OUTPUT_ENABLED164XMLPUBFUN void XMLCALL165xmlShellPrintNode (xmlNodePtr node);166XMLPUBFUN int XMLCALL167xmlShellCat (xmlShellCtxtPtr ctxt,168char *arg,169xmlNodePtr node,170xmlNodePtr node2);171XMLPUBFUN int XMLCALL172xmlShellWrite (xmlShellCtxtPtr ctxt,173char *filename,174xmlNodePtr node,175xmlNodePtr node2);176XMLPUBFUN int XMLCALL177xmlShellSave (xmlShellCtxtPtr ctxt,178char *filename,179xmlNodePtr node,180xmlNodePtr node2);181#endif /* LIBXML_OUTPUT_ENABLED */182#ifdef LIBXML_VALID_ENABLED183XMLPUBFUN int XMLCALL184xmlShellValidate (xmlShellCtxtPtr ctxt,185char *dtd,186xmlNodePtr node,187xmlNodePtr node2);188#endif /* LIBXML_VALID_ENABLED */189XMLPUBFUN int XMLCALL190xmlShellDu (xmlShellCtxtPtr ctxt,191char *arg,192xmlNodePtr tree,193xmlNodePtr node2);194XMLPUBFUN int XMLCALL195xmlShellPwd (xmlShellCtxtPtr ctxt,196char *buffer,197xmlNodePtr node,198xmlNodePtr node2);199200/*201* The Shell interface.202*/203XMLPUBFUN void XMLCALL204xmlShell (xmlDocPtr doc,205char *filename,206xmlShellReadlineFunc input,207FILE *output);208209#endif /* LIBXML_XPATH_ENABLED */210211#ifdef __cplusplus212}213#endif214215#endif /* LIBXML_DEBUG_ENABLED */216#endif /* __DEBUG_XML__ */217218219