void mono_wasm_obj_array_set (MonoArray *array, int idx, MonoObject *obj);
MonoArray* mono_wasm_string_array_new (int size);
MonoString *mono_wasm_string_from_js (const char *str);
-int mono_wasm_array_length(MonoArray* array);
char *mono_wasm_string_get_utf8 (MonoString *str);
MonoMethod* lookup_dotnet_method(const char* assembly_name, const char* namespace, const char* type_name, const char* method_name, int num_params);
[true, "mono_background_exec", null, []],
[true, "mono_set_timeout_exec", null, []],
[true, "mono_wasm_load_icu_data", "number", ["number"]],
- [true, "mono_wasm_get_icudt_name", "string", ["string"]],
[false, "mono_wasm_add_assembly", "number", ["string", "number", "number"]],
[true, "mono_wasm_add_satellite_assembly", "void", ["string", "string", "number", "number"]],
[false, "mono_wasm_load_runtime", null, ["string", "number"]],
[true, "mono_wasm_string_get_utf8", "number", ["number"]],
[true, "mono_wasm_string_from_utf16_ref", "void", ["number", "number", "number"]],
[true, "mono_wasm_get_obj_type", "number", ["number"]],
- [true, "mono_wasm_array_length", "number", ["number"]],
[true, "mono_wasm_array_length_ref", "number", ["number"]],
[true, "mono_wasm_array_get", "number", ["number", "number"]],
[true, "mono_wasm_array_get_ref", "void", ["number", "number", "number"]],
mono_background_exec(): void;
mono_set_timeout_exec(): void;
mono_wasm_load_icu_data(offset: VoidPtr): number;
- mono_wasm_get_icudt_name(name: string): string;
mono_wasm_add_assembly(name: string, data: VoidPtr, size: number): number;
mono_wasm_add_satellite_assembly(name: string, culture: string, data: VoidPtr, size: number): void;
mono_wasm_load_runtime(unused: string, debugLevel: number): void;
*/
mono_wasm_string_get_utf8(str: MonoString): CharPtr;
mono_wasm_string_from_utf16_ref(str: CharPtr, len: number, result: MonoObjectRef): void;
- mono_wasm_array_length(array: MonoArray): number;
mono_wasm_array_length_ref(array: MonoObjectRef): number;
mono_wasm_array_get_ref(array: MonoObjectRef, idx: number, result: MonoObjectRef): void;
return retval;
}
-// FIXME: Ref
-EMSCRIPTEN_KEEPALIVE int
-mono_wasm_array_length (MonoArray *array)
-{
- return mono_array_length (array);
-}
-
EMSCRIPTEN_KEEPALIVE int
mono_wasm_array_length_ref (MonoArray **array)
{
// pal_icushim_static.c
"mono_wasm_load_icu_data",
- "mono_wasm_get_icudt_name",
#if USE_PTHREADS
/// mono-threads-wasm.c
import { mono_wasm_fire_debugger_agent_message_with_data, mono_wasm_fire_debugger_agent_message_with_data_to_pause, mono_wasm_debugger_log, mono_wasm_add_dbg_command_received, mono_wasm_set_entrypoint_breakpoint } from "./debug";
import { mono_wasm_release_cs_owned_object } from "./gc-handles";
-import { mono_wasm_load_icu_data, mono_wasm_get_icudt_name } from "./icu";
+import { mono_wasm_load_icu_data } from "./icu";
import { mono_wasm_bind_cs_function } from "./invoke-cs";
import { mono_wasm_bind_js_function, mono_wasm_invoke_bound_function, mono_wasm_invoke_import } from "./invoke-js";
import { mono_interp_tier_prepare_jiterpreter } from "./jiterpreter";
// pal_icushim_static.c
mono_wasm_load_icu_data,
- mono_wasm_get_icudt_name,
// threading exports, if threading is enabled
...mono_wasm_threads_exports,
return ok;
}
-// Get icudt.dat exact filename that matches given culture, examples:
-// "ja" -> "icudt_CJK.dat"
-// "en_US" (or "en-US" or just "en") -> "icudt_EFIGS.dat"
-// etc, see "mono_wasm_get_icudt_name" implementation in pal_icushim_static.c
-export function mono_wasm_get_icudt_name(culture: string): string {
- return cwraps.mono_wasm_get_icudt_name(culture);
-}
-
// Performs setup for globalization.
// @globalizationMode is one of "icu", "invariant", or "auto".
// "auto" will use "icu" if any ICU data archives have been loaded,
PALEXPORT int32_t GlobalizationNative_LoadICUData(const char* path);
-PALEXPORT const char* GlobalizationNative_GetICUDTName(const char* culture);
-
#endif
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
-EMSCRIPTEN_KEEPALIVE const char* mono_wasm_get_icudt_name(const char* culture);
-
-EMSCRIPTEN_KEEPALIVE const char* mono_wasm_get_icudt_name(const char* culture)
-{
- return GlobalizationNative_GetICUDTName(culture);
-}
-
EMSCRIPTEN_KEEPALIVE int32_t mono_wasm_load_icu_data(const void* pData);
EMSCRIPTEN_KEEPALIVE int32_t mono_wasm_load_icu_data(const void* pData)
return GlobalizationNative_LoadICU();
}
-const char* GlobalizationNative_GetICUDTName(const char* culture)
-{
- // Based on https://github.com/dotnet/icu/tree/maint/maint-67/icu-filters
-
- // Use full one if culture is null or empty
- if (!culture || strlen(culture) < 2)
- return "icudt.dat";
-
- // CJK: starts with "ja", "ko" or "zh"
- if (!strncasecmp("ja", culture, 2) ||
- !strncasecmp("ko", culture, 2) ||
- !strncasecmp("zh", culture, 2))
- return "icudt_CJK.dat"; // contains "en" as well.
-
- // EFIGS
- const char* efigsCultures[15] = {
- "en-US", "fr-FR", "es-ES", "it-IT", "de-DE",
- "en_US", "fr_FR", "es_ES", "it_IT", "de_DE",
- "en", "fr", "es", "it", "de"
- };
-
- for (int i = 0; i < 15; i++)
- if (!strcasecmp(culture, efigsCultures[i]))
- return "icudt_EFIGS.dat";
-
- // full except CJK cultures
- return "icudt_no_CJK.dat";
-}
-
int32_t GlobalizationNative_LoadICU(void)
{
#if !defined(LOCAL_BUILD)