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