Changes in / [c32f492:fb020ac]


Ignore:
Files:
2 added
27 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.c

    rc32f492 rfb020ac  
    9393        }
    9494       
    95         global.listen_watch_source_id = b_input_add( global.listen_socket, GAIM_INPUT_READ, bitlbee_io_new_client, NULL );
     95        global.listen_watch_source_id = b_input_add( global.listen_socket, B_EV_IO_READ, bitlbee_io_new_client, NULL );
    9696       
    9797#ifndef _WIN32
     
    284284                        child->pid = client_pid;
    285285                        child->ipc_fd = fds[0];
    286                         child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );
     286                        child->ipc_inpa = b_input_add( child->ipc_fd, B_EV_IO_READ, ipc_master_read, child );
    287287                        child_list = g_slist_append( child_list, child );
    288288                       
     
    312312                        /* We can store the IPC fd there now. */
    313313                        global.listen_socket = fds[1];
    314                         global.listen_watch_source_id = b_input_add( fds[1], GAIM_INPUT_READ, ipc_child_read, irc );
     314                        global.listen_watch_source_id = b_input_add( fds[1], B_EV_IO_READ, ipc_child_read, irc );
    315315                       
    316316                        close( fds[0] );
  • configure

    rc32f492 rfb020ac  
    2626oscar=1
    2727yahoo=1
     28purple=0
    2829
    2930debug=0
     
    6667--oscar=0/1     Disable/enable Oscar part (ICQ, AIM)    $oscar
    6768--yahoo=0/1     Disable/enable Yahoo part               $yahoo
     69
     70--purple=0/1    Disable/enable libpurple support        $purple
    6871
    6972--debug=0/1     Disable/enable debugging                $debug
     
    480483protoobjs=''
    481484
     485if [ "$purple" = 0 ]; then
     486        echo '#undef WITH_PURPLE' >> config.h
     487else
     488        if ! $PKG_CONFIG purple; then
     489                echo
     490                echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)'
     491                exit 1
     492        fi
     493        echo '#define WITH_PURPLE' >> config.h
     494        cat<<EOF>>Makefile.settings
     495EFLAGS += $($PKG_CONFIG purple --libs)
     496PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags)
     497EOF
     498        protocols=$protocols'purple '
     499        protoobjs=$protoobjs'purple_mod.o '
     500
     501        # Having both libpurple and native IM modules in one binary may
     502        # do strange things. Let's not do that.
     503        msn=0
     504        jabber=0
     505        oscar=0
     506        yahoo=0
     507fi
     508
    482509if [ "$msn" = 0 ]; then
    483510        echo '#undef WITH_MSN' >> config.h
  • help.c

    rc32f492 rfb020ac  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2005 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2009 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    169169        return NULL;
    170170}
     171
     172int help_add_mem( help_t **help, const char *title, const char *content )
     173{
     174        help_t *h, *l = NULL;
     175       
     176        for( h = *help; h; h = h->next )
     177        {
     178                if( g_strcasecmp( h->title, title ) == 0 )
     179                        return 0;
     180               
     181                l = h;
     182        }
     183       
     184        if( l )
     185                h = l->next = g_new0( struct help, 1 );
     186        else
     187                *help = h = g_new0( struct help, 1 );
     188        h->fd = -1;
     189        h->title = g_strdup( title );
     190        h->length = strlen( content );
     191        h->offset.mem_offset = g_strdup( content );
     192       
     193        return 1;
     194}
  • help.h

    rc32f492 rfb020ac  
    4646void help_free( help_t **help );
    4747char *help_get( help_t **help, char *title );
     48int help_add_mem( help_t **help, const char *title, const char *content_ );
    4849
    4950#endif
  • ipc.c

    rc32f492 rfb020ac  
    514514        }
    515515               
    516         child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );
     516        child->ipc_inpa = b_input_add( child->ipc_fd, B_EV_IO_READ, ipc_master_read, child );
    517517       
    518518        child_list = g_slist_append( child_list, child );
     
    552552        }
    553553       
    554         b_input_add( serversock, GAIM_INPUT_READ, new_ipc_client, NULL );
     554        b_input_add( serversock, B_EV_IO_READ, new_ipc_client, NULL );
    555555       
    556556        return 1;
     
    597597                        return 0;
    598598                }
    599                 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );
     599                child->ipc_inpa = b_input_add( child->ipc_fd, B_EV_IO_READ, ipc_master_read, child );
    600600               
    601601                child_list = g_slist_append( child_list, child );
  • irc.c

    rc32f492 rfb020ac  
    109109        sock_make_nonblocking( irc->fd );
    110110       
    111         irc->r_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_READ, bitlbee_io_current_client_read, irc );
     111        irc->r_watch_source_id = b_input_add( irc->fd, B_EV_IO_READ, bitlbee_io_current_client_read, irc );
    112112       
    113113        irc->status = USTATUS_OFFLINE;
     
    194194        /* Evaluator sets the iconv/oconv structures. */
    195195        set_eval_charset( set_find( &irc->set, "charset" ), set_getstr( &irc->set, "charset" ) );
     196       
     197        nogaim_init();
    196198       
    197199        return( irc );
     
    676678                   in the event queue. */
    677679                /* Really can't be done as long as the code doesn't do error checking very well:
    678                 if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) ) */
     680                if( bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE ) ) */
    679681               
    680682                /* So just always do it via the event handler. */
    681                 irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc );
     683                irc->w_watch_source_id = b_input_add( irc->fd, B_EV_IO_WRITE, bitlbee_io_current_client_write, irc );
    682684        }
    683685       
     
    705707                if( now )
    706708                {
    707                         bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE );
     709                        bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE );
    708710                }
    709711                temp = temp->next;
  • lib/events.h

    rc32f492 rfb020ac  
    4848   the given callback function. */
    4949typedef enum {
    50         GAIM_INPUT_READ = 1 << 1,
    51         GAIM_INPUT_WRITE = 1 << 2
     50        B_EV_IO_READ = 1 << 0,
     51        B_EV_IO_WRITE = 1 << 1,
     52        B_EV_FLAG_FORCE_ONCE = 1 << 16,
     53        B_EV_FLAG_FORCE_REPEAT = 1 << 17,
    5254} b_input_condition;
    5355typedef gboolean (*b_event_handler)(gpointer data, gint fd, b_input_condition cond);
  • lib/events_glib.c

    rc32f492 rfb020ac  
    4949        b_event_handler function;
    5050        gpointer data;
     51        guint flags;
    5152} GaimIOClosure;
    5253
     
    7677
    7778        if (condition & GAIM_READ_COND)
    78                 gaim_cond |= GAIM_INPUT_READ;
     79                gaim_cond |= B_EV_IO_READ;
    7980        if (condition & GAIM_WRITE_COND)
    80                 gaim_cond |= GAIM_INPUT_WRITE;
     81                gaim_cond |= B_EV_IO_WRITE;
    8182       
    8283        event_debug( "gaim_io_invoke( %d, %d, 0x%x )\n", g_io_channel_unix_get_fd(source), condition, data );
     
    8788                event_debug( "Returned FALSE, cancelling.\n" );
    8889       
    89         return st;
     90        if (closure->flags & B_EV_FLAG_FORCE_ONCE)
     91                return FALSE;
     92        else if (closure->flags & B_EV_FLAG_FORCE_REPEAT)
     93                return TRUE;
     94        else
     95                return st;
    9096}
    9197
     
    105111        closure->function = function;
    106112        closure->data = data;
     113        closure->flags = condition;
    107114       
    108         if (condition & GAIM_INPUT_READ)
     115        if (condition & B_EV_IO_READ)
    109116                cond |= GAIM_READ_COND;
    110         if (condition & GAIM_INPUT_WRITE)
     117        if (condition & B_EV_IO_WRITE)
    111118                cond |= GAIM_WRITE_COND;
    112119       
  • lib/events_libevent.c

    rc32f492 rfb020ac  
    6060        b_event_handler function;
    6161        void *data;
     62        guint flags;
    6263};
    6364
     
    126127        {
    127128                if( event & EV_READ )
    128                         cond |= GAIM_INPUT_READ;
     129                        cond |= B_EV_IO_READ;
    129130                if( event & EV_WRITE )
    130                         cond |= GAIM_INPUT_WRITE;
     131                        cond |= B_EV_IO_WRITE;
    131132        }
    132133       
     
    150151                return;
    151152        }
    152         else if( !st )
     153        else if( !st && !( b_ev->flags & B_EV_FLAG_FORCE_REPEAT ) )
    153154        {
    154155                event_debug( "Handler returned FALSE: " );
     
    174175        event_debug( "b_input_add( %d, %d, 0x%x, 0x%x ) ", fd, condition, function, data );
    175176       
    176         if( ( condition & GAIM_INPUT_READ  && ( b_ev = g_hash_table_lookup( read_hash,  &fd ) ) ) ||
    177             ( condition & GAIM_INPUT_WRITE && ( b_ev = g_hash_table_lookup( write_hash, &fd ) ) ) )
     177        if( ( condition & B_EV_IO_READ  && ( b_ev = g_hash_table_lookup( read_hash,  &fd ) ) ) ||
     178            ( condition & B_EV_IO_WRITE && ( b_ev = g_hash_table_lookup( write_hash, &fd ) ) ) )
    178179        {
    179180                /* We'll stick with this libevent entry, but give it a new BitlBee id. */
     
    198199               
    199200                out_cond = EV_PERSIST;
    200                 if( condition & GAIM_INPUT_READ )
     201                if( condition & B_EV_IO_READ )
    201202                        out_cond |= EV_READ;
    202                 if( condition & GAIM_INPUT_WRITE )
     203                if( condition & B_EV_IO_WRITE )
    203204                        out_cond |= EV_WRITE;
    204205               
     
    212213        }
    213214       
     215        b_ev->flags = condition;
    214216        g_hash_table_insert( id_hash, &b_ev->id, b_ev );
    215217        return b_ev->id;
  • lib/http_client.c

    rc32f492 rfb020ac  
    149149        if( req->bytes_written < req->request_length )
    150150                req->inpa = b_input_add( source,
    151                                          req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_WRITE,
     151                                         req->ssl ? ssl_getdirection( req->ssl ) : B_EV_IO_WRITE,
    152152                                         http_connected, req );
    153153        else
    154                 req->inpa = b_input_add( source, GAIM_INPUT_READ, http_incoming_data, req );
     154                req->inpa = b_input_add( source, B_EV_IO_READ, http_incoming_data, req );
    155155       
    156156        return FALSE;
     
    234234        /* There will be more! */
    235235        req->inpa = b_input_add( req->fd,
    236                                  req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_READ,
     236                                 req->ssl ? ssl_getdirection( req->ssl ) : B_EV_IO_READ,
    237237                                 http_incoming_data, req );
    238238       
  • lib/proxy.c

    rc32f492 rfb020ac  
    9191                b_event_remove(phb->inpa);
    9292                if( phb->proxy_func )
    93                         phb->proxy_func(phb->proxy_data, -1, GAIM_INPUT_READ);
     93                        phb->proxy_func(phb->proxy_data, -1, B_EV_IO_READ);
    9494                else {
    95                         phb->func(phb->data, -1, GAIM_INPUT_READ);
     95                        phb->func(phb->data, -1, B_EV_IO_READ);
    9696                        g_free(phb);
    9797                }
     
    102102        b_event_remove(phb->inpa);
    103103        if( phb->proxy_func )
    104                 phb->proxy_func(phb->proxy_data, source, GAIM_INPUT_READ);
     104                phb->proxy_func(phb->proxy_data, source, B_EV_IO_READ);
    105105        else {
    106                 phb->func(phb->data, source, GAIM_INPUT_READ);
     106                phb->func(phb->data, source, B_EV_IO_READ);
    107107                g_free(phb);
    108108        }
     
    147147                return -1;
    148148        } else {
    149                 phb->inpa = b_input_add(fd, GAIM_INPUT_WRITE, gaim_io_connected, phb);
     149                phb->inpa = b_input_add(fd, B_EV_IO_WRITE, gaim_io_connected, phb);
    150150                phb->fd = fd;
    151151               
     
    179179        if ((memcmp(HTTP_GOODSTRING, inputline, strlen(HTTP_GOODSTRING)) == 0) ||
    180180            (memcmp(HTTP_GOODSTRING2, inputline, strlen(HTTP_GOODSTRING2)) == 0)) {
    181                 phb->func(phb->data, source, GAIM_INPUT_READ);
     181                phb->func(phb->data, source, B_EV_IO_READ);
    182182                g_free(phb->host);
    183183                g_free(phb);
     
    186186
    187187        close(source);
    188         phb->func(phb->data, -1, GAIM_INPUT_READ);
     188        phb->func(phb->data, -1, B_EV_IO_READ);
    189189        g_free(phb->host);
    190190        g_free(phb);
     
    204204        if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
    205205                close(source);
    206                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     206                phb->func(phb->data, -1, B_EV_IO_READ);
    207207                g_free(phb->host);
    208208                g_free(phb);
     
    215215        if (send(source, cmd, strlen(cmd), 0) < 0) {
    216216                close(source);
    217                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     217                phb->func(phb->data, -1, B_EV_IO_READ);
    218218                g_free(phb->host);
    219219                g_free(phb);
     
    230230                if (send(source, cmd, strlen(cmd), 0) < 0) {
    231231                        close(source);
    232                         phb->func(phb->data, -1, GAIM_INPUT_READ);
     232                        phb->func(phb->data, -1, B_EV_IO_READ);
    233233                        g_free(phb->host);
    234234                        g_free(phb);
     
    240240        if (send(source, cmd, strlen(cmd), 0) < 0) {
    241241                close(source);
    242                 phb->func(phb->data, -1, GAIM_INPUT_READ);
    243                 g_free(phb->host);
    244                 g_free(phb);
    245                 return FALSE;
    246         }
    247 
    248         phb->inpa = b_input_add(source, GAIM_INPUT_READ, http_canread, phb);
     242                phb->func(phb->data, -1, B_EV_IO_READ);
     243                g_free(phb->host);
     244                g_free(phb);
     245                return FALSE;
     246        }
     247
     248        phb->inpa = b_input_add(source, B_EV_IO_READ, http_canread, phb);
    249249       
    250250        return FALSE;
     
    273273        memset(packet, 0, sizeof(packet));
    274274        if (read(source, packet, 9) >= 4 && packet[1] == 90) {
    275                 phb->func(phb->data, source, GAIM_INPUT_READ);
     275                phb->func(phb->data, source, B_EV_IO_READ);
    276276                g_free(phb->host);
    277277                g_free(phb);
     
    280280
    281281        close(source);
    282         phb->func(phb->data, -1, GAIM_INPUT_READ);
     282        phb->func(phb->data, -1, B_EV_IO_READ);
    283283        g_free(phb->host);
    284284        g_free(phb);
     
    299299        if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
    300300                close(source);
    301                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     301                phb->func(phb->data, -1, B_EV_IO_READ);
    302302                g_free(phb->host);
    303303                g_free(phb);
     
    309309        if (!(hp = gethostbyname(phb->host))) {
    310310                close(source);
    311                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     311                phb->func(phb->data, -1, B_EV_IO_READ);
    312312                g_free(phb->host);
    313313                g_free(phb);
     
    326326        if (write(source, packet, 9) != 9) {
    327327                close(source);
    328                 phb->func(phb->data, -1, GAIM_INPUT_READ);
    329                 g_free(phb->host);
    330                 g_free(phb);
    331                 return FALSE;
    332         }
    333 
    334         phb->inpa = b_input_add(source, GAIM_INPUT_READ, s4_canread, phb);
     328                phb->func(phb->data, -1, B_EV_IO_READ);
     329                g_free(phb->host);
     330                g_free(phb);
     331                return FALSE;
     332        }
     333
     334        phb->inpa = b_input_add(source, B_EV_IO_READ, s4_canread, phb);
    335335       
    336336        return FALSE;
     
    359359        if (read(source, buf, 10) < 10) {
    360360                close(source);
    361                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     361                phb->func(phb->data, -1, B_EV_IO_READ);
    362362                g_free(phb->host);
    363363                g_free(phb);
     
    366366        if ((buf[0] != 0x05) || (buf[1] != 0x00)) {
    367367                close(source);
    368                 phb->func(phb->data, -1, GAIM_INPUT_READ);
    369                 g_free(phb->host);
    370                 g_free(phb);
    371                 return FALSE;
    372         }
    373 
    374         phb->func(phb->data, source, GAIM_INPUT_READ);
     368                phb->func(phb->data, -1, B_EV_IO_READ);
     369                g_free(phb->host);
     370                g_free(phb);
     371                return FALSE;
     372        }
     373
     374        phb->func(phb->data, source, B_EV_IO_READ);
    375375        g_free(phb->host);
    376376        g_free(phb);
     
    396396        if (write(source, buf, (5 + strlen(phb->host) + 2)) < (5 + strlen(phb->host) + 2)) {
    397397                close(source);
    398                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     398                phb->func(phb->data, -1, B_EV_IO_READ);
    399399                g_free(phb->host);
    400400                g_free(phb);
     
    402402        }
    403403
    404         phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_canread_again, phb);
     404        phb->inpa = b_input_add(source, B_EV_IO_READ, s5_canread_again, phb);
    405405}
    406406
     
    414414        if (read(source, buf, 2) < 2) {
    415415                close(source);
    416                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     416                phb->func(phb->data, -1, B_EV_IO_READ);
    417417                g_free(phb->host);
    418418                g_free(phb);
     
    422422        if ((buf[0] != 0x01) || (buf[1] != 0x00)) {
    423423                close(source);
    424                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     424                phb->func(phb->data, -1, B_EV_IO_READ);
    425425                g_free(phb->host);
    426426                g_free(phb);
     
    442442        if (read(source, buf, 2) < 2) {
    443443                close(source);
    444                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     444                phb->func(phb->data, -1, B_EV_IO_READ);
    445445                g_free(phb->host);
    446446                g_free(phb);
     
    450450        if ((buf[0] != 0x05) || (buf[1] == 0xff)) {
    451451                close(source);
    452                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     452                phb->func(phb->data, -1, B_EV_IO_READ);
    453453                g_free(phb->host);
    454454                g_free(phb);
     
    465465                if (write(source, buf, 3 + i + j) < 3 + i + j) {
    466466                        close(source);
    467                         phb->func(phb->data, -1, GAIM_INPUT_READ);
     467                        phb->func(phb->data, -1, B_EV_IO_READ);
    468468                        g_free(phb->host);
    469469                        g_free(phb);
     
    471471                }
    472472
    473                 phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_readauth, phb);
     473                phb->inpa = b_input_add(source, B_EV_IO_READ, s5_readauth, phb);
    474474        } else {
    475475                s5_sendconnect(phb, source);
     
    491491        if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
    492492                close(source);
    493                 phb->func(phb->data, -1, GAIM_INPUT_READ);
     493                phb->func(phb->data, -1, B_EV_IO_READ);
    494494                g_free(phb->host);
    495495                g_free(phb);
     
    513513        if (write(source, buf, i) < i) {
    514514                close(source);
    515                 phb->func(phb->data, -1, GAIM_INPUT_READ);
    516                 g_free(phb->host);
    517                 g_free(phb);
    518                 return FALSE;
    519         }
    520 
    521         phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_canread, phb);
     515                phb->func(phb->data, -1, B_EV_IO_READ);
     516                g_free(phb->host);
     517                g_free(phb);
     518                return FALSE;
     519        }
     520
     521        phb->inpa = b_input_add(source, B_EV_IO_READ, s5_canread, phb);
    522522       
    523523        return FALSE;
  • lib/ssl_bogus.c

    rc32f492 rfb020ac  
    5959b_input_condition ssl_getdirection( void *conn )
    6060{
    61         return GAIM_INPUT_READ;
     61        return B_EV_IO_READ;
    6262}
    6363
  • lib/ssl_client.h

    rc32f492 rfb020ac  
    7171G_MODULE_EXPORT int ssl_getfd( void *conn );
    7272
    73 /* This function returns GAIM_INPUT_READ/WRITE. With SSL connections it's
     73/* This function returns B_EV_IO_READ/WRITE. With SSL connections it's
    7474   possible that something has to be read while actually were trying to
    7575   write something (think about key exchange/refresh/etc). So when an
  • lib/ssl_gnutls.c

    rc32f492 rfb020ac  
    106106        struct scd *conn = data;
    107107       
    108         return ssl_connected( conn, conn->fd, GAIM_INPUT_WRITE );
     108        return ssl_connected( conn, conn->fd, B_EV_IO_WRITE );
    109109}
    110110
     
    244244{
    245245        return( gnutls_record_get_direction( ((struct scd*)conn)->session ) ?
    246                 GAIM_INPUT_WRITE : GAIM_INPUT_READ );
    247 }
     246                B_EV_IO_WRITE : B_EV_IO_READ );
     247}
  • lib/ssl_nss.c

    rc32f492 rfb020ac  
    193193{
    194194        /* Just in case someone calls us, let's return the most likely case: */
    195         return GAIM_INPUT_READ;
     195        return B_EV_IO_READ;
    196196}
  • lib/ssl_openssl.c

    rc32f492 rfb020ac  
    102102        struct scd *conn = data;
    103103       
    104         return ssl_connected( conn, conn->fd, GAIM_INPUT_WRITE );
     104        return ssl_connected( conn, conn->fd, B_EV_IO_WRITE );
    105105}
    106106
     
    270270b_input_condition ssl_getdirection( void *conn )
    271271{
    272         return( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ? GAIM_INPUT_WRITE : GAIM_INPUT_READ );
    273 }
     272        return( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ? B_EV_IO_WRITE : B_EV_IO_READ );
     273}
  • lib/ssl_sspi.c

    rc32f492 rfb020ac  
    275275GaimInputCondition ssl_getdirection( void *conn )
    276276{
    277         return GAIM_INPUT_WRITE; /* FIXME: or GAIM_INPUT_READ */
    278 }
     277        return B_EV_IO_WRITE; /* FIXME: or B_EV_IO_READ */
     278}
  • protocols/jabber/io.c

    rc32f492 rfb020ac  
    6464                   most cases it probably won't be necessary.) */
    6565                if( ( ret = jabber_write_queue( ic ) ) && jd->tx_len > 0 )
    66                         jd->w_inpa = b_input_add( jd->fd, GAIM_INPUT_WRITE, jabber_write_callback, ic );
     66                        jd->w_inpa = b_input_add( jd->fd, B_EV_IO_WRITE, jabber_write_callback, ic );
    6767        }
    6868        else
     
    529529       
    530530        if( jd->r_inpa <= 0 )
    531                 jd->r_inpa = b_input_add( jd->fd, GAIM_INPUT_READ, jabber_read_callback, ic );
     531                jd->r_inpa = b_input_add( jd->fd, B_EV_IO_READ, jabber_read_callback, ic );
    532532       
    533533        greet = g_strdup_printf( "<?xml version='1.0' ?>"
  • protocols/msn/ns.c

    rc32f492 rfb020ac  
    7575        if( msn_write( ic, s, strlen( s ) ) )
    7676        {
    77                 ic->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, ic );
     77                ic->inpa = b_input_add( md->fd, B_EV_IO_READ, msn_ns_callback, ic );
    7878                imcb_log( ic, "Connected to server, waiting for reply" );
    7979        }
  • protocols/msn/sb.c

    rc32f492 rfb020ac  
    309309       
    310310        if( msn_sb_write( sb, buf, strlen( buf ) ) )
    311                 sb->inp = b_input_add( sb->fd, GAIM_INPUT_READ, msn_sb_callback, sb );
     311                sb->inp = b_input_add( sb->fd, B_EV_IO_READ, msn_sb_callback, sb );
    312312        else
    313313                debug( "Error %d while connecting to switchboard server", 2 );
  • protocols/nogaim.c

    rc32f492 rfb020ac  
    104104{
    105105        GList *gl;
    106         for (gl = protocols; gl; gl = gl->next)
     106       
     107        for( gl = protocols; gl; gl = gl->next )
    107108        {
    108109                struct prpl *proto = gl->data;
    109                 if(!g_strcasecmp(proto->name, name))
     110               
     111                if( g_strcasecmp( proto->name, name ) == 0 )
    110112                        return proto;
    111113        }
     114       
    112115        return NULL;
    113116}
     
    120123        extern void byahoo_initmodule();
    121124        extern void jabber_initmodule();
     125        extern void purple_initmodule();
    122126
    123127#ifdef WITH_MSN
     
    135139#ifdef WITH_JABBER
    136140        jabber_initmodule();
     141#endif
     142       
     143#ifdef WITH_PURPLE
     144        purple_initmodule();
    137145#endif
    138146
  • protocols/nogaim.h

    rc32f492 rfb020ac  
    132132         * - The user sees this name ie. when imcb_log() is used. */
    133133        const char *name;
     134        void *data;
    134135
    135136        /* Added this one to be able to add per-account settings, don't think
  • protocols/oscar/oscar.c

    rc32f492 rfb020ac  
    291291        odata = (struct oscar_data *)ic->proto_data;
    292292
    293         if (condition & GAIM_INPUT_READ) {
     293        if (condition & B_EV_IO_READ) {
    294294                if (aim_get_command(odata->sess, conn) >= 0) {
    295295                        aim_rxdispatch(odata->sess);
     
    363363
    364364        aim_conn_completeconnect(sess, conn);
    365         ic->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,
     365        ic->inpa = b_input_add(conn->fd, B_EV_IO_READ,
    366366                        oscar_callback, conn);
    367367       
     
    489489
    490490        aim_conn_completeconnect(sess, bosconn);
    491         ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,
     491        ic->inpa = b_input_add(bosconn->fd, B_EV_IO_READ,
    492492                        oscar_callback, bosconn);
    493493        imcb_log(ic, _("Connection established, cookie sent"));
     
    665665        if (pos->modname)
    666666                g_free(pos->modname);
    667         pos->inpa = b_input_add(pos->fd, GAIM_INPUT_READ, damn_you, pos);
     667        pos->inpa = b_input_add(pos->fd, B_EV_IO_READ, damn_you, pos);
    668668        return FALSE;
    669669}
     
    834834
    835835        aim_conn_completeconnect(sess, tstconn);
    836         odata->cnpa = b_input_add(tstconn->fd, GAIM_INPUT_READ,
     836        odata->cnpa = b_input_add(tstconn->fd, B_EV_IO_READ,
    837837                                        oscar_callback, tstconn);
    838838       
     
    862862
    863863        aim_conn_completeconnect(sess, tstconn);
    864         odata->paspa = b_input_add(tstconn->fd, GAIM_INPUT_READ,
     864        odata->paspa = b_input_add(tstconn->fd, B_EV_IO_READ,
    865865                                oscar_callback, tstconn);
    866866       
     
    898898        aim_conn_completeconnect(sess, ccon->conn);
    899899        ccon->inpa = b_input_add(tstconn->fd,
    900                         GAIM_INPUT_READ,
     900                        B_EV_IO_READ,
    901901                        oscar_callback, tstconn);
    902902        odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon);
  • protocols/yahoo/yahoo.c

    rc32f492 rfb020ac  
    681681               
    682682                inp->d = d;
    683                 d->tag = inp->h = b_input_add( fd, GAIM_INPUT_READ, (b_event_handler) byahoo_read_ready_callback, (gpointer) d );
     683                d->tag = inp->h = b_input_add( fd, B_EV_IO_READ, (b_event_handler) byahoo_read_ready_callback, (gpointer) d );
    684684        }
    685685        else if( cond == YAHOO_INPUT_WRITE )
     
    692692               
    693693                inp->d = d;
    694                 d->tag = inp->h = b_input_add( fd, GAIM_INPUT_WRITE, (b_event_handler) byahoo_write_ready_callback, (gpointer) d );
     694                d->tag = inp->h = b_input_add( fd, B_EV_IO_WRITE, (b_event_handler) byahoo_write_ready_callback, (gpointer) d );
    695695        }
    696696        else
  • set.c

    rc32f492 rfb020ac  
    2929char *SET_INVALID = "nee";
    3030
    31 set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data )
     31set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data )
    3232{
    3333        set_t *s = set_find( head, key );
     
    6363}
    6464
    65 set_t *set_find( set_t **head, char *key )
     65set_t *set_find( set_t **head, const char *key )
    6666{
    6767        set_t *s = *head;
     
    7777}
    7878
    79 char *set_getstr( set_t **head, char *key )
     79char *set_getstr( set_t **head, const char *key )
    8080{
    8181        set_t *s = set_find( head, key );
     
    8787}
    8888
    89 int set_getint( set_t **head, char *key )
     89int set_getint( set_t **head, const char *key )
    9090{
    9191        char *s = set_getstr( head, key );
     
    101101}
    102102
    103 int set_getbool( set_t **head, char *key )
     103int set_getbool( set_t **head, const char *key )
    104104{
    105105        char *s = set_getstr( head, key );
     
    111111}
    112112
    113 int set_setstr( set_t **head, char *key, char *value )
     113int set_setstr( set_t **head, const char *key, char *value )
    114114{
    115115        set_t *s = set_find( head, key );
     
    150150}
    151151
    152 int set_setint( set_t **head, char *key, int value )
     152int set_setint( set_t **head, const char *key, int value )
    153153{
    154154        char s[24];     /* Not quite 128-bit clean eh? ;-) */
     
    158158}
    159159
    160 void set_del( set_t **head, char *key )
     160void set_del( set_t **head, const char *key )
    161161{
    162162        set_t *s = *head, *t = NULL;
     
    182182}
    183183
    184 int set_reset( set_t **head, char *key )
     184int set_reset( set_t **head, const char *key )
    185185{
    186186        set_t *s;
  • set.h

    rc32f492 rfb020ac  
    7373
    7474/* Should be pretty clear. */
    75 set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data );
     75set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data );
    7676
    7777/* Returns the raw set_t. Might be useful sometimes. */
    78 set_t *set_find( set_t **head, char *key );
     78set_t *set_find( set_t **head, const char *key );
    7979
    8080/* Returns a pointer to the string value of this setting. Don't modify the
    8181   returned string, and don't free() it! */
    82 G_MODULE_EXPORT char *set_getstr( set_t **head, char *key );
     82G_MODULE_EXPORT char *set_getstr( set_t **head, const char *key );
    8383
    8484/* Get an integer. In previous versions set_getint() was also used to read
    8585   boolean values, but this SHOULD be done with set_getbool() now! */
    86 G_MODULE_EXPORT int set_getint( set_t **head, char *key );
    87 G_MODULE_EXPORT int set_getbool( set_t **head, char *key );
     86G_MODULE_EXPORT int set_getint( set_t **head, const char *key );
     87G_MODULE_EXPORT int set_getbool( set_t **head, const char *key );
    8888
    8989/* set_setstr() strdup()s the given value, so after using this function
    9090   you can free() it, if you want. */
    91 int set_setstr( set_t **head, char *key, char *value );
    92 int set_setint( set_t **head, char *key, int value );
    93 void set_del( set_t **head, char *key );
    94 int set_reset( set_t **head, char *key );
     91int set_setstr( set_t **head, const char *key, char *value );
     92int set_setint( set_t **head, const char *key, int value );
     93void set_del( set_t **head, const char *key );
     94int set_reset( set_t **head, const char *key );
    9595
    9696/* Two very useful generic evaluators. */
  • unix.c

    rc32f492 rfb020ac  
    4747       
    4848        log_init();
     49       
    4950        global.conf_file = g_strdup( CONF_FILE_DEF );
    5051        global.conf = conf_load( argc, argv );
     
    5354       
    5455        b_main_init();
    55         nogaim_init();
    5656       
    5757        srand( time( NULL ) ^ getpid() );
     58       
    5859        global.helpfile = g_strdup( HELP_FILE );
     60        if( help_init( &global.help, global.helpfile ) == NULL )
     61                log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );
     62
     63        global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );
     64        if( global.storage == NULL )
     65        {
     66                log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage );
     67                return( 1 );
     68        }
    5969       
    6070        if( global.conf->runmode == RUNMODE_INETD )
     
    104114                        setuid( pw->pw_uid );
    105115                }
    106         }
    107 
    108         global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );
    109         if( global.storage == NULL )
    110         {
    111                 log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage );
    112                 return( 1 );
    113116        }
    114117       
     
    130133        if( !getuid() || !geteuid() )
    131134                log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" );
    132         if( help_init( &global.help, global.helpfile ) == NULL )
    133                 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );
    134135       
    135136        b_main_run();
Note: See TracChangeset for help on using the changeset viewer.