blob: 313846909870a3b46616af1966a1b8d00fc72983 [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);
45void xmlDebugDumpEntities (FILE *output,
46 xmlDocPtr doc);
47void xmlLsOneNode (FILE *output,
48 xmlNodePtr node);
49
50/****************************************************************
51 * *
52 * The XML shell related structures and functions *
53 * *
54 ****************************************************************/
55
56/**
57 * xmlShellReadlineFunc:
58 * @prompt: a string prompt
59 *
60 * This is a generic signature for the XML shell input function
61 *
62 * Returns a string which will be freed by the Shell
63 */
64typedef char * (* xmlShellReadlineFunc)(char *prompt);
65
66/*
67 * The shell context itself
68 * TODO: add the defined function tables.
69 */
Daniel Veillard71b656e2000-01-05 14:46:17 +000070typedef struct _xmlShellCtxt xmlShellCtxt;
71typedef xmlShellCtxt *xmlShellCtxtPtr;
72struct _xmlShellCtxt {
Daniel Veillarddbfd6411999-12-28 16:35:14 +000073 char *filename;
74 xmlDocPtr doc;
75 xmlNodePtr node;
76 xmlXPathContextPtr pctxt;
77 int loaded;
78 FILE *output;
79 xmlShellReadlineFunc input;
Daniel Veillard71b656e2000-01-05 14:46:17 +000080};
Daniel Veillarddbfd6411999-12-28 16:35:14 +000081
82/**
83 * xmlShellCmd:
84 * @ctxt: a shell context
85 * @arg: a string argument
86 * @node: a first node
87 * @node2: a second node
88 *
89 * This is a generic signature for the XML shell functions
90 *
91 * Returns an int, negative returns indicating errors
92 */
93typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
94 char *arg,
95 xmlNodePtr node,
96 xmlNodePtr node2);
97
98/*
99 * The Shell interface.
100 */
101void xmlShell (xmlDocPtr doc,
102 char *filename,
103 xmlShellReadlineFunc input,
104 FILE *output);
105
Daniel Veillardf600e251999-12-18 15:32:46 +0000106#ifdef __cplusplus
107}
108#endif
Daniel Veillard361d8452000-04-03 19:48:13 +0000109
110#endif /* LIBXML_DEBUG_ENABLED */
Daniel Veillardbaf4cd51998-10-27 22:56:57 +0000111#endif /* __DEBUG_XML__ */