HTML Tidy  5.6.0
The HTACG Tidy HTML Project
Message Key Management

Detailed Description

These functions serve to manage message codes, i.e., codes that are used Tidy and communicated via its callback filters to represent reports and dialogue that Tidy emits.

Remarks
These codes only reflect complete messages, and are specifically distinct from the internal codes that are used to lookup individual strings for localization purposes.

Functions

TidyIterator TIDY_CALL getErrorCodeList (void)
 Initiates an iterator for a list of message codes available in Tidy. More...
 
uint TIDY_CALL getNextErrorCode (TidyIterator *iter)
 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. More...
 
ctmbstr TIDY_CALL tidyErrorCodeAsKey (uint code)
 Given a message code, return the text key that represents it. More...
 
uint TIDY_CALL tidyErrorCodeFromKey (ctmbstr code)
 Given a text key representing a message code, return the uint that represents it. More...
 

Function Documentation

TidyIterator TIDY_CALL getErrorCodeList ( void  )

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:

TidyIterator itMessage = getErrorCodeList();
while ( itMessage ) {
uint code = getNextErrorCode( &itMessage );
// do something with the code, such as lookup a string.
}
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
uint TIDY_CALL getNextErrorCode ( TidyIterator *  iter)

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.

Parameters
iterThe TidyIterator (initiated with getErrorCodeList()) token.
Returns
Returns a message code.
ctmbstr TIDY_CALL tidyErrorCodeAsKey ( uint  code)

Given a message code, return the text key that represents it.

Parameters
codeThe error code to lookup.
Returns
The string representing the error code.
uint TIDY_CALL tidyErrorCodeFromKey ( ctmbstr  code)

Given a text key representing a message code, return the uint that represents it.

Remarks
We establish that for external purposes, the API will ensure that string keys remain consistent. Never count on the integer value of a message code. Always use this function to ensure that the integer is valid if you need one.
Parameters
codeThe string representing the error code.
Returns
Returns an integer that represents the error code, which can be used to lookup Tidy's built-in strings. If the provided string does not have a matching message code, then UINT_MAX will be returned.