コード例 #1
0
ファイル: interface.cpp プロジェクト: Jon0/pm
void set_conf_path(const char *confpath) {
	conf_path = confpath;
	hostname = os::exec("hostname");

	// workaround until init works
	module::module_config mconf(confpath);
	module_info = "";
	for (auto &m : mconf.module_map()) {
		module_info += "<a href=\"" + m.first + "/\">" + m.first + "</a><br>";
	}
}
コード例 #2
0
ファイル: coordinator.cpp プロジェクト: khadiwala/MP3
/* parses membership.conf into map from nodeid to port num
   containing nodeid and port number*/
map<int,int> parseMembers()
{
	int num;
	map<int,int> members;
	ifstream mconf("membership.conf");
	if(!mconf)	
		perror("failed to open membership.conf");
	int nodeid,port;
	while (mconf >> nodeid) {
		mconf >> port;
		members[nodeid] = port;
	}	
	return members;
}