Eneboo - Documentación para desarrolladores
|
00001 /* 00002 * Summary: Tree debugging APIs 00003 * Description: Interfaces to a set of routines used for debugging the tree 00004 * produced by the XML parser. 00005 * 00006 * Copy: See Copyright for the status of this software. 00007 * 00008 * Author: Daniel Veillard 00009 */ 00010 00011 #ifndef __DEBUG_XML__ 00012 #define __DEBUG_XML__ 00013 #include <stdio.h> 00014 #include <libxml/xmlversion.h> 00015 #include <libxml/tree.h> 00016 00017 #ifdef LIBXML_DEBUG_ENABLED 00018 00019 #include <libxml/xpath.h> 00020 00021 #ifdef __cplusplus 00022 extern "C" { 00023 #endif 00024 00025 /* 00026 * The standard Dump routines. 00027 */ 00028 XMLPUBFUN void XMLCALL 00029 xmlDebugDumpString (FILE *output, 00030 const xmlChar *str); 00031 XMLPUBFUN void XMLCALL 00032 xmlDebugDumpAttr (FILE *output, 00033 xmlAttrPtr attr, 00034 int depth); 00035 XMLPUBFUN void XMLCALL 00036 xmlDebugDumpAttrList (FILE *output, 00037 xmlAttrPtr attr, 00038 int depth); 00039 XMLPUBFUN void XMLCALL 00040 xmlDebugDumpOneNode (FILE *output, 00041 xmlNodePtr node, 00042 int depth); 00043 XMLPUBFUN void XMLCALL 00044 xmlDebugDumpNode (FILE *output, 00045 xmlNodePtr node, 00046 int depth); 00047 XMLPUBFUN void XMLCALL 00048 xmlDebugDumpNodeList (FILE *output, 00049 xmlNodePtr node, 00050 int depth); 00051 XMLPUBFUN void XMLCALL 00052 xmlDebugDumpDocumentHead(FILE *output, 00053 xmlDocPtr doc); 00054 XMLPUBFUN void XMLCALL 00055 xmlDebugDumpDocument (FILE *output, 00056 xmlDocPtr doc); 00057 XMLPUBFUN void XMLCALL 00058 xmlDebugDumpDTD (FILE *output, 00059 xmlDtdPtr dtd); 00060 XMLPUBFUN void XMLCALL 00061 xmlDebugDumpEntities (FILE *output, 00062 xmlDocPtr doc); 00063 00064 /**************************************************************** 00065 * * 00066 * Checking routines * 00067 * * 00068 ****************************************************************/ 00069 00070 XMLPUBFUN int XMLCALL 00071 xmlDebugCheckDocument (FILE * output, 00072 xmlDocPtr doc); 00073 00074 /**************************************************************** 00075 * * 00076 * XML shell helpers * 00077 * * 00078 ****************************************************************/ 00079 00080 XMLPUBFUN void XMLCALL 00081 xmlLsOneNode (FILE *output, xmlNodePtr node); 00082 XMLPUBFUN int XMLCALL 00083 xmlLsCountNode (xmlNodePtr node); 00084 00085 XMLPUBFUN const char * XMLCALL 00086 xmlBoolToText (int boolval); 00087 00088 /**************************************************************** 00089 * * 00090 * The XML shell related structures and functions * 00091 * * 00092 ****************************************************************/ 00093 00094 #ifdef LIBXML_XPATH_ENABLED 00095 00103 typedef char * (* xmlShellReadlineFunc)(char *prompt); 00104 00111 typedef struct _xmlShellCtxt xmlShellCtxt; 00112 typedef xmlShellCtxt *xmlShellCtxtPtr; 00113 struct _xmlShellCtxt { 00114 char *filename; 00115 xmlDocPtr doc; 00116 xmlNodePtr node; 00117 xmlXPathContextPtr pctxt; 00118 int loaded; 00119 FILE *output; 00120 xmlShellReadlineFunc input; 00121 }; 00122 00134 typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt, 00135 char *arg, 00136 xmlNodePtr node, 00137 xmlNodePtr node2); 00138 00139 XMLPUBFUN void XMLCALL 00140 xmlShellPrintXPathError (int errorType, 00141 const char *arg); 00142 XMLPUBFUN void XMLCALL 00143 xmlShellPrintXPathResult(xmlXPathObjectPtr list); 00144 XMLPUBFUN int XMLCALL 00145 xmlShellList (xmlShellCtxtPtr ctxt, 00146 char *arg, 00147 xmlNodePtr node, 00148 xmlNodePtr node2); 00149 XMLPUBFUN int XMLCALL 00150 xmlShellBase (xmlShellCtxtPtr ctxt, 00151 char *arg, 00152 xmlNodePtr node, 00153 xmlNodePtr node2); 00154 XMLPUBFUN int XMLCALL 00155 xmlShellDir (xmlShellCtxtPtr ctxt, 00156 char *arg, 00157 xmlNodePtr node, 00158 xmlNodePtr node2); 00159 XMLPUBFUN int XMLCALL 00160 xmlShellLoad (xmlShellCtxtPtr ctxt, 00161 char *filename, 00162 xmlNodePtr node, 00163 xmlNodePtr node2); 00164 #ifdef LIBXML_OUTPUT_ENABLED 00165 XMLPUBFUN void XMLCALL 00166 xmlShellPrintNode (xmlNodePtr node); 00167 XMLPUBFUN int XMLCALL 00168 xmlShellCat (xmlShellCtxtPtr ctxt, 00169 char *arg, 00170 xmlNodePtr node, 00171 xmlNodePtr node2); 00172 XMLPUBFUN int XMLCALL 00173 xmlShellWrite (xmlShellCtxtPtr ctxt, 00174 char *filename, 00175 xmlNodePtr node, 00176 xmlNodePtr node2); 00177 XMLPUBFUN int XMLCALL 00178 xmlShellSave (xmlShellCtxtPtr ctxt, 00179 char *filename, 00180 xmlNodePtr node, 00181 xmlNodePtr node2); 00182 #endif /* LIBXML_OUTPUT_ENABLED */ 00183 #ifdef LIBXML_VALID_ENABLED 00184 XMLPUBFUN int XMLCALL 00185 xmlShellValidate (xmlShellCtxtPtr ctxt, 00186 char *dtd, 00187 xmlNodePtr node, 00188 xmlNodePtr node2); 00189 #endif /* LIBXML_VALID_ENABLED */ 00190 XMLPUBFUN int XMLCALL 00191 xmlShellDu (xmlShellCtxtPtr ctxt, 00192 char *arg, 00193 xmlNodePtr tree, 00194 xmlNodePtr node2); 00195 XMLPUBFUN int XMLCALL 00196 xmlShellPwd (xmlShellCtxtPtr ctxt, 00197 char *buffer, 00198 xmlNodePtr node, 00199 xmlNodePtr node2); 00200 00201 /* 00202 * The Shell interface. 00203 */ 00204 XMLPUBFUN void XMLCALL 00205 xmlShell (xmlDocPtr doc, 00206 char *filename, 00207 xmlShellReadlineFunc input, 00208 FILE *output); 00209 00210 #endif /* LIBXML_XPATH_ENABLED */ 00211 00212 #ifdef __cplusplus 00213 } 00214 #endif 00215 00216 #endif /* LIBXML_DEBUG_ENABLED */ 00217 #endif /* __DEBUG_XML__ */