int xnav_open_URL( pwr_tURL url) { char cmd[200]; int sts; pwr_sClass_WebBrowserConfig *config_p = 0; char browser[40] = "firefox"; pwr_tObjid config_objid; sts = gdh_GetClassList( pwr_cClass_WebBrowserConfig, &config_objid); if ( ODD(sts)) sts = gdh_ObjidToPointer( config_objid, (void **)&config_p); if ( ODD(sts)) { if ( strcmp( config_p->WebBrowser, "") != 0) strcpy( browser, config_p->WebBrowser); } if ( strncmp( url, "$pwr_lang/", 10) == 0) { // If file in $pwr_lang, check if file exist, else take en_us if ( Lng::current() != lng_eLanguage_en_US) { pwr_tURL testurl; pwr_tTime t; replace_symbol( url, testurl, config_p); dcli_translate_filename( testurl, testurl); sts = dcli_file_time( testurl, &t); if ( EVEN(sts)) { // Try en_us strcpy( testurl, "$pwr_doc/en_us/"); strcat( testurl, &url[10]); strcpy( url, testurl); } } } replace_symbol( url, url, config_p); if ( strcmp( browser, "mozilla") == 0 || strcmp( browser, "rt_mozilla") == 0) { // Try remote display first sprintf( cmd, "%s -remote \"openurl(%s,new-window)\"", browser, url); sts = system(cmd); if ( sts) { // Not started yet sprintf( cmd, "%s %s &", browser, url); system( cmd); } } else { sprintf( cmd, "%s %s &", browser, url); system( cmd); } return XNAV__SUCCESS; }
void c_typecheck_baset::typecheck_symbol_type(typet &type) { { // add prefix symbol_typet &symbol_type=to_symbol_type(type); symbol_type.set_identifier(add_language_prefix(symbol_type.get_identifier())); } // adjust identifier, if needed replace_symbol(type); const irep_idt &identifier= to_symbol_type(type).get_identifier(); symbol_tablet::symbolst::const_iterator s_it= symbol_table.symbols.find(identifier); if(s_it==symbol_table.symbols.end()) { err_location(type); str << "type symbol `" << identifier << "' not found"; throw 0; } const symbolt &symbol=s_it->second; if(!symbol.is_type) { err_location(type); throw "expected type symbol"; } if(symbol.is_macro) { // overwrite, but preserve (add) any qualifiers and other flags c_qualifierst c_qualifiers(type); bool is_packed=type.get_bool(ID_C_packed); irept alignment=type.find(ID_C_alignment); c_qualifiers+=c_qualifierst(symbol.type); type=symbol.type; c_qualifiers.write(type); if(is_packed) type.set(ID_C_packed, true); if(alignment.is_not_nil()) type.set(ID_C_alignment, alignment); } // CPROVER extensions if(symbol.base_name=="__CPROVER_rational") { type=rational_typet(); } else if(symbol.base_name=="__CPROVER_integer") { type=integer_typet(); } }