return ret;
}
-void
-ves_icall_System_Globalization_CultureInfo_construct_datetime_format (MonoCultureInfo *this)
+MonoBoolean
+ves_icall_System_Globalization_CalendarData_fill_calendar_data (MonoCalendarData *this_obj, MonoString *name, gint32 calendar_index)
{
MonoDomain *domain;
- MonoDateTimeFormatInfo *datetime;
const DateTimeFormatEntry *dfe;
+ const CultureInfoNameEntry *ne;
+ const CultureInfoEntry *ci;
+ char *n;
- MONO_ARCH_SAVE_REGS;
-
- g_assert (this->datetime_index >= 0);
+ n = mono_string_to_utf8 (name);
+ ne = mono_binary_search (n, culture_name_entries, NUM_CULTURE_ENTRIES,
+ sizeof (CultureInfoNameEntry), culture_name_locator);
+ g_free (n);
+ if (ne == NULL) {
+ return FALSE;
+ }
- datetime = this->datetime_format;
- dfe = &datetime_format_entries [this->datetime_index];
+ ci = &culture_entries [ne->culture_entry_index];
+ dfe = &datetime_format_entries [ci->datetime_format_index];
domain = mono_domain_get ();
- datetime->readOnly = this->is_read_only;
- MONO_OBJECT_SETREF (datetime, AbbreviatedDayNames, create_names_array_idx (dfe->abbreviated_day_names,
- NUM_DAYS));
- MONO_OBJECT_SETREF (datetime, AbbreviatedMonthNames, create_names_array_idx (dfe->abbreviated_month_names,
- NUM_MONTHS));
- MONO_OBJECT_SETREF (datetime, AMDesignator, mono_string_new (domain, idx2string (dfe->am_designator)));
- datetime->CalendarWeekRule = dfe->calendar_week_rule;
- MONO_OBJECT_SETREF (datetime, DateSeparator, mono_string_new (domain, idx2string (dfe->date_separator)));
- MONO_OBJECT_SETREF (datetime, DayNames, create_names_array_idx (dfe->day_names, NUM_DAYS));
- MONO_OBJECT_SETREF (datetime, ShortestDayNames, create_names_array_idx (dfe->shortest_day_names, NUM_DAYS));
- datetime->FirstDayOfWeek = dfe->first_day_of_week;
- MONO_OBJECT_SETREF (datetime, LongDatePattern, mono_string_new (domain, idx2string (dfe->long_date_pattern)));
- MONO_OBJECT_SETREF (datetime, LongTimePattern, mono_string_new (domain, idx2string (dfe->long_time_pattern)));
- MONO_OBJECT_SETREF (datetime, MonthDayPattern, mono_string_new (domain, idx2string (dfe->month_day_pattern)));
- MONO_OBJECT_SETREF (datetime, MonthNames, create_names_array_idx (dfe->month_names, NUM_MONTHS));
- MONO_OBJECT_SETREF (datetime, PMDesignator, mono_string_new (domain, idx2string (dfe->pm_designator)));
- MONO_OBJECT_SETREF (datetime, ShortDatePattern, mono_string_new (domain, idx2string (dfe->short_date_pattern)));
- MONO_OBJECT_SETREF (datetime, ShortTimePattern, mono_string_new (domain, idx2string (dfe->short_time_pattern)));
- MONO_OBJECT_SETREF (datetime, TimeSeparator, mono_string_new (domain, idx2string (dfe->time_separator)));
- MONO_OBJECT_SETREF (datetime, YearMonthPattern, mono_string_new (domain, idx2string (dfe->year_month_pattern)));
- MONO_OBJECT_SETREF (datetime, ShortDatePatterns, create_names_array_idx_dynamic (dfe->short_date_patterns,
+ MONO_OBJECT_SETREF (this_obj, NativeName, mono_string_new (domain, idx2string (ci->nativename)));
+ MONO_OBJECT_SETREF (this_obj, ShortDatePatterns, create_names_array_idx_dynamic (dfe->short_date_patterns,
NUM_SHORT_DATE_PATTERNS));
- MONO_OBJECT_SETREF (datetime, LongDatePatterns, create_names_array_idx_dynamic (dfe->long_date_patterns,
+ MONO_OBJECT_SETREF (this_obj, YearMonthPatterns, create_names_array_idx_dynamic (dfe->year_month_patterns,
+ NUM_YEAR_MONTH_PATTERNS));
+
+ MONO_OBJECT_SETREF (this_obj, LongDatePatterns, create_names_array_idx_dynamic (dfe->long_date_patterns,
NUM_LONG_DATE_PATTERNS));
- MONO_OBJECT_SETREF (datetime, ShortTimePatterns, create_names_array_idx_dynamic (dfe->short_time_patterns,
- NUM_SHORT_TIME_PATTERNS));
- MONO_OBJECT_SETREF (datetime, LongTimePatterns, create_names_array_idx_dynamic (dfe->long_time_patterns,
+ MONO_OBJECT_SETREF (this_obj, MonthDayPattern, mono_string_new (domain, idx2string (dfe->month_day_pattern)));
+
+ MONO_OBJECT_SETREF (this_obj, DayNames, create_names_array_idx (dfe->day_names, NUM_DAYS));
+ MONO_OBJECT_SETREF (this_obj, AbbreviatedDayNames, create_names_array_idx (dfe->abbreviated_day_names,
+ NUM_DAYS));
+ MONO_OBJECT_SETREF (this_obj, SuperShortDayNames, create_names_array_idx (dfe->shortest_day_names, NUM_DAYS));
+ MONO_OBJECT_SETREF (this_obj, MonthNames, create_names_array_idx (dfe->month_names, NUM_MONTHS));
+ MONO_OBJECT_SETREF (this_obj, AbbreviatedMonthNames, create_names_array_idx (dfe->abbreviated_month_names,
+ NUM_MONTHS));
+ MONO_OBJECT_SETREF (this_obj, GenitiveMonthNames, create_names_array_idx (dfe->month_genitive_names, NUM_MONTHS));
+ MONO_OBJECT_SETREF (this_obj, GenitiveAbbreviatedMonthNames, create_names_array_idx (dfe->abbreviated_month_genitive_names, NUM_MONTHS));
+
+ return TRUE;
+}
+
+void
+ves_icall_System_Globalization_CultureData_fill_culture_data (MonoCultureData *this_obj, gint32 datetime_index)
+{
+ MonoDomain *domain;
+ const DateTimeFormatEntry *dfe;
+
+ g_assert (datetime_index >= 0);
+
+ dfe = &datetime_format_entries [datetime_index];
+
+ domain = mono_domain_get ();
+
+ MONO_OBJECT_SETREF (this_obj, AMDesignator, mono_string_new (domain, idx2string (dfe->am_designator)));
+ MONO_OBJECT_SETREF (this_obj, PMDesignator, mono_string_new (domain, idx2string (dfe->pm_designator)));
+ MONO_OBJECT_SETREF (this_obj, TimeSeparator, mono_string_new (domain, idx2string (dfe->time_separator)));
+ MONO_OBJECT_SETREF (this_obj, LongTimePatterns, create_names_array_idx_dynamic (dfe->long_time_patterns,
NUM_LONG_TIME_PATTERNS));
- MONO_OBJECT_SETREF (datetime, GenitiveMonthNames, create_names_array_idx (dfe->month_genitive_names, NUM_MONTHS));
- MONO_OBJECT_SETREF (datetime, GenitiveAbbreviatedMonthNames, create_names_array_idx (dfe->abbreviated_month_genitive_names, NUM_MONTHS));
+ MONO_OBJECT_SETREF (this_obj, ShortTimePatterns, create_names_array_idx_dynamic (dfe->short_time_patterns,
+ NUM_SHORT_TIME_PATTERNS));
+ this_obj->FirstDayOfWeek = dfe->first_day_of_week;
+ this_obj->CalendarWeekRule = dfe->calendar_week_rule;
}
void
-ves_icall_System_Globalization_CultureInfo_construct_number_format (MonoCultureInfo *this)
+ves_icall_System_Globalization_CultureData_fill_number_data (MonoNumberFormatInfo* number, gint32 number_index)
{
MonoDomain *domain;
- MonoNumberFormatInfo *number;
const NumberFormatEntry *nfe;
- MONO_ARCH_SAVE_REGS;
-
- g_assert (this->number_format != 0);
- if (this->number_index < 0)
- return;
+ g_assert (number_index != 0);
- number = this->number_format;
- nfe = &number_format_entries [this->number_index];
+ nfe = &number_format_entries [number_index];
domain = mono_domain_get ();
- number->readOnly = this->is_read_only;
number->currencyDecimalDigits = nfe->currency_decimal_digits;
MONO_OBJECT_SETREF (number, currencyDecimalSeparator, mono_string_new (domain,
idx2string (nfe->currency_decimal_separator)));
MONO_OBJECT_SETREF (number, numberGroupSizes, create_group_sizes_array (nfe->number_group_sizes,
GROUP_SIZE));
number->numberNegativePattern = nfe->number_negative_pattern;
- number->percentDecimalDigits = nfe->percent_decimal_digits;
- MONO_OBJECT_SETREF (number, percentDecimalSeparator, mono_string_new (domain,
- idx2string (nfe->percent_decimal_separator)));
- MONO_OBJECT_SETREF (number, percentGroupSeparator, mono_string_new (domain,
- idx2string (nfe->percent_group_separator)));
- MONO_OBJECT_SETREF (number, percentGroupSizes, create_group_sizes_array (nfe->percent_group_sizes,
- GROUP_SIZE));
number->percentNegativePattern = nfe->percent_negative_pattern;
number->percentPositivePattern = nfe->percent_positive_pattern;
MONO_OBJECT_SETREF (number, percentSymbol, mono_string_new (domain, idx2string (nfe->percent_symbol)));
}
static MonoBoolean
-construct_culture (MonoCultureInfo *this, const CultureInfoEntry *ci)
+construct_culture (MonoCultureInfo *this_obj, const CultureInfoEntry *ci)
{
MonoDomain *domain = mono_domain_get ();
- this->lcid = ci->lcid;
- MONO_OBJECT_SETREF (this, name, mono_string_new (domain, idx2string (ci->name)));
- MONO_OBJECT_SETREF (this, englishname, mono_string_new (domain, idx2string (ci->englishname)));
- MONO_OBJECT_SETREF (this, nativename, mono_string_new (domain, idx2string (ci->nativename)));
- MONO_OBJECT_SETREF (this, win3lang, mono_string_new (domain, idx2string (ci->win3lang)));
- MONO_OBJECT_SETREF (this, iso3lang, mono_string_new (domain, idx2string (ci->iso3lang)));
- MONO_OBJECT_SETREF (this, iso2lang, mono_string_new (domain, idx2string (ci->iso2lang)));
+ this_obj->lcid = ci->lcid;
+ MONO_OBJECT_SETREF (this_obj, name, mono_string_new (domain, idx2string (ci->name)));
+ MONO_OBJECT_SETREF (this_obj, englishname, mono_string_new (domain, idx2string (ci->englishname)));
+ MONO_OBJECT_SETREF (this_obj, nativename, mono_string_new (domain, idx2string (ci->nativename)));
+ MONO_OBJECT_SETREF (this_obj, win3lang, mono_string_new (domain, idx2string (ci->win3lang)));
+ MONO_OBJECT_SETREF (this_obj, iso3lang, mono_string_new (domain, idx2string (ci->iso3lang)));
+ MONO_OBJECT_SETREF (this_obj, iso2lang, mono_string_new (domain, idx2string (ci->iso2lang)));
// It's null for neutral cultures
if (ci->territory > 0)
- MONO_OBJECT_SETREF (this, territory, mono_string_new (domain, idx2string (ci->territory)));
- MONO_OBJECT_SETREF (this, native_calendar_names, create_names_array_idx (ci->native_calendar_names, NUM_CALENDARS));
- this->parent_lcid = ci->parent_lcid;
- this->datetime_index = ci->datetime_format_index;
- this->number_index = ci->number_format_index;
- this->calendar_type = ci->calendar_type;
- this->text_info_data = &ci->text_info;
+ MONO_OBJECT_SETREF (this_obj, territory, mono_string_new (domain, idx2string (ci->territory)));
+ MONO_OBJECT_SETREF (this_obj, native_calendar_names, create_names_array_idx (ci->native_calendar_names, NUM_CALENDARS));
+ this_obj->parent_lcid = ci->parent_lcid;
+ this_obj->datetime_index = ci->datetime_format_index;
+ this_obj->number_index = ci->number_format_index;
+ this_obj->calendar_type = ci->calendar_type;
+ this_obj->text_info_data = &ci->text_info;
return TRUE;
}
static MonoBoolean
-construct_region (MonoRegionInfo *this, const RegionInfoEntry *ri)
+construct_region (MonoRegionInfo *this_obj, const RegionInfoEntry *ri)
{
MonoDomain *domain = mono_domain_get ();
- this->geo_id = ri->geo_id;
- MONO_OBJECT_SETREF (this, iso2name, mono_string_new (domain, idx2string (ri->iso2name)));
- MONO_OBJECT_SETREF (this, iso3name, mono_string_new (domain, idx2string (ri->iso3name)));
- MONO_OBJECT_SETREF (this, win3name, mono_string_new (domain, idx2string (ri->win3name)));
- MONO_OBJECT_SETREF (this, english_name, mono_string_new (domain, idx2string (ri->english_name)));
- MONO_OBJECT_SETREF (this, native_name, mono_string_new (domain, idx2string (ri->native_name)));
- MONO_OBJECT_SETREF (this, currency_symbol, mono_string_new (domain, idx2string (ri->currency_symbol)));
- MONO_OBJECT_SETREF (this, iso_currency_symbol, mono_string_new (domain, idx2string (ri->iso_currency_symbol)));
- MONO_OBJECT_SETREF (this, currency_english_name, mono_string_new (domain, idx2string (ri->currency_english_name)));
- MONO_OBJECT_SETREF (this, currency_native_name, mono_string_new (domain, idx2string (ri->currency_native_name)));
+ this_obj->geo_id = ri->geo_id;
+ MONO_OBJECT_SETREF (this_obj, iso2name, mono_string_new (domain, idx2string (ri->iso2name)));
+ MONO_OBJECT_SETREF (this_obj, iso3name, mono_string_new (domain, idx2string (ri->iso3name)));
+ MONO_OBJECT_SETREF (this_obj, win3name, mono_string_new (domain, idx2string (ri->win3name)));
+ MONO_OBJECT_SETREF (this_obj, english_name, mono_string_new (domain, idx2string (ri->english_name)));
+ MONO_OBJECT_SETREF (this_obj, native_name, mono_string_new (domain, idx2string (ri->native_name)));
+ MONO_OBJECT_SETREF (this_obj, currency_symbol, mono_string_new (domain, idx2string (ri->currency_symbol)));
+ MONO_OBJECT_SETREF (this_obj, iso_currency_symbol, mono_string_new (domain, idx2string (ri->iso_currency_symbol)));
+ MONO_OBJECT_SETREF (this_obj, currency_english_name, mono_string_new (domain, idx2string (ri->currency_english_name)));
+ MONO_OBJECT_SETREF (this_obj, currency_native_name, mono_string_new (domain, idx2string (ri->currency_native_name)));
return TRUE;
}
-static gboolean
-construct_culture_from_specific_name (MonoCultureInfo *ci, gchar *name)
-{
- const CultureInfoEntry *entry;
- const CultureInfoNameEntry *ne;
-
- MONO_ARCH_SAVE_REGS;
-
- ne = mono_binary_search (name, culture_name_entries, NUM_CULTURE_ENTRIES,
- sizeof (CultureInfoNameEntry), culture_name_locator);
-
- if (ne == NULL)
- return FALSE;
-
- entry = &culture_entries [ne->culture_entry_index];
-
- if (entry)
- return construct_culture (ci, entry);
- else
- return FALSE;
-}
-
static const CultureInfoEntry*
culture_info_entry_from_lcid (int lcid)
{
const RegionInfoEntry *entry;
const CultureInfoEntry *ne;
- MONO_ARCH_SAVE_REGS;
-
ne = mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
if (ne == NULL)
return entry;
}
-/*
- * The following two methods are modified from the ICU source code. (http://oss.software.ibm.com/icu)
- * Copyright (c) 1995-2003 International Business Machines Corporation and others
- * All rights reserved.
- */
-static gchar*
-get_posix_locale (void)
-{
- const gchar* posix_locale = NULL;
-
- posix_locale = g_getenv("LC_ALL");
- if (posix_locale == 0) {
- posix_locale = g_getenv("LANG");
- if (posix_locale == 0) {
- posix_locale = setlocale(LC_ALL, NULL);
- }
- }
-
- if (posix_locale == NULL)
- return NULL;
-
- if ((strcmp ("C", posix_locale) == 0) || (strchr (posix_locale, ' ') != NULL)
- || (strchr (posix_locale, '/') != NULL)) {
- /*
- * HPUX returns 'C C C C C C C'
- * Solaris can return /en_US/C/C/C/C/C on the second try.
- * Maybe we got some garbage.
- */
- return NULL;
- }
-
- return g_strdup (posix_locale);
-}
-
#if defined (__APPLE__)
static gchar*
get_darwin_locale (void)
{
static gchar *darwin_locale = NULL;
CFLocaleRef locale = NULL;
+ CFStringRef locale_language = NULL;
+ CFStringRef locale_country = NULL;
+ CFStringRef locale_script = NULL;
CFStringRef locale_cfstr = NULL;
+ CFIndex bytes_converted;
+ CFIndex bytes_written;
CFIndex len;
int i;
locale = CFLocaleCopyCurrent ();
if (locale) {
- locale_cfstr = CFLocaleGetIdentifier (locale);
-
- if (locale_cfstr) {
- len = CFStringGetMaximumSizeForEncoding (CFStringGetLength (locale_cfstr), kCFStringEncodingMacRoman) + 1;
- darwin_locale = (char *) malloc (len);
- if (!CFStringGetCString (locale_cfstr, darwin_locale, len, kCFStringEncodingMacRoman)) {
- free (darwin_locale);
- CFRelease (locale);
- darwin_locale = NULL;
- return NULL;
+ locale_language = CFLocaleGetValue (locale, kCFLocaleLanguageCode);
+ if (locale_language != NULL && CFStringGetBytes(locale_language, CFRangeMake (0, CFStringGetLength (locale_language)), kCFStringEncodingMacRoman, 0, FALSE, NULL, 0, &bytes_converted) > 0) {
+ len = bytes_converted + 1;
+
+ locale_country = CFLocaleGetValue (locale, kCFLocaleCountryCode);
+ if (locale_country != NULL && CFStringGetBytes (locale_country, CFRangeMake (0, CFStringGetLength (locale_country)), kCFStringEncodingMacRoman, 0, FALSE, NULL, 0, &bytes_converted) > 0) {
+ len += bytes_converted + 1;
+
+ locale_script = CFLocaleGetValue (locale, kCFLocaleScriptCode);
+ if (locale_script != NULL && CFStringGetBytes (locale_script, CFRangeMake (0, CFStringGetLength (locale_script)), kCFStringEncodingMacRoman, 0, FALSE, NULL, 0, &bytes_converted) > 0) {
+ len += bytes_converted + 1;
+ }
+
+ darwin_locale = (char *) malloc (len + 1);
+ CFStringGetBytes (locale_language, CFRangeMake (0, CFStringGetLength (locale_language)), kCFStringEncodingMacRoman, 0, FALSE, (UInt8 *) darwin_locale, len, &bytes_converted);
+
+ darwin_locale[bytes_converted] = '-';
+ bytes_written = bytes_converted + 1;
+ if (locale_script != NULL && CFStringGetBytes (locale_script, CFRangeMake (0, CFStringGetLength (locale_script)), kCFStringEncodingMacRoman, 0, FALSE, (UInt8 *) &darwin_locale[bytes_written], len - bytes_written, &bytes_converted) > 0) {
+ darwin_locale[bytes_written + bytes_converted] = '-';
+ bytes_written += bytes_converted + 1;
+ }
+
+ CFStringGetBytes (locale_country, CFRangeMake (0, CFStringGetLength (locale_country)), kCFStringEncodingMacRoman, 0, FALSE, (UInt8 *) &darwin_locale[bytes_written], len - bytes_written, &bytes_converted);
+ darwin_locale[bytes_written + bytes_converted] = '\0';
}
+ }
+
+ if (darwin_locale == NULL) {
+ locale_cfstr = CFLocaleGetIdentifier (locale);
+
+ if (locale_cfstr) {
+ len = CFStringGetMaximumSizeForEncoding (CFStringGetLength (locale_cfstr), kCFStringEncodingMacRoman) + 1;
+ darwin_locale = (char *) malloc (len);
+ if (!CFStringGetCString (locale_cfstr, darwin_locale, len, kCFStringEncodingMacRoman)) {
+ free (darwin_locale);
+ CFRelease (locale);
+ darwin_locale = NULL;
+ return NULL;
+ }
- for (i = 0; i < strlen (darwin_locale); i++)
- if (darwin_locale [i] == '_')
- darwin_locale [i] = '-';
+ for (i = 0; i < strlen (darwin_locale); i++)
+ if (darwin_locale [i] == '_')
+ darwin_locale [i] = '-';
+ }
}
CFRelease (locale);
}
#endif
-static gchar*
-get_current_locale_name (void)
+static char *
+get_posix_locale (void)
{
- gchar *locale;
- gchar *corrected = NULL;
- const gchar *p;
- gchar *c;
+ const char *locale;
+
+ locale = g_getenv ("LC_ALL");
+ if (locale == NULL) {
+ locale = g_getenv ("LANG");
+ if (locale == NULL)
+ locale = setlocale (LC_ALL, NULL);
+ }
+ if (locale == NULL)
+ return NULL;
+
+ /* Skip English-only locale 'C' */
+ if (strcmp (locale, "C") == 0)
+ return NULL;
+ return g_strdup (locale);
+}
+
+
+static gchar *
+get_current_locale_name (void)
+{
+ char *locale;
+ char *p, *ret;
+
#ifdef HOST_WIN32
locale = g_win32_getlocale ();
#elif defined (__APPLE__)
locale = get_posix_locale ();
#else
locale = get_posix_locale ();
-#endif
+#endif
if (locale == NULL)
return NULL;
- if ((p = strchr (locale, '.')) != NULL) {
- /* assume new locale can't be larger than old one? */
- corrected = g_malloc (strlen (locale));
- strncpy (corrected, locale, p - locale);
- corrected [p - locale] = 0;
-
- /* do not copy after the @ */
- if ((p = strchr (corrected, '@')) != NULL)
- corrected [p - corrected] = 0;
- }
-
- /* Note that we scan the *uncorrected* ID. */
- if ((p = strrchr (locale, '@')) != NULL) {
-
- /*
- * In Mono we dont handle the '@' modifier because we do
- * not have any cultures that use it. We just trim it
- * off of the end of the name.
- */
-
- if (corrected == NULL) {
- corrected = g_malloc (strlen (locale));
- strncpy (corrected, locale, p - locale);
- corrected [p - locale] = 0;
- }
- }
-
- if (corrected == NULL)
- corrected = locale;
- else
- g_free (locale);
-
- if ((c = strchr (corrected, '_')) != NULL)
- *c = '-';
-
- c = corrected;
- corrected = g_ascii_strdown (c, -1);
- g_free (c);
+ p = strchr (locale, '.');
+ if (p != NULL)
+ *p = 0;
+ p = strchr (locale, '@');
+ if (p != NULL)
+ *p = 0;
+ p = strchr (locale, '_');
+ if (p != NULL)
+ *p = '-';
+
+ ret = g_ascii_strdown (locale, -1);
+ g_free (locale);
- return corrected;
-}
+ return ret;
+}
-MonoBoolean
-ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_current_locale (MonoCultureInfo *ci)
+MonoString*
+ves_icall_System_Globalization_CultureInfo_get_current_locale_name (void)
{
gchar *locale;
- gboolean ret;
-
- MONO_ARCH_SAVE_REGS;
+ MonoString* ret;
+ MonoDomain *domain;
locale = get_current_locale_name ();
if (locale == NULL)
- return FALSE;
+ return NULL;
- ret = construct_culture_from_specific_name (ci, locale);
+ domain = mono_domain_get ();
+ ret = mono_string_new (domain, locale);
g_free (locale);
- ci->is_read_only = TRUE;
- ci->use_user_override = TRUE;
return ret;
}
MonoBoolean
-ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_lcid (MonoCultureInfo *this,
+ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_lcid (MonoCultureInfo *this_obj,
gint lcid)
{
const CultureInfoEntry *ci;
- MONO_ARCH_SAVE_REGS;
-
ci = culture_info_entry_from_lcid (lcid);
if(ci == NULL)
return FALSE;
- return construct_culture (this, ci);
+ return construct_culture (this_obj, ci);
}
MonoBoolean
-ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name (MonoCultureInfo *this,
+ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name (MonoCultureInfo *this_obj,
MonoString *name)
{
const CultureInfoNameEntry *ne;
char *n;
- MONO_ARCH_SAVE_REGS;
-
n = mono_string_to_utf8 (name);
ne = mono_binary_search (n, culture_name_entries, NUM_CULTURE_ENTRIES,
sizeof (CultureInfoNameEntry), culture_name_locator);
}
g_free (n);
- return construct_culture (this, &culture_entries [ne->culture_entry_index]);
+ return construct_culture (this_obj, &culture_entries [ne->culture_entry_index]);
}
-
+/*
MonoBoolean
ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_specific_name (MonoCultureInfo *ci,
MonoString *name)
gchar *locale;
gboolean ret;
- MONO_ARCH_SAVE_REGS;
-
locale = mono_string_to_utf8 (name);
ret = construct_culture_from_specific_name (ci, locale);
g_free (locale);
return ret;
}
-
+*/
MonoBoolean
-ves_icall_System_Globalization_RegionInfo_construct_internal_region_from_lcid (MonoRegionInfo *this,
+ves_icall_System_Globalization_RegionInfo_construct_internal_region_from_lcid (MonoRegionInfo *this_obj,
gint lcid)
{
const RegionInfoEntry *ri;
- MONO_ARCH_SAVE_REGS;
-
ri = region_info_entry_from_lcid (lcid);
if(ri == NULL)
return FALSE;
- return construct_region (this, ri);
+ return construct_region (this_obj, ri);
}
MonoBoolean
-ves_icall_System_Globalization_RegionInfo_construct_internal_region_from_name (MonoRegionInfo *this,
+ves_icall_System_Globalization_RegionInfo_construct_internal_region_from_name (MonoRegionInfo *this_obj,
MonoString *name)
{
const RegionInfoNameEntry *ne;
char *n;
- MONO_ARCH_SAVE_REGS;
-
n = mono_string_to_utf8 (name);
ne = mono_binary_search (n, region_name_entries, NUM_REGION_ENTRIES,
sizeof (RegionInfoNameEntry), region_name_locator);
}
g_free (n);
- return construct_region (this, ®ion_entries [ne->region_entry_index]);
+ return construct_region (this_obj, ®ion_entries [ne->region_entry_index]);
}
MonoArray*
gint i, len;
gboolean is_neutral;
- MONO_ARCH_SAVE_REGS;
-
domain = mono_domain_get ();
len = 0;
return ret;
}
-void ves_icall_System_Globalization_CompareInfo_construct_compareinfo (MonoCompareInfo *comp, MonoString *locale)
+int ves_icall_System_Globalization_CompareInfo_internal_compare (MonoCompareInfo *this_obj, MonoString *str1, gint32 off1, gint32 len1, MonoString *str2, gint32 off2, gint32 len2, gint32 options)
{
- /* Nothing to do here */
-}
-
-int ves_icall_System_Globalization_CompareInfo_internal_compare (MonoCompareInfo *this, MonoString *str1, gint32 off1, gint32 len1, MonoString *str2, gint32 off2, gint32 len2, gint32 options)
-{
- MONO_ARCH_SAVE_REGS;
-
/* Do a normal ascii string compare, as we only know the
* invariant locale if we dont have ICU
*/
options));
}
-void ves_icall_System_Globalization_CompareInfo_free_internal_collator (MonoCompareInfo *this)
-{
- /* Nothing to do here */
-}
-
-void ves_icall_System_Globalization_CompareInfo_assign_sortkey (MonoCompareInfo *this, MonoSortKey *key, MonoString *source, gint32 options)
+void ves_icall_System_Globalization_CompareInfo_assign_sortkey (MonoCompareInfo *this_obj, MonoSortKey *key, MonoString *source, gint32 options)
{
MonoArray *arr;
gint32 keylen, i;
- MONO_ARCH_SAVE_REGS;
-
keylen=mono_string_length (source);
arr=mono_array_new (mono_domain_get (), mono_get_byte_class (),
MONO_OBJECT_SETREF (key, key, arr);
}
-int ves_icall_System_Globalization_CompareInfo_internal_index (MonoCompareInfo *this, MonoString *source, gint32 sindex, gint32 count, MonoString *value, gint32 options, MonoBoolean first)
+int ves_icall_System_Globalization_CompareInfo_internal_index (MonoCompareInfo *this_obj, MonoString *source, gint32 sindex, gint32 count, MonoString *value, gint32 options, MonoBoolean first)
{
- MONO_ARCH_SAVE_REGS;
-
return(string_invariant_indexof (source, sindex, count, value, first));
}
-int ves_icall_System_Globalization_CompareInfo_internal_index_char (MonoCompareInfo *this, MonoString *source, gint32 sindex, gint32 count, gunichar2 value, gint32 options, MonoBoolean first)
+int ves_icall_System_Globalization_CompareInfo_internal_index_char (MonoCompareInfo *this_obj, MonoString *source, gint32 sindex, gint32 count, gunichar2 value, gint32 options, MonoBoolean first)
{
- MONO_ARCH_SAVE_REGS;
-
return(string_invariant_indexof_char (source, sindex, count, value,
first));
}
int ves_icall_System_Threading_Thread_current_lcid (void)
{
- MONO_ARCH_SAVE_REGS;
-
/* Invariant */
return(0x007F);
}
-MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this, MonoString *old, MonoString *new, MonoCompareInfo *comp)
+MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this_obj, MonoString *old, MonoString *new, MonoCompareInfo *comp)
{
- MONO_ARCH_SAVE_REGS;
-
/* Do a normal ascii string compare and replace, as we only
* know the invariant locale if we dont have ICU
*/
- return(string_invariant_replace (this, old, new));
+ return(string_invariant_replace (this_obj, old, new));
}
static gint32 string_invariant_compare_char (gunichar2 c1, gunichar2 c2,
guint8 **argCombiningClass)
{
#ifdef DISABLE_NORMALIZATION
- mono_raise_exception (mono_get_exception_not_supported ("This runtime has been compiled without string normalization support."));
+ mono_set_pending_exception (mono_get_exception_not_supported ("This runtime has been compiled without string normalization support."));
+ return;
#else
*argProps = (guint8*)props;
*argMappedChars = (guint8*) mappedChars;