blob: 4a55fa8d0f947cec18404eda78dce795220b33dc [file] [log] [blame]
Daniel Veillardbaf4cd51998-10-27 22:56:57 +00001/*
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@w3.org>
6 */
7
8#ifndef __DEBUG_XML__
9#define __DEBUG_XML__
Daniel Veillarddbfd6411999-12-28 16:35:14 +000010#include <stdio.h>
Daniel Veillard361d8452000-04-03 19:48:13 +000011#include <libxml/tree.h>
12
13#ifdef LIBXML_DEBUG_ENABLED
14
15#include <libxml/xpath.h>
Daniel Veillardbaf4cd51998-10-27 22:56:57 +000016
Daniel Veillardf600e251999-12-18 15:32:46 +000017#ifdef __cplusplus
Daniel Veillard5cb5ab81999-12-21 15:35:29 +000018extern "C" {
Daniel Veillardf600e251999-12-18 15:32:46 +000019#endif
Daniel Veillarddbfd6411999-12-28 16:35:14 +000020
21/*
22 * The standard Dump routines
23 */
24void xmlDebugDumpString (FILE *output,
25 const xmlChar *str);
26void xmlDebugDumpAttr (FILE *output,
27 xmlAttrPtr attr,
28 int depth);
29void xmlDebugDumpAttrList (FILE *output,
30 xmlAttrPtr attr,
31 int depth);
32void xmlDebugDumpOneNode (FILE *output,
33 xmlNodePtr node,
34 int depth);
35void xmlDebugDumpNode (FILE *output,
36 xmlNodePtr node,
37 int depth);
38void xmlDebugDumpNodeList (FILE *output,
39 xmlNodePtr node,
40 int depth);
41void xmlDebugDumpDocumentHead(FILE *output,
42 xmlDocPtr doc);
43void xmlDebugDumpDocument (FILE *output,
44 xmlDocPtr doc);
Daniel Veillard39c7d712000-09-10 16:14:55 +000045void xmlDebugDumpDTD (FILE *output,
46 xmlDtdPtr doc);
Daniel Veillarddbfd6411999-12-28 16:35:14 +000047void xmlDebugDumpEntities (FILE *output,
48 xmlDocPtr doc);
49void xmlLsOneNode (FILE *output,
50 xmlNodePtr node);
51
52/****************************************************************
53 * *
54 * The XML shell related structures and functions *
55 * *
56 ****************************************************************/
57
58/**
59 * xmlShellReadlineFunc:
60 * @prompt: a string prompt
61 *
62 * This is a generic signature for the XML shell input function
63 *
64 * Returns a string which will be freed by the Shell
65 */
66typedef char * (* xmlShellReadlineFunc)(char *prompt);
67
68/*
69 * The shell context itself
70 * TODO: add the defined function tables.
71 */
Daniel Veillard71b656e2000-01-05 14:46:17 +000072typedef struct _xmlShellCtxt xmlShellCtxt;
73typedef xmlShellCtxt *xmlShellCtxtPtr;
74struct _xmlShellCtxt {
Daniel Veillarddbfd6411999-12-28 16:35:14 +000075 char *filename;
76 xmlDocPtr doc;
77 xmlNodePtr node;
78 xmlXPathContextPtr pctxt;
79 int loaded;
80 FILE *output;
81 xmlShellReadlineFunc input;
Daniel Veillard71b656e2000-01-05 14:46:17 +000082};
Daniel Veillarddbfd6411999-12-28 16:35:14 +000083
84/**
85 * xmlShellCmd:
86 * @ctxt: a shell context
87 * @arg: a string argument
88 * @node: a first node
89 * @node2: a second node
90 *
91 * This is a generic signature for the XML shell functions
92 *
93 * Returns an int, negative returns indicating errors
94 */
95typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
96 char *arg,
97 xmlNodePtr node,
98 xmlNodePtr node2);
99
100/*
101 * The Shell interface.
102 */
103void xmlShell (xmlDocPtr doc,
104 char *filename,
105 xmlShellReadlineFunc input,
106 FILE *output);
107
Daniel Veillardf600e251999-12-18 15:32:46 +0000108#ifdef __cplusplus
109}
110#endif
Daniel Veillard361d8452000-04-03 19:48:13 +0000111
112#endif /* LIBXML_DEBUG_ENABLED */
Daniel Veillardbaf4cd51998-10-27 22:56:57 +0000113#endif /* __DEBUG_XML__ */