MSymbol msymbol |
( |
const char * |
name |
) |
|
|
The msymbol() function returns the canonical symbol whose name is name. If there is none, one is created. The created one is not a managing key.
Symbols whose name starts by two spaces are reserved by the m17n library, and are used by the library only internally.
- Return value:
- This function returns the found or created symbol.
- Errors:
- This function never fails.
- See Also:
- msymbol_as_managing_key(), msymbol_name(), msymbol_exist()
|
MSymbol msymbol_as_managing_key |
( |
const char * |
name |
) |
|
|
The msymbol_as_managing_key() function returns a newly created managing key whose name is name. It there already exists a symbol of name name, it returns Mnil.
Symbols whose name starts by two spaces are reserved by the m17n library, and are used by the library only internally.
- Return value:
- If the operation was successful, this function returns the created symbol. Otherwise, it returns Mnil.
- Errors:
- MERROR_SYMBOL
- See Also:
- msymbol(), msymbol_exist()
|
int msymbol_is_managing_key |
( |
MSymbol |
symbol |
) |
|
|
The msymbol_is_managing_key() function checks if the symbol symbol is a managing key or not.
- Return value: Return 1 if the symbol is a managing key. Otherwise,
- return 0.
|
|
The msymbol_put() function assigns val to the value of the symbol property that belongs to symbol and whose key is key. If the symbol property already has a value, val overwrites the old one. Both symbol and key must not be Mnil.
If key is a managing key, val must be a managed object. In this case, the reference count of the old value, if not NULL , is decremented by one, and that of val is incremented by one.
- Return value:
- If the operation was successful, msymbol_put() returns 0. Otherwise it returns -1 and assigns an error code to the external variable merror_code.
- Errors:
MERROR_SYMBOL
- See Also:
- msymbol_get()
|
|
The msymbol_get() function searches for the value of the symbol property that belongs to symbol and whose key is key. If symbol has such a symbol property, its value is returned. Otherwise NULL is returned.
- Return value:
- If an error is detected, msymbol_get() returns
NULL and assigns an error code to the external variable merror_code.
- Errors:
MERROR_SYMBOL
- See Also:
- msymbol_put()
|
|