/****************************************************************************
- * Copyright 2018-2022,2023 Thomas E. Dickey *
+ * Copyright 2018-2023,2024 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.228 2023/10/07 23:06:04 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.231 2024/02/04 00:09:34 tom Exp $")
/****************************************************************************
*
}
}
+#if defined(USE_CHECK_SIZE) && defined(user6) && defined(user7)
static const char *
skip_csi(const char *value)
{
_nc_default_screensize(termp, linep, colp);
}
-#else
-#define _nc_check_screensize(termp, linep, colp) _nc_default_screensize(termp, linep, colp)
+#else /* !USE_CHECK_SIZE */
+#define _nc_check_screensize(termp, linep, colp) /* nothing */
#endif
+#endif /* !(defined(USE_TERM_DRIVER) || defined(EXP_WIN32_DRIVER)) */
NCURSES_EXPORT(void)
_nc_get_screensize(SCREEN *sp,
NCURSES_EXPORT(int)
_nc_unicode_locale(void)
{
- int result = 0;
+ static bool initialized = FALSE;
+ static int result = 0;
+
+ if (!initialized) {
#if defined(_NC_WINDOWS) && USE_WIDEC_SUPPORT
- result = 1;
+ result = 1;
#elif HAVE_LANGINFO_CODESET
- char *env = nl_langinfo(CODESET);
- result = !strcmp(env, "UTF-8");
- T(("_nc_unicode_locale(%s) ->%d", env, result));
+ char *env = nl_langinfo(CODESET);
+ result = !strcmp(env, "UTF-8");
+ T(("_nc_unicode_locale(%s) ->%d", env, result));
#else
- char *env = _nc_get_locale();
- if (env != 0) {
- if (strstr(env, ".UTF-8") != 0) {
- result = 1;
- T(("_nc_unicode_locale(%s) ->%d", env, result));
+ char *env = _nc_get_locale();
+ if (env != 0) {
+ if (strstr(env, ".UTF-8") != 0) {
+ result = 1;
+ T(("_nc_unicode_locale(%s) ->%d", env, result));
+ }
}
- }
#endif
+ initialized = TRUE;
+ }
return result;
}