Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:41:48

0001 /*
0002  * Summary: Tree debugging APIs
0003  * Description: Interfaces to a set of routines used for debugging the tree
0004  *              produced by the XML parser.
0005  *
0006  * Copy: See Copyright for the status of this software.
0007  *
0008  * Author: Daniel Veillard
0009  */
0010 
0011 #ifndef __DEBUG_XML__
0012 #define __DEBUG_XML__
0013 #include <stdio.h>
0014 #include <libxml/xmlversion.h>
0015 #include <libxml/tree.h>
0016 
0017 #ifdef LIBXML_DEBUG_ENABLED
0018 
0019 #include <libxml/xpath.h>
0020 
0021 #ifdef __cplusplus
0022 extern "C" {
0023 #endif
0024 
0025 /*
0026  * The standard Dump routines.
0027  */
0028 XMLPUBFUN void
0029     xmlDebugDumpString  (FILE *output,
0030                  const xmlChar *str);
0031 XMLPUBFUN void
0032     xmlDebugDumpAttr    (FILE *output,
0033                  xmlAttrPtr attr,
0034                  int depth);
0035 XMLPUBFUN void
0036     xmlDebugDumpAttrList    (FILE *output,
0037                  xmlAttrPtr attr,
0038                  int depth);
0039 XMLPUBFUN void
0040     xmlDebugDumpOneNode (FILE *output,
0041                  xmlNodePtr node,
0042                  int depth);
0043 XMLPUBFUN void
0044     xmlDebugDumpNode    (FILE *output,
0045                  xmlNodePtr node,
0046                  int depth);
0047 XMLPUBFUN void
0048     xmlDebugDumpNodeList    (FILE *output,
0049                  xmlNodePtr node,
0050                  int depth);
0051 XMLPUBFUN void
0052     xmlDebugDumpDocumentHead(FILE *output,
0053                  xmlDocPtr doc);
0054 XMLPUBFUN void
0055     xmlDebugDumpDocument    (FILE *output,
0056                  xmlDocPtr doc);
0057 XMLPUBFUN void
0058     xmlDebugDumpDTD     (FILE *output,
0059                  xmlDtdPtr dtd);
0060 XMLPUBFUN void
0061     xmlDebugDumpEntities    (FILE *output,
0062                  xmlDocPtr doc);
0063 
0064 /****************************************************************
0065  *                              *
0066  *          Checking routines           *
0067  *                              *
0068  ****************************************************************/
0069 
0070 XMLPUBFUN int
0071     xmlDebugCheckDocument   (FILE * output,
0072                  xmlDocPtr doc);
0073 
0074 /****************************************************************
0075  *                              *
0076  *          XML shell helpers           *
0077  *                              *
0078  ****************************************************************/
0079 
0080 XMLPUBFUN void
0081     xmlLsOneNode        (FILE *output, xmlNodePtr node);
0082 XMLPUBFUN int
0083     xmlLsCountNode      (xmlNodePtr node);
0084 
0085 XMLPUBFUN const char *
0086     xmlBoolToText       (int boolval);
0087 
0088 /****************************************************************
0089  *                              *
0090  *   The XML shell related structures and functions     *
0091  *                              *
0092  ****************************************************************/
0093 
0094 #ifdef LIBXML_XPATH_ENABLED
0095 /**
0096  * xmlShellReadlineFunc:
0097  * @prompt:  a string prompt
0098  *
0099  * This is a generic signature for the XML shell input function.
0100  *
0101  * Returns a string which will be freed by the Shell.
0102  */
0103 typedef char * (* xmlShellReadlineFunc)(char *prompt);
0104 
0105 /**
0106  * xmlShellCtxt:
0107  *
0108  * A debugging shell context.
0109  * TODO: add the defined function tables.
0110  */
0111 typedef struct _xmlShellCtxt xmlShellCtxt;
0112 typedef xmlShellCtxt *xmlShellCtxtPtr;
0113 struct _xmlShellCtxt {
0114     char *filename;
0115     xmlDocPtr doc;
0116     xmlNodePtr node;
0117     xmlXPathContextPtr pctxt;
0118     int loaded;
0119     FILE *output;
0120     xmlShellReadlineFunc input;
0121 };
0122 
0123 /**
0124  * xmlShellCmd:
0125  * @ctxt:  a shell context
0126  * @arg:  a string argument
0127  * @node:  a first node
0128  * @node2:  a second node
0129  *
0130  * This is a generic signature for the XML shell functions.
0131  *
0132  * Returns an int, negative returns indicating errors.
0133  */
0134 typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
0135                              char *arg,
0136                  xmlNodePtr node,
0137                  xmlNodePtr node2);
0138 
0139 XMLPUBFUN void
0140     xmlShellPrintXPathError (int errorType,
0141                  const char *arg);
0142 XMLPUBFUN void
0143     xmlShellPrintXPathResult(xmlXPathObjectPtr list);
0144 XMLPUBFUN int
0145     xmlShellList        (xmlShellCtxtPtr ctxt,
0146                  char *arg,
0147                  xmlNodePtr node,
0148                  xmlNodePtr node2);
0149 XMLPUBFUN int
0150     xmlShellBase        (xmlShellCtxtPtr ctxt,
0151                  char *arg,
0152                  xmlNodePtr node,
0153                  xmlNodePtr node2);
0154 XMLPUBFUN int
0155     xmlShellDir     (xmlShellCtxtPtr ctxt,
0156                  char *arg,
0157                  xmlNodePtr node,
0158                  xmlNodePtr node2);
0159 XMLPUBFUN int
0160     xmlShellLoad        (xmlShellCtxtPtr ctxt,
0161                  char *filename,
0162                  xmlNodePtr node,
0163                  xmlNodePtr node2);
0164 #ifdef LIBXML_OUTPUT_ENABLED
0165 XMLPUBFUN void
0166     xmlShellPrintNode   (xmlNodePtr node);
0167 XMLPUBFUN int
0168     xmlShellCat     (xmlShellCtxtPtr ctxt,
0169                  char *arg,
0170                  xmlNodePtr node,
0171                  xmlNodePtr node2);
0172 XMLPUBFUN int
0173     xmlShellWrite       (xmlShellCtxtPtr ctxt,
0174                  char *filename,
0175                  xmlNodePtr node,
0176                  xmlNodePtr node2);
0177 XMLPUBFUN int
0178     xmlShellSave        (xmlShellCtxtPtr ctxt,
0179                  char *filename,
0180                  xmlNodePtr node,
0181                  xmlNodePtr node2);
0182 #endif /* LIBXML_OUTPUT_ENABLED */
0183 #ifdef LIBXML_VALID_ENABLED
0184 XMLPUBFUN int
0185     xmlShellValidate    (xmlShellCtxtPtr ctxt,
0186                  char *dtd,
0187                  xmlNodePtr node,
0188                  xmlNodePtr node2);
0189 #endif /* LIBXML_VALID_ENABLED */
0190 XMLPUBFUN int
0191     xmlShellDu      (xmlShellCtxtPtr ctxt,
0192                  char *arg,
0193                  xmlNodePtr tree,
0194                  xmlNodePtr node2);
0195 XMLPUBFUN int
0196     xmlShellPwd     (xmlShellCtxtPtr ctxt,
0197                  char *buffer,
0198                  xmlNodePtr node,
0199                  xmlNodePtr node2);
0200 
0201 /*
0202  * The Shell interface.
0203  */
0204 XMLPUBFUN void
0205     xmlShell        (xmlDocPtr doc,
0206                  const char *filename,
0207                  xmlShellReadlineFunc input,
0208                  FILE *output);
0209 
0210 #endif /* LIBXML_XPATH_ENABLED */
0211 
0212 #ifdef __cplusplus
0213 }
0214 #endif
0215 
0216 #endif /* LIBXML_DEBUG_ENABLED */
0217 #endif /* __DEBUG_XML__ */