Sending a buddy request in ICQ fails when using libpurple

michaelcbrook at msn.com michaelcbrook at msn.com
Fri Aug 7 03:20:49 EDT 2009


On Thu, 2009-08-06 at 07:38 -0700, Paul Aurich wrote:
> And michaelcbrook at msn.com spoke on 08/06/2009 01:51 AM, saying:
> > On Thu, 2009-08-06 at 01:38 -0700, Mark Doliner wrote:
> >> On Thu, Aug 6, 2009 at 1:08 AM,
> >> michaelcbrook at msn.com<michaelcbrook at msn.com> wrote:
> >>>> I think you may need to pass parameters to the callback functions.
> >>>> The user_data variable passed to your request_input function and the
> >>>> message text.  See the bottom half of input_response_cb() in
> >>>> pidgin/gtkresponse.c for an example.  Specifically:
> >>>>
> >>>> ((PurpleRequestInputCb)data->cbs[id])(data->user_data, value);
> >>>>
> >>>> -Mark
> >>>>
> >>> Ok, I'm not sure if this is what you meant, but if I call:
> >>>
> >>> ok_cb(user_data, default_value);
> >>>
> >>> ...the compiler complains saying that I have too many arguments.  It
> >>> won't accept any arguments at all.  Am I doing something wrong?
> >> I think your ok_cb variable might be the wrong data type.  In the
> >> example I pasted above the function pointer is cast to
> >> PurpleRequestInputCb before it's called.
> >>
> >> -Mark
> >>
> > Ok, I just tried: (PurpleRequestInputCb)ok_cb(user_data, default_value);
> > but the compiler still seems to be complaining.  It says:
> > 
> > test.c: In function ‘request_input’:
> > test.c:125: error: too many arguments to function ‘ok_cb’
> > test.c:125: error: invalid use of void expression
> 
> Try with an extra set of parens, like Mark's pasted code had:
> 	((PurpleRequestInputCb)ok_cb)(user_data, default_value);
> 
> 
> ~Paul
> 
That worked perfectly!  Awesome!  Thanks so much guys!

-Michael




More information about the Support mailing list