blob: 8774f0bd1bc8b7030fb12c405963ea77b462c570 [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 */
67typedef struct xmlShellCtxt {
68 char *filename;
69 xmlDocPtr doc;
70 xmlNodePtr node;
71 xmlXPathContextPtr pctxt;
72 int loaded;
73 FILE *output;
74 xmlShellReadlineFunc input;
75} xmlShellCtxt, *xmlShellCtxtPtr;
76
77/**
78 * xmlShellCmd:
79 * @ctxt: a shell context
80 * @arg: a string argument
81 * @node: a first node
82 * @node2: a second node
83 *
84 * This is a generic signature for the XML shell functions
85 *
86 * Returns an int, negative returns indicating errors
87 */
88typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
89 char *arg,
90 xmlNodePtr node,
91 xmlNodePtr node2);
92
93/*
94 * The Shell interface.
95 */
96void xmlShell (xmlDocPtr doc,
97 char *filename,
98 xmlShellReadlineFunc input,
99 FILE *output);
100
Daniel Veillardf600e251999-12-18 15:32:46 +0000101#ifdef __cplusplus
102}
103#endif
Daniel Veillardbaf4cd51998-10-27 22:56:57 +0000104#endif /* __DEBUG_XML__ */