• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IS_SERVER函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IS_SERVER函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_SERVER函数的具体用法?C++ IS_SERVER怎么用?C++ IS_SERVER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IS_SERVER函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: server_unref

int server_unref(SERVER_REC *server)
{
    g_return_val_if_fail(IS_SERVER(server), FALSE);

    if (--server->refcount > 0)
        return TRUE;

    if (g_slist_find(servers, server) != NULL) {
        g_warning("Non-referenced server wasn't disconnected");
        server_disconnect(server);
        return TRUE;
    }

    MODULE_DATA_DEINIT(server);
    server_connect_unref(server->connrec);
    if (server->rawlog != NULL) rawlog_destroy(server->rawlog);
    g_free(server->version);
    g_free(server->away_reason);
    g_free(server->nick);
    g_free(server->tag);

    server->type = 0;
    g_free(server);
    return FALSE;
}
开发者ID:vague666,项目名称:irssi,代码行数:25,代码来源:servers.c


示例2: server_connect_callback_init_ssl

static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *handle)
{
    int error;

    g_return_if_fail(IS_SERVER(server));

    error = irssi_ssl_handshake(handle);
    if (error == -1) {
        server->connection_lost = TRUE;
        server_connect_failed(server, NULL);
        return;
    }
    if (error & 1) {
        if (server->connect_tag != -1)
            g_source_remove(server->connect_tag);
        server->connect_tag = g_input_add(handle, error == 1 ? G_INPUT_READ : G_INPUT_WRITE,
                                          (GInputFunction)
                                          server_connect_callback_init_ssl,
                                          server);
        return;
    }

    lookup_servers = g_slist_remove(lookup_servers, server);
    if (server->connect_tag != -1) {
        g_source_remove(server->connect_tag);
        server->connect_tag = -1;
    }

    server_connect_finished(server);
}
开发者ID:vague666,项目名称:irssi,代码行数:30,代码来源:servers.c


示例3: server_connect_failed

/* connection to server failed */
void server_connect_failed(SERVER_REC *server, const char *msg)
{
    g_return_if_fail(IS_SERVER(server));

    lookup_servers = g_slist_remove(lookup_servers, server);

    signal_emit("server connect failed", 2, server, msg);

    if (server->connect_tag != -1) {
        g_source_remove(server->connect_tag);
        server->connect_tag = -1;
    }
    if (server->handle != NULL) {
        net_sendbuffer_destroy(server->handle, TRUE);
        server->handle = NULL;
    }

    if (server->connect_pipe[0] != NULL) {
        g_io_channel_shutdown(server->connect_pipe[0], TRUE, NULL);
        g_io_channel_unref(server->connect_pipe[0]);
        g_io_channel_shutdown(server->connect_pipe[1], TRUE, NULL);
        g_io_channel_unref(server->connect_pipe[1]);
        server->connect_pipe[0] = NULL;
        server->connect_pipe[1] = NULL;
    }

    server_unref(server);
}
开发者ID:vague666,项目名称:irssi,代码行数:29,代码来源:servers.c


示例4: cmd_wait

/* SYNTAX: WAIT [-<server tag>] <milliseconds> */
static void cmd_wait(const char *data, IRC_SERVER_REC *server)
{
	GHashTable *optlist;
	char *msecs;
	void *free_arg;
	int n;

	g_return_if_fail(data != NULL);
	if (!IS_SERVER(server) || !server->connected)
		cmd_return_error(CMDERR_NOT_CONNECTED);

	if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
			    PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_GETREST,
			    NULL, &optlist, &msecs))
		return;

	if (*msecs == '\0')
		cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);

	/* -<server tag> */
	server = IRC_SERVER(cmd_options_get_server(NULL, optlist,
						   SERVER(server)));

	n = atoi(msecs);
	if (server != NULL && n > 0) {
		g_get_current_time(&server->wait_cmd);
		server->wait_cmd.tv_sec += n/1000;
		server->wait_cmd.tv_usec += n%1000;
		if (server->wait_cmd.tv_usec >= 1000) {
			server->wait_cmd.tv_sec++;
			server->wait_cmd.tv_usec -= 1000;
		}
	}
	cmd_params_free(free_arg);
}
开发者ID:svn2github,项目名称:irssi,代码行数:36,代码来源:irc-commands.c


示例5: cmd_cycle

/* SYNTAX: CYCLE [<channel>] [<message>] */
static void cmd_cycle(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
	CHANNEL_REC *chanrec;
	char *channame, *msg, *joindata;
	void *free_arg;

	g_return_if_fail(data != NULL);
	if (!IS_SERVER(server) || !server->connected)
		cmd_return_error(CMDERR_NOT_CONNECTED);

	if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTCHAN,
			    item, &channame, &msg))
		return;
	if (*channame == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);

	chanrec = channel_find(server, channame);
	if (chanrec == NULL) cmd_param_error(CMDERR_CHAN_NOT_FOUND);

	joindata = chanrec->get_join_data(chanrec);
	window_bind_add(window_item_window(chanrec),
			chanrec->server->tag, chanrec->name);

	/* FIXME: kludgy kludgy... */
	signal_emit("command part", 3, data, server, item);

	if (g_slist_find(channels, chanrec) != NULL) {
		chanrec->left = TRUE;
		channel_destroy(chanrec);
	}

	server->channels_join(server, joindata, FALSE);
	g_free(joindata);

	cmd_params_free(free_arg);
}
开发者ID:Mistuke,项目名称:irssi,代码行数:36,代码来源:fe-channels.c


示例6: Handle

	CmdResult Handle (const std::vector<std::string>& parameters, User *user)
	{
		User* dest = ServerInstance->FindNick(parameters[0]);
		if ((dest) && (!IS_SERVER(dest)))
		{
			if (ServerInstance->ULine(dest->server))
			{
				user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str());
				return CMD_FAILURE;
			}

			// Pass the command on, so the client's server can quit it properly.
			if (!IS_LOCAL(dest))
				return CMD_SUCCESS;

			ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAQUIT to make "+dest->nick+" quit with a reason of "+parameters[1]);

			ServerInstance->Users->QuitUser(dest, parameters[1]);
			return CMD_SUCCESS;
		}
		else
		{
			user->WriteNotice("*** Invalid nickname '" + parameters[0] + "'");
			return CMD_FAILURE;
		}
	}
开发者ID:Paciik,项目名称:inspircd,代码行数:26,代码来源:m_saquit.cpp


示例7: unserialize

	void unserialize(SerializeFormat format, Extensible* container, const std::string& value)
	{
		if (format == FORMAT_NETWORK)
			return;

		callerid_data* dat = new callerid_data;
		irc::commasepstream s(value);
		std::string tok;
		if (s.GetToken(tok))
			dat->lastnotify = ConvToInt(tok);

		while (s.GetToken(tok))
		{
			User *u = ServerInstance->FindNick(tok);
			if ((u) && (u->registered == REG_ALL) && (!u->quitting) && (!IS_SERVER(u)))
			{
				if (dat->accepting.insert(u).second)
				{
					callerid_data* other = this->get(u, true);
					other->wholistsme.push_back(dat);
				}
			}
		}

		void* old = set_raw(container, dat);
		if (old)
			this->free(old);
	}
开发者ID:Paciik,项目名称:inspircd,代码行数:28,代码来源:m_callerid.cpp


示例8: Away

bool TreeSocket::Away(const std::string &prefix, parameterlist &params)
{
	User* u = ServerInstance->FindNick(prefix);
	if ((!u) || (IS_SERVER(u)))
		return true;
	if (params.size())
	{
		FOREACH_MOD(I_OnSetAway, OnSetAway(u, params[params.size() - 1]));

		if (params.size() > 1)
			u->awaytime = atoi(params[0].c_str());
		else
			u->awaytime = ServerInstance->Time();

		u->awaymsg = params[params.size() - 1];

		params[params.size() - 1] = ":" + params[params.size() - 1];
	}
	else
	{
		FOREACH_MOD(I_OnSetAway, OnSetAway(u, ""));
		u->awaymsg.clear();
	}
	Utils->DoOneToAllButSender(prefix,"AWAY",params,u->server);
	return true;
}
开发者ID:Shawn-Smith,项目名称:InspIRCd,代码行数:26,代码来源:away.cpp


示例9: sig_not_in_roster

static void
sig_not_in_roster(XMPP_SERVER_REC *server, const char *jid)
{
	g_return_if_fail(IS_SERVER(server));
	g_return_if_fail(jid != NULL);
	printformat_module(MODULE_NAME, server, NULL,
	    MSGLEVEL_CLIENTERROR, XMPPTXT_NOT_IN_ROSTER, jid);
}
开发者ID:ailin-nemui,项目名称:irssi-xmpp,代码行数:8,代码来源:fe-rosters.c


示例10: sig_connected

static void sig_connected(SERVER_REC *server)
{
	g_return_if_fail(IS_SERVER(server));
	if (!server->connrec->reconnection)
		return;

	if (server->connrec->channels != NULL)
		server->channels_join(server, server->connrec->channels, TRUE);
}
开发者ID:svn2github,项目名称:irssi,代码行数:9,代码来源:servers-reconnect.c


示例11: show_group

static void
show_group(XMPP_SERVER_REC *server, XMPP_ROSTER_GROUP_REC *group)
{
	g_return_if_fail(IS_SERVER(server));
	g_return_if_fail(group != NULL);
	printformat_module(MODULE_NAME, server, NULL, MSGLEVEL_CRAP,
	    XMPPTXT_ROSTER_GROUP, (group->name != NULL) ?
	    group->name : settings_get_str("xmpp_roster_default_group"));
}
开发者ID:ailin-nemui,项目名称:irssi-xmpp,代码行数:9,代码来源:fe-rosters.c


示例12: server_get_variant

GVariant *
server_get_variant (Server * server)
{
	/* Okay, this doesn't do anything useful, but it will generate an error
	   which could be a good thing */
	g_return_val_if_fail(IS_SERVER(server), NULL);

	ServerClass * klass = SERVER_GET_CLASS(server);
	if (klass->get_properties != NULL) {
		GVariantBuilder tuple;
		g_variant_builder_init(&tuple, G_VARIANT_TYPE_TUPLE);

		if (IS_CITRIX_SERVER(server)) {
			g_variant_builder_add_value(&tuple, g_variant_new_string("ica"));
		} else if (IS_RDP_SERVER(server)) {
			g_variant_builder_add_value(&tuple, g_variant_new_string("freerdp"));
		} else if (IS_UCCS_SERVER(server)) {
			g_variant_builder_add_value(&tuple, g_variant_new_string("uccs"));
		} else if (IS_X2GO_SERVER(server)) {
			g_variant_builder_add_value(&tuple, g_variant_new_string("x2go"));
		} else {
			g_assert_not_reached();
		}

		if (server->name != NULL) {
			g_variant_builder_add_value(&tuple, g_variant_new_string(server->name));
		} else {
			g_warning("Server has no name");
			g_variant_builder_add_value(&tuple, g_variant_new_string(""));
		}

		if (server->uri != NULL) {
			g_variant_builder_add_value(&tuple, g_variant_new_string(server->uri));
		} else {
			g_warning("Server has no URI");
			g_variant_builder_add_value(&tuple, g_variant_new_string(""));
		}

		g_variant_builder_add_value(&tuple, g_variant_new_boolean(server->last_used));

		GVariant * props = klass->get_properties(server);
		g_variant_builder_add_value(&tuple, props);

		if (klass->get_applications != NULL) {
			GVariant * array = klass->get_applications(server);
			g_variant_builder_add_value(&tuple, array);
		} else {
			/* NULL array of applications */
			g_variant_builder_add_value(&tuple, g_variant_new_array(G_VARIANT_TYPE("(si)"), NULL, 0));
		}

		return g_variant_builder_end(&tuple);
	}

	return NULL;
}
开发者ID:ArcticaProject,项目名称:remote-logon-service,代码行数:56,代码来源:server.c


示例13: OnModeChange

		ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
		{
			if (IS_SERVER(source) || ServerInstance->ULine(source->server))
				return MODEACTION_ALLOW;
			else
			{
				if (source && channel)
					source->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :Only servers are permitted to change channel mode '%c'", source->nick.c_str(), channel->name.c_str(), 'y');
				return MODEACTION_DENY;
			}
		}
开发者ID:H7-25,项目名称:inspircd,代码行数:11,代码来源:m_operprefix.cpp


示例14: server_cached_domains

/**
 * server_cached_domains:
 * @server: Where should we find those domains?
 *
 * Gets a list of cached domains for a particular server, if this function
 * isn't overriden, then a null array is returned.
 */
GVariant *
server_cached_domains (Server * server)
{
	g_return_val_if_fail(IS_SERVER(server), NULL);

	ServerClass * klass = SERVER_GET_CLASS(server);
	if (klass->get_domains != NULL) {
		return klass->get_domains(server);
	}

	return g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0);
}
开发者ID:ArcticaProject,项目名称:remote-logon-service,代码行数:19,代码来源:server.c


示例15: GetTargetAndAction

	ACCEPTAction GetTargetAndAction(std::string& tok)
	{
		bool remove = (tok[0] == '-');
		if ((remove) || (tok[0] == '+'))
			tok.erase(tok.begin());

		User* target = ServerInstance->FindNick(tok);
		if ((!target) || (target->registered != REG_ALL) || (target->quitting) || (IS_SERVER(target)))
			target = NULL;

		return std::make_pair(target, !remove);
	}
开发者ID:Paciik,项目名称:inspircd,代码行数:12,代码来源:m_callerid.cpp


示例16: QuitUser

void UserManager::QuitUser(User* user, const std::string& quitreason, const std::string* operreason)
{
	if (user->quitting)
	{
		ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "ERROR: Tried to quit quitting user: " + user->nick);
		return;
	}

	if (IS_SERVER(user))
	{
		ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "ERROR: Tried to quit server user: " + user->nick);
		return;
	}

	user->quitting = true;

	ServerInstance->Logs->Log("USERS", LOG_DEBUG, "QuitUser: %s=%s '%s'", user->uuid.c_str(), user->nick.c_str(), quitreason.c_str());
	user->Write("ERROR :Closing link: (%[email protected]%s) [%s]", user->ident.c_str(), user->host.c_str(), operreason ? operreason->c_str() : quitreason.c_str());

	std::string reason;
	reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit);
	if (!operreason)
		operreason = &reason;

	ServerInstance->GlobalCulls.AddItem(user);

	if (user->registered == REG_ALL)
	{
		FOREACH_MOD(OnUserQuit, (user, reason, *operreason));
		user->WriteCommonQuit(reason, *operreason);
	}
	else
		unregistered_count--;

	if (IS_LOCAL(user))
	{
		LocalUser* lu = IS_LOCAL(user);
		FOREACH_MOD(OnUserDisconnect, (lu));
		lu->eh.Close();

		if (lu->registered == REG_ALL)
			ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s (%s) [%s]", user->GetFullRealHost().c_str(), user->GetIPString().c_str(), operreason->c_str());
	}

	user_hash::iterator iter = this->clientlist->find(user->nick);

	if (iter != this->clientlist->end())
		this->clientlist->erase(iter);
	else
		ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "ERROR: Nick not found in clientlist, cannot remove: " + user->nick);

	uuidlist->erase(user->uuid);
}
开发者ID:War3Evo,项目名称:inspircd,代码行数:53,代码来源:usermanager.cpp


示例17: Handle

/**
 * SAVE command - force nick change to UID on timestamp match
 */
CmdResult CommandSave::Handle(User* user, std::vector<std::string>& params)
{
	User* u = ServerInstance->FindUUID(params[0]);
	if ((!u) || (IS_SERVER(u)))
		return CMD_FAILURE;

	time_t ts = atol(params[1].c_str());

	if (u->age == ts)
		u->ChangeNick(u->uuid, SavedTimestamp);

	return CMD_SUCCESS;
}
开发者ID:Canternet,项目名称:inspircd,代码行数:16,代码来源:save.cpp


示例18: sig_connected

static void sig_connected(SERVER_REC *server)
{
	CHATNET_REC *rec;

	g_return_if_fail(IS_SERVER(server));

	if (server->connrec->chatnet == NULL || server->session_reconnect)
		return;

	rec = chatnet_find(server->connrec->chatnet);
	if (!server->connrec->no_autosendcmd && rec != NULL && rec->autosendcmd)
		eval_special_string(rec->autosendcmd, "", server, NULL);
}
开发者ID:x3ro,项目名称:macirssi-irrsi,代码行数:13,代码来源:chatnets.c


示例19: g_return_val_if_fail

CHANNEL_REC *channel_find(SERVER_REC *server, const char *name)
{
	g_return_val_if_fail(server == NULL || IS_SERVER(server), NULL);
	g_return_val_if_fail(name != NULL, NULL);

	if (server != NULL)
		return channel_find_server(server, name);

	/* find from any server */
	return gslist_foreach_find(servers,
				   (FOREACH_FIND_FUNC) channel_find_server,
				   (void *) name);
}
开发者ID:Brijen,项目名称:MacIrssi,代码行数:13,代码来源:channels.c


示例20: g_return_val_if_fail

/* Create a new channel */
CHANNEL_REC *channel_create(int chat_type, SERVER_REC *server,
			    const char *name, int automatic)
{
	CHANNEL_REC *channel;

	g_return_val_if_fail(server == NULL || IS_SERVER(server), NULL);
	g_return_val_if_fail(name != NULL, NULL);

	channel = NULL;
	signal_emit("channel create", 5, &channel, GINT_TO_POINTER(chat_type),
		    server, name, GINT_TO_POINTER(automatic));
	return channel;
}
开发者ID:svn2github,项目名称:irssi,代码行数:14,代码来源:channels.c



注:本文中的IS_SERVER函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IS_SET函数代码示例发布时间:2022-05-30
下一篇:
C++ IS_RT3572函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap