ReturnOop VMEvent::get_event_request(DebuggerEvent *d_event, int &event_count, jbyte &suspend_policy) { VMEventStream es; UsingFastOops fast_oops; VMEvent::Fast ep, epp; VMEventModifier::Fast em; bool matched; jbyte kind = d_event->event_kind(); event_count = 0; suspend_policy = 0; ep = es.next_by_kind(kind); while(!ep.is_null()) { bool should_delete = false; // check modifiers #if ENABLE_ISOLATES // Check to see what task this event was requested on if (ep().task_id() != -1 && (Thread::current()->task_id() != ep().task_id())) { ep = es.next_by_kind(kind); continue; } #endif em = ep().mods(); // we need to check the modifiers to see if we send this event matched = true; do { if (em.is_null()) { break; } if (!em().match(d_event, &should_delete)) { matched = false; break; } em = em().next(); } while(em.not_null()); if (matched) { // Found a matching event, join it to the list of events to send ep().set_send_next(&epp); epp = ep; event_count++; if (ep().suspend_policy() > suspend_policy) { suspend_policy = ep().suspend_policy(); } } if (should_delete) { clear_event_request(&ep); } ep = es.next_by_kind(kind); } return epp; }
Exec_stat MCHandleUpdateContact(void *context, MCParameter *p_parameters) // ABUnknownPersonViewController { MCExecPoint ep(nil, nil, nil); MCExecContext ctxt(ep); // Handle parameters. We are doing that in a dedicated call MCVariableValue *t_contact = nil; char *t_title = nil; char *t_message = nil; char *t_alternate_name = nil; /* UNCHECKED */ MCContactParseParams(p_parameters, t_contact, t_title, t_message, t_alternate_name); // Call the Exec implementation MCUpdateContactExec(ctxt, t_contact, t_title, t_message, t_alternate_name); // Set return value return ctxt.GetStat(); }
bool checkIfNodeInUse(IpAddress &ip, bool includespares, StringBuffer &clustname) { SocketEndpoint ep(0,ip); if (RANK_NULL != group->rank(ep)) { clustname.append(groupName); return true; } else if (includespares) { if (RANK_NULL != spareGroup->rank(ep)) { clustname.append(groupName).append(" spares"); return true; } } return false; }
void EffectsExporter::exportEffects(Scene *sce) { this->scene = sce; if (this->export_settings->export_texture_type == BC_TEXTURE_TYPE_MAT) { if (hasEffects(sce)) { MaterialFunctor mf; openLibrary(); mf.forEachMaterialInExportSet<EffectsExporter>(sce, *this, this->export_settings->export_set); closeLibrary(); } } else { std::set<Object *> uv_textured_obs = bc_getUVTexturedObjects(sce, !this->export_settings->active_uv_only); std::set<Image *> uv_images = bc_getUVImages(sce, !this->export_settings->active_uv_only); if (uv_images.size() > 0) { openLibrary(); std::set<Image *>::iterator uv_images_iter; for (uv_images_iter = uv_images.begin(); uv_images_iter != uv_images.end(); uv_images_iter++) { Image *ima = *uv_images_iter; std::string key(id_name(ima)); key = translate_id(key); COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D, key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX, key + COLLADASW::Sampler::SURFACE_SID_SUFFIX); sampler.setImageId(key); openEffect(key + "-effect"); COLLADASW::EffectProfile ep(mSW); ep.setProfileType(COLLADASW::EffectProfile::COMMON); ep.setShaderType(COLLADASW::EffectProfile::PHONG); ep.setDiffuse(createTexture(ima, key, &sampler), false, "diffuse"); COLLADASW::ColorOrTexture cot = getcol(0, 0, 0, 1.0f); ep.setSpecular(cot, false, "specular"); ep.openProfile(); ep.addProfileElements(); ep.addExtraTechniques(mSW); ep.closeProfile(); closeEffect(); } closeLibrary(); } } }
shared_ptr<Layer<Dtype> > GetReLULayer(const LayerParameter& param) { ReLUParameter_Engine engine = param.relu_param().engine(); // New, more flexible way of providing engine if (engine == ReLUParameter_Engine_DEFAULT && param.engine() != "") { EngineParser ep(param.engine()); if (ep.isEngine("CAFFE")) engine = ReLUParameter_Engine_CAFFE; #ifdef USE_CUDNN else if (ep.isEngine("CUDNN")) engine = ReLUParameter_Engine_CUDNN; #endif #if defined(MKL2017_SUPPORTED) else if (ep.isEngine("MKL2017")) engine = ReLUParameter_Engine_MKL2017; #endif #if defined(MKLDNN_SUPPORTED) else if (ep.isEngine("MKLDNN")) engine = ReLUParameter_Engine_MKLDNN; #endif } if (engine == ReLUParameter_Engine_DEFAULT) { engine = ReLUParameter_Engine_CAFFE; #ifdef USE_CUDNN engine = ReLUParameter_Engine_CUDNN; #endif } if (engine == ReLUParameter_Engine_CAFFE) { return shared_ptr<Layer<Dtype> >(new ReLULayer<Dtype>(param)); #ifdef USE_CUDNN } else if (engine == ReLUParameter_Engine_CUDNN) { return shared_ptr<Layer<Dtype> >(new CuDNNReLULayer<Dtype>(param)); #endif #ifdef MKL2017_SUPPORTED } else if (engine == ReLUParameter_Engine_MKL2017) { return shared_ptr<Layer<Dtype> >(new MKLReLULayer<Dtype>(param)); #endif #ifdef MKLDNN_SUPPORTED } else if (engine == ReLUParameter_Engine_MKLDNN) { return shared_ptr<Layer<Dtype> >(new MKLDNNReLULayer<Dtype>(param)); #endif } else { LOG(FATAL) << "Layer " << param.name() << " has unknown engine."; } return shared_ptr<Layer<Dtype> >(); }
void clientTask(const RCF::tstring & pipeName, boost::uint32_t waitMs) { RCF::NamedPipeEndpoint ep(pipeName); RcfClient<I_Echo> client(ep); boost::uint32_t t0 = RCF::getCurrentTimeMs(); std::string s1 = "asdf"; std::string s2 = client.echo(s1, waitMs); RCF_CHECK_EQ(s1 , s2); boost::uint32_t t1 = RCF::getCurrentTimeMs(); RCF::Lock lock(gIoMutex); std::cout << "Waited " << t1-t0 << " ms..." << std::endl; }
//----------------------------------------------------------------------------- // Network stuff void EventManager::listen(const int port) { dbglog << "EventManager: Listening on port " << port << " ..."; boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), port); if (!mAcceptor) { mAcceptor = new boost::asio::ip::tcp::acceptor(mService, ep); startAccept(); } else { throw std::logic_error("EventManager::init(): Initialized twice!"); } }
const RecentEmojiPack &cGetRecentEmojis() { if (cRecentEmojis().isEmpty() && !cRecentEmojisPreload().isEmpty()) { RecentEmojiPreload p(cRecentEmojisPreload()); cSetRecentEmojisPreload(RecentEmojiPreload()); RecentEmojiPack r; r.reserve(p.size()); for (RecentEmojiPreload::const_iterator i = p.cbegin(), e = p.cend(); i != e; ++i) { EmojiPtr ep(getEmoji(i->first)); if (ep) { r.push_back(qMakePair(ep, i->second)); } } cSetRecentEmojis(r); } return cRecentEmojis(); }
Exec_stat MCHandleAdCreate(void *context, MCParameter *p_parameters) { bool t_success; t_success = true; MCExecPoint ep(nil, nil, nil); MCExecContext t_ctxt(ep); t_ctxt . SetTheResultToEmpty(); char *t_ad; t_ad = nil; if (t_success) t_success = MCParseParameters(p_parameters, "s", &t_ad); MCAdType t_type; t_type = kMCAdTypeUnknown; if (t_success) { char *t_type_string; t_type_string = nil; if (MCParseParameters(p_parameters, "s", &t_type_string)) t_type = MCAdTypeFromCString(t_type_string); MCCStringFree(t_type_string); } MCAdTopLeft t_top_left = {0,0}; if (t_success) { char *t_top_left_string; t_top_left_string = nil; if (MCParseParameters(p_parameters, "s", &t_top_left_string)) /* UNCHECKED */ sscanf(t_top_left_string, "%u,%u", &t_top_left.x, &t_top_left.y); MCCStringFree(t_top_left_string); } MCVariableValue *t_meta_data; t_meta_data = nil; if (t_success) MCParseParameters(p_parameters, "a", &t_meta_data); if (t_success) MCAdExecCreateAd(t_ctxt, t_ad, t_type, t_top_left, t_meta_data); MCCStringFree(t_ad); return t_ctxt.GetStat(); }
shared_ptr<Layer<Dtype> > GetDeconvolutionLayer( const LayerParameter& param) { ConvolutionParameter conv_param = param.convolution_param(); ConvolutionParameter_Engine engine = conv_param.engine(); #if defined(MKL2017_SUPPORTED) bool use_dilation = false; for (int i = 0; i < conv_param.dilation_size(); ++i) { if (conv_param.dilation(i) > 1) { use_dilation = true; } } #endif // New, more flexible way of providing engine if (engine == ConvolutionParameter_Engine_DEFAULT && param.engine() != "") { EngineParser ep(param.engine()); if (ep.isEngine("CAFFE")) { engine = ConvolutionParameter_Engine_CAFFE; } #ifdef MKL2017_SUPPORTED else if (!use_dilation && ep.isEngine("MKL2017")) { engine = ConvolutionParameter_Engine_MKL2017; } #endif } if (engine == ConvolutionParameter_Engine_DEFAULT) { engine = ConvolutionParameter_Engine_CAFFE; } if (engine == ConvolutionParameter_Engine_CAFFE) { return shared_ptr<Layer<Dtype> >(new DeconvolutionLayer<Dtype>(param)); #ifdef MKL2017_SUPPORTED } else if (engine == ConvolutionParameter_Engine_MKL2017) { if (use_dilation) { LOG(FATAL) << "MKL2017 doesn't support the dilated convolution at Layer " << param.name(); } return shared_ptr<Layer<Dtype> >(new MKLDeconvolutionLayer<Dtype>(param)); #endif } else { LOG(FATAL) << "Layer " << param.name() << " has unknown engine."; } return shared_ptr<Layer<Dtype> >(); }
int main() { try { io::endpoint ep("127.0.0.1",8080); TEST(ep.ip()=="127.0.0.1"); TEST(ep.port() == 8080); ep.ip("192.168.2.100"); TEST(ep.ip()=="192.168.2.100"); ep.port(10); TEST(ep.port()==10); TEST(ep.family()==io::pf_inet); #ifndef BOOSTER_AIO_NO_PF_INET6 ep.ip("::1"); TEST(ep.family()==io::pf_inet6); #endif #ifndef BOOSTER_WIN32 ep.path("/tmp/test"); TEST(ep.path()=="/tmp/test"); TEST(ep.family()==io::pf_unix); #endif ep=io::endpoint("127.0.0.1",8080); io::acceptor a; a.open(io::pf_inet); #ifndef BOOSTER_WIN32 a.set_option(io::basic_socket::reuse_address,true); #endif a.bind(ep); a.listen(1); io::stream_socket s1; s1.open(io::pf_inet); s1.connect(ep); io::stream_socket s2; a.accept(s2); io::endpoint rep = s2.remote_endpoint(); TEST(rep.family()==io::pf_inet); TEST(rep.ip()=="127.0.0.1"); } catch(std::exception const &e) { std::cerr<<"Failed:"<< e.what() << std::endl; return 1; } std::cout << "Ok" << std::endl; return 0; }
bool EditorData::check_and_update_scene(int p_idx) { ERR_FAIL_INDEX_V(p_idx,edited_scene.size(),false); if (!edited_scene[p_idx].root) return false; Set<String> checked_scenes; bool must_reload = _find_updated_instances(edited_scene[p_idx].root,edited_scene[p_idx].root,checked_scenes); if (must_reload) { Ref<PackedScene> pscene; pscene.instance(); EditorProgress ep("update_scene","Updating Scene",2); ep.step("Storing local changes..",0); //pack first, so it stores diffs to previous version of saved scene Error err = pscene->pack(edited_scene[p_idx].root); ERR_FAIL_COND_V(err!=OK,false); ep.step("Updating scene..",1); Node *new_scene = pscene->instance(true); ERR_FAIL_COND_V(!new_scene,false); //transfer selection List<Node*> new_selection; for (List<Node*>::Element *E=edited_scene[p_idx].selection.front();E;E=E->next()) { NodePath p = edited_scene[p_idx].root->get_path_to(E->get()); Node *new_node = new_scene->get_node(p); if (new_node) new_selection.push_back(new_node); } new_scene->set_filename( edited_scene[p_idx].root->get_filename() ); memdelete(edited_scene[p_idx].root); edited_scene[p_idx].root=new_scene; edited_scene[p_idx].selection=new_selection; return true; } return false; }
void Client::Connect(const std::string& ip_addr, int port) { boost::asio::ip::tcp::endpoint ep(boost::asio::ip::address_v4::from_string(ip_addr), port); socket_.async_connect(ep, boost::bind(&Client::OnConnect, this, _1)); for (;;) { try{ io_service_.run(); break; } catch (const std::exception& ex) { std::cout << "io_service_ exception: " << ex.what() << std::endl; } } }
void RemoteProxyHost::start() { if (this->m_thread.is_running()) { DOUT(this->dinfo() << "RemoteProxyHost already running on port: " << this->m_local_port); return; } // We do the following because we want it done in the main thread, so exceptions during start are propagated through. // In particular we want to ensure that we dont have 2 servers with the same port number. this->dolog(this->dinfo() + std::string("opening connection on port: ") + mylib::to_string(this->m_local_port)); boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), this->m_local_port); this->m_acceptor.open(ep.protocol()); this->m_acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(false)); this->m_acceptor.bind(ep); DOUT(this->dinfo() << "Bind ok for " << ep); this->m_thread.start( [this]{ this->threadproc(); } ); }
bool CNetConnector::ReConnect() { boost::asio::ip::tcp::socket *pNewSocket = new boost::asio::ip::tcp::socket(m_ioService); if (nullptr == pNewSocket) { return false; } m_pAsioSocket = pNewSocket; boost::asio::ip::tcp::endpoint ep(boost::asio::ip::address::from_string(m_strRemoteIP.c_str()), m_wRemotePort); m_pAsioSocket->async_connect(ep, bind(&CNetConnector::OnConnect, this, boost::asio::placeholders::error)); return true; }
/** * \brief Construct a Link SAP IO Service * * \param cfg configuration with the parameters for MIH Link SAP port, * MIHF ip:port and receive buffer size. * \param io generic IO service * \param h handler callback as a function pointer/object * * The handler callback is invoked when a mensage is received such as a request * mensage. * * The signature of the callback is: * \code void(odtone::mih::message&, const boost::system::error_code&) \endcode * * \throws boost::system::error_code */ link::link(const mih::config& cfg, boost::asio::io_service& io, const default_handler& h) : _handler(h), _sock(io, ip::udp::endpoint(ip::udp::v4(), cfg.get<ushort>(kConf_Port))) { ip::udp::endpoint ep(ip::address::from_string(cfg.get<std::string>(kConf_MIHF_Ip)), cfg.get<ushort>(kConf_MIHF_Local_Port)); buffer<uint8> buff(cfg.get<uint>(kConf_Receive_Buffer_Len)); void* rbuff = buff.get(); size_t rlen = buff.size(); _sock.connect(ep); _sock.async_receive(boost::asio::buffer(rbuff, rlen), boost::bind(&link::recv_handler, this, bindrv(buff), boost::asio::placeholders::bytes_transferred, boost::asio::placeholders::error)); }
void run(gce::actor<gce::stackful>& self) { try { gce::yield_t yield = self.get_yield(); gce::io_service_t& ios = ctx_.get_io_service(); boost::asio::ip::address addr; addr.from_string(host_); boost::asio::ip::tcp::endpoint ep(addr, port_); acpr_.open(ep.protocol()); acpr_.set_option(boost::asio::socket_base::reuse_address(true)); acpr_.bind(ep); acpr_.set_option(boost::asio::socket_base::receive_buffer_size(640000)); acpr_.set_option(boost::asio::socket_base::send_buffer_size(640000)); acpr_.listen(1024); acpr_.set_option(boost::asio::ip::tcp::no_delay(true)); acpr_.set_option(boost::asio::socket_base::keep_alive(true)); acpr_.set_option(boost::asio::socket_base::enable_connection_aborted(true)); while (true) { gce::errcode_t ec; boost::shared_ptr<socket_t> sock(new socket_t(ios)); acpr_.async_accept(*sock, yield[ec]); if (!ec) { std::cout << "new connection!\n"; gce::spawn(self, boost::bind(&server::session, this, _1, sock)); } else { break; } } } catch (std::exception& ex) { std::cerr << ex.what() << std::endl; } }
TEST(EntropyPool, Simple) { // For hardwired SHA256 values. ASSERT_EQ(Config::kEntropySourceFactor, 2); // Hack to forcibly zero initialise underlying memory. This is only // necessary for testing. char epData[sizeof(EntropyPool)]; std::fill(epData, epData + sizeof(epData), 0); EntropyPool* epPtr(new (epData) EntropyPool()); EntropyPool& ep(*epPtr); for (std::size_t i(0); i < 32 * Config::kEntropySourceFactor; i+=4) { ep.insert('A'); ep.insert('B'); ep.insert('C'); ep.insert('D'); } ASSERT_EQ(ep.count(), 32 * Config::kEntropySourceFactor); ASSERT_EQ(ep.entryCount(), 1); Crypto::SHA256 output; ASSERT_TRUE(ep.read(output)); ASSERT_EQ(ep.count(), 0); ASSERT_EQ(ep.entryCount(), 0); DataRef outputRef(output); // printf 'ABCD%.0s' {1..16} | sha256sum const uint8_t expected[] = { 0x6b, 0xf3, 0xf1, 0xe7, 0x14, 0xbb, 0x3a, 0xd1, 0x49, 0x5e, 0xd7, 0x43, 0xcc, 0x67, 0x96, 0xdb, 0x84, 0x50, 0xff, 0x25, 0x5d, 0x47, 0x9d, 0x6a, 0xfb, 0x21, 0x80, 0xd9, 0xc3, 0xc3, 0xd4, 0xbc }; DataRef expectedRef(expected, expected + sizeof(expected)); ASSERT_EQ(outputRef, expectedRef); }
bool MCSystemPickTime(MCDateTime *p_current, MCDateTime *p_min, MCDateTime *p_max, int32_t p_step, bool p_use_cancel, bool p_use_done, MCDateTime *r_result, bool &r_canceled, MCRectangle p_button_rect) { if (s_in_popup_dialog) return false; int32_t t_hour, t_minute; MCExecPoint ep(nil, nil, nil); MCDateTime t_current; if (p_current != nil) t_current = *p_current; else { ep.setnvalue(MCS_time()); MCD_convert_to_datetime(ep, CF_SECONDS, CF_UNDEFINED, t_current); } // IM-2012-05-09 - make sure we show the correct local hour + minute values MCS_datetimetolocal(t_current); t_hour = t_current.hour; t_minute = t_current.minute; s_in_popup_dialog = true; s_dialog_result = kMCDialogResultUnknown; // IM-2012-10-31 [[ BZ 10483 ]] - make sure we have the timezone bias for the date s_selected_date = t_current; MCAndroidEngineRemoteCall("showTimePicker", "vii", nil, t_hour, t_minute); while (s_in_popup_dialog) MCscreen->wait(60.0, True, True); if (s_dialog_result == kMCDialogResultError) return false; r_canceled = s_dialog_result == kMCDialogResultCanceled; if (!r_canceled) { // IM-2012-10-31 [[ BZ 10483 ]] - convert the return value back to UTC MCS_datetimetouniversal(s_selected_date); *r_result = s_selected_date; } return true; }
void Graph::insert(int x, int y) { static bool firstCall = true; EdgeNodePtr ep(new EdgeNode()); ep->next = this->eNs[x]; ep->y = y; this->eNs[x] = ep; if (!directed && firstCall) { firstCall = false; insert(y, x); } else { ec++; } return; }
Exec_stat MCHandleRemoveContact(void *context, MCParameter *p_parameters) { MCExecPoint ep(nil, nil, nil); ep . clear(); int32_t t_contact_id = 0; // Handle parameters. if (p_parameters) { p_parameters->eval(ep); t_contact_id = atoi (ep.getsvalue().getstring()); } MCExecContext t_ctxt(ep); t_ctxt.SetTheResultToEmpty(); // Call the Exec implementation MCRemoveContactExec(t_ctxt, t_contact_id); // Set return value return t_ctxt.GetStat(); }
Image_TilesetFroms::Image_TilesetFroms(TilesetFromImages_List& content, unsigned int layoutWidth) : layoutWidth(layoutWidth), caps(0) { for (TilesetFromImages_List::iterator i = content.begin(); i != content.end(); i++ ) { ImageEntry *fat = new ImageEntry; EntryPtr ep(fat); fat->valid = true; fat->attr = i->isImage ? Tileset::Default : Tileset::SubTileset; if (!i->name.empty()) this->caps |= Tileset::HasNames; fat->name = i->name; fat->item = *i; this->items.push_back(ep); } }
void replication_options::read_meta_servers(configuration_ptr config) { // read meta_servers from machine list file meta_servers.clear(); std::vector<std::string> servers; config->get_all_keys("replication.meta_servers", servers); for (auto& s : servers) { // name:port auto pos1 = s.find_first_of(':'); if (pos1 != std::string::npos) { end_point ep(s.substr(0, pos1).c_str(), atoi(s.substr(pos1 + 1).c_str())); meta_servers.push_back(ep); } } }
int main(int argc, char** argv) { boost::asio::io_service ios; opmip::net::link::ethernet::socket sk(ios); opmip::net::link::ethernet::endpoint ep(opmip::net::link::ethernet::ipv6, 2, opmip::net::link::ethernet::endpoint::outgoing, opmip::ll::mac_address::from_string("00:11:22:33:44:55")); opmip::net::ip::icmp6_ra_packet ra; opmip::net::ip::ipv6_packet pk(opmip::ip::address_v6::from_string("fe80::1"), opmip::ip::address_v6::from_string("ff02::1"), 128, ra); sk.open(opmip::net::link::ethernet(0x0003)); sk.send_to(pk.cbuffer(), ep); }
int main(int argc, char **argv) { srand(time(nullptr)); try { boost::asio::io_service io; tcp::endpoint ep(tcp::v4(), 9998); Server s(io, ep); io.run(); } catch (std::exception &e) { std::cerr << "Exception caught: " << e.what() << '\n'; } return 0; }
void replica_helper::load_meta_servers(/*out*/ std::vector<dsn::rpc_address>& servers, const char* section, const char* key) { servers.clear(); std::string server_list = dsn_config_get_value_string(section, key, "", ""); std::vector<std::string> lv; ::dsn::utils::split_args(server_list.c_str(), lv, ','); for (auto& s : lv) { // name:port auto pos1 = s.find_first_of(':'); if (pos1 != std::string::npos) { ::dsn::rpc_address ep(s.substr(0, pos1).c_str(), atoi(s.substr(pos1 + 1).c_str())); servers.push_back(ep); } } dassert(servers.size() > 0, "no meta server specified in config [%s].%s", section, key); }
uri_resolver::uri_resolver(const char * name, const char* factory, const char * arguments) : _name(name), _factory(factory) { _meta_server.assign_group(dsn_group_build(name)); std::vector<std::string> args; utils::split_args(arguments, args, ','); for (auto& arg : args) { // name:port auto pos1 = arg.find_first_of(':'); if (pos1 != std::string::npos) { ::dsn::rpc_address ep(arg.substr(0, pos1).c_str(), atoi(arg.substr(pos1 + 1).c_str())); dsn_group_add(_meta_server.group_handle(), ep.c_addr()); } } }
void client(boost::asio::io_service &ios) try { std::cout << "client start." << std::endl; TCP::socket sock(ios); TCP::endpoint ep(boost::asio::ip::address::from_string("127.0.0.1"), 6688); sock.connect(ep); std::vector<char> str(100, 0); sock.read_some(boost::asio::buffer(str)); std::cout << "recive from " << sock.remote_endpoint().address(); std::cout << &str[0] << std::endl; } catch (std::exception& e) { std::cout << e.what() << std::endl; }
Exec_stat MCHandleFindContact(void *context, MCParameter *p_parameters) { const char *t_contact_name = NULL; const char *r_result = NULL; MCExecPoint ep(nil, nil, nil); ep . clear(); // Handle parameters. if (p_parameters) { p_parameters->eval(ep); t_contact_name = ep.getcstring(); } MCExecContext t_ctxt(ep); t_ctxt.SetTheResultToEmpty(); // Call the Exec implementation MCFindContactExec(t_ctxt, t_contact_name); // Set return value return t_ctxt.GetStat(); }
Exec_stat MCHandleGetContactData(void *context, MCParameter *p_parameters) { MCExecPoint ep(nil, nil, nil); ep . clear(); int32_t t_contact_id = 0; // Handle parameters. if (p_parameters) { p_parameters->eval(ep); t_contact_id = atoi (ep.getsvalue().getstring()); } MCExecContext t_ctxt(ep); t_ctxt.SetTheResultToEmpty(); // Call the Exec implementation MCGetContactDataExec(t_ctxt, t_contact_id); if (MCresult->isempty()) MCresult->store(ep, True); return t_ctxt.GetStat(); }