~ubuntu-branches/ubuntu/gutsy/tidy/gutsy

« back to all changes in this revision

Viewing changes to include/tidy.h

  • Committer: Bazaar Package Importer
  • Author(s): Jason Thomas
  • Date: 2005-04-20 11:22:49 UTC
  • mfrom: (0.2.1 upstream) (1.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050420112249-mygnr5vcrutwsen3
Tags: 20050415-1
New upstream release 

Show diffs side-by-side

added added

removed removed

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