Database - Language: liblangtag Documentation

## Database - Language Database - Language — An interface to access Language Database |

## Functions

lt_lang_db_t * | lt_lang_db_new ()
lt_lang_db_t * | lt_lang_db_ref ()
void | lt_lang_db_unref ()
lt_lang_t * | lt_lang_db_lookup ()

## Types and Values

| lt_lang_db_t

## Description

This class provides an interface to access Language database. which has been registered as ISO 639 code.

## Functions

### lt_lang_db_new ()

    lt_lang_db_t *
    lt_lang_db_new (void);

Create a new instance of a lt_lang_db_t.

#### Returns

a new instance of lt_lang_db_t.

[transfer full]

### lt_lang_db_ref ()

    lt_lang_db_t *
    lt_lang_db_ref (lt_lang_db_t *langdb);

Increases the reference count of `langdb` .

#### Parameters

langdb | a lt_lang_db_t. |

#### Returns

the same `langdb` object.

[transfer none]

### lt_lang_db_unref ()

    void
    lt_lang_db_unref (lt_lang_db_t *langdb);

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

#### Parameters

langdb | a lt_lang_db_t. |

### lt_lang_db_lookup ()

    lt_lang_t *
    lt_lang_db_lookup (lt_lang_db_t *langdb,
                       const char *subtag);

Lookup `lt_lang_t` if `subtag` is valid and registered into the database.

#### Parameters

langdb | a lt_lang_db_t. |
subtag | a subtag name to lookup. |

#### Returns

a lt_lang_t that meets with `subtag` . otherwise `NULL`.

[transfer full]

## Types and Values

### lt_lang_db_t

    typedef struct _lt_lang_db_t lt_lang_db_t;

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