purple_request_file incompletely specified callbacks

Mark Doliner mark at kingant.net
Wed Aug 1 01:49:13 EDT 2007

On Sun, 29 Jul 2007 22:18:43 -0400, William Ehlhardt wrote
> The prototype required of callback functions for the ok_cb and
> cancel_cb arguments to libpurple/request.c:purple_request_file seems
> impossible to divine from the header file and function prototype; 
> both callback arguments are specified only as "GCallback", which is not
> very descriptive [1].
> With some grepping, I determined the expected prototype for the 
> ok_cb, going by pidgin/gtkdebug.c:save_writefile_cb, which is passed 
> into purple_request_file as ok_cb in save_cb a little ways down. Can 
> this information can be made explicit in libpurple/request.h without 
> forcing a major version bump? A PurpleRequestFileCb typedef already 
> exists in request.h; can it be used directly in the 
> purple_request_file prototype?
> While I am aware that changing function signatures will force a major
> bump, in this case, I think that the function signatures themselves
> will not be affected, as the expected signature is already implicitly
> defined somewhere deep in the code that calls the callbacks. For
> general sanity, it should be possible for the programmer to figure 
> out the necessary prototype simply by looking at the purple_request_file
> prototype in request.h.
> -William
> [1]

I think as long as existing plugins continue to run unmodified (and without
needing to be recompiled), and as long as old plugins continue to compile then
it should be ok.

This is vague... but it seems like I tried to use PurpleRequestFileCb instead
of GCallback at some point in the past but for some reason it ended up being
messier, so I scrapped it.  But feel free to take a stab at it.


More information about the Devel mailing list