当前位置: 首页>>代码示例>>C++>>正文


C++ xchat_print函数代码示例

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


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

示例1: xchat_plugin_init

int
xchat_plugin_init (xchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
{
	xchat_plugin_get_info (plugin_name, plugin_desc, plugin_version, NULL);

	ph = plugin_handle;

	if (notify_init ("XChat-GNOME OSD")) {
		/* FIXME: multi-head! */
		GtkIconTheme *theme = gtk_icon_theme_get_default ();
		notify_icon = gtk_icon_theme_load_icon (theme, "xchat-gnome", 48, 0, NULL);

		xchat_hook_print (ph, "Channel Msg Hilight",       XCHAT_PRI_NORM, new_msg_cb,     NULL);
		xchat_hook_print (ph, "Channel Action Hilight",    XCHAT_PRI_NORM, new_action_cb,  NULL);
		xchat_hook_print (ph, "Private Message",           XCHAT_PRI_NORM, private_msg_cb, NULL);
		xchat_hook_print (ph, "Private Message to Dialog", XCHAT_PRI_NORM, private_msg_cb, NULL);

		xchat_print (ph, _("OSD loaded\n"));

		return TRUE;
	} else {
		xchat_print (ph, _("OSD initialization failed\n"));
	}
	return FALSE;
}
开发者ID:GNOME,项目名称:xchat-gnome,代码行数:25,代码来源:notify-osd.c

示例2: xchat_plugin_init

int
xchat_plugin_init (xchat_plugin * plugin_handle, char **plugin_name,
						 char **plugin_desc, char **plugin_version, char *arg)
{
	if (initialized != 0) {
		xchat_print (plugin_handle, "Perl interface already loaded\n");
		return 0;
	}

	ph = plugin_handle;
	initialized = 1;

	*plugin_name = "Perl";
	*plugin_desc = "Perl scripting interface";
	*plugin_version = PACKAGE_VERSION;

	xchat_hook_command (ph, "load", XCHAT_PRI_NORM, perl_command_load, 0, 0);
	xchat_hook_command (ph, "unload", XCHAT_PRI_NORM, perl_command_unload, 0,
							  0);
	xchat_hook_command (ph, "reload", XCHAT_PRI_NORM, perl_command_reload, 0,
							  0);
	xchat_hook_command (ph, "pl_reload", XCHAT_PRI_NORM, perl_command_reload, 0,
							  0);
	xchat_hook_command (ph, "unloadall", XCHAT_PRI_NORM,
							  perl_command_unloadall, 0, 0);
	xchat_hook_command (ph, "reloadall", XCHAT_PRI_NORM,
							  perl_command_reloadall, 0, 0);

	/*perl_init (); */
	xchat_hook_timer (ph, 0, perl_auto_load, NULL );

	xchat_print (ph, "Perl interface loaded\n");

	return 1;
}
开发者ID:KhitryyGruzinGivi,项目名称:xchat,代码行数:35,代码来源:perl.c

示例3: XS

/* Xchat::Internal::hook_fd(fd, callback, flags, userdata) */
static
XS (XS_Xchat_hook_fd)
{
	int fd;
	SV *callback;
	int flags;
	SV *userdata;
	SV *package;
	xchat_hook *hook;
	HookData *data;

	dXSARGS;

	if (items != 4) {
		xchat_print (ph,
						 "Usage: Xchat::Internal::hook_fd(fd, callback, flags, userdata)");
	} else {
		fd = (int) SvIV (ST (0));
		callback = ST (1);
		flags = (int) SvIV (ST (2));
		userdata = ST (3);
		package = ST (4);
		data = NULL;

#ifdef WIN32
		if ((flags & XCHAT_FD_NOTSOCKET) == 0) {
			/* this _get_osfhandle if from win32iop.h in the perl distribution,
			 *  not the one provided by Windows
			 */ 
			fd = _get_osfhandle(fd);
			if (fd < 0) {
				xchat_print(ph, "Invalid file descriptor");
				XSRETURN_UNDEF;
			}
		}
#endif

		data = malloc (sizeof (HookData));
		if (data == NULL) {
			XSRETURN_UNDEF;
		}

		data->callback = newSVsv (callback);
		data->userdata = newSVsv (userdata);
		data->depth = 0;
		data->package = newSVsv (package);
		hook = xchat_hook_fd (ph, fd, flags, fd_cb, data);
		data->hook = hook;

		XSRETURN_IV (PTR2IV (hook));
	}
}
开发者ID:JordanKinsley,项目名称:hexchat,代码行数:53,代码来源:perl.c

示例4: XS

/* Xchat::print(output) */
static
XS (XS_Xchat_print)
{

	char *text = NULL;

	dXSARGS;
	if (items != 1) {
		xchat_print (ph, "Usage: Xchat::Internal::print(text)");
	} else {
		text = SvPV_nolen (ST (0));
		xchat_print (ph, text);
	}
	XSRETURN_EMPTY;
}
开发者ID:KhitryyGruzinGivi,项目名称:xchat,代码行数:16,代码来源:perl.c

示例5: lxc_print

/* 
 * lua:  xchat.print(text)
 * desc: Prints some text to the current tab/window.
 * ret:  none
 * args: 
 *       * text (string): the text to print
 */
static int lxc_print(lua_State *L)
{
	const char *txt = luaL_checkstring(L, 1);
	// FIXME? const char *txt = lua_tostring(L, 1);
	xchat_print(ph, txt);
	return 0;
}
开发者ID:JordanKinsley,项目名称:hexchat,代码行数:14,代码来源:lua.c

示例6: xchat_plugin_deinit

int
xchat_plugin_deinit(void)
{
	xchat_command (ph, "MENU DEL \"Window/Display Current Song (Winamp)\"");
	xchat_print (ph, "Winamp plugin unloaded\n");
	return 1;
}
开发者ID:JordanKinsley,项目名称:hexchat,代码行数:7,代码来源:winamp.c

示例7: XS

static
XS (XS_Xchat_get_info)
{
	SV *temp = NULL;
	dXSARGS;
	if (items != 1) {
		xchat_print (ph, "Usage: Xchat::get_info(id)");
	} else {
		SV *id = ST (0);
		const char *RETVAL;

		RETVAL = xchat_get_info (ph, SvPV_nolen (id));
		if (RETVAL == NULL) {
			XSRETURN_UNDEF;
		}

		if (!strncmp ("win_ptr", SvPV_nolen (id), 7)) {
			XSRETURN_IV (PTR2IV (RETVAL));
		} else {
			
			if (
				!strncmp ("libdirfs", SvPV_nolen (id), 8) ||
				!strncmp ("xchatdirfs", SvPV_nolen (id), 10)
			) {
				XSRETURN_PV (RETVAL);
			} else {
				temp = newSVpv (RETVAL, 0);
				SvUTF8_on (temp);
				PUSHMARK (SP);
				XPUSHs (sv_2mortal (temp));
				PUTBACK;
			}
		}
	}
}
开发者ID:hananh,项目名称:xchat-aqua,代码行数:35,代码来源:perl.c

示例8: xchat_plugin_deinit

int
xchat_plugin_deinit (void)
{
    xdcc_save ();
    xchat_print (ph, "XDCC List saved\n");
    return 1;
}
开发者ID:arinity,项目名称:gchat,代码行数:7,代码来源:xdcc.c

示例9: loadThemes

void loadThemes(){
    char *hDir, *hFile, *line, *val;
	FILE *f;
	xchat_print(ph,"loading themes\n");
    hDir=(char*)calloc(1024,sizeof(char));
    strcpy(hDir,xchat_get_info(ph,"xchatdirfs"));
    hFile=str3cat(hDir,"\\","mpcInfo.theme.txt");
    f = fopen(hFile,"r");
    if(f==NULL)
	{
		xchat_print(ph,"no theme in homedir, checking global theme");
		f=fopen("mpcInfo.theme.txt","r");
    }
	//xchat_printf(ph,"file_desc: %p\n",f);
	if (f==NULL) xchat_print(ph, "no theme found, using hardcoded\n");
	else {
		if (f > 0)
		{
			line=" ";
		} else
		{
			line="\0";
		}

		while (line[0]!=0)
		{
			line=readLine(f);
			val=split(line,'=');
			printf("line: %s\n",line);
			printf("val: %s\n",val);
			if (strcmp(toUpper(line),"OFF_LINE")==0) notRunTheme=themeAdd(notRunTheme,val);
			if (strcmp(toUpper(line),"TITLE_LINE")==0) titleTheme=themeAdd(titleTheme,val);
			if (strcmp(toUpper(line),"MP3_LINE")==0) mp3Theme=themeAdd(mp3Theme,val);
			if (strcmp(toUpper(line),"OGG_LINE")==0) mp3Theme=themeAdd(oggTheme,val);
		}
		fclose(f);
		xchat_print(ph, "theme loaded successfull\n");
	}
	if (notRunTheme.size==0) notRunTheme=themeAdd(notRunTheme,"say Media Player Classic not running");
	if (titleTheme.size==0) titleTheme=themeAdd(titleTheme,"say Playing %title in Media Player Classic");
	if (mp3Theme.size==0) mp3Theme=themeAdd(mp3Theme,"me listens to %art with %tit from %alb [%gen|%br kbps|%frq kHz|%mode] in Media Player Classic ");
	if (oggTheme.size==0) oggTheme=themeAdd(oggTheme,"me listens to %art with %tit from %alb [%gen|%br kbps|%frq kHz|%chan channels] in Media Player Classic ");
	//mp3Theme=themeAdd(mp3Theme,"me listens to %art with %tit from %alb [%time|%length|%perc%|%br kbps|%frq kHz|%mode] in Media Player Classic ");
}
开发者ID:JordanKinsley,项目名称:hexchat,代码行数:44,代码来源:theme.c

示例10: fd_cb

static int
fd_cb (int fd, int flags, void *userdata)
{
	HookData *data = (HookData *) userdata;
	int retVal = 0;
	int count = 0;

	dSP;
	ENTER;
	SAVETMPS;

	PUSHMARK (SP);
	XPUSHs (data->userdata);
	PUTBACK;

	set_current_package (data->package);
	count = call_sv (data->callback, G_EVAL);
	set_current_package (&PL_sv_undef);
	SPAGAIN;

	if (SvTRUE (ERRSV)) {
		xchat_printf (ph, "Error in fd callback %s", SvPV_nolen (ERRSV));
		if (!SvOK (POPs)) {}		  /* remove undef from the top of the stack */
		retVal = XCHAT_EAT_ALL;
	} else {
		if (count != 1) {
			xchat_print (ph, "Fd handler should only return 1 value.");
			retVal = XCHAT_EAT_NONE;
		} else {
			retVal = POPi;
			if (retVal == 0) {
				/* if 0 is returned, the fd is going to get unhooked */
				PUSHMARK (SP);
				XPUSHs (sv_2mortal (newSViv (PTR2IV (data->hook))));
				PUTBACK;

				call_pv ("Xchat::unhook", G_EVAL);
				SPAGAIN;

				SvREFCNT_dec (data->callback);

				if (data->userdata) {
					SvREFCNT_dec (data->userdata);
				}
				free (data);
			}
		}

	}

	PUTBACK;
	FREETMPS;
	LEAVE;

	return retVal;
}
开发者ID:JordanKinsley,项目名称:hexchat,代码行数:56,代码来源:perl.c

示例11: xchat_plugin_deinit

int
xchat_plugin_deinit (xchat_plugin * plugin_handle)
{
	perl_end ();

	initialized = 0;
	xchat_print (plugin_handle, "Perl interface unloaded\n");

	return 1;
}
开发者ID:KhitryyGruzinGivi,项目名称:xchat,代码行数:10,代码来源:perl.c

示例12: timer_cb

static int
timer_cb (void *userdata)
{
	HookData *data = (HookData *) userdata;
	int retVal = 0;
	int count = 0;

	dSP;
	ENTER;
	SAVETMPS;

	PUSHMARK (SP);
	XPUSHs (data->userdata);
	PUTBACK;

	if (data->ctx) {
		xchat_set_context (ph, data->ctx);
	}

	set_current_package (data->package);
	count = call_sv (data->callback, G_EVAL | G_KEEPERR);
	set_current_package (&PL_sv_undef);
	SPAGAIN;

	if (SvTRUE (ERRSV)) {
		xchat_printf (ph, "Error in timer callback %s", SvPV_nolen (ERRSV));
		if (!SvOK (POPs)) {}		  /* remove undef from the top of the stack */
		retVal = XCHAT_EAT_ALL;
	} else {
		if (count != 1) {
			xchat_print (ph, "Timer handler should only return 1 value.");
			retVal = XCHAT_EAT_NONE;
		} else {
			retVal = POPi;
			if (retVal == 0) {
				/* if 0 is return the timer is going to get unhooked */
				PUSHMARK (SP);
				XPUSHs (sv_2mortal (newSViv (PTR2IV (data->hook))));
				XPUSHs (sv_mortalcopy (data->package));
				PUTBACK;

				call_pv ("XChat::unhook", G_EVAL);
				SPAGAIN;
			}
		}

	}

	PUTBACK;
	FREETMPS;
	LEAVE;

	return retVal;
}
开发者ID:DoctorWho11,项目名称:pchat,代码行数:54,代码来源:perl.c

示例13: xchat_printf

void xchat_printf(xchat_plugin *ph, const char *format, ...)
{
	va_list args;
	char *buf;

	va_start(args, format);
	buf = g_strdup_vprintf(format, args);
	va_end(args);

	xchat_print(ph, buf);
	g_free(buf);
}
开发者ID:wowzaman12,项目名称:libPChat,代码行数:12,代码来源:plugin.cpp

示例14: xchat_print

void ScriptDataList::list()
{
   xchat_print( the_plugin, PNAME ": -------------------------------------------\n" );
   if ( m_head == 0 ) {
      xchat_print( the_plugin, PNAME ":    Currently, no module loaded.\n" );
      return;
   }

   xchat_print( the_plugin,
      PNAME ": Status  Name\n"
      PNAME ": ------  ----------------------------------\n" );

   ScriptData *mod = m_head;
   while( mod != 0 )
   {
      Falcon::String status = mod->m_bStatus ? "Ok  " : "Error";
      xchat_print_falcon( PNAME ": "+ status + "    " + mod->m_module->name() +"\n" );
      mod = mod->m_next;
   }
   xchat_print( the_plugin, PNAME ": ----------------------------------------------\n" );
}
开发者ID:falconpl,项目名称:fxchat,代码行数:21,代码来源:fxchat_script.cpp

示例15: static_ruby_xchat_print

static VALUE static_ruby_xchat_print( VALUE klass,
                                      VALUE text )
{
  char *s_text;

  Check_Type( text, T_STRING );

  s_text = StringValueCStr( text );

  xchat_print( static_plugin_handle, s_text );

  return Qnil;
}
开发者ID:FrostbittenKing,项目名称:XChat-Ruby,代码行数:13,代码来源:xchat-ruby.c


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