Exemplo n.º 1
0
Arquivo: lua.c Projeto: Cynede/hexchat
static int api_hexchat_register(lua_State *L)
{
	char const *name, *version, *description;
	script_info *info = get_info(L);
	if(info->name)
		return luaL_error(L, "script is already registered as '%s'", info->name);

	name = luaL_checkstring(L, 1);
	version = luaL_checkstring(L, 2);
	description = luaL_checkstring(L, 3);

	info->name = g_strdup(name);
	info->description = g_strdup(description);
	info->version = g_strdup(version);
	info->handle = hexchat_plugingui_add(ph, info->filename, info->name, info->description, info->version, NULL);

	return 0;
}
Exemplo n.º 2
0
Arquivo: perl.c Projeto: Farow/hexchat
static
XS (XS_Xchat_register)
{
	char *name, *version, *desc, *filename;
	void *gui_entry;
	dXSARGS;
	if (items != 4) {
		hexchat_printf (ph,
						  "Usage: Xchat::Internal::register(scriptname, version, desc, filename)");
	} else {
		name = SvPV_nolen (ST (0));
		version = SvPV_nolen (ST (1));
		desc = SvPV_nolen (ST (2));
		filename = SvPV_nolen (ST (3));

		gui_entry = hexchat_plugingui_add (ph, filename, name,
													desc, version, NULL);

		XSRETURN_IV (PTR2IV (gui_entry));

	}
}