From 0cc0c89d08994e66fa4fae5c0891b8fa14960e50 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 14 Sep 2025 14:35:56 -0400 Subject: Error translations --- pom.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'pom.h') diff --git a/pom.h b/pom.h index 5635316..79bdcd7 100644 --- a/pom.h +++ b/pom.h @@ -6,7 +6,9 @@ /// Of course, you should not free or \ref pom_conf_merge into /// a configuration while another thread is using it. /// -/// Other than that, all these functions are fully thread-safe +/// \ref pom_set_error_language is not thread-safe — see its documentation for more notes. +/// +/// Otherwise, libpom is fully thread-safe /// provided that C11 atomics are available /// (`__STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__)`). /// But beware of race conditions when using \ref pom_conf_next_unread_key @@ -93,6 +95,18 @@ typedef struct pom_item { uint64_t line; } pom_item; +/// Set language for error messages. +/// +/// This function is **not** thread-safe. Ensure synchronization between calling +/// this and any functions which can return errors. +/// +/// If `lang` is `NULL` or unrecognized, the default of `"en-US"` will be used. +/// +/// Currently supported languages: +/// +/// - `en-US` +void pom_set_error_language(const char *lang); + /// Load a configuration using a `read`-like function. /// /// Most of the time, you won't need this function: -- cgit v1.2.3