示例#1
0
文件: perl.c 项目: MrOpposite/hexchat
static
XS (XS_HexChat_plugin_pref_list)
{
	char list[4096];
	char value[512];
	char *token;

	dSP;
	dMARK;
	dAX;

	if (!hexchat_pluginpref_list (ph, list))
		XSRETURN_EMPTY;

	PUSHMARK (SP);

	token = strtok (list, ",");
	while (token != NULL)
	{
		hexchat_pluginpref_get_str (ph, token, value);

		XPUSHs (sv_2mortal (newSVpv (token, 0)));
		XPUSHs (sv_2mortal (newSVpv (value, 0)));

		token = strtok (NULL, ",");
	}

	PUTBACK;
}
示例#2
0
文件: lua.c 项目: Cynede/hexchat
static int api_hexchat_pluginprefs_meta_pairs(lua_State *L)
{
	script_info *script = get_info(L);
	char *dest;
	hexchat_plugin *h;

	if(!script->name)
		return luaL_error(L, "cannot use hexchat.pluginprefs before registering with hexchat.register");

	dest = lua_newuserdata(L, 4096);
	h = script->handle;
	if(!hexchat_pluginpref_list(h, dest))
		strcpy(dest, "");
	lua_pushlightuserdata(L, dest);
	lua_pushlightuserdata(L, dest);
	lua_pushcclosure(L, api_hexchat_pluginprefs_meta_pairs_closure, 2);
	return 1;
}
示例#3
0
文件: xsys.c 项目: fuzzmz/hexchat
static void
list_settings ()
{
	char list[512];
	char buffer[512];
	char* token;

	hexchat_pluginpref_list (ph, list);
	hexchat_printf (ph, "%s\tCurrent Settings:", name);
	token = strtok (list, ",");

	while (token != NULL)
	{
		hexchat_pluginpref_get_str (ph, token, buffer);
		hexchat_printf (ph, "%s\t%s: %s\n", name, token, buffer);
		token = strtok (NULL, ",");
	}
}
示例#4
0
文件: sasl.c 项目: ArchUser/hexchat
static void
print_info ()
{
	char list[512];
	char* token;

	if (hexchat_pluginpref_list (ph, list))
	{
		hexchat_printf (ph, "%s\tSASL-enabled networks:", name);
		hexchat_printf (ph, "%s\t----------------------", name);
		token = strtok (list, ",");
		while (token != NULL)
		{
			hexchat_printf (ph, "%s\t%s", name, token);
			token = strtok (NULL, ",");
		}
	}
	else
	{
		hexchat_printf (ph, "%s\tThere are no SASL-enabled networks currently", name);
	}
}