HTML Tidy  5.7.0
The HTACG Tidy HTML Project
language.h File Reference

Go to the source code of this file.

Data Structures

struct  languageDefinition
 Finally, a complete language definition. More...
 
struct  languageDictionaryEntry
 Describes a record for a localization string. More...
 
struct  tidyLocaleMapItemImpl
 The function getNextWindowsLanguage() returns pointers to this type; it gives LibTidy implementors the ability to determine how Windows locale names are mapped to POSIX language codes. More...
 

Functions

Localization Related Functions
tmbstr TY_❪tidySystemLocale❫ (tmbstr result)
 Determines the current locale without affecting the C locale. More...
 
Bool TY_❪tidySetLanguage❫ (ctmbstr languageCode)
 Tells Tidy to use a different language for output. More...
 
ctmbstr TY_❪tidyGetLanguage❫ (void)
 Gets the current language used by Tidy. More...
 
Bool TY_❪tidyGetLanguageSetByUser❫ (void)
 Indicates whether or not the current language was set by a LibTidy user or internally by the library. More...
 
void TY_❪tidySetLanguageSetByUser❫ (void)
 Specifies to LibTidy that the user (rather than the library) selected the current language. More...
 
ctmbstr TY_❪tidyLocalizedStringN❫ (uint messageType, uint quantity)
 Provides a string given messageType in the current localization for quantity. More...
 
ctmbstr TY_❪tidyLocalizedString❫ (uint messageType)
 Provides a string given messageType in the current localization for the single case. More...
 
Documentation Generation
ctmbstr TY_❪tidyDefaultString❫ (uint messageType)
 Provides a string given messageType in the default localization (which is en). More...
 
TidyIterator TY_❪getStringKeyList❫ (void)
 
uint TY_❪getNextStringKey❫ (TidyIterator *iter)
 
TidyIterator TY_❪getWindowsLanguageList❫ (void)
 Initializes the TidyIterator to point to the first item in Tidy's structure of Windows<->POSIX local mapping. More...
 
const tidyLocaleMapItemImplTY_❪getNextWindowsLanguage❫ (TidyIterator *iter)
 Returns the next record of type localeMapItem in Tidy's structure of Windows<->POSIX local mapping. More...
 
const ctmbstr TY_❪TidyLangWindowsName❫ (const tidyLocaleMapItemImpl *item)
 Given a `tidyLocalMapItemImpl, return the Windows name. More...
 
const ctmbstr TY_❪TidyLangPosixName❫ (const tidyLocaleMapItemImpl *item)
 Given a `tidyLocalMapItemImpl, return the POSIX name. More...
 
TidyIterator TY_❪getInstalledLanguageList❫ (void)
 Initializes the TidyIterator to point to the first item in Tidy's list of installed language codes. More...
 
ctmbstr TY_❪getNextInstalledLanguage❫ (TidyIterator *iter)
 Returns the next installed language. More...
 

Exposed Data Structures

enum  tidyLanguage {
  TIDY_LANGUAGE = 400,
  TIDY_MESSAGE_TYPE_LAST
}
 These enumerations are used within instances of languageDefinition structures to provide additional metadata, and are localizable therein. More...
 
typedef languageDictionaryEntry const languageDictionary[600]
 For now we'll just use an array to hold all of the dictionary entries. More...
 

Data Structure Documentation

struct languageDictionaryEntry

Describes a record for a localization string.

Data Fields
uint key
uint pluralForm
ctmbstr value
struct tidyLocaleMapItemImpl

The function getNextWindowsLanguage() returns pointers to this type; it gives LibTidy implementors the ability to determine how Windows locale names are mapped to POSIX language codes.

Data Fields
ctmbstr POSIXName
ctmbstr winName

Typedef Documentation

typedef languageDictionaryEntry const languageDictionary[600]

For now we'll just use an array to hold all of the dictionary entries.

In the future we can convert this to a hash structure which will make looking up strings faster.

Enumeration Type Documentation

These enumerations are used within instances of languageDefinition structures to provide additional metadata, and are localizable therein.

Enumerator
TIDY_LANGUAGE 
TIDY_MESSAGE_TYPE_LAST 

Function Documentation

TidyIterator TY_❪getInstalledLanguageList❫ ( void  )

Initializes the TidyIterator to point to the first item in Tidy's list of installed language codes.

Items can be retrieved with getNextInstalledLanguage();

ctmbstr TY_❪getNextInstalledLanguage❫ ( TidyIterator *  iter)

Returns the next installed language.

uint TY_❪getNextStringKey❫ ( TidyIterator *  iter)
const tidyLocaleMapItemImpl* TY_❪getNextWindowsLanguage❫ ( TidyIterator *  iter)

Returns the next record of type localeMapItem in Tidy's structure of Windows<->POSIX local mapping.

TidyIterator TY_❪getStringKeyList❫ ( void  )
TidyIterator TY_❪getWindowsLanguageList❫ ( void  )

Initializes the TidyIterator to point to the first item in Tidy's structure of Windows<->POSIX local mapping.

Items can be retrieved with getNextWindowsLanguage();

ctmbstr TY_❪tidyDefaultString❫ ( uint  messageType)

Provides a string given messageType in the default localization (which is en).

Bool TY_❪tidyGetLanguageSetByUser❫ ( void  )

Indicates whether or not the current language was set by a LibTidy user or internally by the library.

This flag prevents subsequently created instances of TidyDocument from changing the user's language.

Returns
Returns yes to indicate that the current language was specified by an API user.
ctmbstr TY_❪tidyGetLanguage❫ ( void  )

Gets the current language used by Tidy.

const ctmbstr TY_❪TidyLangPosixName❫ ( const tidyLocaleMapItemImpl item)

Given a `tidyLocalMapItemImpl, return the POSIX name.

const ctmbstr TY_❪TidyLangWindowsName❫ ( const tidyLocaleMapItemImpl item)

Given a `tidyLocalMapItemImpl, return the Windows name.

ctmbstr TY_❪tidyLocalizedStringN❫ ( uint  messageType,
uint  quantity 
)

Provides a string given messageType in the current localization for quantity.

ctmbstr TY_❪tidyLocalizedString❫ ( uint  messageType)

Provides a string given messageType in the current localization for the single case.

void TY_❪tidySetLanguageSetByUser❫ ( void  )

Specifies to LibTidy that the user (rather than the library) selected the current language.

This flag prevents subsequently created instances of TidyDocument from changing the user's language.

Bool TY_❪tidySetLanguage❫ ( ctmbstr  languageCode)

Tells Tidy to use a different language for output.

Parameters
languageCodeA Windows or POSIX language code, and must match a TIDY_LANGUAGE for an installed language.
Returns
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.
tmbstr TY_❪tidySystemLocale❫ ( tmbstr  result)

Determines the current locale without affecting the C locale.

Tidy has always used the default C locale, and at this point in its development we're not going to tamper with that.

Parameters
resultThe buffer to use to return the string. Returns NULL on failure.
Returns
The same buffer for convenience.