/app/libxml2-2.4.28/include/libxml2/libxml/debugXML.h


    1 /*
    2  * debugXML.h : Interfaces to a set of routines used for debugging the tree
    3  *              produced by the XML parser.
    4  *
    5  * Daniel Veillard <daniel@veillard.com>
    6  */
    7 
    8 #ifndef __DEBUG_XML__
    9 #define __DEBUG_XML__
   10 #include <stdio.h>
   11 #include <libxml/tree.h>
   12 
   13 #ifdef LIBXML_DEBUG_ENABLED
   14 
   15 #include <libxml/xpath.h>
   16 
   17 #ifdef __cplusplus
   18 extern "C" {
   19 #endif
   20 
   21 /*
   22  * The standard Dump routines.
   23  */
   24 void	xmlDebugDumpString	(FILE *output,
   25 				 const xmlChar *str);
   26 void	xmlDebugDumpAttr	(FILE *output,
   27 				 xmlAttrPtr attr,
   28 				 int depth);
   29 void	xmlDebugDumpAttrList	(FILE *output,
   30 				 xmlAttrPtr attr,
   31 				 int depth);
   32 void	xmlDebugDumpOneNode	(FILE *output,
   33 				 xmlNodePtr node,
   34 				 int depth);
   35 void	xmlDebugDumpNode	(FILE *output,
   36 				 xmlNodePtr node,
   37 				 int depth);
   38 void	xmlDebugDumpNodeList	(FILE *output,
   39 				 xmlNodePtr node,
   40 				 int depth);
   41 void	xmlDebugDumpDocumentHead(FILE *output,
   42 				 xmlDocPtr doc);
   43 void	xmlDebugDumpDocument	(FILE *output,
   44 				 xmlDocPtr doc);
   45 void	xmlDebugDumpDTD		(FILE *output,
   46 				 xmlDtdPtr dtd);
   47 void	xmlDebugDumpEntities	(FILE *output,
   48 				 xmlDocPtr doc);
   49 
   50 void	xmlLsOneNode		(FILE *output, xmlNodePtr node);
   51 int	xmlLsCountNode		(xmlNodePtr node);
   52 
   53 LIBXML_DLL_IMPORT const char *xmlBoolToText	(int boolval);
   54 
   55 /****************************************************************
   56  *								*
   57  *	 The XML shell related structures and functions		*
   58  *								*
   59  ****************************************************************/
   60 
   61 /**
   62  * xmlShellReadlineFunc:
   63  * @prompt:  a string prompt
   64  *
   65  * This is a generic signature for the XML shell input function.
   66  *
   67  * Returns a string which will be freed by the Shell.
   68  */
   69 typedef char * (* xmlShellReadlineFunc)(char *prompt);
   70 
   71 /**
   72  * xmlShellCtxt:
   73  *
   74  * A debugging shell context.
   75  * TODO: add the defined function tables.
   76  */
   77 typedef struct _xmlShellCtxt xmlShellCtxt;
   78 typedef xmlShellCtxt *xmlShellCtxtPtr;
   79 struct _xmlShellCtxt {
   80     char *filename;
   81     xmlDocPtr doc;
   82     xmlNodePtr node;
   83     xmlXPathContextPtr pctxt;
   84     int loaded;
   85     FILE *output;
   86     xmlShellReadlineFunc input;
   87 };
   88 
   89 /**
   90  * xmlShellCmd:
   91  * @ctxt:  a shell context
   92  * @arg:  a string argument
   93  * @node:  a first node
   94  * @node2:  a second node
   95  *
   96  * This is a generic signature for the XML shell functions.
   97  *
   98  * Returns an int, negative returns indicating errors.
   99  */
  100 typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
  101                              char *arg,
  102 			     xmlNodePtr node,
  103 			     xmlNodePtr node2);
  104 
  105 void	xmlShellPrintXPathError	(int errorType,
  106 				 const char *arg);
  107 void	xmlShellPrintNode	(xmlNodePtr node);
  108 void	xmlShellPrintXPathResult(xmlXPathObjectPtr list);
  109 int	xmlShellList		(xmlShellCtxtPtr ctxt,
  110 				 char *arg,
  111 				 xmlNodePtr node,
  112 				 xmlNodePtr node2);
  113 int	xmlShellBase		(xmlShellCtxtPtr ctxt,
  114 				 char *arg,
  115 				 xmlNodePtr node,
  116 				 xmlNodePtr node2);
  117 int	xmlShellDir		(xmlShellCtxtPtr ctxt,
  118 				 char *arg,
  119 				 xmlNodePtr node,
  120 				 xmlNodePtr node2);
  121 int	xmlShellCat		(xmlShellCtxtPtr ctxt,
  122 				 char *arg,
  123 				 xmlNodePtr node,
  124 				 xmlNodePtr node2);
  125 int	xmlShellLoad		(xmlShellCtxtPtr ctxt,
  126 				 char *filename,
  127 				 xmlNodePtr node,
  128 				 xmlNodePtr node2);
  129 int	xmlShellWrite		(xmlShellCtxtPtr ctxt,
  130 				 char *filename,
  131 				 xmlNodePtr node,
  132 				 xmlNodePtr node2);
  133 int	xmlShellSave		(xmlShellCtxtPtr ctxt,
  134 				 char *filename,
  135 				 xmlNodePtr node,
  136 				 xmlNodePtr node2);
  137 int	xmlShellValidate	(xmlShellCtxtPtr ctxt,
  138 				 char *dtd,
  139 				 xmlNodePtr node,
  140 				 xmlNodePtr node2);
  141 int	xmlShellDu		(xmlShellCtxtPtr ctxt,
  142 				 char *arg,
  143 				 xmlNodePtr tree,
  144 				 xmlNodePtr node2);
  145 int	xmlShellPwd		(xmlShellCtxtPtr ctxt,
  146 				 char *buffer,
  147 				 xmlNodePtr node,
  148 				 xmlNodePtr node2);
  149 
  150 /*
  151  * The Shell interface.
  152  */
  153 void	xmlShell		(xmlDocPtr doc,
  154 				 char *filename,
  155 				 xmlShellReadlineFunc input,
  156 				 FILE *output);
  157 			 
  158 #ifdef __cplusplus
  159 }
  160 #endif
  161 
  162 #endif /* LIBXML_DEBUG_ENABLED */
  163 #endif /* __DEBUG_XML__ */