From 502c540485a1626fce474639d572904a4e3c55fe Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 10:56:01 +0200 Subject: Merging upstream version 1.24.5. Signed-off-by: Daniel Baumann --- lib/setlocale_null.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'lib/setlocale_null.h') diff --git a/lib/setlocale_null.h b/lib/setlocale_null.h index c740fa0..966c53c 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-2023 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, -- cgit v1.2.3