1#ifndef __TIDY_H__
2#define __TIDY_H__
3
4/** @file tidy.h - Defines HTML Tidy API implemented by tidy library.
5
6 Public interface is const-correct and doesn't explicitly depend
7 on any globals. Thus, thread-safety may be introduced w/out
8 changing the interface.
9
10 Looking ahead to a C++ wrapper, C functions always pass
11 this-equivalent as 1st arg.
12
13
14 Copyright (c) 1998-2008 World Wide Web Consortium
15 (Massachusetts Institute of Technology, European Research
16 Consortium for Informatics and Mathematics, Keio University).
17 All Rights Reserved.
18
19 CVS Info :
20
21 $Author: arnaud02 $
22 $Date: 2008/04/22 11:00:42 $
23 $Revision: 1.22 $
24
25 Contributing Author(s):
26
27 Dave Raggett <dsr@w3.org>
28
29 The contributing author(s) would like to thank all those who
30 helped with testing, bug fixes and suggestions for improvements.
31 This wouldn't have been possible without your help.
32
33 COPYRIGHT NOTICE:
34
35 This software and documentation is provided "as is," and
36 the copyright holders and contributing author(s) make no
37 representations or warranties, express or implied, including
38 but not limited to, warranties of merchantability or fitness
39 for any particular purpose or that the use of the software or
40 documentation will not infringe any third party patents,
41 copyrights, trademarks or other rights.
42
43 The copyright holders and contributing author(s) will not be held
44 liable for any direct, indirect, special or consequential damages
45 arising out of any use of the software or documentation, even if
46 advised of the possibility of such damage.
47
48 Permission is hereby granted to use, copy, modify, and distribute
49 this source code, or portions hereof, documentation and executables,
50 for any purpose, without fee, subject to the following restrictions:
51
52 1. The origin of this source code must not be misrepresented.
53 2. Altered versions must be plainly marked as such and must
54 not be misrepresented as being the original source.
55 3. This Copyright notice may not be removed or altered from any
56 source or altered source distribution.
57
58 The copyright holders and contributing author(s) specifically
59 permit, without fee, and encourage the use of this source code
60 as a component for supporting the Hypertext Markup Language in
61 commercial products. If you use this source code in a product,
62 acknowledgment is not required but would be appreciated.
63
64
65 Created 2001-05-20 by Charles Reitzel
66 Updated 2002-07-01 by Charles Reitzel - 1st Implementation
67
68*/
69
70#include "platform.h"
71#include "tidyenum.h"
72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77/** @defgroup Opaque Opaque Types
78**
79** Cast to implementation types within lib.
80** Reduces inter-dependencies/conflicts w/ application code.
81** @{
82*/
83
84/** @struct TidyDoc
85** Opaque document datatype
86*/
87opaque_type( TidyDoc );
88
89/** @struct TidyOption
90** Opaque option datatype
91*/
92opaque_type( TidyOption );
93
94/** @struct TidyNode
95** Opaque node datatype
96*/
97opaque_type( TidyNode );
98
99/** @struct TidyAttr
100** Opaque attribute datatype
101*/
102opaque_type( TidyAttr );
103
104/** @} end Opaque group */
105
106TIDY_STRUCT struct _TidyBuffer;
107typedef struct _TidyBuffer TidyBuffer;
108
109
110/** @defgroup Memory Memory Allocation
111**
112** Tidy uses a user provided allocator for all
113** memory allocations. If this allocator is
114** not provided, then a default allocator is
115** used which simply wraps standard C malloc/free
116** calls. These wrappers call the panic function
117** upon any failure. The default panic function
118** prints an out of memory message to stderr, and
119** calls exit(2).
120**
121** For applications in which it is unacceptable to
122** abort in the case of memory allocation, then the
123** panic function can be replaced with one which
124** longjmps() out of the tidy code. For this to
125** clean up completely, you should be careful not
126** to use any tidy methods that open files as these
127** will not be closed before panic() is called.
128**
129** TODO: associate file handles with tidyDoc and
130** ensure that tidyDocRelease() can close them all.
131**
132** Calling the withAllocator() family (
133** tidyCreateWithAllocator, tidyBufInitWithAllocator,
134** tidyBufAllocWithAllocator) allow settings custom
135** allocators).
136**
137** All parts of the document use the same allocator.
138** Calls that require a user provided buffer can
139** optionally use a different allocator.
140**
141** For reference in designing a plug-in allocator,
142** most allocations made by tidy are less than 100
143** bytes, corresponding to attribute names/values, etc.
144**
145** There is also an additional class of much larger
146** allocations which are where most of the data from
147** the lexer is stored. (It is not currently possible
148** to use a separate allocator for the lexer, this
149** would be a useful extension).
150**
151** In general, approximately 1/3rd of the memory
152** used by tidy is freed during the parse, so if
153** memory usage is an issue then an allocator that
154** can reuse this memory is a good idea.
155**
156** @{
157*/
158
159/** Prototype for the allocator's function table */
160struct _TidyAllocatorVtbl;
161/** The allocators function table */
162typedef struct _TidyAllocatorVtbl TidyAllocatorVtbl;
163
164/** Prototype for the allocator */
165struct _TidyAllocator;
166/** The allocator **/
167typedef struct _TidyAllocator TidyAllocator;
168
169/** An allocator's function table. All functions here must
170 be provided.
171 */
172struct _TidyAllocatorVtbl {
173 /** Called to allocate a block of nBytes of memory */
174 void* (TIDY_CALL *alloc)( TidyAllocator *self, size_t nBytes );
175 /** Called to resize (grow, in general) a block of memory.
176 Must support being called with NULL.
177 */
178 void* (TIDY_CALL *realloc)( TidyAllocator *self, void *block, size_t nBytes );
179 /** Called to free a previously allocated block of memory */
180 void (TIDY_CALL *free)( TidyAllocator *self, void *block);
181 /** Called when a panic condition is detected. Must support
182 block == NULL. This function is not called if either alloc
183 or realloc fails; it is up to the allocator to do this.
184 Currently this function can only be called if an error is
185 detected in the tree integrity via the internal function
186 CheckNodeIntegrity(). This is a situation that can
187 only arise in the case of a programming error in tidylib.
188 You can turn off node integrity checking by defining
189 the constant NO_NODE_INTEGRITY_CHECK during the build.
190 **/
191 void (TIDY_CALL *panic)( TidyAllocator *self, ctmbstr msg );
192};
193
194/** An allocator. To create your own allocator, do something like
195 the following:
196
197 typedef struct _MyAllocator {
198 TidyAllocator base;
199 ...other custom allocator state...
200 } MyAllocator;
201
202 void* MyAllocator_alloc(TidyAllocator *base, void *block, size_t nBytes)
203 {
204 MyAllocator *self = (MyAllocator*)base;
205 ...
206 }
207 (etc)
208
209 static const TidyAllocatorVtbl MyAllocatorVtbl = {
210 MyAllocator_alloc,
211 MyAllocator_realloc,
212 MyAllocator_free,
213 MyAllocator_panic
214 };
215
216 myAllocator allocator;
217 TidyDoc doc;
218
219 allocator.base.vtbl = &amp;MyAllocatorVtbl;
220 ...initialise allocator specific state...
221 doc = tidyCreateWithAllocator(&allocator);
222 ...
223
224 Although this looks slightly long winded, the advantage is that to create
225 a custom allocator you simply need to set the vtbl pointer correctly.
226 The vtbl itself can reside in static/global data, and hence does not
227 need to be initialised each time an allocator is created, and furthermore
228 the memory is shared amongst all created allocators.
229*/
230struct _TidyAllocator {
231 const TidyAllocatorVtbl *vtbl;
232};
233
234/** Callback for "malloc" replacement */
235typedef void* (TIDY_CALL *TidyMalloc)( size_t len );
236/** Callback for "realloc" replacement */
237typedef void* (TIDY_CALL *TidyRealloc)( void* buf, size_t len );
238/** Callback for "free" replacement */
239typedef void (TIDY_CALL *TidyFree)( void* buf );
240/** Callback for "out of memory" panic state */
241typedef void (TIDY_CALL *TidyPanic)( ctmbstr mssg );
242
243
244/** Give Tidy a malloc() replacement */
245TIDY_EXPORT Bool TIDY_CALL tidySetMallocCall( TidyMalloc fmalloc );
246/** Give Tidy a realloc() replacement */
247TIDY_EXPORT Bool TIDY_CALL tidySetReallocCall( TidyRealloc frealloc );
248/** Give Tidy a free() replacement */
249TIDY_EXPORT Bool TIDY_CALL tidySetFreeCall( TidyFree ffree );
250/** Give Tidy an "out of memory" handler */
251TIDY_EXPORT Bool TIDY_CALL tidySetPanicCall( TidyPanic fpanic );
252
253/** @} end Memory group */
254
255/** @defgroup Basic Basic Operations
256**
257** Tidy public interface
258**
259** Several functions return an integer document status:
260**
261** <pre>
262** 0 -> SUCCESS
263** >0 -> 1 == TIDY WARNING, 2 == TIDY ERROR
264** <0 -> SEVERE ERROR
265** </pre>
266**
267The following is a short example program.
268
269<pre>
270#include &lt;tidy.h&gt;
271#include &lt;buffio.h&gt;
272#include &lt;stdio.h&gt;
273#include &lt;errno.h&gt;
274
275
276int main(int argc, char **argv )
277{
278 const char* input = "&lt;title&gt;Foo&lt;/title&gt;&lt;p&gt;Foo!";
279 TidyBuffer output;
280 TidyBuffer errbuf;
281 int rc = -1;
282 Bool ok;
283
284 TidyDoc tdoc = tidyCreate(); // Initialize "document"
285 tidyBufInit( &amp;output );
286 tidyBufInit( &amp;errbuf );
287 printf( "Tidying:\t\%s\\n", input );
288
289 ok = tidyOptSetBool( tdoc, TidyXhtmlOut, yes ); // Convert to XHTML
290 if ( ok )
291 rc = tidySetErrorBuffer( tdoc, &amp;errbuf ); // Capture diagnostics
292 if ( rc &gt;= 0 )
293 rc = tidyParseString( tdoc, input ); // Parse the input
294 if ( rc &gt;= 0 )
295 rc = tidyCleanAndRepair( tdoc ); // Tidy it up!
296 if ( rc &gt;= 0 )
297 rc = tidyRunDiagnostics( tdoc ); // Kvetch
298 if ( rc &gt; 1 ) // If error, force output.
299 rc = ( tidyOptSetBool(tdoc, TidyForceOutput, yes) ? rc : -1 );
300 if ( rc &gt;= 0 )
301 rc = tidySaveBuffer( tdoc, &amp;output ); // Pretty Print
302
303 if ( rc &gt;= 0 )
304 {
305 if ( rc &gt; 0 )
306 printf( "\\nDiagnostics:\\n\\n\%s", errbuf.bp );
307 printf( "\\nAnd here is the result:\\n\\n\%s", output.bp );
308 }
309 else
310 printf( "A severe error (\%d) occurred.\\n", rc );
311
312 tidyBufFree( &amp;output );
313 tidyBufFree( &amp;errbuf );
314 tidyRelease( tdoc );
315 return rc;
316}
317</pre>
318** @{
319*/
320
321TIDY_EXPORT TidyDoc TIDY_CALL tidyCreate(void);
322TIDY_EXPORT TidyDoc TIDY_CALL tidyCreateWithAllocator( TidyAllocator *allocator );
323TIDY_EXPORT void TIDY_CALL tidyRelease( TidyDoc tdoc );
324
325/** Let application store a chunk of data w/ each Tidy instance.
326** Useful for callbacks.
327*/
328TIDY_EXPORT void TIDY_CALL tidySetAppData( TidyDoc tdoc, void* appData );
329
330/** Get application data set previously */
331TIDY_EXPORT void* TIDY_CALL tidyGetAppData( TidyDoc tdoc );
332
333/** Get release date (version) for current library */
334TIDY_EXPORT ctmbstr TIDY_CALL tidyReleaseDate(void);
335
336/* Diagnostics and Repair
337*/
338
339/** Get status of current document. */
340TIDY_EXPORT int TIDY_CALL tidyStatus( TidyDoc tdoc );
341
342/** Detected HTML version: 0, 2, 3 or 4 */
343TIDY_EXPORT int TIDY_CALL tidyDetectedHtmlVersion( TidyDoc tdoc );
344
345/** Input is XHTML? */
346TIDY_EXPORT Bool TIDY_CALL tidyDetectedXhtml( TidyDoc tdoc );
347
348/** Input is generic XML (not HTML or XHTML)? */
349TIDY_EXPORT Bool TIDY_CALL tidyDetectedGenericXml( TidyDoc tdoc );
350
351/** Number of Tidy errors encountered. If > 0, output is suppressed
352** unless TidyForceOutput is set.
353*/
354TIDY_EXPORT uint TIDY_CALL tidyErrorCount( TidyDoc tdoc );
355
356/** Number of Tidy warnings encountered. */
357TIDY_EXPORT uint TIDY_CALL tidyWarningCount( TidyDoc tdoc );
358
359/** Number of Tidy accessibility warnings encountered. */
360TIDY_EXPORT uint TIDY_CALL tidyAccessWarningCount( TidyDoc tdoc );
361
362/** Number of Tidy configuration errors encountered. */
363TIDY_EXPORT uint TIDY_CALL tidyConfigErrorCount( TidyDoc tdoc );
364
365/* Get/Set configuration options
366*/
367/** Load an ASCII Tidy configuration file */
368TIDY_EXPORT int TIDY_CALL tidyLoadConfig( TidyDoc tdoc, ctmbstr configFile );
369
370/** Load a Tidy configuration file with the specified character encoding */
371TIDY_EXPORT int TIDY_CALL tidyLoadConfigEnc( TidyDoc tdoc, ctmbstr configFile,
372 ctmbstr charenc );
373
374TIDY_EXPORT Bool TIDY_CALL tidyFileExists( TidyDoc tdoc, ctmbstr filename );
375
376
377/** Set the input/output character encoding for parsing markup.
378** Values include: ascii, latin1, raw, utf8, iso2022, mac,
379** win1252, utf16le, utf16be, utf16, big5 and shiftjis. Case in-sensitive.
380*/
381TIDY_EXPORT int TIDY_CALL tidySetCharEncoding( TidyDoc tdoc, ctmbstr encnam );
382
383/** Set the input encoding for parsing markup.
384** As for tidySetCharEncoding but only affects the input encoding
385**/
386TIDY_EXPORT int TIDY_CALL tidySetInCharEncoding( TidyDoc tdoc, ctmbstr encnam );
387
388/** Set the output encoding.
389**/
390TIDY_EXPORT int TIDY_CALL tidySetOutCharEncoding( TidyDoc tdoc, ctmbstr encnam );
391
392/** @} end Basic group */
393
394
395/** @defgroup Configuration Configuration Options
396**
397** Functions for getting and setting Tidy configuration options.
398** @{
399*/
400
401/** Applications using TidyLib may want to augment command-line and
402** configuration file options. Setting this callback allows an application
403** developer to examine command-line and configuration file options after
404** TidyLib has examined them and failed to recognize them.
405**/
406
407typedef Bool (TIDY_CALL *TidyOptCallback)( ctmbstr option, ctmbstr value );
408
409TIDY_EXPORT Bool TIDY_CALL tidySetOptionCallback( TidyDoc tdoc, TidyOptCallback pOptCallback );
410
411/** Get option ID by name */
412TIDY_EXPORT TidyOptionId TIDY_CALL tidyOptGetIdForName( ctmbstr optnam );
413
414/** Get iterator for list of option */
415/**
416Example:
417<pre>
418TidyIterator itOpt = tidyGetOptionList( tdoc );
419while ( itOpt )
420{
421 TidyOption opt = tidyGetNextOption( tdoc, &itOpt );
422 .. get/set option values ..
423}
424</pre>
425*/
426
427TIDY_EXPORT TidyIterator TIDY_CALL tidyGetOptionList( TidyDoc tdoc );
428/** Get next Option */
429TIDY_EXPORT TidyOption TIDY_CALL tidyGetNextOption( TidyDoc tdoc, TidyIterator* pos );
430
431/** Lookup option by ID */
432TIDY_EXPORT TidyOption TIDY_CALL tidyGetOption( TidyDoc tdoc, TidyOptionId optId );
433/** Lookup option by name */
434TIDY_EXPORT TidyOption TIDY_CALL tidyGetOptionByName( TidyDoc tdoc, ctmbstr optnam );
435
436/** Get ID of given Option */
437TIDY_EXPORT TidyOptionId TIDY_CALL tidyOptGetId( TidyOption opt );
438
439/** Get name of given Option */
440TIDY_EXPORT ctmbstr TIDY_CALL tidyOptGetName( TidyOption opt );
441
442/** Get datatype of given Option */
443TIDY_EXPORT TidyOptionType TIDY_CALL tidyOptGetType( TidyOption opt );
444
445/** Is Option read-only? */
446TIDY_EXPORT Bool TIDY_CALL tidyOptIsReadOnly( TidyOption opt );
447
448/** Get category of given Option */
449TIDY_EXPORT TidyConfigCategory TIDY_CALL tidyOptGetCategory( TidyOption opt );
450
451/** Get default value of given Option as a string */
452TIDY_EXPORT ctmbstr TIDY_CALL tidyOptGetDefault( TidyOption opt );
453
454/** Get default value of given Option as an unsigned integer */
455TIDY_EXPORT ulong TIDY_CALL tidyOptGetDefaultInt( TidyOption opt );
456
457/** Get default value of given Option as a Boolean value */
458TIDY_EXPORT Bool TIDY_CALL tidyOptGetDefaultBool( TidyOption opt );
459
460/** Iterate over Option "pick list" */
461TIDY_EXPORT TidyIterator TIDY_CALL tidyOptGetPickList( TidyOption opt );
462/** Get next string value of Option "pick list" */
463TIDY_EXPORT ctmbstr TIDY_CALL tidyOptGetNextPick( TidyOption opt, TidyIterator* pos );
464
465/** Get current Option value as a string */
466TIDY_EXPORT ctmbstr TIDY_CALL tidyOptGetValue( TidyDoc tdoc, TidyOptionId optId );
467/** Set Option value as a string */
468TIDY_EXPORT Bool TIDY_CALL tidyOptSetValue( TidyDoc tdoc, TidyOptionId optId, ctmbstr val );
469/** Set named Option value as a string. Good if not sure of type. */
470TIDY_EXPORT Bool TIDY_CALL tidyOptParseValue( TidyDoc tdoc, ctmbstr optnam, ctmbstr val );
471
472/** Get current Option value as an integer */
473TIDY_EXPORT ulong TIDY_CALL tidyOptGetInt( TidyDoc tdoc, TidyOptionId optId );
474/** Set Option value as an integer */
475TIDY_EXPORT Bool TIDY_CALL tidyOptSetInt( TidyDoc tdoc, TidyOptionId optId, ulong val );
476
477/** Get current Option value as a Boolean flag */
478TIDY_EXPORT Bool TIDY_CALL tidyOptGetBool( TidyDoc tdoc, TidyOptionId optId );
479/** Set Option value as a Boolean flag */
480TIDY_EXPORT Bool TIDY_CALL tidyOptSetBool( TidyDoc tdoc, TidyOptionId optId, Bool val );
481
482/** Reset option to default value by ID */
483TIDY_EXPORT Bool TIDY_CALL tidyOptResetToDefault( TidyDoc tdoc, TidyOptionId opt );
484/** Reset all options to their default values */
485TIDY_EXPORT Bool TIDY_CALL tidyOptResetAllToDefault( TidyDoc tdoc );
486
487/** Take a snapshot of current config settings */
488TIDY_EXPORT Bool TIDY_CALL tidyOptSnapshot( TidyDoc tdoc );
489/** Reset config settings to snapshot (after document processing) */
490TIDY_EXPORT Bool TIDY_CALL tidyOptResetToSnapshot( TidyDoc tdoc );
491
492/** Any settings different than default? */
493TIDY_EXPORT Bool TIDY_CALL tidyOptDiffThanDefault( TidyDoc tdoc );
494/** Any settings different than snapshot? */
495TIDY_EXPORT Bool TIDY_CALL tidyOptDiffThanSnapshot( TidyDoc tdoc );
496
497/** Copy current configuration settings from one document to another */
498TIDY_EXPORT Bool TIDY_CALL tidyOptCopyConfig( TidyDoc tdocTo, TidyDoc tdocFrom );
499
500/** Get character encoding name. Used with TidyCharEncoding,
501** TidyOutCharEncoding, TidyInCharEncoding */
502TIDY_EXPORT ctmbstr TIDY_CALL tidyOptGetEncName( TidyDoc tdoc, TidyOptionId optId );
503
504/** Get current pick list value for option by ID. Useful for enum types. */
505TIDY_EXPORT ctmbstr TIDY_CALL tidyOptGetCurrPick( TidyDoc tdoc, TidyOptionId optId);
506
507/** Iterate over user declared tags */
508TIDY_EXPORT TidyIterator TIDY_CALL tidyOptGetDeclTagList( TidyDoc tdoc );
509/** Get next declared tag of specified type: TidyInlineTags, TidyBlockTags,
510** TidyEmptyTags, TidyPreTags */
511TIDY_EXPORT ctmbstr TIDY_CALL tidyOptGetNextDeclTag( TidyDoc tdoc,
512 TidyOptionId optId,
513 TidyIterator* iter );
514/** Get option description */
515TIDY_EXPORT ctmbstr TIDY_CALL tidyOptGetDoc( TidyDoc tdoc, TidyOption opt );
516
517/** Iterate over a list of related options */
518TIDY_EXPORT TidyIterator TIDY_CALL tidyOptGetDocLinksList( TidyDoc tdoc,
519 TidyOption opt );
520/** Get next related option */
521TIDY_EXPORT TidyOption TIDY_CALL tidyOptGetNextDocLinks( TidyDoc tdoc,
522 TidyIterator* pos );
523
524/** @} end Configuration group */
525
526/** @defgroup IO I/O and Messages
527**
528** By default, Tidy will define, create and use
529** instances of input and output handlers for
530** standard C buffered I/O (i.e. FILE* stdin,
531** FILE* stdout and FILE* stderr for content
532** input, content output and diagnostic output,
533** respectively. A FILE* cfgFile input handler
534** will be used for config files. Command line
535** options will just be set directly.
536**
537** @{
538*/
539
540/*****************
541 Input Source
542*****************/
543/** Input Callback: get next byte of input */
544typedef int (TIDY_CALL *TidyGetByteFunc)( void* sourceData );
545
546/** Input Callback: unget a byte of input */
547typedef void (TIDY_CALL *TidyUngetByteFunc)( void* sourceData, byte bt );
548
549/** Input Callback: is end of input? */
550typedef Bool (TIDY_CALL *TidyEOFFunc)( void* sourceData );
551
552/** End of input "character" */
553#define EndOfStream (~0u)
554
555/** TidyInputSource - Delivers raw bytes of input
556*/
557TIDY_STRUCT
558typedef struct _TidyInputSource
559{
560 /* Instance data */
561 void* sourceData; /**< Input context. Passed to callbacks */
562
563 /* Methods */
564 TidyGetByteFunc getByte; /**< Pointer to "get byte" callback */
565 TidyUngetByteFunc ungetByte; /**< Pointer to "unget" callback */
566 TidyEOFFunc eof; /**< Pointer to "eof" callback */
567} TidyInputSource;
568
569/** Facilitates user defined source by providing
570** an entry point to marshal pointers-to-functions.
571** Needed by .NET and possibly other language bindings.
572*/
573TIDY_EXPORT Bool TIDY_CALL tidyInitSource( TidyInputSource* source,
574 void* srcData,
575 TidyGetByteFunc gbFunc,
576 TidyUngetByteFunc ugbFunc,
577 TidyEOFFunc endFunc );
578
579/** Helper: get next byte from input source */
580TIDY_EXPORT uint TIDY_CALL tidyGetByte( TidyInputSource* source );
581
582/** Helper: unget byte back to input source */
583TIDY_EXPORT void TIDY_CALL tidyUngetByte( TidyInputSource* source, uint byteValue );
584
585/** Helper: check if input source at end */
586TIDY_EXPORT Bool TIDY_CALL tidyIsEOF( TidyInputSource* source );
587
588
589/****************
590 Output Sink
591****************/
592/** Output callback: send a byte to output */
593typedef void (TIDY_CALL *TidyPutByteFunc)( void* sinkData, byte bt );
594
595
596/** TidyOutputSink - accepts raw bytes of output
597*/
598TIDY_STRUCT
599typedef struct _TidyOutputSink
600{
601 /* Instance data */
602 void* sinkData; /**< Output context. Passed to callbacks */
603
604 /* Methods */
605 TidyPutByteFunc putByte; /**< Pointer to "put byte" callback */
606} TidyOutputSink;
607
608/** Facilitates user defined sinks by providing
609** an entry point to marshal pointers-to-functions.
610** Needed by .NET and possibly other language bindings.
611*/
612TIDY_EXPORT Bool TIDY_CALL tidyInitSink( TidyOutputSink* sink,
613 void* snkData,
614 TidyPutByteFunc pbFunc );
615
616/** Helper: send a byte to output */
617TIDY_EXPORT void TIDY_CALL tidyPutByte( TidyOutputSink* sink, uint byteValue );
618
619
620/** Callback to filter messages by diagnostic level:
621** info, warning, etc. Just set diagnostic output
622** handler to redirect all diagnostics output. Return true
623** to proceed with output, false to cancel.
624*/
625typedef Bool (TIDY_CALL *TidyReportFilter)( TidyDoc tdoc, TidyReportLevel lvl,
626 uint line, uint col, ctmbstr mssg );
627
628/** Give Tidy a filter callback to use */
629TIDY_EXPORT Bool TIDY_CALL tidySetReportFilter( TidyDoc tdoc,
630 TidyReportFilter filtCallback );
631
632/** Set error sink to named file */
633TIDY_EXPORT FILE* TIDY_CALL tidySetErrorFile( TidyDoc tdoc, ctmbstr errfilnam );
634/** Set error sink to given buffer */
635TIDY_EXPORT int TIDY_CALL tidySetErrorBuffer( TidyDoc tdoc, TidyBuffer* errbuf );
636/** Set error sink to given generic sink */
637TIDY_EXPORT int TIDY_CALL tidySetErrorSink( TidyDoc tdoc, TidyOutputSink* sink );
638
639/** @} end IO group */
640
641/* TODO: Catalog all messages for easy translation
642TIDY_EXPORT ctmbstr tidyLookupMessage( int errorNo );
643*/
644
645
646
647/** @defgroup Parse Document Parse
648**
649** Parse markup from a given input source. String and filename
650** functions added for convenience. HTML/XHTML version determined
651** from input.
652** @{
653*/
654
655/** Parse markup in named file */
656TIDY_EXPORT int TIDY_CALL tidyParseFile( TidyDoc tdoc, ctmbstr filename );
657
658/** Parse markup from the standard input */
659TIDY_EXPORT int TIDY_CALL tidyParseStdin( TidyDoc tdoc );
660
661/** Parse markup in given string */
662TIDY_EXPORT int TIDY_CALL tidyParseString( TidyDoc tdoc, ctmbstr content );
663
664/** Parse markup in given buffer */
665TIDY_EXPORT int TIDY_CALL tidyParseBuffer( TidyDoc tdoc, TidyBuffer* buf );
666
667/** Parse markup in given generic input source */
668TIDY_EXPORT int TIDY_CALL tidyParseSource( TidyDoc tdoc, TidyInputSource* source);
669
670/** @} End Parse group */
671
672
673/** @defgroup Clean Diagnostics and Repair
674**
675** @{
676*/
677/** Execute configured cleanup and repair operations on parsed markup */
678TIDY_EXPORT int TIDY_CALL tidyCleanAndRepair( TidyDoc tdoc );
679
680/** Run configured diagnostics on parsed and repaired markup.
681** Must call tidyCleanAndRepair() first.
682*/
683TIDY_EXPORT int TIDY_CALL tidyRunDiagnostics( TidyDoc tdoc );
684
685/** @} end Clean group */
686
687
688/** @defgroup Save Document Save Functions
689**
690** Save currently parsed document to the given output sink. File name
691** and string/buffer functions provided for convenience.
692** @{
693*/
694
695/** Save to named file */
696TIDY_EXPORT int TIDY_CALL tidySaveFile( TidyDoc tdoc, ctmbstr filename );
697
698/** Save to standard output (FILE*) */
699TIDY_EXPORT int TIDY_CALL tidySaveStdout( TidyDoc tdoc );
700
701/** Save to given TidyBuffer object */
702TIDY_EXPORT int TIDY_CALL tidySaveBuffer( TidyDoc tdoc, TidyBuffer* buf );
703
704/** Save document to application buffer. If buffer is not big enough,
705** ENOMEM will be returned and the necessary buffer size will be placed
706** in *buflen.
707*/
708TIDY_EXPORT int TIDY_CALL tidySaveString( TidyDoc tdoc,
709 tmbstr buffer, uint* buflen );
710
711/** Save to given generic output sink */
712TIDY_EXPORT int TIDY_CALL tidySaveSink( TidyDoc tdoc, TidyOutputSink* sink );
713
714/** @} end Save group */
715
716
717/** @addtogroup Basic
718** @{
719*/
720/** Save current settings to named file.
721 Only non-default values are written. */
722TIDY_EXPORT int TIDY_CALL tidyOptSaveFile( TidyDoc tdoc, ctmbstr cfgfil );
723
724/** Save current settings to given output sink.
725 Only non-default values are written. */
726TIDY_EXPORT int TIDY_CALL tidyOptSaveSink( TidyDoc tdoc, TidyOutputSink* sink );
727
728
729/* Error reporting functions
730*/
731
732/** Write more complete information about errors to current error sink. */
733TIDY_EXPORT void TIDY_CALL tidyErrorSummary( TidyDoc tdoc );
734
735/** Write more general information about markup to current error sink. */
736TIDY_EXPORT void TIDY_CALL tidyGeneralInfo( TidyDoc tdoc );
737
738/** @} end Basic group (again) */
739
740
741/** @defgroup Tree Document Tree
742**
743** A parsed and, optionally, repaired document is
744** represented by Tidy as a Tree, much like a W3C DOM.
745** This tree may be traversed using these functions.
746** The following snippet gives a basic idea how these
747** functions can be used.
748**
749<pre>
750void dumpNode( TidyNode tnod, int indent )
751{
752 TidyNode child;
753
754 for ( child = tidyGetChild(tnod); child; child = tidyGetNext(child) )
755 {
756 ctmbstr name;
757 switch ( tidyNodeGetType(child) )
758 {
759 case TidyNode_Root: name = "Root"; break;
760 case TidyNode_DocType: name = "DOCTYPE"; break;
761 case TidyNode_Comment: name = "Comment"; break;
762 case TidyNode_ProcIns: name = "Processing Instruction"; break;
763 case TidyNode_Text: name = "Text"; break;
764 case TidyNode_CDATA: name = "CDATA"; break;
765 case TidyNode_Section: name = "XML Section"; break;
766 case TidyNode_Asp: name = "ASP"; break;
767 case TidyNode_Jste: name = "JSTE"; break;
768 case TidyNode_Php: name = "PHP"; break;
769 case TidyNode_XmlDecl: name = "XML Declaration"; break;
770
771 case TidyNode_Start:
772 case TidyNode_End:
773 case TidyNode_StartEnd:
774 default:
775 name = tidyNodeGetName( child );
776 break;
777 }
778 assert( name != NULL );
779 printf( "\%*.*sNode: \%s\\n", indent, indent, " ", name );
780 dumpNode( child, indent + 4 );
781 }
782}
783
784void dumpDoc( TidyDoc tdoc )
785{
786 dumpNode( tidyGetRoot(tdoc), 0 );
787}
788
789void dumpBody( TidyDoc tdoc )
790{
791 dumpNode( tidyGetBody(tdoc), 0 );
792}
793</pre>
794
795@{
796
797*/
798
799TIDY_EXPORT TidyNode TIDY_CALL tidyGetRoot( TidyDoc tdoc );
800TIDY_EXPORT TidyNode TIDY_CALL tidyGetHtml( TidyDoc tdoc );
801TIDY_EXPORT TidyNode TIDY_CALL tidyGetHead( TidyDoc tdoc );
802TIDY_EXPORT TidyNode TIDY_CALL tidyGetBody( TidyDoc tdoc );
803
804/* parent / child */
805TIDY_EXPORT TidyNode TIDY_CALL tidyGetParent( TidyNode tnod );
806TIDY_EXPORT TidyNode TIDY_CALL tidyGetChild( TidyNode tnod );
807
808/* siblings */
809TIDY_EXPORT TidyNode TIDY_CALL tidyGetNext( TidyNode tnod );
810TIDY_EXPORT TidyNode TIDY_CALL tidyGetPrev( TidyNode tnod );
811
812/* Null for non-element nodes and all pure HTML
813TIDY_EXPORT ctmbstr tidyNodeNsLocal( TidyNode tnod );
814TIDY_EXPORT ctmbstr tidyNodeNsPrefix( TidyNode tnod );
815TIDY_EXPORT ctmbstr tidyNodeNsUri( TidyNode tnod );
816*/
817
818/* Iterate over attribute values */
819TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrFirst( TidyNode tnod );
820TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrNext( TidyAttr tattr );
821
822TIDY_EXPORT ctmbstr TIDY_CALL tidyAttrName( TidyAttr tattr );
823TIDY_EXPORT ctmbstr TIDY_CALL tidyAttrValue( TidyAttr tattr );
824
825/* Null for pure HTML
826TIDY_EXPORT ctmbstr tidyAttrNsLocal( TidyAttr tattr );
827TIDY_EXPORT ctmbstr tidyAttrNsPrefix( TidyAttr tattr );
828TIDY_EXPORT ctmbstr tidyAttrNsUri( TidyAttr tattr );
829*/
830
831/** @} end Tree group */
832
833
834/** @defgroup NodeAsk Node Interrogation
835**
836** Get information about any givent node.
837** @{
838*/
839
840/* Node info */
841TIDY_EXPORT TidyNodeType TIDY_CALL tidyNodeGetType( TidyNode tnod );
842TIDY_EXPORT ctmbstr TIDY_CALL tidyNodeGetName( TidyNode tnod );
843
844TIDY_EXPORT Bool TIDY_CALL tidyNodeIsText( TidyNode tnod );
845TIDY_EXPORT Bool TIDY_CALL tidyNodeIsProp( TidyDoc tdoc, TidyNode tnod );
846TIDY_EXPORT Bool TIDY_CALL tidyNodeIsHeader( TidyNode tnod ); /* h1, h2, ... */
847
848TIDY_EXPORT Bool TIDY_CALL tidyNodeHasText( TidyDoc tdoc, TidyNode tnod );
849TIDY_EXPORT Bool TIDY_CALL tidyNodeGetText( TidyDoc tdoc, TidyNode tnod, TidyBuffer* buf );
850
851/* Copy the unescaped value of this node into the given TidyBuffer as UTF-8 */
852TIDY_EXPORT Bool TIDY_CALL tidyNodeGetValue( TidyDoc tdoc, TidyNode tnod, TidyBuffer* buf );
853
854TIDY_EXPORT TidyTagId TIDY_CALL tidyNodeGetId( TidyNode tnod );
855
856TIDY_EXPORT uint TIDY_CALL tidyNodeLine( TidyNode tnod );
857TIDY_EXPORT uint TIDY_CALL tidyNodeColumn( TidyNode tnod );
858
859/** @defgroup NodeIsElementName Deprecated node interrogation per TagId
860**
861** @deprecated The functions tidyNodeIs{ElementName} are deprecated and
862** should be replaced by tidyNodeGetId.
863** @{
864*/
865TIDY_EXPORT Bool TIDY_CALL tidyNodeIsHTML( TidyNode tnod );
866TIDY_EXPORT Bool TIDY_CALL tidyNodeIsHEAD( TidyNode tnod );
867TIDY_EXPORT Bool TIDY_CALL tidyNodeIsTITLE( TidyNode tnod );
868TIDY_EXPORT Bool TIDY_CALL tidyNodeIsBASE( TidyNode tnod );
869TIDY_EXPORT Bool TIDY_CALL tidyNodeIsMETA( TidyNode tnod );
870TIDY_EXPORT Bool TIDY_CALL tidyNodeIsBODY( TidyNode tnod );
871TIDY_EXPORT Bool TIDY_CALL tidyNodeIsFRAMESET( TidyNode tnod );
872TIDY_EXPORT Bool TIDY_CALL tidyNodeIsFRAME( TidyNode tnod );
873TIDY_EXPORT Bool TIDY_CALL tidyNodeIsIFRAME( TidyNode tnod );
874TIDY_EXPORT Bool TIDY_CALL tidyNodeIsNOFRAMES( TidyNode tnod );
875TIDY_EXPORT Bool TIDY_CALL tidyNodeIsHR( TidyNode tnod );
876TIDY_EXPORT Bool TIDY_CALL tidyNodeIsH1( TidyNode tnod );
877TIDY_EXPORT Bool TIDY_CALL tidyNodeIsH2( TidyNode tnod );
878TIDY_EXPORT Bool TIDY_CALL tidyNodeIsPRE( TidyNode tnod );
879TIDY_EXPORT Bool TIDY_CALL tidyNodeIsLISTING( TidyNode tnod );
880TIDY_EXPORT Bool TIDY_CALL tidyNodeIsP( TidyNode tnod );
881TIDY_EXPORT Bool TIDY_CALL tidyNodeIsUL( TidyNode tnod );
882TIDY_EXPORT Bool TIDY_CALL tidyNodeIsOL( TidyNode tnod );
883TIDY_EXPORT Bool TIDY_CALL tidyNodeIsDL( TidyNode tnod );
884TIDY_EXPORT Bool TIDY_CALL tidyNodeIsDIR( TidyNode tnod );
885TIDY_EXPORT Bool TIDY_CALL tidyNodeIsLI( TidyNode tnod );
886TIDY_EXPORT Bool TIDY_CALL tidyNodeIsDT( TidyNode tnod );
887TIDY_EXPORT Bool TIDY_CALL tidyNodeIsDD( TidyNode tnod );
888TIDY_EXPORT Bool TIDY_CALL tidyNodeIsTABLE( TidyNode tnod );
889TIDY_EXPORT Bool TIDY_CALL tidyNodeIsCAPTION( TidyNode tnod );
890TIDY_EXPORT Bool TIDY_CALL tidyNodeIsTD( TidyNode tnod );
891TIDY_EXPORT Bool TIDY_CALL tidyNodeIsTH( TidyNode tnod );
892TIDY_EXPORT Bool TIDY_CALL tidyNodeIsTR( TidyNode tnod );
893TIDY_EXPORT Bool TIDY_CALL tidyNodeIsCOL( TidyNode tnod );
894TIDY_EXPORT Bool TIDY_CALL tidyNodeIsCOLGROUP( TidyNode tnod );
895TIDY_EXPORT Bool TIDY_CALL tidyNodeIsBR( TidyNode tnod );
896TIDY_EXPORT Bool TIDY_CALL tidyNodeIsA( TidyNode tnod );
897TIDY_EXPORT Bool TIDY_CALL tidyNodeIsLINK( TidyNode tnod );
898TIDY_EXPORT Bool TIDY_CALL tidyNodeIsB( TidyNode tnod );
899TIDY_EXPORT Bool TIDY_CALL tidyNodeIsI( TidyNode tnod );
900TIDY_EXPORT Bool TIDY_CALL tidyNodeIsSTRONG( TidyNode tnod );
901TIDY_EXPORT Bool TIDY_CALL tidyNodeIsEM( TidyNode tnod );
902TIDY_EXPORT Bool TIDY_CALL tidyNodeIsBIG( TidyNode tnod );
903TIDY_EXPORT Bool TIDY_CALL tidyNodeIsSMALL( TidyNode tnod );
904TIDY_EXPORT Bool TIDY_CALL tidyNodeIsPARAM( TidyNode tnod );
905TIDY_EXPORT Bool TIDY_CALL tidyNodeIsOPTION( TidyNode tnod );
906TIDY_EXPORT Bool TIDY_CALL tidyNodeIsOPTGROUP( TidyNode tnod );
907TIDY_EXPORT Bool TIDY_CALL tidyNodeIsIMG( TidyNode tnod );
908TIDY_EXPORT Bool TIDY_CALL tidyNodeIsMAP( TidyNode tnod );
909TIDY_EXPORT Bool TIDY_CALL tidyNodeIsAREA( TidyNode tnod );
910TIDY_EXPORT Bool TIDY_CALL tidyNodeIsNOBR( TidyNode tnod );
911TIDY_EXPORT Bool TIDY_CALL tidyNodeIsWBR( TidyNode tnod );
912TIDY_EXPORT Bool TIDY_CALL tidyNodeIsFONT( TidyNode tnod );
913TIDY_EXPORT Bool TIDY_CALL tidyNodeIsLAYER( TidyNode tnod );
914TIDY_EXPORT Bool TIDY_CALL tidyNodeIsSPACER( TidyNode tnod );
915TIDY_EXPORT Bool TIDY_CALL tidyNodeIsCENTER( TidyNode tnod );
916TIDY_EXPORT Bool TIDY_CALL tidyNodeIsSTYLE( TidyNode tnod );
917TIDY_EXPORT Bool TIDY_CALL tidyNodeIsSCRIPT( TidyNode tnod );
918TIDY_EXPORT Bool TIDY_CALL tidyNodeIsNOSCRIPT( TidyNode tnod );
919TIDY_EXPORT Bool TIDY_CALL tidyNodeIsFORM( TidyNode tnod );
920TIDY_EXPORT Bool TIDY_CALL tidyNodeIsTEXTAREA( TidyNode tnod );
921TIDY_EXPORT Bool TIDY_CALL tidyNodeIsBLOCKQUOTE( TidyNode tnod );
922TIDY_EXPORT Bool TIDY_CALL tidyNodeIsAPPLET( TidyNode tnod );
923TIDY_EXPORT Bool TIDY_CALL tidyNodeIsOBJECT( TidyNode tnod );
924TIDY_EXPORT Bool TIDY_CALL tidyNodeIsDIV( TidyNode tnod );
925TIDY_EXPORT Bool TIDY_CALL tidyNodeIsSPAN( TidyNode tnod );
926TIDY_EXPORT Bool TIDY_CALL tidyNodeIsINPUT( TidyNode tnod );
927TIDY_EXPORT Bool TIDY_CALL tidyNodeIsQ( TidyNode tnod );
928TIDY_EXPORT Bool TIDY_CALL tidyNodeIsLABEL( TidyNode tnod );
929TIDY_EXPORT Bool TIDY_CALL tidyNodeIsH3( TidyNode tnod );
930TIDY_EXPORT Bool TIDY_CALL tidyNodeIsH4( TidyNode tnod );
931TIDY_EXPORT Bool TIDY_CALL tidyNodeIsH5( TidyNode tnod );
932TIDY_EXPORT Bool TIDY_CALL tidyNodeIsH6( TidyNode tnod );
933TIDY_EXPORT Bool TIDY_CALL tidyNodeIsADDRESS( TidyNode tnod );
934TIDY_EXPORT Bool TIDY_CALL tidyNodeIsXMP( TidyNode tnod );
935TIDY_EXPORT Bool TIDY_CALL tidyNodeIsSELECT( TidyNode tnod );
936TIDY_EXPORT Bool TIDY_CALL tidyNodeIsBLINK( TidyNode tnod );
937TIDY_EXPORT Bool TIDY_CALL tidyNodeIsMARQUEE( TidyNode tnod );
938TIDY_EXPORT Bool TIDY_CALL tidyNodeIsEMBED( TidyNode tnod );
939TIDY_EXPORT Bool TIDY_CALL tidyNodeIsBASEFONT( TidyNode tnod );
940TIDY_EXPORT Bool TIDY_CALL tidyNodeIsISINDEX( TidyNode tnod );
941TIDY_EXPORT Bool TIDY_CALL tidyNodeIsS( TidyNode tnod );
942TIDY_EXPORT Bool TIDY_CALL tidyNodeIsSTRIKE( TidyNode tnod );
943TIDY_EXPORT Bool TIDY_CALL tidyNodeIsU( TidyNode tnod );
944TIDY_EXPORT Bool TIDY_CALL tidyNodeIsMENU( TidyNode tnod );
945
946/** @} End NodeIsElementName group */
947
948/** @} End NodeAsk group */
949
950
951/** @defgroup Attribute Attribute Interrogation
952**
953** Get information about any given attribute.
954** @{
955*/
956
957TIDY_EXPORT TidyAttrId TIDY_CALL tidyAttrGetId( TidyAttr tattr );
958TIDY_EXPORT Bool TIDY_CALL tidyAttrIsEvent( TidyAttr tattr );
959TIDY_EXPORT Bool TIDY_CALL tidyAttrIsProp( TidyAttr tattr );
960
961/** @defgroup AttrIsAttributeName Deprecated attribute interrogation per AttrId
962**
963** @deprecated The functions tidyAttrIs{AttributeName} are deprecated and
964** should be replaced by tidyAttrGetId.
965** @{
966*/
967TIDY_EXPORT Bool TIDY_CALL tidyAttrIsHREF( TidyAttr tattr );
968TIDY_EXPORT Bool TIDY_CALL tidyAttrIsSRC( TidyAttr tattr );
969TIDY_EXPORT Bool TIDY_CALL tidyAttrIsID( TidyAttr tattr );
970TIDY_EXPORT Bool TIDY_CALL tidyAttrIsNAME( TidyAttr tattr );
971TIDY_EXPORT Bool TIDY_CALL tidyAttrIsSUMMARY( TidyAttr tattr );
972TIDY_EXPORT Bool TIDY_CALL tidyAttrIsALT( TidyAttr tattr );
973TIDY_EXPORT Bool TIDY_CALL tidyAttrIsLONGDESC( TidyAttr tattr );
974TIDY_EXPORT Bool TIDY_CALL tidyAttrIsUSEMAP( TidyAttr tattr );
975TIDY_EXPORT Bool TIDY_CALL tidyAttrIsISMAP( TidyAttr tattr );
976TIDY_EXPORT Bool TIDY_CALL tidyAttrIsLANGUAGE( TidyAttr tattr );
977TIDY_EXPORT Bool TIDY_CALL tidyAttrIsTYPE( TidyAttr tattr );
978TIDY_EXPORT Bool TIDY_CALL tidyAttrIsVALUE( TidyAttr tattr );
979TIDY_EXPORT Bool TIDY_CALL tidyAttrIsCONTENT( TidyAttr tattr );
980TIDY_EXPORT Bool TIDY_CALL tidyAttrIsTITLE( TidyAttr tattr );
981TIDY_EXPORT Bool TIDY_CALL tidyAttrIsXMLNS( TidyAttr tattr );
982TIDY_EXPORT Bool TIDY_CALL tidyAttrIsDATAFLD( TidyAttr tattr );
983TIDY_EXPORT Bool TIDY_CALL tidyAttrIsWIDTH( TidyAttr tattr );
984TIDY_EXPORT Bool TIDY_CALL tidyAttrIsHEIGHT( TidyAttr tattr );
985TIDY_EXPORT Bool TIDY_CALL tidyAttrIsFOR( TidyAttr tattr );
986TIDY_EXPORT Bool TIDY_CALL tidyAttrIsSELECTED( TidyAttr tattr );
987TIDY_EXPORT Bool TIDY_CALL tidyAttrIsCHECKED( TidyAttr tattr );
988TIDY_EXPORT Bool TIDY_CALL tidyAttrIsLANG( TidyAttr tattr );
989TIDY_EXPORT Bool TIDY_CALL tidyAttrIsTARGET( TidyAttr tattr );
990TIDY_EXPORT Bool TIDY_CALL tidyAttrIsHTTP_EQUIV( TidyAttr tattr );
991TIDY_EXPORT Bool TIDY_CALL tidyAttrIsREL( TidyAttr tattr );
992TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnMOUSEMOVE( TidyAttr tattr );
993TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnMOUSEDOWN( TidyAttr tattr );
994TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnMOUSEUP( TidyAttr tattr );
995TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnCLICK( TidyAttr tattr );
996TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnMOUSEOVER( TidyAttr tattr );
997TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnMOUSEOUT( TidyAttr tattr );
998TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnKEYDOWN( TidyAttr tattr );
999TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnKEYUP( TidyAttr tattr );
1000TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnKEYPRESS( TidyAttr tattr );
1001TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnFOCUS( TidyAttr tattr );
1002TIDY_EXPORT Bool TIDY_CALL tidyAttrIsOnBLUR( TidyAttr tattr );
1003TIDY_EXPORT Bool TIDY_CALL tidyAttrIsBGCOLOR( TidyAttr tattr );
1004TIDY_EXPORT Bool TIDY_CALL tidyAttrIsLINK( TidyAttr tattr );
1005TIDY_EXPORT Bool TIDY_CALL tidyAttrIsALINK( TidyAttr tattr );
1006TIDY_EXPORT Bool TIDY_CALL tidyAttrIsVLINK( TidyAttr tattr );
1007TIDY_EXPORT Bool TIDY_CALL tidyAttrIsTEXT( TidyAttr tattr );
1008TIDY_EXPORT Bool TIDY_CALL tidyAttrIsSTYLE( TidyAttr tattr );
1009TIDY_EXPORT Bool TIDY_CALL tidyAttrIsABBR( TidyAttr tattr );
1010TIDY_EXPORT Bool TIDY_CALL tidyAttrIsCOLSPAN( TidyAttr tattr );
1011TIDY_EXPORT Bool TIDY_CALL tidyAttrIsROWSPAN( TidyAttr tattr );
1012
1013/** @} End AttrIsAttributeName group */
1014
1015/** @} end AttrAsk group */
1016
1017
1018/** @defgroup AttrGet Attribute Retrieval
1019**
1020** Lookup an attribute from a given node
1021** @{
1022*/
1023
1024TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetById( TidyNode tnod, TidyAttrId attId );
1025
1026/** @defgroup AttrGetAttributeName Deprecated attribute retrieval per AttrId
1027**
1028** @deprecated The functions tidyAttrGet{AttributeName} are deprecated and
1029** should be replaced by tidyAttrGetById.
1030** For instance, tidyAttrGetID( TidyNode tnod ) can be replaced by
1031** tidyAttrGetById( TidyNode tnod, TidyAttr_ID ). This avoids a potential
1032** name clash with tidyAttrGetId for case-insensitive languages.
1033** @{
1034*/
1035TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetHREF( TidyNode tnod );
1036TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetSRC( TidyNode tnod );
1037TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetID( TidyNode tnod );
1038TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetNAME( TidyNode tnod );
1039TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetSUMMARY( TidyNode tnod );
1040TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetALT( TidyNode tnod );
1041TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetLONGDESC( TidyNode tnod );
1042TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetUSEMAP( TidyNode tnod );
1043TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetISMAP( TidyNode tnod );
1044TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetLANGUAGE( TidyNode tnod );
1045TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetTYPE( TidyNode tnod );
1046TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetVALUE( TidyNode tnod );
1047TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetCONTENT( TidyNode tnod );
1048TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetTITLE( TidyNode tnod );
1049TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetXMLNS( TidyNode tnod );
1050TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetDATAFLD( TidyNode tnod );
1051TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetWIDTH( TidyNode tnod );
1052TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetHEIGHT( TidyNode tnod );
1053TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetFOR( TidyNode tnod );
1054TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetSELECTED( TidyNode tnod );
1055TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetCHECKED( TidyNode tnod );
1056TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetLANG( TidyNode tnod );
1057TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetTARGET( TidyNode tnod );
1058TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetHTTP_EQUIV( TidyNode tnod );
1059TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetREL( TidyNode tnod );
1060TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnMOUSEMOVE( TidyNode tnod );
1061TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnMOUSEDOWN( TidyNode tnod );
1062TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnMOUSEUP( TidyNode tnod );
1063TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnCLICK( TidyNode tnod );
1064TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnMOUSEOVER( TidyNode tnod );
1065TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnMOUSEOUT( TidyNode tnod );
1066TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnKEYDOWN( TidyNode tnod );
1067TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnKEYUP( TidyNode tnod );
1068TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnKEYPRESS( TidyNode tnod );
1069TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnFOCUS( TidyNode tnod );
1070TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetOnBLUR( TidyNode tnod );
1071TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetBGCOLOR( TidyNode tnod );
1072TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetLINK( TidyNode tnod );
1073TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetALINK( TidyNode tnod );
1074TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetVLINK( TidyNode tnod );
1075TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetTEXT( TidyNode tnod );
1076TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetSTYLE( TidyNode tnod );
1077TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetABBR( TidyNode tnod );
1078TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetCOLSPAN( TidyNode tnod );
1079TIDY_EXPORT TidyAttr TIDY_CALL tidyAttrGetROWSPAN( TidyNode tnod );
1080
1081/** @} End AttrGetAttributeName group */
1082
1083/** @} end AttrGet group */
1084
1085#ifdef __cplusplus
1086} /* extern "C" */
1087#endif
1088#endif /* __TIDY_H__ */
1089
1090/*
1091 * local variables:
1092 * mode: c
1093 * indent-tabs-mode: nil
1094 * c-basic-offset: 4
1095 * eval: (c-set-offset 'substatement-open 0)
1096 * end:
1097 */
1098