Дано: функция glibc, у которой в мануале написано:
char* nl_langinfo(nl_item item);
If no locale has been selected for the appropriate category, nl_lang-
info() returns a pointer to the corresponding string in the "C" locale.
If item is not valid, a pointer to an empty string is returned.
nl_langinfo doesn't return always char pointers.Разумеется, никакой документации для этого любопыного факта в обозримой вселенной не существует, уж во всяком случае - не на сайте GNU.
For some values it returns unsigned int and for others uint32_t, it really
depends on the value. Say for _NL_TIME_WEEK_1STDAY you want:
union { char *p; unsigned int val; } u;
u.p = nl_langinfo (_NL_TIME_WEEK_1STDAY);
value = u.val;
Внимание, риторический вопрос: что курят эти люди и зачем они прилетели к нам на Землю?
Originally posted on sm.vox.com
Tags:
no subject