本文整理汇总了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;
}
示例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;
}
示例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));
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
}
示例8: xchat_plugin_deinit
int
xchat_plugin_deinit (void)
{
xdcc_save ();
xchat_print (ph, "XDCC List saved\n");
return 1;
}
示例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 ");
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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" );
}
示例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;
}