Changeset 9143aeb


Ignore:
Timestamp:
2008-04-05T12:26:04Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f35aee7
Parents:
f3351f0
Message:

query.h now defines a callback function type, not using void* for it anymore.
Got rid of the bogus window handler pointer as the first argument to the
callback.

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber_util.c

    rf3351f0 r9143aeb  
    246246};
    247247
    248 static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla )
    249 {
     248static void jabber_buddy_ask_yes( void *data )
     249{
     250        struct jabber_buddy_ask_data *bla = data;
     251       
    250252        presence_send_request( bla->ic, bla->handle, "subscribed" );
    251253       
     
    257259}
    258260
    259 static void jabber_buddy_ask_no( gpointer w, struct jabber_buddy_ask_data *bla )
    260 {
     261static void jabber_buddy_ask_no( void *data )
     262{
     263        struct jabber_buddy_ask_data *bla = data;
     264       
    261265        presence_send_request( bla->ic, bla->handle, "subscribed" );
    262266       
  • protocols/msn/msn_util.c

    rf3351f0 r9143aeb  
    9090};
    9191
    92 static void msn_buddy_ask_yes( gpointer w, struct msn_buddy_ask_data *bla )
    93 {
     92static void msn_buddy_ask_yes( void *data )
     93{
     94        struct msn_buddy_ask_data *bla = data;
     95       
    9496        msn_buddy_list_add( bla->ic, "AL", bla->handle, bla->realname );
    9597       
     
    102104}
    103105
    104 static void msn_buddy_ask_no( gpointer w, struct msn_buddy_ask_data *bla )
    105 {
     106static void msn_buddy_ask_no( void *data )
     107{
     108        struct msn_buddy_ask_data *bla = data;
     109       
    106110        msn_buddy_list_add( bla->ic, "BL", bla->handle, bla->realname );
    107111       
  • protocols/nogaim.c

    rf3351f0 r9143aeb  
    343343/* dialogs.c */
    344344
    345 void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont )
     345void imcb_ask( struct im_connection *ic, char *msg, void *data,
     346               query_callback doit, query_callback dont )
    346347{
    347348        query_add( ic->irc, ic, msg, doit, dont, data );
     
    495496};
    496497
    497 void show_got_added_no( gpointer w, struct show_got_added_data *data )
    498 {
    499         g_free( data->handle );
     498void show_got_added_no( void *data )
     499{
     500        g_free( ((struct show_got_added_data*)data)->handle );
    500501        g_free( data );
    501502}
    502503
    503 void show_got_added_yes( gpointer w, struct show_got_added_data *data )
    504 {
    505         data->ic->acc->prpl->add_buddy( data->ic, data->handle, NULL );
    506         /* imcb_add_buddy( data->ic, NULL, data->handle, data->handle ); */
    507        
    508         return show_got_added_no( w, data );
     504void show_got_added_yes( void *data )
     505{
     506        struct show_got_added_data *sga = data;
     507       
     508        sga->ic->acc->prpl->add_buddy( sga->ic, sga->handle, NULL );
     509        /* imcb_add_buddy( sga->ic, NULL, sga->handle, sga->handle ); */
     510       
     511        return show_got_added_no( data );
    509512}
    510513
  • protocols/nogaim.h

    rf3351f0 r9143aeb  
    4242#include "account.h"
    4343#include "proxy.h"
     44#include "query.h"
    4445#include "md5.h"
    4546
     
    261262 * - 'doit' or 'dont' will be called depending of the answer of the user.
    262263 */
    263 G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont );
     264G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont );
    264265G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname );
    265266
  • protocols/oscar/oscar.c

    rf3351f0 r9143aeb  
    10841084}
    10851085
    1086 void oscar_accept_chat(gpointer w, struct aim_chat_invitation * inv);
    1087 void oscar_reject_chat(gpointer w, struct aim_chat_invitation * inv);
     1086void oscar_accept_chat(void *data);
     1087void oscar_reject_chat(void *data);
    10881088       
    10891089static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) {
     
    11191119}
    11201120
    1121 static void gaim_icq_authgrant(gpointer w, struct icq_auth *data) {
     1121static void gaim_icq_authgrant(void *data_) {
     1122        struct icq_auth *data = data_;
    11221123        char *uin, message;
    11231124        struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
     
    11341135}
    11351136
    1136 static void gaim_icq_authdeny(gpointer w, struct icq_auth *data) {
     1137static void gaim_icq_authdeny(void *data_) {
     1138        struct icq_auth *data = data_;
    11371139        char *uin, *message;
    11381140        struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
     
    25882590}
    25892591
    2590 void oscar_accept_chat(gpointer w, struct aim_chat_invitation * inv)
     2592void oscar_accept_chat(void *data)
    25912593{
     2594        struct aim_chat_invitation * inv = data;
     2595       
    25922596        oscar_chat_join(inv->ic, inv->name, NULL, NULL);
    25932597        g_free(inv->name);
     
    25952599}
    25962600
    2597 void oscar_reject_chat(gpointer w, struct aim_chat_invitation * inv)
     2601void oscar_reject_chat(void *data)
    25982602{
     2603        struct aim_chat_invitation * inv = data;
     2604       
    25992605        g_free(inv->name);
    26002606        g_free(inv);
  • protocols/yahoo/yahoo.c

    rf3351f0 r9143aeb  
    797797}
    798798
    799 static void byahoo_accept_conf( gpointer w, struct byahoo_conf_invitation *inv )
    800 {
     799static void byahoo_accept_conf( void *data )
     800{
     801        struct byahoo_conf_invitation *inv = data;
     802       
    801803        yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name );
    802804        imcb_chat_add_buddy( inv->c, inv->ic->acc->user );
     
    805807}
    806808
    807 static void byahoo_reject_conf( gpointer w, struct byahoo_conf_invitation *inv )
    808 {
     809static void byahoo_reject_conf( void *data )
     810{
     811        struct byahoo_conf_invitation *inv = data;
     812       
    809813        yahoo_conference_decline( inv->yid, NULL, inv->members, inv->name, "User rejected groupchat" );
    810814        imcb_chat_free( inv->c );
  • query.c

    rf3351f0 r9143aeb  
    3030static query_t *query_default( irc_t *irc );
    3131
    32 query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, void *yes, void *no, void *data )
     32query_t *query_add( irc_t *irc, struct im_connection *ic, char *question,
     33                    query_callback yes, query_callback no, void *data )
    3334{
    3435        query_t *q = g_new0( query_t, 1 );
     
    144145                else
    145146                        irc_usermsg( irc, "Accepted: %s", q->question );
    146                 q->yes( NULL, q->data );
     147                q->yes( q->data );
    147148        }
    148149        else
     
    152153                else
    153154                        irc_usermsg( irc, "Rejected: %s", q->question );
    154                 q->no( NULL, q->data );
     155                q->no( q->data );
    155156        }
    156157        q->data = NULL;
  • query.h

    rf3351f0 r9143aeb  
    2727#define _QUERY_H
    2828
     29typedef void (*query_callback) ( void *data );
     30
    2931typedef struct query
    3032{
    3133        struct im_connection *ic;
    3234        char *question;
    33         void (* yes) ( gpointer w, void *data );
    34         void (* no) ( gpointer w, void *data );
     35        query_callback yes, no;
    3536        void *data;
    3637        struct query *next;
    3738} query_t;
    3839
    39 query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, void *yes, void *no, void *data );
     40query_t *query_add( irc_t *irc, struct im_connection *ic, char *question,
     41                    query_callback yes, query_callback no, void *data );
    4042void query_del( irc_t *irc, query_t *q );
    4143void query_del_by_conn( irc_t *irc, struct im_connection *ic );
Note: See TracChangeset for help on using the changeset viewer.