MSymbol mchar_define_charset |
( |
const char * |
name, |
|
|
MPlist * |
plist | |
|
) |
| | |
|
The mchar_define_charset() function defines a new charset and makes it accessible via a symbol whose name is name. plist specifies parameters of the charset as below:
-
Key is Mmethod, value is a symbol.
The value specifies the method for decoding/encoding code-points in the charset. It must be Moffset, Mmap (default), Munify, Msubset, or Msuperset.
-
Key is Mdimension, value is an integer
The value specifies the dimension of code-points of the charset. It must be 1 (default), 2, 3, or 4.
-
Key is Mmin_range, value is an unsigned integer
The value specifies the minimum range of a code-point, which means that the Nth byte of the value is the minimum Nth byte of code-points of the charset. The default value is 0.
-
Key is Mmax_range, value is an unsigned integer
The value specifies the maximum range of a code-point, which means that the Nth byte of the value is the maximum Nth byte of code-points of the charset. The default value is 0xFF, 0xFFFF, 0xFFFFFF, or 0xFFFFFFFF if the dimension is 1, 2, 3, or 4 respectively.
-
Key is Mmin_code, value is an unsigned integer
The value specifies the minimum code-point of the charset. The default value is the minimum range.
-
Key is Mmax_code, value is an unsigned integer
The value specifies the maximum code-point of the charset. The default value is the maximum range.
-
Key is Mascii_compatible, value is a symbol
The value specifies whether the charset is ASCII compatible or not. If the value is Mnil (default), it is not ASCII compatible, else compatible.
-
Key is Mfinal_byte, value is an integer
The value specifies the final byte of the charset registered in The International Registry. It must be 0 (default) or 32..127. The value 0 means that the charset is not in the registry.
-
Key is Mrevision, value is an integer
The value specifies the revision number of the charset registered in The International Registry. It must be 0..127. If the charset is not in The International Registry, the value is ignored. The value 0 means that the charset has no revision number.
-
Key is Mmin_char, value is an integer
The value specifies the minimum character code of the charset. The default value is 0.
-
Key is Mmapfile, value is an M-text
If the method is Mmap or Munify, a data that contains mapping information is added to the m17n database by calling the function mdatabase_define() with the value as an argument extra_info, i.e. the value is used as a file name of the data.
Otherwise, this parameter is ignored.
-
Key is Mparents, value is a plist
If the method is Msubset, the value must is a plist of length 1, and the value of the plist must be a symbol representing a parent charset.
If the method is Msuperset, the value must be a plist of length less than 9, and the values of the plist must be symbols representing subset charsets.
Otherwise, this parameter is ignored.
-
Key is Mdefine_coding, value is a symbol
If the dimension of the charset is 1, the value specifies whether or not to define a coding system of the same name whose type is Mcharset. A coding system is defined if the value is not Mnil.
Otherwise, this parameter is ignored.
- Return value:
- If the operation was successful, mchar_define_charset() returns a symbol whose name is name. Otherwise it returns Mnil and assigns an error code to the external variable merror_code.
- Errors:
MERROR_CHARSET
|
|
The mchar_resolve_charset() function returns symbol if it represents a charset. Otherwise, canonicalize symbol as to a charset name, and if the canonicalized name represents a charset, return it. Otherwise, return Mnil. |
int mchar_list_charset |
( |
MSymbol ** |
symbols |
) |
|
|
The mchar_list_charsets() function makes an array of symbols representing a charset, stores the pointer to the array in a place pointed to by symbols, and returns the length of the array. |
int mchar_decode |
( |
MSymbol |
charset_name, |
|
|
unsigned |
code | |
|
) |
| | |
|
The mchar_decode() function decodes code-point code in the charset represented by the symbol charset_name to get a character code.
- Return value:
- If decoding was successful, mchar_decode() returns the decoded character code. Otherwise it returns -1.
- See Also:
- mchar_encode()
|
int mchar_map_charset |
( |
MSymbol |
charset_name, |
|
|
void(*)(int from, int to, void *arg) |
func, |
|
|
void * |
func_arg | |
|
) |
| | |
|
The mcharset_map_chars() function calls func for all the characters in the charset named charset_name. A call is done for a chunk of consecutive characters rather than character by character.
func receives three arguments: from, to, and arg. from and to specify the range of character codes in charset. arg is the same as func_arg.
- Return value:
- If the operation was successful, mcharset_map_chars() returns 0. Otherwise, it returns -1 and assigns an error code to the external variable merror_code.
- Errors:
MERROR_CHARSET
|
|