blob: babb8acb1c9f9916e560310230e1c03039139cff [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
Daniel Veillardbed7b052001-05-19 14:59:49 +000068/**
69 * xmlShellCtxt:
70 *
71 * A debugging shell context
Owen Taylor3473f882001-02-23 17:55:21 +000072 * TODO: add the defined function tables.
73 */
74typedef struct _xmlShellCtxt xmlShellCtxt;
75typedef xmlShellCtxt *xmlShellCtxtPtr;
76struct _xmlShellCtxt {
77 char *filename;
78 xmlDocPtr doc;
79 xmlNodePtr node;
80 xmlXPathContextPtr pctxt;
81 int loaded;
82 FILE *output;
83 xmlShellReadlineFunc input;
84};
85
86/**
87 * xmlShellCmd:
88 * @ctxt: a shell context
89 * @arg: a string argument
90 * @node: a first node
91 * @node2: a second node
92 *
93 * This is a generic signature for the XML shell functions
94 *
95 * Returns an int, negative returns indicating errors
96 */
97typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
98 char *arg,
99 xmlNodePtr node,
100 xmlNodePtr node2);
101
102/*
103 * The Shell interface.
104 */
105void xmlShell (xmlDocPtr doc,
106 char *filename,
107 xmlShellReadlineFunc input,
108 FILE *output);
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif /* LIBXML_DEBUG_ENABLED */
115#endif /* __DEBUG_XML__ */