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