4 /* pprint.h -- pretty print parse tree
6 (c) 1998-2007 (W3C) MIT, ERCIM, Keio University
7 See tidy.h for the copyright notice.
14 Block-level and unknown elements are printed on
15 new lines and their contents indented 2 spaces
17 Inline elements are printed inline.
19 Inline content is wrapped on spaces (except in
20 attribute values or preformatted text, after
21 start tags and before end tags
25 #define PREFORMATTED 1u
27 #define ATTRIBVALUE 4u
32 /* The pretty printer keeps at most two lines of text in the
33 ** buffer before flushing output. We need to capture the
34 ** indent state (indent level) at the _beginning_ of _each_
35 ** line, not the end of just the second line.
37 ** We must also keep track "In Attribute" and "In String"
38 ** states at the _end_ of each line,
41 typedef struct _TidyIndent
48 typedef struct _TidyPrintImpl
50 TidyAllocator *allocator; /* Allocator */
58 TidyIndent indent[2]; /* Two lines worth of indent state */
62 #if 0 && SUPPORT_ASIAN_ENCODINGS
63 /* #431953 - start RJ Wraplen adjusted for smooth international ride */
64 uint CWrapLen( TidyDocImpl* doc, uint ind );
67 void TY_(InitPrintBuf)( TidyDocImpl* doc );
68 void TY_(FreePrintBuf)( TidyDocImpl* doc );
70 void TY_(PFlushLine)( TidyDocImpl* doc, uint indent );
73 /* print just the content of the body element.
74 ** useful when you want to reuse material from
77 ** -- Sebastiano Vigna <vigna@dsi.unimi.it>
80 void TY_(PrintBody)( TidyDocImpl* doc ); /* you can print an entire document */
81 /* node as body using PPrintTree() */
83 void TY_(PPrintTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node );
85 void TY_(PPrintXMLTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node );
88 #endif /* __PPRINT_H__ */