[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hooking to same event



Resent due to delivery problems

On Mon, 2003-10-13 at 02:47, Bailey Kong wrote:
> Both are set to XCHAT_PRI_NORM.
> 
> Plugin 1:
> 
> int fxn1(char *word[], void *userdata) {
> 
>      int *index = (int *) userdata;
>      char nick[32] = "";
>      char message[256] = "";
> 
>      if (index[0] > 0) {
>           strcpy(nick, word[index[0]]);
>      }
> 
>      if (index[1] > 0) {
>           strcpy(message, word[index[1]]);
>      }
> 
>      control_cb(nick, message, index[2]);
> 
>      return XCHAT_EAT_NONE;
> 
> }

What is userdata actually? And from where is this function called?
And more importantly, where is word_eol?

Example from my plugin:

int rping_cmd(char *word[], char *word_eol[], void *userdata)
{
....

> gdb always says 'control_cb(nick, message, index[2]);' is the line that's causing the problems.  
> 
> The function I run when the segfault occurs is
> 
> Plugin 2:
> 
> int check_fserves_cb() {
>      notice_hook = xchat_hook_print(ph, "Notice", XCHAT_PRI_NORM, voice_cb, NULL);
>      xchat_hook_timer(ph, 40000, voice_stop_notices_cb, NULL);
>      count = 0;
>      xchat_set_context(ph, voice_get_context("#lightshock"));
>      xchat_command(ph, "msg #lightshock !list");
>      xchat_command(ph, "msg #lightshock \0034:: \003Detecting new servers \0034::");
>      return XCHAT_EAT_ALL;
> }

Looks ok =)

-- 
Ian Kumlien <pomac@vapor.com>

This is a digitally signed message part