Locale.h (2688B)
1 #ifndef Locale_H 2 #define Locale_H 3 4 #include <stdio.h> 5 #include <stdint.h> 6 #include <stddef.h> 7 #include <stdbool.h> 8 #include "diplomat_runtime.h" 9 10 #include "LocaleParseError.d.h" 11 12 #include "Locale.d.h" 13 14 15 16 17 18 19 typedef struct icu4x_Locale_from_string_mv1_result {union {Locale* ok; LocaleParseError err;}; bool is_ok;} icu4x_Locale_from_string_mv1_result; 20 icu4x_Locale_from_string_mv1_result icu4x_Locale_from_string_mv1(DiplomatStringView name); 21 22 Locale* icu4x_Locale_unknown_mv1(void); 23 24 Locale* icu4x_Locale_clone_mv1(const Locale* self); 25 26 void icu4x_Locale_basename_mv1(const Locale* self, DiplomatWrite* write); 27 28 typedef struct icu4x_Locale_get_unicode_extension_mv1_result { bool is_ok;} icu4x_Locale_get_unicode_extension_mv1_result; 29 icu4x_Locale_get_unicode_extension_mv1_result icu4x_Locale_get_unicode_extension_mv1(const Locale* self, DiplomatStringView s, DiplomatWrite* write); 30 31 void icu4x_Locale_language_mv1(const Locale* self, DiplomatWrite* write); 32 33 typedef struct icu4x_Locale_set_language_mv1_result {union { LocaleParseError err;}; bool is_ok;} icu4x_Locale_set_language_mv1_result; 34 icu4x_Locale_set_language_mv1_result icu4x_Locale_set_language_mv1(Locale* self, DiplomatStringView s); 35 36 typedef struct icu4x_Locale_region_mv1_result { bool is_ok;} icu4x_Locale_region_mv1_result; 37 icu4x_Locale_region_mv1_result icu4x_Locale_region_mv1(const Locale* self, DiplomatWrite* write); 38 39 typedef struct icu4x_Locale_set_region_mv1_result {union { LocaleParseError err;}; bool is_ok;} icu4x_Locale_set_region_mv1_result; 40 icu4x_Locale_set_region_mv1_result icu4x_Locale_set_region_mv1(Locale* self, DiplomatStringView s); 41 42 typedef struct icu4x_Locale_script_mv1_result { bool is_ok;} icu4x_Locale_script_mv1_result; 43 icu4x_Locale_script_mv1_result icu4x_Locale_script_mv1(const Locale* self, DiplomatWrite* write); 44 45 typedef struct icu4x_Locale_set_script_mv1_result {union { LocaleParseError err;}; bool is_ok;} icu4x_Locale_set_script_mv1_result; 46 icu4x_Locale_set_script_mv1_result icu4x_Locale_set_script_mv1(Locale* self, DiplomatStringView s); 47 48 typedef struct icu4x_Locale_normalize_mv1_result {union { LocaleParseError err;}; bool is_ok;} icu4x_Locale_normalize_mv1_result; 49 icu4x_Locale_normalize_mv1_result icu4x_Locale_normalize_mv1(DiplomatStringView s, DiplomatWrite* write); 50 51 void icu4x_Locale_to_string_mv1(const Locale* self, DiplomatWrite* write); 52 53 bool icu4x_Locale_normalizing_eq_mv1(const Locale* self, DiplomatStringView other); 54 55 int8_t icu4x_Locale_compare_to_string_mv1(const Locale* self, DiplomatStringView other); 56 57 int8_t icu4x_Locale_compare_to_mv1(const Locale* self, const Locale* other); 58 59 void icu4x_Locale_destroy_mv1(Locale* self); 60 61 62 63 64 65 #endif // Locale_H