blob: 5d4d2ae1d2763ec46d63ac5e80a8adc584f139f0 [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 Veillardbaf4cd51998-10-27 22:56:57 +000011#include "tree.h"
Daniel Veillarddbfd6411999-12-28 16:35:14 +000012#include "xpath.h"
Daniel Veillardbaf4cd51998-10-27 22:56:57 +000013
Daniel Veillardf600e251999-12-18 15:32:46 +000014#ifdef __cplusplus
Daniel Veillard5cb5ab81999-12-21 15:35:29 +000015extern "C" {
Daniel Veillardf600e251999-12-18 15:32:46 +000016#endif
Daniel Veillarddbfd6411999-12-28 16:35:14 +000017
18/*
19 * The standard Dump routines
20 */
21void xmlDebugDumpString (FILE *output,
22 const xmlChar *str);
23void xmlDebugDumpAttr (FILE *output,
24 xmlAttrPtr attr,
25 int depth);
26void xmlDebugDumpAttrList (FILE *output,
27 xmlAttrPtr attr,
28 int depth);
29void xmlDebugDumpOneNode (FILE *output,
30 xmlNodePtr node,
31 int depth);
32void xmlDebugDumpNode (FILE *output,
33 xmlNodePtr node,
34 int depth);
35void xmlDebugDumpNodeList (FILE *output,
36 xmlNodePtr node,
37 int depth);
38void xmlDebugDumpDocumentHead(FILE *output,
39 xmlDocPtr doc);
40void xmlDebugDumpDocument (FILE *output,
41 xmlDocPtr doc);
42void xmlDebugDumpEntities (FILE *output,
43 xmlDocPtr doc);
44void xmlLsOneNode (FILE *output,
45 xmlNodePtr node);
46
47/****************************************************************
48 * *
49 * The XML shell related structures and functions *
50 * *
51 ****************************************************************/
52
53/**
54 * xmlShellReadlineFunc:
55 * @prompt: a string prompt
56 *
57 * This is a generic signature for the XML shell input function
58 *
59 * Returns a string which will be freed by the Shell
60 */
61typedef char * (* xmlShellReadlineFunc)(char *prompt);
62
63/*
64 * The shell context itself
65 * TODO: add the defined function tables.
66 */
Daniel Veillard71b656e2000-01-05 14:46:17 +000067typedef struct _xmlShellCtxt xmlShellCtxt;
68typedef xmlShellCtxt *xmlShellCtxtPtr;
69struct _xmlShellCtxt {
Daniel Veillarddbfd6411999-12-28 16:35:14 +000070 char *filename;
71 xmlDocPtr doc;
72 xmlNodePtr node;
73 xmlXPathContextPtr pctxt;
74 int loaded;
75 FILE *output;
76 xmlShellReadlineFunc input;
Daniel Veillard71b656e2000-01-05 14:46:17 +000077};
Daniel Veillarddbfd6411999-12-28 16:35:14 +000078
79/**
80 * xmlShellCmd:
81 * @ctxt: a shell context
82 * @arg: a string argument
83 * @node: a first node
84 * @node2: a second node
85 *
86 * This is a generic signature for the XML shell functions
87 *
88 * Returns an int, negative returns indicating errors
89 */
90typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
91 char *arg,
92 xmlNodePtr node,
93 xmlNodePtr node2);
94
95/*
96 * The Shell interface.
97 */
98void xmlShell (xmlDocPtr doc,
99 char *filename,
100 xmlShellReadlineFunc input,
101 FILE *output);
102
Daniel Veillardf600e251999-12-18 15:32:46 +0000103#ifdef __cplusplus
104}
105#endif
Daniel Veillardbaf4cd51998-10-27 22:56:57 +0000106#endif /* __DEBUG_XML__ */