14 #if defined(__has_include)
15 #if __has_include(<langinfo.h>)
17 #define ZPMOD_HAVE_LANGINFO 1
29 const char *env =
getsparam(
"ZPMOD_ICONS");
31 if (!strcmp(env,
"0") || !strcmp(env,
"false") || !strcmp(env,
"off")) {
34 if (!strcmp(env,
"1") || !strcmp(env,
"true") || !strcmp(env,
"on")) {
38 if (!isatty(STDOUT_FILENO)) {
41 setlocale(LC_ALL,
"");
42 #ifdef ZPMOD_HAVE_LANGINFO
43 const char *cs = nl_langinfo(CODESET);
44 if (cs && (strstr(cs,
"UTF-8") || strstr(cs,
"utf8") || strstr(cs,
"UTF8"))) {
48 const char *lc = getenv(
"LC_ALL");
51 if (lc && (strstr(lc,
"UTF-8") || strstr(lc,
"utf8") || strstr(lc,
"UTF8")))
const char * zp_icon(const char *s)
Return icon string if enabled, empty string otherwise.
int zp_icons_enabled(void)
Determine if icons should be emitted to stdout.
Module declaration header (mdh) for zpmod.
Prototype stub for zpmod when building out-of-tree.
Optional terminal/locale detection for emoji support in messages.
char * getsparam(const char *name)
Local, non-invasive shims to suppress benign vendor header warnings.