HTML Tidy  0.1
I/O and Messages

Data Structures

struct  _TidyInputSource
 
struct  _TidyOutputSink
 

Macros

#define EndOfStream   (~0u)
 

Typedefs

typedef int(TIDY_CALL * TidyGetByteFunc) (void *sourceData)
 
typedef void(TIDY_CALL * TidyUngetByteFunc) (void *sourceData, byte bt)
 
typedef Bool(TIDY_CALL * TidyEOFFunc) (void *sourceData)
 
typedef TIDY_STRUCT struct _TidyInputSource TidyInputSource
 
typedef void(TIDY_CALL * TidyPutByteFunc) (void *sinkData, byte bt)
 
typedef TIDY_STRUCT struct _TidyOutputSink TidyOutputSink
 
typedef Bool(TIDY_CALL * TidyReportFilter) (TidyDoc tdoc, TidyReportLevel lvl, uint line, uint col, ctmbstr mssg)
 

Functions

Bool TIDY_CALL tidyInitSource (TidyInputSource *source, void *srcData, TidyGetByteFunc gbFunc, TidyUngetByteFunc ugbFunc, TidyEOFFunc endFunc)
 
uint TIDY_CALL tidyGetByte (TidyInputSource *source)
 
void TIDY_CALL tidyUngetByte (TidyInputSource *source, uint byteValue)
 
Bool TIDY_CALL tidyIsEOF (TidyInputSource *source)
 
Bool TIDY_CALL tidyInitSink (TidyOutputSink *sink, void *snkData, TidyPutByteFunc pbFunc)
 
void TIDY_CALL tidyPutByte (TidyOutputSink *sink, uint byteValue)
 
Bool TIDY_CALL tidySetReportFilter (TidyDoc tdoc, TidyReportFilter filtCallback)
 
FILE *TIDY_CALL tidySetErrorFile (TidyDoc tdoc, ctmbstr errfilnam)
 
int TIDY_CALL tidySetErrorBuffer (TidyDoc tdoc, TidyBuffer *errbuf)
 
int TIDY_CALL tidySetErrorSink (TidyDoc tdoc, TidyOutputSink *sink)
 

Detailed Description

By default, Tidy will define, create and use instances of input and output handlers for standard C buffered I/O (i.e. FILE* stdin, FILE* stdout and FILE* stderr for content input, content output and diagnostic output, respectively. A FILE* cfgFile input handler will be used for config files. Command line options will just be set directly.

Macro Definition Documentation

◆ EndOfStream

#define EndOfStream   (~0u)

End of input "character"

Typedef Documentation

◆ TidyGetByteFunc

typedef int(TIDY_CALL * TidyGetByteFunc) (void *sourceData)

Input Callback: get next byte of input

◆ TidyUngetByteFunc

typedef void(TIDY_CALL * TidyUngetByteFunc) (void *sourceData, byte bt)

Input Callback: unget a byte of input

◆ TidyEOFFunc

typedef Bool(TIDY_CALL * TidyEOFFunc) (void *sourceData)

Input Callback: is end of input?

◆ TidyInputSource

typedef TIDY_STRUCT struct _TidyInputSource TidyInputSource

TidyInputSource - Delivers raw bytes of input

◆ TidyPutByteFunc

typedef void(TIDY_CALL * TidyPutByteFunc) (void *sinkData, byte bt)

Output callback: send a byte to output

◆ TidyOutputSink

typedef TIDY_STRUCT struct _TidyOutputSink TidyOutputSink

TidyOutputSink - accepts raw bytes of output

◆ TidyReportFilter

typedef Bool(TIDY_CALL * TidyReportFilter) (TidyDoc tdoc, TidyReportLevel lvl, uint line, uint col, ctmbstr mssg)

Callback to filter messages by diagnostic level: info, warning, etc. Just set diagnostic output handler to redirect all diagnostics output. Return true to proceed with output, false to cancel.

Function Documentation

◆ tidyInitSource()

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. Needed by .NET and possibly other language bindings.

◆ tidyGetByte()

uint TIDY_CALL tidyGetByte ( TidyInputSource source)

Helper: get next byte from input source

◆ tidyUngetByte()

void TIDY_CALL tidyUngetByte ( TidyInputSource source,
uint  byteValue 
)

Helper: unget byte back to input source

◆ tidyIsEOF()

Bool TIDY_CALL tidyIsEOF ( TidyInputSource source)

Helper: check if input source at end

◆ tidyInitSink()

Bool TIDY_CALL tidyInitSink ( TidyOutputSink sink,
void *  snkData,
TidyPutByteFunc  pbFunc 
)

Facilitates user defined sinks by providing an entry point to marshal pointers-to-functions. Needed by .NET and possibly other language bindings.

◆ tidyPutByte()

void TIDY_CALL tidyPutByte ( TidyOutputSink sink,
uint  byteValue 
)

Helper: send a byte to output

◆ tidySetReportFilter()

Bool TIDY_CALL tidySetReportFilter ( TidyDoc  tdoc,
TidyReportFilter  filtCallback 
)

Give Tidy a filter callback to use

◆ tidySetErrorFile()

FILE* TIDY_CALL tidySetErrorFile ( TidyDoc  tdoc,
ctmbstr  errfilnam 
)

Set error sink to named file

◆ tidySetErrorBuffer()

int TIDY_CALL tidySetErrorBuffer ( TidyDoc  tdoc,
TidyBuffer errbuf 
)

Set error sink to given buffer

◆ tidySetErrorSink()

int TIDY_CALL tidySetErrorSink ( TidyDoc  tdoc,
TidyOutputSink sink 
)

Set error sink to given generic sink