HTML Tidy  5.6.0
The HTACG Tidy HTML Project
Configuration Options

Detailed Description

Functions for getting and setting Tidy configuration options.

Note
In general, you should expect that options you set should stay set. This isn't always the case, though, because Tidy will adjust options for internal use during the lexing, parsing, cleaning, and printing phases, but will restore them after the printing process. If you require access to user configuration values at any time between the tidyParseXXX() process and the tidySaveXXX() process, make sure to keep your own copy.

Option Callback Functions

typedef Bool(TIDY_CALLTidyOptCallback) (ctmbstr option, ctmbstr value)
 This typedef represents the required signature for your provided callback function should you wish to register one with tidySetOptionCallback(). More...
 
typedef Bool(TIDY_CALLTidyConfigCallback) (TidyDoc tdoc, ctmbstr option, ctmbstr value)
 This typedef represents the required signature for your provided callback function should you wish to register one with tidySetConfigCallback(). More...
 
typedef void(TIDY_CALLTidyConfigChangeCallback) (TidyDoc tdoc, TidyOption option)
 This typedef represents the required signature for your provided callback function should you wish to register one with tidySetConfigChangeCallback(). More...
 
Bool TIDY_CALL tidySetOptionCallback (TidyDoc tdoc, TidyOptCallback pOptCallback)
 Applications using TidyLib may want to augment command-line and configuration file options. More...
 
Bool TIDY_CALL tidySetConfigCallback (TidyDoc tdoc, TidyConfigCallback pConfigCallback)
 Applications using TidyLib may want to augment command-line and configuration file options. More...
 
Bool TIDY_CALL tidySetConfigChangeCallback (TidyDoc tdoc, TidyConfigChangeCallback pCallback)
 Applications using TidyLib may want to be informed when changes to options are made. More...
 

Option ID Discovery

TidyOptionId TIDY_CALL tidyOptGetId (TidyOption opt)
 Get ID of given Option. More...
 
TidyOptionId TIDY_CALL tidyOptGetIdForName (ctmbstr optnam)
 Returns the TidyOptionId (enum value) by providing the name of a Tidy configuration option. More...
 

Getting Instances of Tidy Options

TidyIterator TIDY_CALL tidyGetOptionList (TidyDoc tdoc)
 Initiates an iterator for a list of TidyOption instances, which allows you to iterate through all of the available options. More...
 
TidyOption TIDY_CALL tidyGetNextOption (TidyDoc tdoc, TidyIterator *pos)
 Given a valid TidyIterator initiated with tidyGetOptionList(), returns the instance of the next TidyOption. More...
 
TidyOption TIDY_CALL tidyGetOption (TidyDoc tdoc, TidyOptionId optId)
 Retrieves an instance of TidyOption given a valid TidyOptionId. More...
 
TidyOption TIDY_CALL tidyGetOptionByName (TidyDoc tdoc, ctmbstr optnam)
 Returns an instance of TidyOption by providing the name of a Tidy configuration option. More...
 

Information About Options

ctmbstr TIDY_CALL tidyOptGetName (TidyOption opt)
 Get name of given Option. More...
 
TidyOptionType TIDY_CALL tidyOptGetType (TidyOption opt)
 Get datatype of given Option. More...
 
Bool TIDY_CALL tidyOptionIsList (TidyOption opt)
 Indicates that an option takes a list of items. More...
 
Bool TIDY_CALL tidyOptIsReadOnly (TidyOption opt)
 Is Option read-only? Some options (mainly internal use only options) are read-only. More...
 
TidyConfigCategory TIDY_CALL tidyOptGetCategory (TidyOption opt)
 Get category of given Option. More...
 
ctmbstr TIDY_CALL tidyOptGetDefault (TidyOption opt)
 Get default value of given Option as a string. More...
 
ulong TIDY_CALL tidyOptGetDefaultInt (TidyOption opt)
 Get default value of given Option as an unsigned integer. More...
 
Bool TIDY_CALL tidyOptGetDefaultBool (TidyOption opt)
 Get default value of given Option as a Boolean value. More...
 
TidyIterator TIDY_CALL tidyOptGetPickList (TidyOption opt)
 Initiates an iterator for a list of TidyOption pick-list values, which allows you iterate through all of the available option values. More...
 
ctmbstr TIDY_CALL tidyOptGetNextPick (TidyOption opt, TidyIterator *pos)
 Given a valid TidyIterator initiated with tidyOptGetPickList(), returns a string representing a possible option value. More...
 

Option Value Functions

ctmbstr TIDY_CALL tidyOptGetValue (TidyDoc tdoc, TidyOptionId optId)
 Get the current value of the option ID for the given document. More...
 
Bool TIDY_CALL tidyOptSetValue (TidyDoc tdoc, TidyOptionId optId, ctmbstr val)
 Set the option value as a string. More...
 
Bool TIDY_CALL tidyOptParseValue (TidyDoc tdoc, ctmbstr optnam, ctmbstr val)
 Set named option value as a string, regardless of the TidyOptionType. More...
 
ulong TIDY_CALL tidyOptGetInt (TidyDoc tdoc, TidyOptionId optId)
 Get current option value as an integer. More...
 
Bool TIDY_CALL tidyOptSetInt (TidyDoc tdoc, TidyOptionId optId, ulong val)
 Set option value as an integer. More...
 
Bool TIDY_CALL tidyOptGetBool (TidyDoc tdoc, TidyOptionId optId)
 Get current option value as a Boolean flag. More...
 
Bool TIDY_CALL tidyOptSetBool (TidyDoc tdoc, TidyOptionId optId, Bool val)
 Set option value as a Boolean flag. More...
 
Bool TIDY_CALL tidyOptResetToDefault (TidyDoc tdoc, TidyOptionId opt)
 Reset option to default value by ID. More...
 
Bool TIDY_CALL tidyOptResetAllToDefault (TidyDoc tdoc)
 Reset all options to their default values. More...
 
Bool TIDY_CALL tidyOptSnapshot (TidyDoc tdoc)
 Take a snapshot of current config settings. More...
 
Bool TIDY_CALL tidyOptResetToSnapshot (TidyDoc tdoc)
 Apply a snapshot of config settings to a document. More...
 
Bool TIDY_CALL tidyOptDiffThanDefault (TidyDoc tdoc)
 Any settings different than default? More...
 
Bool TIDY_CALL tidyOptDiffThanSnapshot (TidyDoc tdoc)
 Any settings different than snapshot? More...
 
Bool TIDY_CALL tidyOptCopyConfig (TidyDoc tdocTo, TidyDoc tdocFrom)
 Copy current configuration settings from one document to another. More...
 
ctmbstr TIDY_CALL tidyOptGetEncName (TidyDoc tdoc, TidyOptionId optId)
 Get character encoding name. More...
 
ctmbstr TIDY_CALL tidyOptGetCurrPick (TidyDoc tdoc, TidyOptionId optId)
 Get the current pick list value for the option ID, which can be useful for enum types. More...
 
TidyIterator TIDY_CALL tidyOptGetDeclTagList (TidyDoc tdoc)
 Initiates an iterator for a list of user-declared tags, including autonomous custom tags detected in the document if TidyUseCustomTags is not set to no. More...
 
ctmbstr TIDY_CALL tidyOptGetNextDeclTag (TidyDoc tdoc, TidyOptionId optId, TidyIterator *iter)
 Given a valid TidyIterator initiated with tidyOptGetDeclTagList(), returns a string representing a user-declared or autonomous custom tag. More...
 
TidyIterator TIDY_CALL tidyOptGetPriorityAttrList (TidyDoc tdoc)
 Initiates an iterator for a list of priority attributes. More...
 
ctmbstr TIDY_CALL tidyOptGetNextPriorityAttr (TidyDoc tdoc, TidyIterator *iter)
 Given a valid TidyIterator initiated with tidyOptGetPriorityAttrList(), returns a string representing a priority attribute. More...
 
TidyIterator TIDY_CALL tidyOptGetMutedMessageList (TidyDoc tdoc)
 Initiates an iterator for a list of muted messages. More...
 
ctmbstr TIDY_CALL tidyOptGetNextMutedMessage (TidyDoc tdoc, TidyIterator *iter)
 Given a valid TidyIterator initiated with tidyOptGetMutedMessageList(), returns a string representing a muted message. More...
 

Option Documentation

ctmbstr TIDY_CALL tidyOptGetDoc (TidyDoc tdoc, TidyOption opt)
 Get the description of the specified option. More...
 
TidyIterator TIDY_CALL tidyOptGetDocLinksList (TidyDoc tdoc, TidyOption opt)
 Initiates an iterator for a list of options related to a given option. More...
 
TidyOption TIDY_CALL tidyOptGetNextDocLinks (TidyDoc tdoc, TidyIterator *pos)
 Given a valid TidyIterator initiated with tidyOptGetDocLinksList(), returns a TidyOption instance. More...
 

Typedef Documentation

typedef Bool(TIDY_CALL * TidyConfigCallback) (TidyDoc tdoc, ctmbstr option, ctmbstr value)

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.

Parameters
tdocThe document instance for which the callback was invoked.
optionThe option name that was provided.
valueThe option value that was provided
Returns
Your callback function will return yes if it handles the provided option, or no if it does not. In the latter case, Tidy will issue an unknown configuration option error.
typedef void(TIDY_CALL * TidyConfigChangeCallback) (TidyDoc tdoc, TidyOption option)

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.

Parameters
tdocThe document instance for which the callback was invoked.
optionThe option that will be changed.
typedef Bool(TIDY_CALL * TidyOptCallback) (ctmbstr option, ctmbstr value)

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().

Parameters
optionThe option name that was provided.
valueThe option value that was provided
Returns
Your callback function will return yes if it handles the provided option, or no if it does not. In the latter case, Tidy will issue an unknown configuration option error.

Function Documentation

TidyOption TIDY_CALL tidyGetNextOption ( TidyDoc  tdoc,
TidyIterator *  pos 
)

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 use tidyOptGetCategory() before assuming that an option is okay to use in your application.
Returns
An instance of TidyOption.
Parameters
tdocThe document for which you are retrieving options.
posThe TidyIterator (initiated with tidyGetOptionList()) token.
TidyOption TIDY_CALL tidyGetOption ( TidyDoc  tdoc,
TidyOptionId  optId 
)

Retrieves an instance of TidyOption given a valid TidyOptionId.

Returns
An instance of TidyOption matching the provided TidyOptionId.
Parameters
tdocThe document for which you are retrieving the option.
optIdThe TidyOptionId to retrieve.
TidyOption TIDY_CALL tidyGetOptionByName ( TidyDoc  tdoc,
ctmbstr  optnam 
)

Returns an instance of TidyOption by providing the name of a Tidy configuration option.

Returns
The TidyOption of the given optname.
Parameters
tdocThe document for which you are retrieving the option.
optnamThe name of the Tidy configuration option.
TidyIterator TIDY_CALL tidyGetOptionList ( TidyDoc  tdoc)

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:

TidyIterator itOpt = tidyGetOptionList( tdoc );
while ( itOpt ) {
TidyOption opt = tidyGetNextOption( tdoc, &itOpt );
// Use other API to query or set set option values
}
Parameters
tdocAn instance of a TidyDoc to query.
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
Bool TIDY_CALL tidyOptCopyConfig ( TidyDoc  tdocTo,
TidyDoc  tdocFrom 
)

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.

Returns
Returns a bool indicating success or failure.
Parameters
tdocToThe destination tidy document.
tdocFromThe source tidy document.
Bool TIDY_CALL tidyOptDiffThanDefault ( TidyDoc  tdoc)

Any settings different than default?

Parameters
tdocThe tidy document to check.
Returns
Returns a bool indicating whether or not a difference exists.
Bool TIDY_CALL tidyOptDiffThanSnapshot ( TidyDoc  tdoc)

Any settings different than snapshot?

Parameters
tdocThe tidy document to check.
Returns
Returns a bool indicating whether or not a difference exists.
Bool TIDY_CALL tidyOptGetBool ( TidyDoc  tdoc,
TidyOptionId  optId 
)

Get current option value as a Boolean flag.

Returns
Returns a bool indicating the value.
Parameters
tdocThe tidy document for which to get the value.
optIdThe option ID to get.
TidyConfigCategory TIDY_CALL tidyOptGetCategory ( TidyOption  opt)

Get category of given Option.

Parameters
optAn instance of a TidyOption to query.
Returns
The TidyConfigCategory of the specified option.
ctmbstr TIDY_CALL tidyOptGetCurrPick ( TidyDoc  tdoc,
TidyOptionId  optId 
)

Get the current pick list value for the option ID, which can be useful for enum types.

Returns
Returns a string indicating the current value of the specified option.
Parameters
tdocThe tidy document to query.
optIdThe option ID whose value to check.
TidyIterator TIDY_CALL tidyOptGetDeclTagList ( TidyDoc  tdoc)

Initiates an iterator for a list of user-declared tags, including autonomous custom tags detected in the document if 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:

TidyIterator itTag = tidyOptGetDeclTagList( tdoc );
while ( itTag ) {
printf("%s", tidyOptGetNextDeclTag( tdoc, TidyBlockTags, &itTag ));
}
Parameters
tdocAn instance of a TidyDoc to query.
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
ctmbstr TIDY_CALL tidyOptGetDefault ( TidyOption  opt)

Get default value of given Option as a string.

Parameters
optAn instance of a TidyOption to query.
Returns
A string indicating the default value of the specified option.
Bool TIDY_CALL tidyOptGetDefaultBool ( TidyOption  opt)

Get default value of given Option as a Boolean value.

Parameters
optAn instance of a TidyOption to query.
Returns
A boolean indicating the default value of the specified option.
ulong TIDY_CALL tidyOptGetDefaultInt ( TidyOption  opt)

Get default value of given Option as an unsigned integer.

Parameters
optAn instance of a TidyOption to query.
Returns
An unsigned integer indicating the default value of the specified option.
ctmbstr TIDY_CALL tidyOptGetDoc ( TidyDoc  tdoc,
TidyOption  opt 
)

Get the description of the specified option.

Returns
Returns a string containing a description of the given option.
Parameters
tdocThe tidy document to query.
optThe option ID of the option.
TidyIterator TIDY_CALL tidyOptGetDocLinksList ( TidyDoc  tdoc,
TidyOption  opt 
)

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:

TidyIterator itOpt = tidyOptGetDocLinksList( tdoc, TidyJoinStyles );
while ( itOpt ) {
TidyOption my_option = tidyOptGetNextDocLinks( tdoc, &itOpt );
// do something with my_option
}
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
Parameters
tdocThe tidy document to query.
optThe option whose related options you wish to find.
ctmbstr TIDY_CALL tidyOptGetEncName ( TidyDoc  tdoc,
TidyOptionId  optId 
)

Get character encoding name.

Used with TidyCharEncoding, TidyOutCharEncoding, and TidyInCharEncoding.

Returns
The encoding name as a string for the specified option.
Parameters
tdocThe tidy document to query.
optIdThe option ID whose value to check.
TidyOptionId TIDY_CALL tidyOptGetId ( TidyOption  opt)

Get ID of given Option.

Parameters
optAn instance of a TidyOption to query.
Returns
The TidyOptionId of the given option.
TidyOptionId TIDY_CALL tidyOptGetIdForName ( ctmbstr  optnam)

Returns the TidyOptionId (enum value) by providing the name of a Tidy configuration option.

Parameters
optnamThe name of the option ID to retrieve.
Returns
The TidyOptionId of the given optname.
ulong TIDY_CALL tidyOptGetInt ( TidyDoc  tdoc,
TidyOptionId  optId 
)

Get current option value as an integer.

Returns
Returns the integer value of the specified option.
Parameters
tdocThe tidy document for which to get the value.
optIdThe option ID to get.
TidyIterator TIDY_CALL tidyOptGetMutedMessageList ( TidyDoc  tdoc)

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:

TidyIterator itAttr = tidyOptGetMutedMessageList( tdoc );
while ( itAttr ) {
printf("%s", tidyOptGetNextMutedMessage( tdoc, &itAttr ));
}
Parameters
tdocAn instance of a TidyDoc to query.
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
ctmbstr TIDY_CALL tidyOptGetName ( TidyOption  opt)

Get name of given Option.

Parameters
optAn instance of a TidyOption to query.
Returns
The name of the given option.
ctmbstr TIDY_CALL tidyOptGetNextDeclTag ( TidyDoc  tdoc,
TidyOptionId  optId,
TidyIterator *  iter 
)

Given a valid TidyIterator initiated with tidyOptGetDeclTagList(), returns a string representing a user-declared or autonomous custom tag.

Remarks
Specifying optId limits the scope of the tags to one of TidyInlineTags, TidyBlockTags, TidyEmptyTags, or TidyPreTags. Note that autonomous custom tags (if used) are added to one of these option types, depending on the value of TidyUseCustomTags.
Returns
A string containing the next tag.
Parameters
tdocThe tidy document to query.
optIdThe option ID matching the type of tag to retrieve.
iterThe TidyIterator (initiated with tidyOptGetDeclTagList()) token.
TidyOption TIDY_CALL tidyOptGetNextDocLinks ( TidyDoc  tdoc,
TidyIterator *  pos 
)

Given a valid TidyIterator initiated with tidyOptGetDocLinksList(), returns a TidyOption instance.

Returns
Returns in instance of TidyOption.
Parameters
tdocThe tidy document to query.
posThe TidyIterator (initiated with tidyOptGetDocLinksList()) token.
ctmbstr TIDY_CALL tidyOptGetNextMutedMessage ( TidyDoc  tdoc,
TidyIterator *  iter 
)

Given a valid TidyIterator initiated with tidyOptGetMutedMessageList(), returns a string representing a muted message.

Returns
A string containing the next tag.
Parameters
tdocThe tidy document to query.
iterThe TidyIterator (initiated with tidyOptGetMutedMessageList()) token.
ctmbstr TIDY_CALL tidyOptGetNextPick ( TidyOption  opt,
TidyIterator *  pos 
)

Given a valid TidyIterator initiated with tidyOptGetPickList(), returns a string representing a possible option value.

Returns
A string containing the next pick-list option value.
Parameters
optAn instance of a TidyOption to query.
posThe TidyIterator (initiated with tidyOptGetPickList()) token.
ctmbstr TIDY_CALL tidyOptGetNextPriorityAttr ( TidyDoc  tdoc,
TidyIterator *  iter 
)

Given a valid TidyIterator initiated with tidyOptGetPriorityAttrList(), returns a string representing a priority attribute.

Returns
A string containing the next tag.
Parameters
tdocThe tidy document to query.
iterThe TidyIterator (initiated with tidyOptGetPriorityAttrList()) token.
TidyIterator TIDY_CALL tidyOptGetPickList ( TidyOption  opt)

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:

TidyIterator itOpt = tidyOptGetPickList( opt );
while ( itOpt ) {
printf("%s", tidyOptGetNextPick( opt, &itOpt ));
}
Parameters
optAn instance of a TidyOption to query.
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
TidyIterator TIDY_CALL tidyOptGetPriorityAttrList ( TidyDoc  tdoc)

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:

TidyIterator itAttr = tidyOptGetPriorityAttrList( tdoc );
while ( itAttr ) {
printf("%s", tidyOptGetNextPriorityAttr( tdoc, &itAttr ));
}
Parameters
tdocAn instance of a TidyDoc to query.
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
TidyOptionType TIDY_CALL tidyOptGetType ( TidyOption  opt)

Get datatype of given Option.

Parameters
optAn instance of a TidyOption to query.
Returns
The TidyOptionType of the given option.
ctmbstr TIDY_CALL tidyOptGetValue ( TidyDoc  tdoc,
TidyOptionId  optId 
)

Get the current value of the option ID for the given document.

Remarks
The optId must have a TidyOptionType of TidyString!
Parameters
tdocThe tidy document whose option value you wish to check.
optIdThe option ID whose value you wish to check.
Bool TIDY_CALL tidyOptionIsList ( TidyOption  opt)

Indicates that an option takes a list of items.

Parameters
optAn instance of a TidyOption to query.
Returns
A bool indicating whether or not the option accepts a list.
Bool TIDY_CALL tidyOptIsReadOnly ( TidyOption  opt)

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() against TidyInternalCategory. This API will be removed!
Parameters
optAn instance of a TidyOption to query.
Returns
Returns yes or no depending on whether or not the specified option is read-only.
Bool TIDY_CALL tidyOptParseValue ( TidyDoc  tdoc,
ctmbstr  optnam,
ctmbstr  val 
)

Set named option value as a string, regardless of the TidyOptionType.

Remarks
This is good setter if you are unsure of the type.
Returns
Returns a bool indicating success or failure.
Parameters
tdocThe tidy document for which to set the value.
optnamThe name of the option to set; this is the string value from the UI, e.g., error-file.
valThe value to set, as a string.
Bool TIDY_CALL tidyOptResetAllToDefault ( TidyDoc  tdoc)

Reset all options to their default values.

Parameters
tdocThe tidy document for which to reset all values.
Returns
Returns a bool indicating success or failure.
Bool TIDY_CALL tidyOptResetToDefault ( TidyDoc  tdoc,
TidyOptionId  opt 
)

Reset option to default value by ID.

Returns
Returns a bool indicating success or failure.
Parameters
tdocThe tidy document for which to reset the value.
optThe option ID to reset.
Bool TIDY_CALL tidyOptResetToSnapshot ( TidyDoc  tdoc)

Apply a snapshot of config settings to a document.

Parameters
tdocThe tidy document for which to apply a snapshot.
Returns
Returns a bool indicating success or failure.
Bool TIDY_CALL tidyOptSetBool ( TidyDoc  tdoc,
TidyOptionId  optId,
Bool  val 
)

Set option value as a Boolean flag.

Returns
Returns a bool indicating success or failure.
Parameters
tdocThe tidy document for which to set the value.
optIdThe option ID to set.
valThe value to set.
Bool TIDY_CALL tidyOptSetInt ( TidyDoc  tdoc,
TidyOptionId  optId,
ulong  val 
)

Set option value as an integer.

Returns
Returns a bool indicating success or failure.
Parameters
tdocThe tidy document for which to set the value.
optIdThe option ID to set.
valThe value to set.
Bool TIDY_CALL tidyOptSetValue ( TidyDoc  tdoc,
TidyOptionId  optId,
ctmbstr  val 
)

Set the option value as a string.

Remarks
The optId must have a TidyOptionType of TidyString!
Returns
Returns a bool indicating success or failure.
Parameters
tdocThe tidy document for which to set the value.
optIdThe option ID of the value to set.
valThe string value to set.
Bool TIDY_CALL tidyOptSnapshot ( TidyDoc  tdoc)

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.

Parameters
tdocThe tidy document for which to take a snapshot.
Returns
Returns a bool indicating success or failure.
Bool TIDY_CALL tidySetConfigCallback ( TidyDoc  tdoc,
TidyConfigCallback  pConfigCallback 
)

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.

Returns
Returns yes upon success.
Parameters
tdocThe document to apply the callback to.
pConfigCallbackThe name of a function of type TidyConfigCallback() to serve as your callback.
Bool TIDY_CALL tidySetConfigChangeCallback ( TidyDoc  tdoc,
TidyConfigChangeCallback  pCallback 
)

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.
Returns
Returns yes upon success.
Parameters
tdocThe document to apply the callback to.
pCallbackThe name of a function of type TidyConfigChangeCallback() to serve as your callback.
Bool TIDY_CALL tidySetOptionCallback ( TidyDoc  tdoc,
TidyOptCallback  pOptCallback 
)

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().

Returns
Returns yes upon success.
Parameters
tdocThe document to apply the callback to.
pOptCallbackThe name of a function of type TidyOptCallback() to serve as your callback.