Expand description
§tidy-sys
Rust bindings for the HTML Tidy library.
§Documentation
§Note About Vendored Dependencies
The source code for Tidy is vendored in this repository for ease of use, under the vendor/
directory.
Otherwise this is an unassociated project.
Also note that Tidy has its own license; this crate’s license is for files excluding the vendor/
directory.
§Requirements
This crate will build the Tidy library from source and generate bindings depending on the target platform. Some external tools are required:
- CMake (Tidy uses CMake as the build system)
- A C compiler (to compile Tidy)
- Clang (as bindgen needs it)
§The Default Build Configuration
Tidy will be built with:
-DNDEBUG
, regardless of the rust profile (not setting it causes Tidy to debug-log to stderr uncontrollably)- CMake profile always set to
Release
as other values cause problems with Visual Studio generators - Optimization level matching the rust build’s opt-level (overwritten with
CFLAGS
andTIDY_SYS_CFLAGS
)
§Setting Build Options
This crate respects the standard environment variables used by C compilers and related tools, such as CC
, CFLAGS
, LD
etc.
In addition, you can set the TIDY_SYS_CFLAGS
environment variable; the values will be appended to CFLAGS
while building Tidy.
§Crate Features
Currently there’s only one feature, by default disabled:
localization
: Enable multi-language support in Tidy (sets theSUPPORT_LOCALIZATIONS
option toon
with CMake).
Structs§
- _IO_
FILE - _IO_
codecvt - _IO_
marker - _IO_
wide_ data - _Tidy
Allocator - Tidy’s built-in default allocator.
- _Tidy
Allocator Vtbl - //** @defgroup Memory Memory Allocation
- _Tidy
Attr - _Tidy
Buffer - @name Forward declarations and typedefs. @{
- _Tidy
Doc - _Tidy
Input Source - This type defines an input source capable of delivering raw bytes of input.
- _Tidy
Iterator - _Tidy
Message - _Tidy
Message Argument - _Tidy
Node - _Tidy
Option - _Tidy
Output Sink - This type defines an output destination capable of accepting raw bytes of output
- __
va_ list_ tag - _tidy
Locale MapItem
Enums§
- Tidy
Attr Id - Known HTML attributes
- Tidy
Attr Sort Strategy - Mode controlling treatment of sorting attributes @remark This enum’s starting value is guaranteed to remain stable.
- Tidy
Config Category - Categories of Tidy configuration options, which are used mostly by user interfaces to sort Tidy options into related groups.
- Tidy
Doctype Modes - Mode controlling treatment of doctype @remark This enum’s starting value is guaranteed to remain stable.
- Tidy
DupAttr Modes - Mode controlling treatment of duplicate Attributes @remark This enum’s starting value is guaranteed to remain stable.
- Tidy
Encoding Options - TidyEncodingOptions option values specify the input and/or output encoding. @remark This enum’s starting value is guaranteed to remain stable.
- Tidy
Format Parameter Type - Indicates the data type of a format string parameter used when Tidy
emits reports and dialogue as part of the messaging callback functions.
See
messageobj.h
for more information on this API. - Tidy
Line Ending - TidyNewline option values to control output line endings. @remark This enum’s starting value is guaranteed to remain stable.
- Tidy
Node Type - Node types
- Tidy
Option Id - Option IDs are used used to get and/or set configuration option values and retrieve their descriptions.
- Tidy
Option Type - A Tidy configuration option can have one of these data types.
- Tidy
Report Level - Message severity level, used throughout LibTidy to indicate the severity or status of a message
- Tidy
TagId - Known HTML element types
- Tidy
TriState - AutoBool values used by ParseBool, ParseTriState, ParseIndent, ParseBOM @remark This enum’s starting value is guaranteed to remain stable.
- Tidy
Uppercase - Mode controlling capitalization of things, such as attributes. @remark This enum’s starting value is guaranteed to remain stable.
- Tidy
UseCustom Tags State - Values used by ParseUseCustomTags, which describes how Autonomous Custom tags (ACT’s) found by Tidy are treated.
- tidy
Strings - The enumeration contains a list of every possible string that Tidy and the console application can output, except for strings from the following enumerations:
Constants§
- Auto
State - Bool_no
- Bool_
yes - EndOf
Stream - FILENAMES_
CASE_ SENSITIVE - HAS_
FUTIME - HAS_
VSNPRINTF - NoState
- PLATFORM_
NAME - PRESERVE_
FILE_ TIMES - SUPPORT_
CONSOLE_ APP - SUPPORT_
LOCALIZATIONS - SUPPORT_
POSIX_ MAPPED_ FILES - UTIME_
NEEDS_ CLOSED_ FILE - YesState
Functions§
- Tidy
Lang ⚠Posix Name - Given a
tidyLocaleMapItem
, return the POSIX name. @param item An instance of tidyLocaleMapItem to query. @result Returns a string with the POSIX name of the mapping. - Tidy
Lang ⚠Windows Name - Given a
tidyLocaleMapItem
, return the Windows name. @param item An instance of tidyLocaleMapItem to query. @result Returns a string with the Windows name of the mapping. - getError
Code ⚠List - Initiates an iterator for a list of message codes available in Tidy. This iterator allows you to iterate through all of the code. In orde to iterate through the codes, initiate the iterator with this function, and then use getNextErrorCode() to retrieve the first and subsequent codes. For example: @code{.c} TidyIterator itMessage = getErrorCodeList(); while ( itMessage ) { uint code = getNextErrorCode( &itMessage ); // do something with the code, such as lookup a string. } @endcode @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- getInstalled
Language ⚠List - Initiates an iterator for a list of Tidy’s installed languages. This iterator allows you to iterate through this list. In order to iterate through the list, initiate the iterator with this function, and then use use getNextInstalledLanguage() to retrieve the first and subsequent strings. For example: @code{.c} TidyIterator itList = getInstalledLanguageList(); while ( itList ) { printf(“%s”, getNextInstalledLanguage( &itList )); } @endcode @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- getNext
Error ⚠Code - Given a valid TidyIterator initiated with getErrorCodeList(), returns an instance of the opaque type TidyMessageArgument, which serves as a token against which the remaining argument API functions may be used to query information. @param iter The TidyIterator (initiated with getErrorCodeList()) token. @result Returns a message code.
- getNext
Installed ⚠Language - Given a valid TidyIterator initiated with getInstalledLanguageList(), returns a string representing a language name that is installed in Tidy. @param iter The TidyIterator (initiated with getInstalledLanguageList()) token. @result Returns a string indicating the installed language.
- getNext
String ⚠Key - Given a valid TidyIterator initiated with getStringKeyList(), returns an unsigned integer representing the next key value. @remark These are provided for documentation generation purposes, and probably aren’t of much use to the average LibTidy implementor. @param iter The TidyIterator (initiated with getStringKeyList()) token. @result Returns a message code.
- getNext
Windows ⚠Language - Given a valid TidyIterator initiated with getWindowsLanguageList(), returns a pointer to a tidyLocaleMapItem, which can be further interrogated with TidyLangWindowsName() or TidyLangPosixName(). @param iter The TidyIterator (initiated with getWindowsLanguageList()) token. @result Returns a pointer to a tidyLocaleMapItem.
- getString
KeyList ⚠ - Initiates an iterator for a list of string key codes available in Tidy. This iterator allows you to iterate through all of the codes. In order to iterate through the codes, initiate the iterator with this function, and then use getNextStringKey() to retrieve the first and subsequent codes. For example: @code{.c} TidyIterator itKey = getErrorCodeList(); while ( itKey ) { uint code = getNextStringKey( &itKey ); // do something with the code, such as lookup a string. } @endcode @remark These are provided for documentation generation purposes, and probably aren’t of much use to the average LibTidy implementor. @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- getWindows
Language ⚠List - Initiates an iterator for a list of Tidy’s Windows<->POSIX locale mappings. This iterator allows you to iterate through this list. In order to iterate through the list, initiate the iterator with this function, and then use getNextWindowsLanguage() to retrieve the first and subsequent codes. For example: @code{.c} TidyIterator itList = getWindowsLanguageList(); while ( itList ) { tidyLocaleMapItem *item = getNextWindowsLanguage( &itList ); // do something such as get the TidyLangWindowsName(item). } @endcode @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- tidy
Access ⚠Warning Count - Indicates the number of TidyAccess messages that were generated. @param tdoc An instance of a TidyDoc to query. @result Returns the number of TidyAccess messages that were generated.
- tidy
Attr ⚠Discard - Discard an attribute.
- tidy
Attr ⚠First - Get the first attribute. @param tnod The node for which to get attributes. @result Returns an instance of TidyAttr.
- tidy
Attr ⚠GetBy Id - Get an instance of TidyAttr by specifying an attribute ID. @result Returns a TidyAttr instance.
- tidy
Attr ⚠GetId - Get the attribute ID given a tidy attribute. @param tattr The attribute to query. @result Returns the TidyAttrId of the given attribute.
- tidy
Attr ⚠IsEvent - Indicates whether or not a given attribute is an event attribute. @param tattr The attribute to query. @result Returns a bool indicating whether or not the attribute is an event.
- tidy
Attr ⚠Name - Get the name of a TidyAttr instance. @param tattr The tidy attribute to query. @result Returns a string indicating the name of the attribute.
- tidy
Attr ⚠Next - Get the next attribute. @param tattr The current attribute, so the next one can be returned. @result Returns and instance of TidyAttr.
- tidy
Attr ⚠Value - Get the value of a TidyAttr instance. @param tattr The tidy attribute to query. @result Returns a string indicating the value of the attribute.
- tidy
BufAlloc ⚠ - Free current buffer, allocate given amount, reset input pointer, use the default allocator
- tidy
BufAlloc ⚠With Allocator - Free current buffer, allocate given amount, reset input pointer, use the given custom allocator
- tidy
BufAppend ⚠ - Append bytes to buffer. Expand if necessary.
- tidy
BufAttach ⚠ - Attach to existing buffer
- tidy
BufCheck ⚠Alloc - Expand buffer to given size. Chunk size is minimum growth. Pass 0 for default of 256 bytes.
- tidy
BufClear ⚠ - Set buffer bytes to 0
- tidy
BufDetach ⚠ - Detach from buffer. Caller must free.
- tidy
BufEnd ⚠OfInput - At end of buffer?
- tidy
BufFree ⚠ - Free current contents and zero out
- tidy
BufGet ⚠Byte - Get byte from front of buffer. Increment input offset.
- tidy
BufInit ⚠ - Initialize data structure using the default allocator
- tidy
BufInit ⚠With Allocator - Initialize data structure using the given custom allocator
- tidy
BufPop ⚠Byte - Get byte from end of buffer
- tidy
BufPut ⚠Byte - Append one byte to buffer. Expand if necessary.
- tidy
BufUnget ⚠Byte - Put a byte back into the buffer. Decrement input offset.
- tidy
Clean ⚠AndRepair - Execute configured cleanup and repair operations on parsed markup. @param tdoc The tidy document to use. @result An integer representing the status.
- tidy
Config ⚠Error Count - Indicates the number of configuration error messages that were generated. @param tdoc An instance of a TidyDoc to query. @result Returns the number of configuration error messages that were generated.
- tidy
Create ⚠ - The primary creation of a document instance. Instances of a TidyDoc are used
throughout the API as a token to represent a particular document. You must
create at least one TidyDoc instance to initialize the library and begin
interaction with the API. When done using a TidyDoc instance, be sure to
tidyRelease(myTidyDoc);
in order to free related memory. @result Returns a TidyDoc instance. - tidy
Create ⚠With Allocator - Create a document supplying your own, custom TidyAllocator instead of using the built-in default. See the @ref Memory module if you want to create and use your own allocator. @param allocator The allocator to use for creating the document. @result Returns a TidyDoc instance.
- tidy
Default ⚠String - Provides a string given
messageType
in the default localization (which isen
). @param messageType The message type. @result Returns the desired string. - tidy
Detected ⚠Generic Xml - Indicates whether or not the input document was XML. If TidyXml tags is
true, or there was an XML declaration in the input document, then this
function will return yes.
@param tdoc An instance of a TidyDoc to query.
@result Returns
yes
if the input document was XML. - tidy
Detected ⚠Html Version - Gets the version of HTML that was output, as an integer, times 100. For example, HTML5 will return 500; HTML4.0.1 will return 401. @param tdoc An instance of a TidyDoc to query. @result Returns the HTML version number (x100).
- tidy
Detected ⚠Xhtml - Indicates whether the output document is or isn’t XHTML.
@param tdoc An instance of a TidyDoc to query.
@result Returns
yes
if the document is an XHTML type. - tidy
Discard ⚠Element - Remove the indicated node. @result Returns the next tidy node.
- tidy
Error ⚠Code AsKey - Given a message code, return the text key that represents it. @param code The error code to lookup. @result The string representing the error code.
- tidy
Error ⚠Code From Key - Given a text key representing a message code, return the uint that represents it.
- tidy
Error ⚠Count - Indicates the number of TidyError messages that were generated. For any
value greater than
0
, output is suppressed unless TidyForceOutput is set. @param tdoc An instance of a TidyDoc to query. @result Returns the number of TidyError messages that were generated. - tidy
Error ⚠Summary - Write more complete information about errors to current error sink. @param tdoc An instance of a TidyDoc to query.
- tidy
File ⚠Exists - Determine whether or not a particular file exists. On Unix systems, the use
of the tilde to represent the user’s home directory is supported.
@result Returns
yes
orno
, indicating whether or not the file exists. - tidy
General ⚠Info - Write more general information about markup to current error sink. @param tdoc An instance of a TidyDoc to query.
- tidy
GetApp ⚠Data - Returns the data previously stored with
tidySetAppData()
. @param tdoc document where data has been stored. @result The pointer to the data block previously stored. - tidy
GetArg ⚠Format - Returns the format specifier of the given message argument. The memory for this string is cleared upon termination of the callback, so do be sure to make your own copy. @result Returns the format specifier string of the given argument.
- tidy
GetArg ⚠Type - Returns the
TidyFormatParameterType
of the given message argument. @result Returns the type of parameter of type TidyFormatParameterType. - tidy
GetArg ⚠Value Double - Returns the double value of the given message argument. An assertion will be generated if the argument type is not a double. @result Returns the double value of the given argument.
- tidy
GetArg ⚠Value Int - Returns the integer value of the given message argument. An assertion will be generated if the argument type is not an integer. @result Returns the integer value of the given argument.
- tidy
GetArg ⚠Value String - Returns the string value of the given message argument. An assertion will be generated if the argument type is not a string. @result Returns the string value of the given argument.
- tidy
GetArg ⚠ValueU Int - Returns the unsigned integer value of the given message argument. An assertion will be generated if the argument type is not an unsigned int. @result Returns the unsigned integer value of the given argument.
- tidy
GetBody ⚠ - Get the BODY node. @param tdoc The document to query. @result Returns a tidy node.
- tidy
GetByte ⚠ - Helper: get next byte from input source. @param source A pointer to your input source. @result Returns a byte as an unsigned integer.
- tidy
GetChild ⚠ - Get the child of the indicated node. @param tnod The node to query. @result Returns a tidy node.
- tidy
GetEmacs ⚠File - Get the file path to use for reports when
TidyEmacs
is being used. This function provides a proper interface for using the hidden, internal-onlyTidyEmacsFile
configuration option. @param tdoc The tidy document for which you want to fetch the file path. @result Returns a string indicating the file path. - tidy
GetHead ⚠ - Get the HEAD node. @param tdoc The document to query. @result Returns a tidy node.
- tidy
GetHtml ⚠ - Get the HTML node. @param tdoc The document to query. @result Returns a tidy node.
- tidy
GetLanguage ⚠ - Gets the current language used by Tidy. @result Returns a string indicating the currently set language.
- tidy
GetMessage ⚠ - Get the message with the format string already completed, in Tidy’s current localization. @param tmessage Specify the message that you are querying. @result Returns the message in the current localization.
- tidy
GetMessage ⚠Arguments - Initiates an iterator for a list of arguments related to a given message. This iterator allows you to iterate through all of the arguments, if any. In order to iterate through the arguments, initiate the iterator with this function, and then use tidyGetNextMessageArgument() to retrieve the first and subsequent arguments. For example: @code{.c} TidyIterator itArg = tidyGetMessageArguments( tmessage ); while ( itArg ) { TidyMessageArgument my_arg = tidyGetNextMessageArgument( tmessage, &itArg ); // do something with my_arg, such as inspect its value or format } @endcode @param tmessage The message about whose arguments you wish to query. @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- tidy
GetMessage ⚠Code - Get the message code. @param tmessage Specify the message that you are querying. @result Returns a code representing the message. This code can be used directly with the localized strings API; however we never make any guarantees about the value of these codes. For code stability don’t store this value in your own application. Instead use the enum field or use the message key string value.
- tidy
GetMessage ⚠Column - Get the column the message applies to. @param tmessage Specify the message that you are querying. @result Returns the column number, if any, that generated the message.
- tidy
GetMessage ⚠Default - Get the message with the format string already completed, in Tidy’s default localization. @param tmessage Specify the message that you are querying. @result Returns the message in the default localization.
- tidy
GetMessage ⚠Doc - Get the tidy document this message comes from. @param tmessage Specify the message that you are querying. @result Returns the TidyDoc that generated the message.
- tidy
GetMessage ⚠Format - Get the localized format string. If a localized version of the format string doesn’t exist, then the default version will be returned. @param tmessage Specify the message that you are querying. @result Returns the localized format string of the message.
- tidy
GetMessage ⚠Format Default - Get the default format string, which is the format string for the message in Tidy’s default localization (en_us). @param tmessage Specify the message that you are querying. @result Returns the default localization format string of the message.
- tidy
GetMessage ⚠IsMuted - Get the muted status of the message, that is, whether or not the current configuration indicated that this message should be muted. @param tmessage Specify the message that you are querying. @result Returns a Bool indicating that the config indicates muting this message.
- tidy
GetMessage ⚠Key - Get the message key string. @param tmessage Specify the message that you are querying. @result Returns a string representing the message. This string is intended to be stable by the LibTidy API, and is suitable for use as a key in your own applications.
- tidy
GetMessage ⚠Level - Get the TidyReportLevel of the message. @param tmessage Specify the message that you are querying. @result Returns a TidyReportLevel indicating the severity or status of the message.
- tidy
GetMessage ⚠Line - Get the line number the message applies to. @param tmessage Specify the message that you are querying. @result Returns the line number, if any, that generated the message.
- tidy
GetMessage ⚠Output - Get the complete message as Tidy would emit it in the current localization. @param tmessage Specify the message that you are querying. @result Returns the complete message just as Tidy would display it on the console.
- tidy
GetMessage ⚠Output Default - Get the complete message as Tidy would emit it in the default localization. @param tmessage Specify the message that you are querying. @result Returns the complete message just as Tidy would display it on the console.
- tidy
GetMessage ⚠Pos - Get the position part part of the message in the current language. @param tmessage Specify the message that you are querying. @result Returns the positional part of a string as Tidy would display it in the console application.
- tidy
GetMessage ⚠PosDefault - Get the position part part of the message in the default language. @param tmessage Specify the message that you are querying. @result Returns the positional part of a string as Tidy would display it in the console application.
- tidy
GetMessage ⚠Prefix - Get the prefix part of a message in the current language. @param tmessage Specify the message that you are querying. @result Returns the message prefix part of a string as Tidy would display it in the console application.
- tidy
GetMessage ⚠Prefix Default - Get the prefix part of a message in the default language. @param tmessage Specify the message that you are querying. @result Returns the message prefix part of a string as Tidy would display it in the console application.
- tidy
GetNext ⚠ - Get the next sibling node. @param tnod The node to query. @result Returns a tidy node.
- tidy
GetNext ⚠Message Argument - Given a valid TidyIterator initiated with tidyGetMessageArguments(), returns an instance of the opaque type TidyMessageArgument, which serves as a token against which the remaining argument API functions may be used to query information. @result Returns an instance of TidyMessageArgument.
- tidy
GetNext ⚠Option - Given a valid TidyIterator initiated with tidyGetOptionList(), returns
the instance of the next TidyOption.
@note This function will return internal-only option types including
TidyInternalCategory
; you should never use these. Always ensure that you usetidyOptGetCategory()
before assuming that an option is okay to use in your application. @result An instance of TidyOption. - tidy
GetOption ⚠ - Retrieves an instance of TidyOption given a valid TidyOptionId. @result An instance of TidyOption matching the provided TidyOptionId.
- tidy
GetOption ⚠ByName - Returns an instance of TidyOption by providing the name of a Tidy
configuration option.
@result The TidyOption of the given
optname
. - tidy
GetOption ⚠List - Initiates an iterator for a list of TidyOption instances, which allows you to iterate through all of the available options. In order to iterate through the available options, initiate the iterator with this function, and then use tidyGetNextOption() to retrieve the first and subsequent options. For example: @code{.c} TidyIterator itOpt = tidyGetOptionList( tdoc ); while ( itOpt ) { TidyOption opt = tidyGetNextOption( tdoc, &itOpt ); // Use other API to query or set set option values } @endcode @param tdoc An instance of a TidyDoc to query. @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- tidy
GetParent ⚠ - Get the parent of the indicated node. @param tnod The node to query. @result Returns a tidy node.
- tidy
GetPrev ⚠ - Get the previous sibling node. @param tnod The node to query. @result Returns a tidy node.
- tidy
GetRoot ⚠ - Get the root node. @param tdoc The document to query. @result Returns a tidy node.
- tidy
Init ⚠Input Buffer - Initialize a buffer input source
- tidy
Init ⚠Output Buffer - Initialize a buffer output sink
- tidy
Init ⚠Sink - Facilitates user defined sinks by providing an entry point to marshal pointers-to-functions. This is needed by .NET, and possibly other language bindings. @result Returns a bool indicating success or failure.
- tidy
Init ⚠Source - Facilitates user defined source by providing an entry point to marshal pointers-to-functions. This is needed by .NET, and possibly other language bindings. @result Returns a bool indicating success or failure.
- tidy
IsEOF ⚠ - Helper: check if input source at end. @param source The input source. @result Returns a bool indicating whether or not the source is at EOF.
- tidy
Library ⚠Version - Get the version number for the current library. @result The string representing the version number.
- tidy
Load ⚠Config - Load an ASCII Tidy configuration file and set the configuration per its contents. Reports config option errors, which can be filtered. @result Returns 0 upon success, or any other value if there was an option error.
- tidy
Load ⚠Config Enc - Load a Tidy configuration file with the specified character encoding, and set the configuration per its contents. Reports config option errors, which can be filtered. @result Returns 0 upon success, or any other value if there was an option error.
- tidy
Localized ⚠String - Provides a string given
messageType
in the current localization for the single case. @param messageType The message type. @result Returns the desired string. - tidy
Localized ⚠StringN - Provides a string given
messageType
in the current localization forquantity
. Some strings have one or more plural forms, and this function will ensure that the correct singular or plural form is returned for the specified quantity. @result Returns the desired string. - tidy
Node ⚠Column - Get the column location of the node. @param tnod The node to query. @result Returns the column location of the node.
- tidy
Node ⚠GetId - Get the tag ID of the node. @param tnod The node to query. @result Returns the tag ID of the node as TidyTagId.
- tidy
Node ⚠GetName - Get the name of the node. @param tnod The node to query. @result Returns a string indicating the name of the node.
- tidy
Node ⚠GetText - Gets the text of a node and places it into the given TidyBuffer. The text will be terminated with a
TidyNewline
. If you want the raw utf-8 stream seetidyNodeGetValue()
. @result Returns a bool indicating success or not. - tidy
Node ⚠GetType - Get the type of node. @param tnod The node to query. @result Returns the type of node as TidyNodeType.
- tidy
Node ⚠GetValue - Get the value of the node. This copies the unescaped value of this node into the given TidyBuffer at UTF-8. @result Returns a bool indicating success or not.
- tidy
Node ⚠HasText - Indicates whether or not the node has text. @result Returns the type of node as TidyNodeType.
- tidy
Node ⚠IsHeader - Indicates whether or not a node represents and HTML header element, such as h1, h2, etc. @param tnod The node to query. @result Returns a bool indicating whether or not the node is an HTML header.
- tidy
Node ⚠IsProp - Indicates whether or not the node is a propriety type. @result Returns a bool indicating whether or not the node is a proprietary type.
- tidy
Node ⚠IsText - Indicates whether or not a node is a text node. @param tnod The node to query. @result Returns a bool indicating whether or not the node is a text node.
- tidy
Node ⚠Line - Get the line number where the node occurs. @param tnod The node to query. @result Returns the line number.
- tidy
OptCopy ⚠Config - Copy current configuration settings from one document to another. Note that the destination document’s existing settings will be stored as that document’s snapshot prior to having its option values overwritten by the source document’s settings. @result Returns a bool indicating success or failure.
- tidy
OptDiff ⚠Than Default - Any settings different than default? @param tdoc The tidy document to check. @result Returns a bool indicating whether or not a difference exists.
- tidy
OptDiff ⚠Than Snapshot - Any settings different than snapshot? @param tdoc The tidy document to check. @result Returns a bool indicating whether or not a difference exists.
- tidy
OptGet ⚠Bool - Get current option value as a Boolean flag. @result Returns a bool indicating the value.
- tidy
OptGet ⚠Category - Get category of given Option @param opt An instance of a TidyOption to query. @result The TidyConfigCategory of the specified option.
- tidy
OptGet ⚠Curr Pick - Get the current pick list value for the option ID, which can be useful for enum types. @result Returns a string indicating the current value of the specified option.
- tidy
OptGet ⚠Decl TagList - Initiates an iterator for a list of user-declared tags, including autonomous custom tags detected in the document if @ref TidyUseCustomTags is not set to no. This iterator allows you to iterate through all of the custom tags. In order to iterate through the tags, initiate the iterator with this function, and then use tidyOptGetNextDeclTag() to retrieve the first and subsequent tags. For example: @code{.c} TidyIterator itTag = tidyOptGetDeclTagList( tdoc ); while ( itTag ) { printf(“%s”, tidyOptGetNextDeclTag( tdoc, TidyBlockTags, &itTag )); } @endcode @param tdoc An instance of a TidyDoc to query. @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- tidy
OptGet ⚠Default - Get default value of given Option as a string @param opt An instance of a TidyOption to query. @result A string indicating the default value of the specified option.
- tidy
OptGet ⚠Default Bool - Get default value of given Option as a Boolean value @param opt An instance of a TidyOption to query. @result A boolean indicating the default value of the specified option.
- tidy
OptGet ⚠Default Int - Get default value of given Option as an unsigned integer @param opt An instance of a TidyOption to query. @result An unsigned integer indicating the default value of the specified option.
- tidy
OptGet ⚠Doc - Get the description of the specified option. @result Returns a string containing a description of the given option.
- tidy
OptGet ⚠DocLinks List - Initiates an iterator for a list of options related to a given option. This iterator allows you to iterate through all of the related options, if any. In order to iterate through the options, initiate the iterator with this function, and then use tidyOptGetNextDocLinks() to retrieve the first and subsequent options. For example: @code{.c} TidyIterator itOpt = tidyOptGetDocLinksList( tdoc, TidyJoinStyles ); while ( itOpt ) { TidyOption my_option = tidyOptGetNextDocLinks( tdoc, &itOpt ); // do something with my_option } @endcode @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- tidy
OptGet ⚠EncName - Get character encoding name. Used with @ref TidyCharEncoding, @ref TidyOutCharEncoding, and @ref TidyInCharEncoding. @result The encoding name as a string for the specified option.
- tidy
OptGet ⚠Id - Get ID of given Option @param opt An instance of a TidyOption to query. @result The TidyOptionId of the given option.
- tidy
OptGet ⚠IdFor Name - Returns the TidyOptionId (enum value) by providing the name of a Tidy
configuration option.
@param optnam The name of the option ID to retrieve.
@result The TidyOptionId of the given
optname
. - tidy
OptGet ⚠Int - Get current option value as an integer. @result Returns the integer value of the specified option.
- tidy
OptGet ⚠Muted Message List - Initiates an iterator for a list of muted messages. This iterator allows
you to iterate through all of the priority attributes defined with the
mute
configuration option. In order to iterate through the list, initiate with this function, and then use tidyOptGetNextMutedMessage() to retrieve the first and subsequent attributes. For example: @code{.c} TidyIterator itAttr = tidyOptGetMutedMessageList( tdoc ); while ( itAttr ) { printf(“%s”, tidyOptGetNextMutedMessage( tdoc, &itAttr )); } @endcode @param tdoc An instance of a TidyDoc to query. @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy. - tidy
OptGet ⚠Name - Get name of given Option @param opt An instance of a TidyOption to query. @result The name of the given option.
- tidy
OptGet ⚠Next Decl Tag - Given a valid TidyIterator initiated with tidyOptGetDeclTagList(), returns a string representing a user-declared or autonomous custom tag. @remark Specifying optId limits the scope of the tags to one of @ref TidyInlineTags, @ref TidyBlockTags, @ref TidyEmptyTags, or @ref TidyPreTags. Note that autonomous custom tags (if used) are added to one of these option types, depending on the value of @ref TidyUseCustomTags. @result A string containing the next tag.
- tidy
OptGet ⚠Next DocLinks - Given a valid TidyIterator initiated with tidyOptGetDocLinksList(), returns a TidyOption instance. @result Returns in instance of TidyOption.
- tidy
OptGet ⚠Next Muted Message - Given a valid TidyIterator initiated with tidyOptGetMutedMessageList(), returns a string representing a muted message. @result A string containing the next tag.
- tidy
OptGet ⚠Next Pick - Given a valid TidyIterator initiated with tidyOptGetPickList(), returns a string representing a possible option value. @result A string containing the next pick-list option value.
- tidy
OptGet ⚠Next Priority Attr - Given a valid TidyIterator initiated with tidyOptGetPriorityAttrList(), returns a string representing a priority attribute. @result A string containing the next tag.
- tidy
OptGet ⚠Pick List - Initiates an iterator for a list of TidyOption pick-list values, which allows you iterate through all of the available option values. In order to iterate through the available values, initiate the iterator with this function, and then use tidyOptGetNextPick() to retrieve the first and subsequent option values. For example: @code{.c} TidyIterator itOpt = tidyOptGetPickList( opt ); while ( itOpt ) { printf(“%s”, tidyOptGetNextPick( opt, &itOpt )); } @endcode @param opt An instance of a TidyOption to query. @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
- tidy
OptGet ⚠Priority Attr List - Initiates an iterator for a list of priority attributes. This iterator
allows you to iterate through all of the priority attributes defined with
the
priority-attributes
configuration option. In order to iterate through the attributes, initiate the iterator with this function, and then use tidyOptGetNextPriorityAttr() to retrieve the first and subsequent attributes. For example: @code{.c} TidyIterator itAttr = tidyOptGetPriorityAttrList( tdoc ); while ( itAttr ) { printf(“%s”, tidyOptGetNextPriorityAttr( tdoc, &itAttr )); } @endcode @param tdoc An instance of a TidyDoc to query. @result Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy. - tidy
OptGet ⚠Type - Get datatype of given Option @param opt An instance of a TidyOption to query. @result The TidyOptionType of the given option.
- tidy
OptGet ⚠Value - Get the current value of the option ID for the given document. @remark The optId must have a @ref TidyOptionType of @ref TidyString!
- tidy
OptIs ⚠Read Only - Is Option read-only? Some options (mainly internal use only options) are
read-only.
@deprecated This is no longer a valid test for the public API; instead
you should test an option’s availability using
tidyOptGetCategory()
againstTidyInternalCategory
. This API will be removed! @param opt An instance of a TidyOption to query. @result Returnsyes
orno
depending on whether or not the specified option is read-only. - tidy
OptParse ⚠Value - Set named option value as a string, regardless of the @ref TidyOptionType. @remark This is good setter if you are unsure of the type. @result Returns a bool indicating success or failure.
- tidy
OptReset ⚠AllTo Default - Reset all options to their default values. @param tdoc The tidy document for which to reset all values. @result Returns a bool indicating success or failure.
- tidy
OptReset ⚠ToDefault - Reset option to default value by ID. @result Returns a bool indicating success or failure.
- tidy
OptReset ⚠ToSnapshot - Apply a snapshot of config settings to a document. @param tdoc The tidy document for which to apply a snapshot. @result Returns a bool indicating success or failure.
- tidy
OptSave ⚠File - Save current settings to named file. Only writes non-default values. @result An integer representing the status.
- tidy
OptSave ⚠Sink - Save current settings to given output sink. Only non-default values are written. @result An integer representing the status.
- tidy
OptSet ⚠Bool - Set option value as a Boolean flag. @result Returns a bool indicating success or failure.
- tidy
OptSet ⚠Int - Set option value as an integer. @result Returns a bool indicating success or failure.
- tidy
OptSet ⚠Value - Set the option value as a string. @remark The optId must have a @ref TidyOptionType of @ref TidyString! @result Returns a bool indicating success or failure.
- tidy
OptSnapshot ⚠ - Take a snapshot of current config settings. These settings are stored within the tidy document. Note, however, that snapshots do not reliably survive the tidyParseXXX() process, as Tidy uses the snapshot mechanism in order to store the current configuration right at the beginning of the parsing process. @param tdoc The tidy document for which to take a snapshot. @result Returns a bool indicating success or failure.
- tidy
Option ⚠IsList - Indicates that an option takes a list of items. @param opt An instance of a TidyOption to query. @result A bool indicating whether or not the option accepts a list.
- tidy
Parse ⚠Buffer - Parse markup in given buffer.
@result Returns the highest of
2
indicating that errors were present in the document,1
indicating warnings, and0
in the case of everything being okay. - tidy
Parse ⚠File - Parse markup in named file.
@result Returns the highest of
2
indicating that errors were present in the document,1
indicating warnings, and0
in the case of everything being okay. - tidy
Parse ⚠Source - Parse markup in given generic input source.
@result Returns the highest of
2
indicating that errors were present in the document,1
indicating warnings, and0
in the case of everything being okay. - tidy
Parse ⚠Stdin - Parse markup from the standard input.
@param tdoc The tidy document to use for parsing.
@result Returns the highest of
2
indicating that errors were present in the document,1
indicating warnings, and0
in the case of everything being okay. - tidy
Parse ⚠String - Parse markup in given string. Note that the supplied string is of type
ctmbstr
based onchar
and therefore doesn’t support the use of UTF-16 strings. UsetidyParseBuffer()
if parsing multibyte strings. @result Returns the highest of2
indicating that errors were present in the document,1
indicating warnings, and0
in the case of everything being okay. - tidy
Platform ⚠ - Get the platform for which Tidy was built. @result The string representing the version number.
- tidy
PutByte ⚠ - Helper: send a byte to output.
- tidy
Release ⚠ - Free all memory and release the TidyDoc. The TidyDoc can not be used after this call. @param tdoc The TidyDoc to free.
- tidy
Release ⚠Date - Get the release date for the current library. @result The string representing the release date.
- tidy
Report ⚠Doctype - Reports the document type into the output sink. @param tdoc The tidy document to use. @result An integer representing the status.
- tidy
RunDiagnostics ⚠ - Reports the document type and diagnostic statistics on parsed and repaired markup. You must call tidyCleanAndRepair() before using this function. @param tdoc The tidy document to use. @result An integer representing the status.
- tidy
Save ⚠Buffer - Save the tidy document to given TidyBuffer object. @result An integer representing the status.
- tidy
Save ⚠File - Save the tidy document to the named file. @result An integer representing the status.
- tidy
Save ⚠Sink - Save to given generic output sink. @result An integer representing the status.
- tidy
Save ⚠Stdout - Save the tidy document to standard output (FILE*). @param tdoc The tidy document to save. @result An integer representing the status.
- tidy
Save ⚠String - Save the tidy document to an application buffer. If TidyShowMarkup and the document has no errors, or TidyForceOutput, then the current document (per the current configuration) will be pretty printed to this application buffer. The document byte length (not character length) will be placed into *buflen. The document will not be null terminated. If the buffer is not big enough, ENOMEM will be returned, else the actual document status. @result An integer representing the status.
- tidy
SetApp ⚠Data - Allows the host application to store a chunk of data with each TidyDoc
instance. This can be useful for callbacks, such as saving a reference to
self
within the document. - tidy
SetChar ⚠Encoding - Set the input/output character encoding for parsing markup. Valid values
include
ascii
,latin1
,raw
,utf8
,iso2022
,mac
,win1252
,utf16le
,utf16be
,utf16
,big5
, andshiftjis
. These values are not case sensitive. @note This is the same as using TidySetInCharEncoding() and TidySetOutCharEncoding() to set the same value. @result Returns 0 upon success, or a system standard error numberEINVAL
. - tidy
SetConfig ⚠Callback - Applications using TidyLib may want to augment command-line and
configuration file options. Setting this callback allows a LibTidy
application developer to examine command-line and configuration file options
after LibTidy has examined them and failed to recognize them.
@result Returns
yes
upon success. - tidy
SetConfig ⚠Change Callback - Applications using TidyLib may want to be informed when changes to options
are made. Temporary changes made internally by Tidy are not reported, but
permanent changes made by Tidy (such as indent-spaces or output-encoding)
will be reported.
@note This callback is not currently implemented.
@result Returns
yes
upon success. - tidy
SetEmacs ⚠File - Set the file path to use for reports when
TidyEmacs
is being used. This function provides a proper interface for using the hidden, internal-onlyTidyEmacsFile
configuration option. - tidy
SetError ⚠Buffer - Set error sink to given buffer. @result Returns 0 upon success or a standard error number.
- tidy
SetError ⚠File - Set error sink to named file. @result Returns a file handle.
- tidy
SetError ⚠Sink - Set error sink to given generic sink. @result Returns 0 upon success or a standard error number.
- tidy
SetFree ⚠Call - Give Tidy a
free()
replacement - tidy
SetIn ⚠Char Encoding - Set the input encoding for parsing markup. Valid values include
ascii
,latin1
,raw
,utf8
,iso2022
,mac
,win1252
,utf16le
,utf16be
,utf16
,big5
, andshiftjis
. These values are not case sensitive. @result Returns 0 upon success, or a system standard error numberEINVAL
. - tidy
SetLanguage ⚠ - Tells Tidy to use a different language for output. @param languageCode A Windows or POSIX language code, and must match a TIDY_LANGUAGE for an installed language. @result Indicates that a setting was applied, but not necessarily the specific request, i.e., true indicates a language and/or region was applied. If es_mx is requested but not installed, and es is installed, then es will be selected and this function will return true. However the opposite is not true; if es is requested but not present, Tidy will not try to select from the es_XX variants.
- tidy
SetMalloc ⚠Call - Give Tidy a
malloc()
replacement - tidy
SetMessage ⚠Callback - This function informs Tidy to use the specified callback to send reports.
- tidy
SetOption ⚠Callback - Applications using TidyLib may want to augment command-line and
configuration file options. Setting this callback allows a LibTidy
application developer to examine command-line and configuration file options
after LibTidy has examined them and failed to recognize them.
Note that this is deprecated and you should instead migrate to
tidySetConfigCallback().
@result Returns
yes
upon success. - tidy
SetOut ⚠Char Encoding - Set the input encoding for writing markup. Valid values include
ascii
,latin1
,raw
,utf8
,iso2022
,mac
,win1252
,utf16le
,utf16be
,utf16
,big5
, andshiftjis
. These values are not case sensitive. @result Returns 0 upon success, or a system standard error numberEINVAL
. - tidy
SetPanic ⚠Call - Give Tidy an “out of memory” handler
- tidy
SetPretty ⚠Printer Callback - This function informs Tidy to use the specified callback for tracking the pretty-printing process progress.
- tidy
SetRealloc ⚠Call - Give Tidy a
realloc()
replacement - tidy
SetReport ⚠Callback - This function informs Tidy to use the specified callback to send reports.
- tidy
SetReport ⚠Filter - This function informs Tidy to use the specified callback to send reports.
- tidy
Status ⚠ - Get status of current document.
@param tdoc An instance of a TidyDoc to query.
@result Returns the highest of
2
indicating that errors were present in the document,1
indicating warnings, and0
in the case of everything being okay. - tidy
Unget ⚠Byte - Helper: unget byte back to input source.
- tidy
Warning ⚠Count - Indicates the number of TidyWarning messages that were generated. @param tdoc An instance of a TidyDoc to query. @result Returns the number of TidyWarning messages that were generated.
Type Aliases§
- Bool
- FILE
- Tidy
Allocator - Tidy’s built-in default allocator.
- Tidy
Allocator Vtbl - //** @defgroup Memory Memory Allocation
- Tidy
Attr - Tidy
Buffer - @name Forward declarations and typedefs. @{
- Tidy
Config Callback - This typedef represents the required signature for your provided callback
function should you wish to register one with tidySetConfigCallback().
Your callback function will be provided with the following parameters.
@param tdoc The document instance for which the callback was invoked.
@param option The option name that was provided.
@param value The option value that was provided
@return Your callback function will return
yes
if it handles the provided option, orno
if it does not. In the latter case, Tidy will issue an unknown configuration option error. - Tidy
Config Change Callback - This typedef represents the required signature for your provided callback function should you wish to register one with tidySetConfigChangeCallback(). Your callback function will be provided with the following parameters. @param tdoc The document instance for which the callback was invoked. @param option The option that will be changed.
- TidyDoc
- TidyEOF
Func - Input Callback: is end of input?
- Tidy
Free - Callback for
free
replacement - Tidy
GetByte Func - Input Callback: get next byte of input
- Tidy
Input Source - This type defines an input source capable of delivering raw bytes of input.
- Tidy
Iterator - Tidy
Malloc - Callback for
malloc
replacement - Tidy
Message - Tidy
Message Argument - Tidy
Message Callback - This typedef represents the required signature for your provided callback
function should you wish to register one with tidySetMessageCallback().
Your callback function will be provided with the following parameters.
@param tmessage An opaque type used as a token against which other API
calls can be made.
@return Your callback function will return
yes
if Tidy should include the report in its own output sink, orno
if Tidy should suppress it. - Tidy
Node - Tidy
OptCallback - This typedef represents the required signature for your provided callback
function should you wish to register one with tidySetOptionCallback().
Your callback function will be provided with the following parameters.
Note that this is deprecated and you should instead migrate to
tidySetConfigCallback().
@param option The option name that was provided.
@param value The option value that was provided
@return Your callback function will return
yes
if it handles the provided option, orno
if it does not. In the latter case, Tidy will issue an unknown configuration option error. - Tidy
Option - Tidy
Output Sink - This type defines an output destination capable of accepting raw bytes of output
- TidyPP
Progress - This typedef represents the required signature for your provided callback function should you wish to register one with tidySetMessageCallback(). Your callback function will be provided with the following parameters. @param tdoc Indicates the source tidy document. @param line Indicates the line in the source document at this point in the process. @param col Indicates the column in the source document at this point in the process. @param destLine Indicates the line number in the output document at this point in the process.
- Tidy
Panic - Callback for out of memory panic state
- Tidy
PutByte Func - Output callback: send a byte to output
- Tidy
Realloc - Callback for
realloc
replacement - Tidy
Report Callback - This typedef represents the required signature for your provided callback
function should you wish to register one with tidySetReportCallback().
Your callback function will be provided with the following parameters.
@param tdoc Indicates the tidy document the message comes from.
@param lvl Specifies the TidyReportLevel of the message.
@param line Indicates the line number in the source document the message applies to.
@param col Indicates the column in the source document the message applies to.
@param code Specifies the message code representing the message. Note that
this code is a string value that the API promises to hold constant,
as opposed to an enum value that can change at any time. Although
this is intended so that you can look up your own application’s
strings, you can retrieve Tidy’s format string with this code by
using tidyErrorCodeFromKey() and then the tidyLocalizedString()
family of functions.
@param args Is a
va_list
of arguments used to fill Tidy’s message format string. @return Your callback function will returnyes
if Tidy should include the report in its own output sink, orno
if Tidy should suppress it. - Tidy
Report Filter - This typedef represents the required signature for your provided callback
function should you wish to register one with tidySetReportFilter().
Your callback function will be provided with the following parameters.
@param tdoc Indicates the tidy document the message comes from.
@param lvl Specifies the TidyReportLevel of the message.
@param line Indicates the line number in the source document the message applies to.
@param col Indicates the column in the source document the message applies to.
@param mssg Specifies the complete message as Tidy would emit it.
@return Your callback function will return
yes
if Tidy should include the report in its own output sink, orno
if Tidy should suppress it. - Tidy
Unget Byte Func - Input Callback: unget a byte of input
- _IO_
lock_ t - __
builtin_ va_ list - __
gnuc_ va_ list - __
off64_ t - __off_t
- byte
- ctmbstr
- tchar
- tidy
Locale MapItem - tmbchar
- tmbstr
- uint
- ulong
- va_list