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

Exposed Data Structures

typedef languageDictionaryEntry const languageDictionary[600]
 For now we'll just use an array to hold all of the dictionary entries. More...
 
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...
 

Data Structure Documentation

◆ languageDictionaryEntry

struct languageDictionaryEntry

Describes a record for a localization string.

Data Fields
uint key
uint pluralForm
ctmbstr value

◆ tidyLocaleMapItemImpl

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

◆ languageDictionary

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

◆ tidyLanguage

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

◆ TY_❪getInstalledLanguageList❫()

TY_PRIVATE 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();

◆ TY_❪getNextInstalledLanguage❫()

TY_PRIVATE ctmbstr TY_❪getNextInstalledLanguage❫ ( TidyIterator *  iter)

Returns the next installed language.

◆ TY_❪getNextStringKey❫()

TY_PRIVATE uint TY_❪getNextStringKey❫ ( TidyIterator *  iter)

◆ TY_❪getNextWindowsLanguage❫()

TY_PRIVATE const tidyLocaleMapItemImpl* TY_❪getNextWindowsLanguage❫ ( TidyIterator *  iter)

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

◆ TY_❪getStringKeyList❫()

TY_PRIVATE TidyIterator TY_❪getStringKeyList❫ ( void  )

◆ TY_❪getWindowsLanguageList❫()

TY_PRIVATE 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();

◆ TY_❪tidyDefaultStringN❫()

TY_PRIVATE ctmbstr TY_❪tidyDefaultStringN❫ ( uint  messageType,
uint  quantity 
)

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

◆ TY_❪tidyDefaultString❫()

TY_PRIVATE ctmbstr TY_❪tidyDefaultString❫ ( uint  messageType)

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

◆ TY_❪tidyGetLanguageSetByUser❫()

TY_PRIVATE 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.

◆ TY_❪tidyGetLanguage❫()

TY_PRIVATE ctmbstr TY_❪tidyGetLanguage❫ ( void  )

Gets the current language used by Tidy.

◆ TY_❪TidyLangPosixName❫()

TY_PRIVATE ctmbstr TY_❪TidyLangPosixName❫ ( const tidyLocaleMapItemImpl item)

Given a `tidyLocaleMapItemImpl, return the POSIX name.

◆ TY_❪TidyLangWindowsName❫()

TY_PRIVATE ctmbstr TY_❪TidyLangWindowsName❫ ( const tidyLocaleMapItemImpl item)

Given a `tidyLocaleMapItemImpl, return the Windows name.

◆ TY_❪tidyLocalizedStringN❫()

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

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

◆ TY_❪tidyLocalizedString❫()

TY_PRIVATE ctmbstr TY_❪tidyLocalizedString❫ ( uint  messageType)

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

◆ TY_❪tidySetLanguageSetByUser❫()

TY_PRIVATE 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.

◆ TY_❪tidySetLanguage❫()

TY_PRIVATE 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.

◆ TY_❪tidySystemLocale❫()

TY_PRIVATE 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.