static MCAdType MCAdTypeFromCString(const char *p_string) { if (MCCStringEqualCaseless(p_string, "banner")) return kMCAdTypeBanner; else if (MCCStringEqualCaseless(p_string, "text")) return kMCAdTypeText; else if (MCCStringEqualCaseless(p_string, "full screen")) return kMCAdTypeFullscreen; return kMCAdTypeUnknown; }
static MCActivityIndicatorType MCActivityIndicatorTypeFromCString(const char *p_string) { #ifdef /* MCActivityIndicatorTypeFromCString */ LEGACY_EXEC if (MCCStringEqualCaseless(p_string, "white")) return kMCActivityIndicatorWhite; else if (MCCStringEqualCaseless(p_string, "large white")) return kMCActivityIndicatorWhiteLarge; else if (MCCStringEqualCaseless(p_string, "gray")) return kMCActivityIndicatorGray; return kMCActivityIndicatorWhite; #endif /* MCActivityIndicatorTypeFromCString */ }
static MCBusyIndicatorType MCBusyIndicatorTypeFromCString(const char *p_string) { #ifdef /* MCBusyIndicatorTypeFromCString */ LEGACY_EXEC if (MCCStringEqualCaseless(p_string, "in line")) return kMCBusyIndicatorInLine; else if (MCCStringEqualCaseless(p_string, "square")) return kMCBusyIndicatorSquare; else if (MCCStringEqualCaseless(p_string, "keyboard")) return kMCBusyIndicatorKeyboard; return kMCBusyIndicatorSquare; #endif /* MCBusyIndicatorTypeFromCString */ }
void MCSystemListFontsForFamily(MCExecPoint& ep, const char *p_family) { uint32_t t_styles; t_styles = 0; for (uint32_t i = 0; s_droid_fonts[i].name != nil; i++) { if (MCCStringEqualCaseless(s_droid_fonts[i].name, p_family)) { t_styles = s_droid_fonts[i].styles; break; } } if (t_styles == 0) t_styles = MCAndroidCustomFontsGetStyle(p_family); ep . clear(); if (t_styles & kMCAndroidFontStyleRegular) ep.concatcstring("plain", EC_RETURN, ep.getsvalue().getlength() == 0); if (t_styles & kMCAndroidFontStyleBold) ep.concatcstring("bold", EC_RETURN, ep.getsvalue().getlength() == 0); if (t_styles & kMCAndroidFontStyleItalic) ep.concatcstring("italic", EC_RETURN, ep.getsvalue().getlength() == 0); if (t_styles & kMCAndroidFontStyleBoldItalic) ep.concatcstring("bold-italic", EC_RETURN, ep.getsvalue().getlength() == 0); }
Exec_stat MCHandleSetAllowedOrientations(void *context, MCParameter *p_parameters) { bool t_success; t_success = true; char *t_orientations; t_orientations = nil; if (t_success) t_success = MCParseParameters(p_parameters, "s", &t_orientations); char **t_orientations_array; uint32_t t_orientations_count; t_orientations_array = nil; t_orientations_count = 0; if (t_success) t_success = MCCStringSplit(t_orientations, ',', t_orientations_array, t_orientations_count); uint32_t t_orientations_set; t_orientations_set = 0; if (t_success) for(uint32_t i = 0; i < t_orientations_count; i++) for(uint32_t j = 0; s_orientation_names[j] != nil; j++) if (MCCStringEqualCaseless(t_orientations_array[i], s_orientation_names[j])) t_orientations_set |= (1 << j); s_allowed_orientations = t_orientations_set; for(uint32_t i = 0; i < t_orientations_count; i++) MCCStringFree(t_orientations_array[i]); MCMemoryDeleteArray(t_orientations_array); MCCStringFree(t_orientations); return ES_NORMAL; }
static bool MCTextLayoutFontFromHFONT(void *p_font, MCTextLayoutFont*& r_font) { bool t_success; t_success = true; // First fetch the HFONT's LOGFONT structure LOGFONTA t_logfont; if (t_success) if (!GetObjectA(p_font, sizeof(LOGFONTA), &t_logfont)) t_success = false; if (t_success) t_logfont . lfHeight = -256; // Now use this to search for an existing layout font MCTextLayoutFont *self; self = nil; if (t_success) { self = MCTextLayoutFontFind(t_logfont); if (self != nil) { r_font = self; return true; } } // Otherwise we must go ahead and create a new font if (t_success) t_success = MCMemoryNew(self); if (t_success) { self -> handle = CreateFontIndirectA(&t_logfont); if (self -> handle == nil) t_success = false; } if (t_success) { MCListPushFront(s_fonts, self); self -> info = t_logfont; // Now see if the font is a linked font for(MCTextLayoutLinkedFont *t_links = s_linked_fonts; t_links != nil; t_links = t_links -> next) if (MCCStringEqualCaseless(t_links -> name, self -> info . lfFaceName)) { self -> linking = t_links; break; } r_font = self; } else MCTextLayoutFontDestroy(self); return t_success; }
static MCAndroidCustomFont* look_up_custom_font_by_name(const char *p_name) { for (MCAndroidCustomFont *t_font = s_custom_fonts; t_font != nil; t_font = t_font->next) { if (MCCStringEqualCaseless(p_name, t_font->name)) return t_font; } return nil; }
Exec_stat MCHandleStartActivityIndicator(void *p_context, MCParameter *p_parameters) { #ifdef /* MCHandleStartActivityIndicator */ LEGACY_EXEC MCActivityIndicatorType t_indicator_type; t_indicator_type = kMCActivityIndicatorWhite; char *t_style; t_style = nil; MCLocation t_location; t_location.x = -1; t_location.y = -1; MCExecPoint ep(nil, nil, nil); if (p_parameters != nil) { p_parameters->eval(ep); // Provide backwards compatibility here for "whiteLarge" rather than "large white". if (MCCStringEqualCaseless (ep.getsvalue().getstring(), "whiteLarge")) MCCStringClone("large white", t_style); else t_style = ep.getsvalue().clone(); if (t_style != nil) p_parameters = p_parameters->getnext(); } if (p_parameters != nil) { p_parameters->eval(ep); if (ep.getformat() != VF_STRING || ep.ston() == ES_NORMAL) { t_location.x = ep.getint4(); p_parameters = p_parameters->getnext(); if (p_parameters != nil) { p_parameters->eval(ep); if (ep.getformat() != VF_STRING || ep.ston() == ES_NORMAL) { t_location.y = ep.getint4(); p_parameters = p_parameters->getnext(); } } } if (t_location.y == -1) t_location.x = -1; } MCExecContext t_ctxt(ep); t_ctxt . SetTheResultToEmpty(); if (t_style != nil) t_indicator_type = MCActivityIndicatorTypeFromCString(t_style); MCActivityIndicatorExecStart(t_ctxt, t_indicator_type, t_location); return t_ctxt.GetStat(); #endif /* MCHandleStartActivityIndicator */ }
bool MCNativeControl::LookupAction(const char *p_action, MCNativeControlAction& r_action) { for(uint32_t i = 0; s_native_control_actions[i] . name != nil; i++) if (MCCStringEqualCaseless(p_action, s_native_control_actions[i] . name)) { r_action = s_native_control_actions[i] . action; return true; } return false; }
bool MCNativeControl::LookupType(const char *p_type, MCNativeControlType& r_type) { for(uint32_t i = 0; s_native_control_types[i] . name != nil; i++) if (MCCStringEqualCaseless(p_type, s_native_control_types[i] . name)) { r_type = s_native_control_types[i] . type; return true; } return false; }
bool MCNativeControl::LookupProperty(const char *p_property, MCNativeControlProperty& r_prop) { for(uint32_t i = 0; s_native_control_properties[i] . name != nil; i++) if (MCCStringEqualCaseless(p_property, s_native_control_properties[i] . name)) { r_prop = s_native_control_properties[i] . property; return true; } return false; }
bool MCNativeControl::ParseEnum(MCExecPoint& ep, MCNativeControlEnumEntry *p_entries, int32_t& r_value) { for(uint32_t i = 0; p_entries[i] . key != nil; i++) if (MCCStringEqualCaseless(p_entries[i] . key, ep . getcstring())) { r_value = p_entries[i] . value; return true; } MCeerror->add(EE_OBJECT_BADSTYLE, 0, 0, ep.getsvalue()); return false; }
bool MCStackFullscreenModeFromString(const char *p_string, MCStackFullscreenMode &r_mode) { for (uint32_t i = 0; s_fullscreenmode_names[i].name != nil; i++) { if (MCCStringEqualCaseless(p_string, s_fullscreenmode_names[i].name)) { r_mode = s_fullscreenmode_names[i].mode; return true; } } return false; }
bool MCAd::FindByNameOrId(const char *p_name, MCAd *&r_ad) { char *t_id_end; uint32_t t_id; t_id = strtoul(p_name, &t_id_end, 10); if (t_id_end != p_name) return FindById(t_id, r_ad); for(MCAd *t_ad = s_ads; t_ad != nil; t_ad = t_ad -> m_next) if (t_ad -> GetName() != nil && MCCStringEqualCaseless(t_ad -> GetName(), p_name)) { r_ad = t_ad; return true; } return false; }
bool MCNativeControl::FindByNameOrId(const char *p_name, MCNativeControl*& r_control) { char *t_id_end; uint32_t t_id; t_id = strtoul(p_name, &t_id_end, 10); if (t_id_end != p_name) return FindById(t_id, r_control); for(MCNativeControl *t_control = s_native_controls; t_control != nil; t_control = t_control -> m_next) if (!t_control -> m_deleted && t_control -> GetName() != nil && MCCStringEqualCaseless(t_control -> GetName(), p_name)) { r_control = t_control; return true; } return false; }
static bool cgi_multipart_get_boundary(char *&r_boundary) { bool t_success = true; char *t_content_type; t_content_type = MCS_getenv("CONTENT_TYPE"); char *t_params = NULL; uint32_t t_index = 0; char **t_names = NULL; char **t_values = NULL; uint32_t t_param_count = 0; t_success = MCCStringFirstIndexOf(t_content_type, ';', t_index); if (t_success) t_success = MCMultiPartParseHeaderParams(t_content_type + t_index + 1, t_names, t_values, t_param_count); r_boundary = NULL; if (t_success) { for (uint32_t i = 0; i < t_param_count; i++) { if (MCCStringEqualCaseless(t_names[i], "boundary") && MCCStringLength(t_values[i]) > 0) { r_boundary = t_values[i]; t_values[i] = NULL; break; } } } if (t_success) t_success = r_boundary != NULL; for (uint32_t i = 0; i < t_param_count; i++) { MCCStringFree(t_names[i]); MCCStringFree(t_values[i]); } MCMemoryDeleteArray(t_names); MCMemoryDeleteArray(t_values); return t_success; }
static MCAndroidCustomFont* look_up_custom_font_by_family_and_style(const char *p_family, bool p_bold, bool p_italic) { MCAndroidCustomFont *t_closest_font; t_closest_font = nil; for (MCAndroidCustomFont *t_font = s_custom_fonts; t_font != nil; t_font = t_font->next) { if (MCCStringEqualCaseless(p_family, t_font->family)) { if ((p_bold && p_italic && t_font->style == kMCAndroidFontStyleBoldItalic) || (p_bold && t_font->style == kMCAndroidFontStyleBold) || (p_italic && t_font->style == kMCAndroidFontStyleItalic)) return t_font; else if (t_closest_font == nil) t_closest_font = t_font; } } return t_closest_font; }
static MCAndroidFontStyle MCAndroidCustomFontsGetStyle(const char *p_name) { MCAndroidFontStyle t_styles; t_styles = 0; for (MCAndroidCustomFont *t_font = s_custom_fonts; t_font != nil; t_font = t_font->next) { if (MCCStringEqualCaseless(p_name, t_font->family)) t_styles |= t_font->style; } if (t_styles == 0) { MCAndroidCustomFont *t_font; t_font = look_up_custom_font_by_name(p_name); if (t_font != nil) t_styles |= t_font->style; } return t_styles; }
bool MCField::macmatchfontname(const char *p_font_name, char p_derived_font_name[]) { ATSUFontID t_font_id; if (ATSUFindFontFromName(p_font_name, strlen(p_font_name), kFontFullName, kFontNoPlatform, kFontNoScript, kFontNoLanguage, &t_font_id) == noErr || ATSUFindFontFromName(p_font_name, strlen(p_font_name), kFontUniqueName, kFontNoPlatform, kFontNoScript, kFontNoLanguage, &t_font_id) == noErr || ATSUFindFontFromName(p_font_name, strlen(p_font_name), kFontFamilyName, kFontNoPlatform, kFontNoScript, kFontNoLanguage, &t_font_id) == noErr || ATSUFindFontFromName(p_font_name, strlen(p_font_name), kFontNoName, kFontNoPlatform, kFontNoScript, kFontNoLanguage, &t_font_id) == noErr) { // Fetch the style name char t_style_name[64]; ByteCount t_style_name_length; t_style_name_length = 0; ATSUFindFontName(t_font_id, kFontStyleName, kFontMacintoshPlatform, kFontNoScript, kFontNoLanguage, 63, t_style_name, &t_style_name_length, NULL); t_style_name[t_style_name_length] = '\0'; // Fetch the full name char t_full_name[256]; ByteCount t_full_name_length; t_full_name_length = 0; ATSUFindFontName(t_font_id, kFontFullName, kFontMacintoshPlatform, kFontNoScript, kFontNoLanguage, 255, t_full_name, &t_full_name_length, NULL); t_full_name[t_full_name_length] = '\0'; // MW-2011-09-02: Make sure we don't do anything at all if style is regular // (output name should be fullname!) if (MCCStringEqualCaseless(t_style_name, "Regular")) p_font_name = p_font_name; // Do nothing else if (MCCStringEndsWithCaseless(t_full_name, "Bold Italic")) t_full_name[t_full_name_length - 12] = '\0'; else if (MCCStringEndsWithCaseless(t_full_name, "Bold")) t_full_name[t_full_name_length - 5] = '\0'; else if (MCCStringEndsWithCaseless(t_full_name, "Italic")) t_full_name[t_full_name_length - 7] = '\0'; strcpy(p_derived_font_name, t_full_name); return true; } return false; }
bool MCNativeControl::ParseSet(MCExecPoint& ep, MCNativeControlEnumEntry *p_entries, int32_t& r_value) { bool t_success = true; char **t_members_array; uint32_t t_members_count; t_members_array = nil; t_members_count = 0; if (t_success) t_success = MCCStringSplit(ep.getcstring(), ',', t_members_array, t_members_count); int32_t t_members_set; t_members_set = 0; if (t_success) for(uint32_t i = 0; t_success && i < t_members_count; i++) { bool t_found = false; for(uint32_t j = 0; !t_found && p_entries[j].key != nil; j++) { if (MCCStringEqualCaseless(t_members_array[i], p_entries[j].key)) { t_members_set |= p_entries[j].value; t_found = true; } } if (!t_found) t_success = false; } for(uint32_t i = 0; i < t_members_count; i++) MCCStringFree(t_members_array[i]); MCMemoryDeleteArray(t_members_array); if (t_success) r_value = t_members_set; return t_success; }
static bool cgi_multipart_header_callback(void *p_context, MCMultiPartHeader *p_header) { bool t_success = true; cgi_multipart_context_t *t_context = (cgi_multipart_context_t*)p_context; if (p_header != NULL) { if (MCCStringEqualCaseless(p_header->name, "Content-Disposition")) { if (MCCStringEqualCaseless(p_header->value, "form-data")) t_context->disposition = kMCDispositionFormData; else if (MCCStringEqualCaseless(p_header->value, "file")) t_context->disposition = kMCDispositionFile; else t_context->disposition = kMCDispositionUnknown; for (uint32_t i = 0; i < p_header->param_count; i++) { if (MCCStringEqualCaseless(p_header->param_name[i], "name")) grab_string(t_context->name, p_header->param_value[i]); else if (MCCStringEqualCaseless(p_header->param_name[i], "filename")) grab_string(t_context->file_name, p_header->param_value[i]); } } else if (MCCStringEqualCaseless(p_header->name, "Content-Type")) { grab_string(t_context->type, p_header->value); for (uint32_t i = 0; i < p_header->param_count; i++) { if (MCCStringEqualCaseless(p_header->param_name[i], "boundary")) grab_string(t_context->boundary, p_header->param_value[i]); } } } else { if (cgi_context_is_form_data(t_context)) { MCExecPoint ep; t_success = t_context->name != NULL; if (t_success) { cgi_fetch_variable_value_for_key(s_cgi_post, t_context->name, MCCStringLength(t_context->name), ep, t_context->post_variable); t_context->post_variable->assign_empty(); cgi_fetch_variable_value_for_key(s_cgi_post_binary, t_context->name, MCCStringLength(t_context->name), ep, t_context->post_binary_variable); t_context->post_binary_variable->assign_empty(); } } else if (cgi_context_is_file(t_context)) { const char *t_temp_dir = cgi_get_upload_temp_dir(); const char *t_error = NULL; if (t_temp_dir == NULL || !MCS_exists(t_temp_dir, False)) { t_context->file_status = kMCFileStatusNoUploadFolder; } else if (!MCMultiPartCreateTempFile(cgi_get_upload_temp_dir(), t_context->file_handle, t_context->temp_name)) { t_context->file_status = kMCFileStatusIOError; } } } return t_success; }
static bool create_custom_font_from_path(const char *p_path, FT_Library p_library, MCAndroidCustomFont *&r_custom_font) { bool t_success; t_success = true; char *t_buffer; t_buffer = nil; uint32_t t_file_size; t_file_size = 0; if (t_success) t_success = load_custom_font_file_into_buffer_from_path(p_path, t_buffer, t_file_size); FT_Face t_font_face; t_font_face = nil; if (t_success) t_success = FT_New_Memory_Face(p_library, (FT_Byte *)t_buffer, t_file_size, 0, &t_font_face) == 0; MCAndroidCustomFont *t_font; t_font = nil; if (t_success) t_success = MCMemoryNew(t_font); if (t_success) t_success = MCCStringClone(p_path, t_font->path); if (t_success) t_success = MCCStringClone(t_font_face->family_name, t_font->family); if (t_success) { if (MCCStringEqualCaseless(t_font_face->style_name, "bold")) t_font->style = kMCAndroidFontStyleBold; else if (MCCStringEqualCaseless(t_font_face->style_name, "italic")) t_font->style = kMCAndroidFontStyleItalic; else if (MCCStringEqualCaseless(t_font_face->style_name, "bold italic")) t_font->style = kMCAndroidFontStyleBoldItalic; else t_font->style = kMCAndroidFontStyleRegular; } if (t_success) { FT_SfntName t_sft_name; for (uint32_t i = 0; i < FT_Get_Sfnt_Name_Count(t_font_face); i++) { // Attempt to fetch the name of the font. The name is name id 4 as defined in https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html // It appears that the platform to use here is 1 (Macintosh according to the spec). FT_Get_Sfnt_Name(t_font_face, i, &t_sft_name); if (t_sft_name.name_id == 4 && t_sft_name.platform_id == 1 && t_sft_name.encoding_id == 0 && t_sft_name.language_id == 0 && t_sft_name.string_len != 0) { t_success = MCCStringCloneSubstring((char *)t_sft_name.string, t_sft_name.string_len, t_font->name); break; } } } if (t_success) t_success = t_font->name != nil; if (t_success) r_custom_font = t_font; else delete_custom_font(t_font); if (t_font_face != nil) FT_Done_Face(t_font_face); /*UNCHECKED */ MCMemoryDelete(t_buffer); return t_success; }
Exec_stat MCProperty::mode_set(MCExecPoint& ep) { switch(which) { case P_REV_CRASH_REPORT_SETTINGS: { MCVariableValue *t_settings; t_settings = ep . getarray(); if (t_settings == NULL) break; MCExecPoint ep_key(ep); if (t_settings -> fetch_element(ep_key, "verbose") == ES_NORMAL) MCU_stob(ep_key . getsvalue(), MCcrashreportverbose); if (t_settings -> fetch_element(ep_key, "filename") == ES_NORMAL) { if (MCcrashreportfilename != NULL) delete MCcrashreportfilename; MCcrashreportfilename = ep_key . getsvalue() . getlength() > 0 ? ep_key . getsvalue() . clone() : NULL; } } break; case P_REV_LICENSE_LIMITS: { if(!MCenvironmentactive) break; MCVariableValue *t_settings = ep.getarray(); if (t_settings == NULL) break; MCExecPoint ep_key(ep); if (t_settings -> fetch_element(ep_key, "token") == ES_NORMAL) MClicenseparameters . license_token = ep_key . getsvalue() . clone(); if (t_settings -> fetch_element(ep_key, "name") == ES_NORMAL) MClicenseparameters . license_name = ep_key . getsvalue() . clone(); if (t_settings -> fetch_element(ep_key, "organization") == ES_NORMAL) MClicenseparameters . license_organization = ep_key . getsvalue() . clone(); if (t_settings -> fetch_element(ep_key, "class") == ES_NORMAL) { static struct { const char *tag; uint32_t value; } s_class_map[] = { { "community", kMCLicenseClassCommunity }, { "commercial", kMCLicenseClassCommercial }, { "professional", kMCLicenseClassProfessional }, { NULL, kMCLicenseClassNone } }; uint4 t_index; for(t_index = 0; s_class_map[t_index] . tag != NULL; ++t_index) if (ep_key . getsvalue() == s_class_map[t_index] . tag) break; MClicenseparameters . license_class = s_class_map[t_index] . value; } if (t_settings -> fetch_element(ep_key, "multiplicity") == ES_NORMAL && ep_key . ton() == ES_NORMAL) MClicenseparameters . license_multiplicity = ep_key . getuint4(); if (t_settings -> fetch_element(ep_key, "scriptlimit") == ES_NORMAL && ep_key . ton() == ES_NORMAL) MClicenseparameters . script_limit = ep_key . getnvalue() <= 0 ? 0 : ep_key . getuint4(); if (t_settings -> fetch_element(ep_key, "dolimit") == ES_NORMAL && ep_key . ton() == ES_NORMAL) MClicenseparameters . do_limit = ep_key . getnvalue() <= 0 ? 0 : ep_key . getuint4(); if (t_settings -> fetch_element(ep_key, "usinglimit") == ES_NORMAL && ep_key . ton() == ES_NORMAL) MClicenseparameters . using_limit = ep_key . getnvalue() <= 0 ? 0 : ep_key . getuint4(); if (t_settings -> fetch_element(ep_key, "insertlimit") == ES_NORMAL && ep_key . ton() == ES_NORMAL) MClicenseparameters . insert_limit = ep_key . getnvalue() <= 0 ? 0 : ep_key . getuint4(); if (t_settings -> fetch_element(ep_key, "deploy") == ES_NORMAL) { static struct { const char *tag; uint32_t value; } s_deploy_map[] = { { "windows", kMCLicenseDeployToWindows }, { "macosx", kMCLicenseDeployToMacOSX }, { "linux", kMCLicenseDeployToLinux }, { "ios", kMCLicenseDeployToIOS }, { "android", kMCLicenseDeployToAndroid }, { "winmobile", kMCLicenseDeployToWinMobile }, { "meego", kMCLicenseDeployToLinuxMobile }, { "server", kMCLicenseDeployToServer }, { "ios-embedded", kMCLicenseDeployToIOSEmbedded }, { "android-embedded", kMCLicenseDeployToIOSEmbedded }, }; MClicenseparameters . deploy_targets = 0; uint32_t t_target_count; char **t_targets; t_target_count = 0; t_targets = nil; if (MCCStringSplit(ep_key . getcstring(), ',', t_targets, t_target_count)) { for(uint32_t i = 0; i < t_target_count; i++) { for(uint32_t j = 0; j < sizeof(s_deploy_map) / sizeof(s_deploy_map[0]); j++) if (MCCStringEqualCaseless(s_deploy_map[j] . tag, t_targets[i])) { MClicenseparameters . deploy_targets |= s_deploy_map[j] . value; break; } } MCCStringArrayFree(t_targets, t_target_count); } } if (t_settings -> fetch_element(ep_key, "addons") == ES_NORMAL && ep_key . getformat() == VF_ARRAY) MClicenseparameters . addons = new MCVariableValue(*(ep_key . getarray())); } break; case P_REV_MESSAGE_BOX_REDIRECT: { MCObject *t_object; t_object = getobj(ep); if (t_object != NULL) MCmessageboxredirect = t_object; else MCmessageboxredirect = NULL; } break; #ifdef FEATURE_PROPERTY_LISTENER // MM-2012-11-06: [[ Property Listener ]] case P_REV_PROPERTY_LISTENER_THROTTLE_TIME: if (ep.getuint4(MCpropertylistenerthrottletime, line, pos, EE_OBJECT_NAN) != ES_NORMAL) return ES_ERROR; break; #endif default: return ES_NOT_HANDLED; } return ES_NORMAL; }