Container - Language

Container - Language — A container class for Language subtag

Functions

lt_lang_t * lt_lang_ref ()
void lt_lang_unref ()
const char * lt_lang_get_name ()
const char * lt_lang_get_better_tag ()
const char * lt_lang_get_tag ()
const char * lt_lang_get_preferred_tag ()
const char * lt_lang_get_suppress_script ()
const char * lt_lang_get_macro_language ()
const char * lt_lang_get_scope ()
void lt_lang_dump ()
lt_bool_t lt_lang_compare ()

Types and Values

Description

This container class provides a data access to Language subtag entry.

Functions

lt_lang_ref ()

lt_lang_t *
lt_lang_ref (lt_lang_t *lang);

Increases the reference count of lang .

Parameters

lang

a lt_lang_t.

 

Returns

the same lang object.

[transfer none]


lt_lang_unref ()

void
lt_lang_unref (lt_lang_t *lang);

Decreases the reference count of lang . when its reference count drops to 0, the object is finalized (i.e. its memory is freed).

Parameters

lang

a lt_lang_t.

 

lt_lang_get_name ()

const char *
lt_lang_get_name (const lt_lang_t *lang);

Obtains the description of the subtag.

Parameters

lang

a lt_lang_t.

 

Returns

a description string.


lt_lang_get_better_tag ()

const char *
lt_lang_get_better_tag (const lt_lang_t *lang);

Obtains the better tag for use. this is a convenient function to get the preferred-value if available.

Parameters

lang

a lt_lang_t.

 

Returns

a tag string.


lt_lang_get_tag ()

const char *
lt_lang_get_tag (const lt_lang_t *lang);

Obtains the tag name.

Parameters

lang

a lt_lang_t.

 

Returns

a tag string.


lt_lang_get_preferred_tag ()

const char *
lt_lang_get_preferred_tag (const lt_lang_t *lang);

Obtains the preferred-value. this is available only when the tag is marked as deprecated.

Parameters

lang

a lt_lang_t.

 

Returns

a preferred-value for the tag or NULL.


lt_lang_get_suppress_script ()

const char *
lt_lang_get_suppress_script (const lt_lang_t *lang);

Obtains the suppress-script value. which shouldn't be used to form language tags with the associated primary or extended language subtag.

Parameters

lang

a lt_lang_t.

 

Returns

a suppress-script string or NULL.


lt_lang_get_macro_language ()

const char *
lt_lang_get_macro_language (const lt_lang_t *lang);

Obtains the macrolanguage being assigned for the subtag. This is available only when the subtag is registered as the macrolanguage in ISO 639-3.

Parameters

lang

a lt_lang_t.

 

Returns

a macrolanguage string or NULL.


lt_lang_get_scope ()

const char *
lt_lang_get_scope (const lt_lang_t *lang);

Obtains the scope value indicating the type of language code according to ISO 639.

Parameters

lang

a lt_lang_t.

 

Returns

a scope string or NULL.


lt_lang_dump ()

void
lt_lang_dump (const lt_lang_t *lang);

Dumps the container information to the standard output.

Parameters

lang

a lt_lang_t.

 

lt_lang_compare ()

lt_bool_t
lt_lang_compare (const lt_lang_t *v1,
                 const lt_lang_t *v2);

Compare if v1 and v2 is the same object or not.

Parameters

v1

a lt_lang_t.

 

v2

a lt_lang_t.

 

Returns

TRUE if it's the same, otherwise FALSE.

Types and Values

lt_lang_t

typedef struct _lt_lang_t lt_lang_t;

All the fields in the lt_lang_t structure are private to the lt_lang_t implementation.