blob: 4a55fa8d0f947cec18404eda78dce795220b33dc [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +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__
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
18extern "C" {
19#endif
20
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);
45void xmlDebugDumpDTD (FILE *output,
46 xmlDtdPtr doc);
47void 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 */
72typedef struct _xmlShellCtxt xmlShellCtxt;
73typedef xmlShellCtxt *xmlShellCtxtPtr;
74struct _xmlShellCtxt {
75 char *filename;
76 xmlDocPtr doc;
77 xmlNodePtr node;
78 xmlXPathContextPtr pctxt;
79 int loaded;
80 FILE *output;
81 xmlShellReadlineFunc input;
82};
83
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
108#ifdef __cplusplus
109}
110#endif
111
112#endif /* LIBXML_DEBUG_ENABLED */
113#endif /* __DEBUG_XML__ */