Changes in / [fd03770:9b63df6]


Ignore:
Files:
22 added
30 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rfd03770 r9b63df6  
    1010
    1111# Program variables
    12 objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_text.o storage_xml.o unix.o user.o
     12objects = account.o bitlbee.o conf.o crypting.o help.o ini.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_text.o unix.o url.o user.o util.o
    1313headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ini.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h url.h user.h protocols/http_client.h protocols/md5.h protocols/nogaim.h protocols/proxy.h protocols/sha.h protocols/ssl_client.h
    14 subdirs = protocols lib
    15 
    16 objects += $(LDAP_OBJ)
     14subdirs = protocols
    1715
    1816# Expansion of variables
  • account.c

    rfd03770 r9b63df6  
    3535        {
    3636                for( a = irc->accounts; a->next; a = a->next );
    37                 a = a->next = g_new0( account_t, 1 );
     37                a = a->next = g_new0 ( account_t, 1 );
    3838        }
    3939        else
     
    4545        a->user = g_strdup( user );
    4646        a->pass = g_strdup( pass );
    47         a->auto_connect = 1;
    4847        a->irc = irc;
    4948       
  • account.h

    rfd03770 r9b63df6  
    3434        char *server;
    3535       
    36         int auto_connect;
    3736        int reconnect;
    3837       
  • bitlbee.c

    rfd03770 r9b63df6  
    291291                        irc_t *irc;
    292292                       
    293                         /* Since we're fork()ing here, let's make sure we won't
    294                            get the same random numbers as the parent/siblings. */
    295                         srand( time( NULL ) ^ getpid() );
    296                        
    297293                        /* Close the listening socket, we're a client. */
    298294                        close( global.listen_socket );
  • bitlbee.h

    rfd03770 r9b63df6  
    130130#include "query.h"
    131131#include "sock.h"
    132 #include "misc.h"
     132#include "util.h"
    133133#include "proxy.h"
    134134
  • conf.c

    rfd03770 r9b63df6  
    3434#include "ipc.h"
    3535
    36 #include "proxy.h"
     36#include "protocols/proxy.h"
    3737
    3838char *CONF_FILE;
     
    5555        conf->nofork = 0;
    5656        conf->verbose = 0;
    57         conf->primary_storage = "xml";
    58         conf->migrate_storage = g_strsplit( "text", ",", -1 );
     57        conf->primary_storage = "text";
    5958        conf->runmode = RUNMODE_INETD;
    6059        conf->authmode = AUTHMODE_OPEN;
  • configure

    rfd03770 r9b63df6  
    3131
    3232events=glib
    33 ldap=auto
    3433ssl=auto
    3534
     
    6766
    6867--ipv6=0/1      IPv6 socket support                     $ipv6
    69 
    70 --ldap=0/1/auto LDAP support                            $ldap
    7168
    7269--events=...    Event handler (glib, libevent)          $events
     
    144141fi
    145142
    146 echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings
     143echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings
    147144
    148145echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
    149146
    150147if [ -n "$CC" ]; then
    151         CC=$CC
     148        echo "CC=$CC" >> Makefile.settings;
    152149elif type gcc > /dev/null 2> /dev/null; then
    153         CC=gcc
     150        echo "CC=gcc" >> Makefile.settings;
    154151elif type cc > /dev/null 2> /dev/null; then
    155         CC=cc
     152        echo "CC=cc" >> Makefile.settings;
    156153else
    157154        echo 'Cannot find a C compiler, aborting.'
    158155        exit 1;
    159156fi
    160 
    161 echo "CC=$CC" >> Makefile.settings;
    162157
    163158if [ -n "$LD" ]; then
     
    207202echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
    208203
    209 if [ "$events" = "libevent" ]; then
    210         if ! [ -e "${libevent}include/event.h" ]; then
    211                 echo
    212                 echo 'Warning: Could not find event.h, you might have to install it and/or specify'
    213                 echo 'its location using the --libevent= argument. (Example: If event.h is in'
    214                 echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)'
    215         fi
    216        
    217         echo '#define EVENTS_LIBEVENT' >> config.h
    218         cat <<EOF>>Makefile.settings
    219 EFLAGS+=-levent -L${libevent}lib
    220 CFLAGS+=-I${libevent}include
    221 EOF
    222 elif [ "$events" = "glib" ]; then
    223         ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...):
    224         echo '#define EVENTS_GLIB' >> config.h
    225 else
    226         echo
    227         echo 'ERROR: Unknown event handler specified.'
    228         exit 1
    229 fi
    230 echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
    231 
    232204detect_gnutls()
    233205{
     
    258230                ret=0;
    259231        fi;
    260 }
    261 
    262 detect_ldap()
    263 {
    264         TMPFILE=`mktemp`
    265         if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
    266                 cat<<EOF>>Makefile.settings
    267 EFLAGS+=-lldap
    268 CFLAGS+=
    269 EOF
    270                 ldap=1
    271                 rm -f $TMPFILE
    272                 ret=1
    273         else
    274                 ldap=0
    275                 ret=0
    276         fi
    277232}
    278233
     
    337292fi
    338293
    339 if [ "$ldap" = "auto" ]; then
    340         detect_ldap
    341 fi
    342 
    343 if [ "$ldap" = 0 ]; then
    344         echo "LDAP_OBJ=" >> Makefile.settings
    345         echo "#undef WITH_LDAP" >> config.h
    346 elif [ "$ldap" = 1 ]; then
    347         echo "#define WITH_LDAP 1" >> config.h
    348         echo "LDAP_OBJ=storage_ldap.o" >> Makefile.settings
    349 fi
    350 
    351294if [ "$strip" = 0 ]; then
    352295        echo "STRIP=\# skip strip" >> Makefile.settings;
     
    501444        echo '  Building without IM-protocol support. We wish you a lot of fun...';
    502445fi
    503 
    504 if [ "$ldap" = "0" ]; then
    505         echo "  LDAP storage backend disabled."
    506 else
    507         echo "  LDAP storage backend enabled."
    508 fi
  • irc.c

    rfd03770 r9b63df6  
    3333GSList *irc_connection_list = NULL;
    3434
    35 static char *passchange( irc_t *irc, void *set, char *value )
    36 {
    37         irc_setpass( irc, value );
    38         irc_usermsg( irc, "Password successfully changed" );
    39         return NULL;
     35static char *passchange (irc_t *irc, void *set, char *value)
     36{
     37        irc_setpass (irc, value);
     38        return (NULL);
    4039}
    4140
     
    330329void irc_setpass (irc_t *irc, const char *pass)
    331330{
    332         g_free (irc->password);
     331        if (irc->password) g_free (irc->password);
    333332       
    334333        if (pass) {
    335334                irc->password = g_strdup (pass);
     335                irc_usermsg (irc, "Password successfully changed");
    336336        } else {
    337337                irc->password = NULL;
  • protocols/Makefile

    rfd03770 r9b63df6  
    1010
    1111# [SH] Program variables
    12 objects = nogaim.o
     12objects = $(EVENT_HANDLER) http_client.o md5.o nogaim.o proxy.o sha.o $(SSL_CLIENT)
    1313
    1414# [SH] The next two lines should contain the directory name (in $(subdirs))
  • protocols/nogaim.c

    rfd03770 r9b63df6  
    297297        b_event_remove( gc->keepalive );
    298298        gc->flags |= OPT_LOGGING_OUT;
    299        
    300299        gc->keepalive = 0;
    301300        gc->prpl->close( gc );
  • protocols/yahoo/libyahoo2.c

    rfd03770 r9b63df6  
    8989#define vsnprintf _vsnprintf
    9090#endif
    91 
    92 #include "base64.h"
    9391
    9492#ifdef USE_STRUCT_CALLBACKS
     
    697695}
    698696
     697static char base64digits[] =    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
     698                                "abcdefghijklmnopqrstuvwxyz"
     699                                "0123456789._";
     700static void to_y64(unsigned char *out, const unsigned char *in, int inlen)
    699701/* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
    700 static void to_y64(unsigned char *out, const unsigned char *in, int inlen)
    701 {
    702         base64_encode_real(in, inlen, out, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-");
     702{
     703        for (; inlen >= 3; inlen -= 3)
     704                {
     705                        *out++ = base64digits[in[0] >> 2];
     706                        *out++ = base64digits[((in[0]<<4) & 0x30) | (in[1]>>4)];
     707                        *out++ = base64digits[((in[1]<<2) & 0x3c) | (in[2]>>6)];
     708                        *out++ = base64digits[in[2] & 0x3f];
     709                        in += 3;
     710                }
     711        if (inlen > 0)
     712                {
     713                        unsigned char fragment;
     714
     715                        *out++ = base64digits[in[0] >> 2];
     716                        fragment = (in[0] << 4) & 0x30;
     717                        if (inlen > 1)
     718                                fragment |= in[1] >> 4;
     719                        *out++ = base64digits[fragment];
     720                        *out++ = (inlen < 2) ? '-'
     721                                        : base64digits[(in[1] << 2) & 0x3c];
     722                        *out++ = '-';
     723                }
     724        *out = '\0';
    703725}
    704726
  • root_commands.c

    rfd03770 r9b63df6  
    139139                break;
    140140        case STORAGE_OK:
    141                 irc_usermsg( irc, "Password accepted, settings and accounts loaded" );
     141                irc_usermsg( irc, "Password accepted" );
    142142                irc_umode_set( irc, "+R", 1 );
    143143                break;
    144         case STORAGE_OTHER_ERROR:
    145144        default:
    146                 irc_usermsg( irc, "Unknown error while loading configuration" );
     145                irc_usermsg( irc, "Something very weird happened" );
    147146                break;
    148147        }
     
    307306                       
    308307                                for( a = irc->accounts; a; a = a->next )
    309                                         if( !a->gc && a->auto_connect )
     308                                        if( !a->gc )
    310309                                                account_on( irc, a );
    311310                        }
  • storage.c

    rfd03770 r9b63df6  
    66
    77/* Support for multiple storage backends */
    8 
    9 /* Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org> */
    108
    119/*
     
    3129
    3230extern storage_t storage_text;
    33 extern storage_t storage_xml;
    3431
    35 static GList *storage_backends = NULL;
     32static GList text_entry = { &storage_text, NULL, NULL };
     33static GList *storage_backends = &text_entry;
    3634
    3735void register_storage_backend(storage_t *backend)
     
    6563        int i;
    6664        storage_t *storage;
    67        
    68         register_storage_backend(&storage_text);
    69         register_storage_backend(&storage_xml);
    70        
     65
    7166        storage = storage_init_single(primary);
    7267        if (storage == NULL)
  • storage.h

    rfd03770 r9b63df6  
    3333        STORAGE_ALREADY_EXISTS,
    3434        STORAGE_OTHER_ERROR /* Error that isn't caused by user input, such as
    35                                a database that is unreachable. log() will be
    36                                used for the exact error message */
     35                                                   a database that is unreachable. log() will be
     36                                                   used for the exact error message */
    3737} storage_status_t;
    3838
  • unix.c

    rfd03770 r9b63df6  
    4848       
    4949        b_main_init();
     50       
    5051        log_init();
     52
    5153        nogaim_init();
    52        
    53         srand( time( NULL ) ^ getpid() );
    54        
     54
    5555        CONF_FILE = g_strdup( CONF_FILE_DEF );
     56       
    5657        global.helpfile = g_strdup( HELP_FILE );
    57        
     58
    5859        global.conf = conf_load( argc, argv );
    5960        if( global.conf == NULL )
    6061                return( 1 );
    61        
     62
     63
    6264        if( global.conf->runmode == RUNMODE_INETD )
    6365        {
     
    8789        if( i != 0 )
    8890                return( i );
    89        
     91
    9092        global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );
    9193        if ( global.storage == NULL) {
Note: See TracChangeset for help on using the changeset viewer.