Go to the source code of this file.
Data Structures | |
struct | M17NObjectHead |
The first member of a managed object. More... | |
Defines | |
#define | M17NLIB_MAJOR_VERSION 1 |
#define | M17NLIB_MINOR_VERSION 0 |
#define | M17NLIB_VERSION_NAME "1.0" |
#define | M17N_INIT() m17n_init_core() |
#define | M17N_FINI() m17n_fini_core() |
#define | MCHAR_MAX 0x3FFFFF |
Typedefs | |
typedef MSymbol * | MSymbol |
Type of symbols. | |
typedef MPlist | MPlist |
Type of property list objects. | |
typedef MCharTable | MCharTable |
Type of chartables. | |
typedef MText | MText |
Type of M-texts. | |
typedef MPlist *(* | MTextPropSerializeFunc )(void *val) |
Type of serializer functions. | |
typedef void *(* | MTextPropDeserializeFunc )(MPlist *plist) |
Type of deserializer functions. | |
typedef MTextProperty | MTextProperty |
Enumerations | |
enum | MTextFormat { MTEXT_FORMAT_US_ASCII, MTEXT_FORMAT_UTF_8, MTEXT_FORMAT_UTF_16LE, MTEXT_FORMAT_UTF_16BE, MTEXT_FORMAT_UTF_32LE, MTEXT_FORMAT_UTF_32BE, MTEXT_FORMAT_MAX } |
Enumeration for specifying the format of an M-text. More... | |
enum | MTextPropertyControl { MTEXTPROP_FRONT_STICKY = 0x01, MTEXTPROP_REAR_STICKY = 0x02, MTEXTPROP_VOLATILE_WEAK = 0x04, MTEXTPROP_VOLATILE_STRONG = 0x08, MTEXTPROP_NO_MERGE = 0x10, MTEXTPROP_CONTROL_MAX = 0x1F } |
Flag bits to control text property. More... | |
Functions | |
void | m17n_init_core (void) |
void | m17n_fini_core (void) |
void * | m17n_object_setup (int size, void(*freer)(void *)) |
int | m17n_object_ref (void *object) |
Increment the reference count of a managed object. | |
int | m17n_object_unref (void *object) |
Decrement the reference count of a managed object. | |
MSymbol | msymbol (const char *name) |
Get a symbol. | |
MSymbol | msymbol_as_managing_key (const char *name) |
Create a managing key. | |
MSymbol | msymbol_exist (const char *name) |
Search for a symbol that has a specified name. | |
char * | msymbol_name (MSymbol symbol) |
Get symbol name. | |
int | msymbol_put (MSymbol symbol, MSymbol key, void *val) |
Set the value of a symbol property. | |
void * | msymbol_get (MSymbol symbol, MSymbol key) |
Get the value of a symbol property. | |
MPlist * | mplist () |
Create a property list object. | |
MPlist * | mplist_copy (MPlist *plist) |
Copy a plist. | |
MPlist * | mplist_add (MPlist *plist, MSymbol key, void *val) |
Add a property at the end of a property list object. | |
MPlist * | mplist_push (MPlist *plist, MSymbol key, void *val) |
Push a property to a property list object. | |
void * | mplist_pop (MPlist *plist) |
Pop a property from a property list object. | |
MPlist * | mplist_put (MPlist *plist, MSymbol key, void *val) |
Set the value of a property in a property list object. | |
void * | mplist_get (MPlist *plist, MSymbol key) |
Get the value of a property in a property list object. | |
MPlist * | mplist_find_by_key (MPlist *plist, MSymbol key) |
Find a property of a specific key in a property list object. | |
MPlist * | mplist_find_by_value (MPlist *plist, void *val) |
Find a property of a specific value in a property list object. | |
MPlist * | mplist_next (MPlist *plist) |
Return the next sublist of a plist. | |
MPlist * | mplist_set (MPlist *plist, MSymbol key, void *val) |
Set the first property in a property list object. | |
int | mplist_length (MPlist *plist) |
Return the length of a plist. | |
MSymbol | mplist_key (MPlist *plist) |
Return the key of the first property in a property list object. | |
void * | mplist_value (MPlist *plist) |
Return the value of the first property in a property list object. | |
MSymbol | mchar_define_property (char *name, MSymbol type) |
Define a character property. | |
void * | mchar_get_prop (int c, MSymbol key) |
Get the value of a character property. | |
int | mchar_put_prop (int c, MSymbol key, void *val) |
Set the value of a character property. | |
MCharTable * | mchartable (MSymbol key, void *default_value) |
Create a new chartable. | |
void * | mchartable_lookup (MCharTable *table, int c) |
Return the assigned value of a character in a chartable. | |
int | mchartable_set (MCharTable *table, int c, void *val) |
Assign a value to a character in a chartable. | |
int | mchartable_set_range (MCharTable *table, int from, int to, void *val) |
Assign a value to the characters in the specified range. | |
int | mchartable_map (MCharTable *table, void *ignore, void(*func)(int from, int to, void *val, void *arg), void *func_arg) |
void | mchartable_range (MCharTable *table, int *from, int *to) |
Search for characters that have non-default value. | |
MText * | mtext () |
Allocate a new M-text. | |
MText * | mtext_from_data (void *data, int nitems, enum MTextFormat format) |
Allocate a new M-text with specified data. | |
int | mtext_len (MText *mt) |
Number of characters in M-text. | |
int | mtext_ref_char (MText *mt, int pos) |
Return the character at the specified position in an M-text. | |
int | mtext_set_char (MText *mt, int pos, int c) |
Store a character into an M-text. | |
MText * | mtext_copy (MText *mt1, int pos, MText *mt2, int from, int to) |
Copy characters in the specified range into an M-text. | |
int | mtext_compare (MText *mt1, int from1, int to1, MText *mt2, int from2, int to2) |
Compare two M-texts. | |
int | mtext_case_compare (MText *mt1, int from1, int to1, MText *mt2, int from2, int to2) |
Compare two M-texts ignoring cases. | |
int | mtext_character (MText *mt, int from, int to, int c) |
Search a character in an M-text. | |
int | mtext_del (MText *mt, int from, int to) |
Delete characters in the specified range destructively. | |
int | mtext_ins (MText *mt1, int pos, MText *mt2) |
Insert an M-text into another M-text. | |
int | mtext_ins_char (MText *mt, int pos, int c, int n) |
MText * | mtext_cat_char (MText *mt, int c) |
Append a character to an M-text. | |
MText * | mtext_duplicate (MText *mt, int from, int to) |
Create a new M-text from a part of an existing M-text. | |
MText * | mtext_dup (MText *mt) |
Create a copy of an M-text. | |
MText * | mtext_cat (MText *mt1, MText *mt2) |
Append an M-text to another. | |
MText * | mtext_ncat (MText *mt1, MText *mt2, int n) |
Append a part of an M-text to another. | |
MText * | mtext_cpy (MText *mt1, MText *mt2) |
Copy an M-text to another. | |
MText * | mtext_ncpy (MText *mt1, MText *mt2, int n) |
Copy the first some characters in an M-text to another. | |
int | mtext_chr (MText *mt, int c) |
Return the position of the first occurrence of a character in an M-text. | |
int | mtext_rchr (MText *mt, int c) |
Return the position of the last occurrence of a character in an M-text. | |
int | mtext_cmp (MText *mt1, MText *mt2) |
Compare two M-texts character-by-character. | |
int | mtext_ncmp (MText *mt1, MText *mt2, int n) |
Compare two M-texts character-by-character. | |
int | mtext_spn (MText *mt1, MText *mt2) |
Search an M-text for a set of characters. | |
int | mtext_cspn (MText *mt1, MText *mt2) |
Search an M-text for the complement of a set of characters. | |
int | mtext_pbrk (MText *mt1, MText *mt2) |
Search an M-text for any of a set of characters. | |
int | mtext_text (MText *mt1, int pos, MText *mt2) |
Locate an M-text in another. | |
int | mtext_search (MText *mt1, int from, int to, MText *mt2) |
MText * | mtext_tok (MText *mt, MText *delim, int *pos) |
Look for a token in an M-text. | |
int | mtext_casecmp (MText *mt1, MText *mt2) |
Compare two M-texts ignoring cases. | |
int | mtext_ncasecmp (MText *mt1, MText *mt2, int n) |
Compare two M-texts ignoring cases. | |
void * | mtext_get_prop (MText *mt, int pos, MSymbol key) |
Get the value of the topmost text property. | |
int | mtext_get_prop_values (MText *mt, int pos, MSymbol key, void **values, int num) |
Get multiple values of a text property. | |
int | mtext_get_prop_keys (MText *mt, int pos, MSymbol **keys) |
Get list of text property keys at a position of an M-text. | |
int | mtext_put_prop (MText *mt, int from, int to, MSymbol key, void *val) |
Set a text property. | |
int | mtext_put_prop_values (MText *mt, int from, int to, MSymbol key, void **values, int num) |
Set multiple text properties with the same key. | |
int | mtext_push_prop (MText *mt, int from, int to, MSymbol key, void *val) |
Push a text property. | |
int | mtext_pop_prop (MText *mt, int from, int to, MSymbol key) |
Pop a text property. | |
int | mtext_change_prop (MText *mt, int from, int to, MSymbol key, int(*func)(int, void ***, int *)) |
int | mtext_prop_range (MText *mt, MSymbol key, int pos, int *from, int *to, int deeper) |
Find the range where the value of a text property is the same. | |
MTextProperty * | mtext_property (MSymbol key, void *val, int control_bits) |
Create a text property. | |
MText * | mtext_property_mtext (MTextProperty *prop) |
Return the M-text of a text property. | |
MSymbol | mtext_property_key (MTextProperty *prop) |
Return the key of a text property. | |
void * | mtext_property_value (MTextProperty *prop) |
Return the value of a text property. | |
int | mtext_property_start (MTextProperty *prop) |
Return the start position of a text property. | |
int | mtext_property_end (MTextProperty *prop) |
Return the end position of a text property. | |
MTextProperty * | mtext_get_property (MText *mt, int pos, MSymbol key) |
Get the topmost text property. | |
int | mtext_get_properties (MText *mt, int pos, MSymbol key, MTextProperty **props, int num) |
Get multiple text properties. | |
int | mtext_attach_property (MText *mt, int from, int to, MTextProperty *prop) |
Attach a text property to an M-text. | |
int | mtext_detach_property (MTextProperty *prop) |
Detach a text property from an M-text. | |
int | mtext_push_property (MText *mt, int from, int to, MTextProperty *prop) |
Push a text property onto an M-text. | |
MText * | mtext_serialize (MText *mt, int from, int to, MPlist *property_list) |
Serialize text properties in an M-text. | |
MText * | mtext_deserialize (MText *mt) |
Deserialize text properties in an M-text. | |
Variables | |
MSymbol | Mnil |
Symbol whose name is "nil". | |
MSymbol | Mt |
Symbol whose name is "t". | |
MSymbol | Mstring |
Symbol whose name is "string". | |
MSymbol | Msymbol |
Symbol whose name is "symbol". | |
MSymbol | Mtext |
Symbol whose name is "mtext". | |
MSymbol | Mplist |
Symbol whose name is "plist". | |
MSymbol | Minteger |
Symbol whose name is "integer". | |
MSymbol | Mscript |
Key for script. | |
MSymbol | Mname |
Key for character name. | |
MSymbol | Mcategory |
Key for general category. | |
MSymbol | Mcombining_class |
Key for canonical combining class. | |
MSymbol | Mbidi_category |
Key for bidi category. | |
MSymbol | Msimple_case_folding |
Key for corresponding single lowercase character. | |
MSymbol | Mcomplicated_case_folding |
Key for corresponding multiple lowercase characters. | |
MSymbol | Mchar_table |
Symbol whose name is "char-table". | |
MSymbol | Mtext_prop_serializer |
Symbol for specifying serializer functions. | |
MSymbol | Mtext_prop_deserializer |
Symbol for specifying deserializer functions. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The enum MTextFormat is used as an argument of the mtext_from_data() function to specify the format of data from which an M-text is created. |
|
|
|
|
|
|
|
|
|
|