#include "Unihan.h"
Go to the source code of this file.
Functions | |
UnihanTable | unihanField_get_builtin_preferred_table (UnihanField field) |
Return the preferred table of field (Builtin). | |
UnihanTable * | unihanField_get_builtin_required_tables (UnihanField field) |
Return an array of tables which are required by the given field (Builtin). | |
gboolean | unihanField_builtin_has_flags (UnihanField field, guint flags) |
Whether field has given flags. | |
UnihanField | unihanField_builtin_parse (const char *str) |
Parses the string argument as a UnihanField. | |
const char * | unihanField_builtin_to_string (UnihanField field) |
Returns a string representing a built-in UnihanField. | |
UnihanField * | unihanTable_get_builtin_fields (UnihanTable table) |
Returns all built-in fields of the table in an UnihanField array. | |
UnihanTable | unihanTable_builtin_parse (const char *str) |
Parses the string argument as a UnihanTable. | |
const char * | unihanTable_builtin_to_string (UnihanTable table) |
Returns all built-in fields of the table in an UnihanField array. | |
int | unihan_import_builtin_table_tagValue (sqlite3 *db, gunichar code, UnihanField field, const char *tagValue) |
Import a tag value of a character from a line of Unihan.txt. |
These function are mainly for rebuilding database only, i.e. Normally not needed.
int unihan_import_builtin_table_tagValue | ( | sqlite3 * | db, | |
gunichar | code, | |||
UnihanField | field, | |||
const char * | tagValue | |||
) |
This function imports a line in Unihan.txt to database db
. For non-singleton fields (fields which may have multiple values for each character), the tag value is split with the delimiter ' ', and each chunk is passed to unihan_import_builtin_table_single_tagValue() for further process.
db | Db handle | |
code | the UCS4 representation of the character. | |
field | The UnihanField to be import. | |
tagValue | The value of the field. |
gboolean unihanField_builtin_has_flags | ( | UnihanField | field, | |
guint | flags | |||
) |
Whether field has given flags. Always return FALSE if field is UNIHAN_INVALID_FIELD or field is not built-in (field >=UNIHAN_FIELD_3RD_PARTY).
field | field to be checked. | |
flags | flags to be checked. |
UnihanField unihanField_builtin_parse | ( | const char * | str | ) |
Parses the string argument as a UnihanField. Note that the match is case-sensitive.
str | the string to be parsed. |
const char* unihanField_builtin_to_string | ( | UnihanField | field | ) |
UnihanTable unihanField_get_builtin_preferred_table | ( | UnihanField | field | ) |
libUnihan is field-center, that is, normally you only need to mention the field to get the desirable result. This function returns the preferred table need to get that field.
The field can be either real or pseudo.
field | the UnihanField. |
UNIHAN_INVALID_TABLE
if invalid field is given. unihanField_get_all_builtin_tables(UnihanField field)
UnihanTable* unihanField_get_builtin_required_tables | ( | UnihanField | field | ) |
This function returns a newly allocated array of tables which are required by the given field. UNIHAN_INVALID_TABLE
marks the end of the array.
If a real field is given, then it returns an array that has the preferred table.
If a pseudo field is given, then it returns an array which contains all tables it need to generate it.
Use free() or g_free() to free the result.
field | the UnihanField. |
UNIHAN_INVALID_TABLE
if invalid field is given. unihanField_get_all_builtin_tables(UnihanField field)
UnihanTable unihanTable_builtin_parse | ( | const char * | str | ) |
Parses the string argument as a UnihanTable. Note that the match is case-sensitive.
str | the string to be parsed. |
const char * unihanTable_builtin_to_string | ( | UnihanTable | table | ) |
Returns a string representing a built-in UnihanTable.
Returns all built-in fields of the table in an UnihanField array. The returned UnihanField array is terminated by UNIHAN_INVALID_FIELD. Use free() or g_free() to free the UnihanField array.
table | the UnihanTable. |
table | the UnihanTable. |
UnihanField* unihanTable_get_builtin_fields | ( | UnihanTable | table | ) |
Returns all built-in fields of the table in an UnihanField array. The returned UnihanField array is terminated by UNIHAN_INVALID_FIELD. Use free() or g_free() to free the UnihanField array.
table | the UnihanTable. |