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