diff options
Diffstat (limited to 'lib/setlocale_null.h')
-rw-r--r-- | lib/setlocale_null.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/setlocale_null.h b/lib/setlocale_null.h index d1921b09..966c53cf 100644 --- a/lib/setlocale_null.h +++ b/lib/setlocale_null.h @@ -1,5 +1,5 @@ /* Query the name of the current global locale. - Copyright (C) 2019-2022 Free Software Foundation, Inc. + Copyright (C) 2019-2024 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -44,6 +44,34 @@ extern "C" { 55+5*58. */ #define SETLOCALE_NULL_ALL_MAX (148+12*256+1) +/* setlocale_null_r_unlocked (CATEGORY, BUF, BUFSIZE) is like + setlocale (CATEGORY, NULL), except that + - it returns the resulting locale category name or locale name in the + user-supplied buffer BUF, which must be BUFSIZE bytes long. + The recommended minimum buffer size is + - SETLOCALE_NULL_MAX for CATEGORY != LC_ALL, and + - SETLOCALE_NULL_ALL_MAX for CATEGORY == LC_ALL. + The return value is an error code: 0 if the call is successful, EINVAL if + CATEGORY is invalid, or ERANGE if BUFSIZE is smaller than the length needed + size (including the trailing NUL byte). In the latter case, a truncated + result is returned in BUF, but still NUL-terminated if BUFSIZE > 0. + This call is guaranteed to be multithread-safe only if + - CATEGORY != LC_ALL and SETLOCALE_NULL_ONE_MTSAFE is true, or + - CATEGORY == LC_ALL and SETLOCALE_NULL_ALL_MTSAFE is true, + and the other threads must not make other setlocale invocations (since + changing the global locale has side effects on all threads). */ +extern int setlocale_null_r_unlocked (int category, char *buf, size_t bufsize) + _GL_ARG_NONNULL ((2)); + +/* setlocale_null_unlocked (CATEGORY) is like setlocale (CATEGORY, NULL). + The return value is NULL if CATEGORY is invalid. + This call is guaranteed to be multithread-safe only if + - CATEGORY != LC_ALL and SETLOCALE_NULL_ONE_MTSAFE is true, or + - CATEGORY == LC_ALL and SETLOCALE_NULL_ALL_MTSAFE is true, + and the other threads must not make other setlocale invocations (since + changing the global locale has side effects on all threads). */ +extern const char *setlocale_null_unlocked (int category); + /* setlocale_null_r (CATEGORY, BUF, BUFSIZE) is like setlocale (CATEGORY, NULL), except that - it is guaranteed to be multithread-safe, |