MLocale* mlocale_set |
( |
int |
category, |
|
|
const char * |
name | |
|
) |
| | |
|
The mlocale_set() function sets or query a part of the current locale. The part is specified by category which must be a valid first argument to setlocale() .
If locale is not NULL, the locale of the specified part is set to locale. If locale is not supported by the system, the current locale is not changed.
If locale is NULL, the current locale of the specified part is queried.
- Return value:
- If the call is successful, mlocale_set() returns an opaque locale object that corresponds to the locale. The name of the locale can be acquired by the function mlocale_get_prop().
Otherwise, it returns NULL.
- Errors:
MERROR_LOCALE
|
int mtext_ftime |
( |
MText * |
mt, |
|
|
const char * |
format, |
|
|
const struct tm * |
tm, |
|
|
MLocale * |
locale | |
|
) |
| | |
|
The mtext_ftime() function formats the broken-down time tm according to the format specification format and append the result to the M-text mt. The formating is done according to the locale locale (if not NULL) or the current locale (LC_TIME).
The meaning of the arguments tm and format are the same as those of strftime().
- See Also:
- strftime()
|
MText* mtext_getenv |
( |
const char * |
name |
) |
|
|
The mtext_getenv() function searches the environment variable list for a string that matches the string pointed to by name.
If there is a match, the function decodes the value according to the current locale (LC_CTYPE) into an M-text, and return that M-text.
If there is no match, the function returns NULL. |
int mtext_putenv |
( |
MText * |
mt |
) |
|
|
The mtext_putenv() function changes or adds the value of environment variables according to M-text mt. It calls the function putenv with an argument generated by encoding mt according to the current locale (LC_CTYPE).
- Return value:
- This function returns zero on success, or -1 if an error occurs.
|
|
The mtext_coll() function compares the two M-texts mt1 and mt2. It returns an integer less than, equal to, or greater than zero if mt1 is found, respectively, to be less than, to match, or to be greater than mt2. The comparison is based on texts as appropriate for the current locale (LC_COLLATE).
This function makes use of information that is automatically cached in the M-texts as a text property. So, the second call of this function with mt1 or mt2 finishes faster than the first call. |
|