Changes in / [fd03770:9b63df6]
- Files:
-
- 22 added
- 30 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rfd03770 r9b63df6 10 10 11 11 # Program variables 12 objects = account.o bitlbee.o conf.o crypting.o help.o i pc.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.o12 objects = 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 13 13 headers = 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) 14 subdirs = protocols 17 15 18 16 # Expansion of variables -
account.c
rfd03770 r9b63df6 35 35 { 36 36 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 ); 38 38 } 39 39 else … … 45 45 a->user = g_strdup( user ); 46 46 a->pass = g_strdup( pass ); 47 a->auto_connect = 1;48 47 a->irc = irc; 49 48 -
account.h
rfd03770 r9b63df6 34 34 char *server; 35 35 36 int auto_connect;37 36 int reconnect; 38 37 -
bitlbee.c
rfd03770 r9b63df6 291 291 irc_t *irc; 292 292 293 /* Since we're fork()ing here, let's make sure we won't294 get the same random numbers as the parent/siblings. */295 srand( time( NULL ) ^ getpid() );296 297 293 /* Close the listening socket, we're a client. */ 298 294 close( global.listen_socket ); -
bitlbee.h
rfd03770 r9b63df6 130 130 #include "query.h" 131 131 #include "sock.h" 132 #include " misc.h"132 #include "util.h" 133 133 #include "proxy.h" 134 134 -
conf.c
rfd03770 r9b63df6 34 34 #include "ipc.h" 35 35 36 #include "pro xy.h"36 #include "protocols/proxy.h" 37 37 38 38 char *CONF_FILE; … … 55 55 conf->nofork = 0; 56 56 conf->verbose = 0; 57 conf->primary_storage = "xml"; 58 conf->migrate_storage = g_strsplit( "text", ",", -1 ); 57 conf->primary_storage = "text"; 59 58 conf->runmode = RUNMODE_INETD; 60 59 conf->authmode = AUTHMODE_OPEN; -
configure
rfd03770 r9b63df6 31 31 32 32 events=glib 33 ldap=auto34 33 ssl=auto 35 34 … … 67 66 68 67 --ipv6=0/1 IPv6 socket support $ipv6 69 70 --ldap=0/1/auto LDAP support $ldap71 68 72 69 --events=... Event handler (glib, libevent) $events … … 144 141 fi 145 142 146 echo CFLAGS+=-I`pwd` -I`pwd`/ lib -I`pwd`/protocols -I. >> Makefile.settings143 echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings 147 144 148 145 echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings 149 146 150 147 if [ -n "$CC" ]; then 151 CC=$CC148 echo "CC=$CC" >> Makefile.settings; 152 149 elif type gcc > /dev/null 2> /dev/null; then 153 CC=gcc150 echo "CC=gcc" >> Makefile.settings; 154 151 elif type cc > /dev/null 2> /dev/null; then 155 CC=cc152 echo "CC=cc" >> Makefile.settings; 156 153 else 157 154 echo 'Cannot find a C compiler, aborting.' 158 155 exit 1; 159 156 fi 160 161 echo "CC=$CC" >> Makefile.settings;162 157 163 158 if [ -n "$LD" ]; then … … 207 202 echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings 208 203 209 if [ "$events" = "libevent" ]; then210 if ! [ -e "${libevent}include/event.h" ]; then211 echo212 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 fi216 217 echo '#define EVENTS_LIBEVENT' >> config.h218 cat <<EOF>>Makefile.settings219 EFLAGS+=-levent -L${libevent}lib220 CFLAGS+=-I${libevent}include221 EOF222 elif [ "$events" = "glib" ]; then223 ## 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.h225 else226 echo227 echo 'ERROR: Unknown event handler specified.'228 exit 1229 fi230 echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings231 232 204 detect_gnutls() 233 205 { … … 258 230 ret=0; 259 231 fi; 260 }261 262 detect_ldap()263 {264 TMPFILE=`mktemp`265 if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then266 cat<<EOF>>Makefile.settings267 EFLAGS+=-lldap268 CFLAGS+=269 EOF270 ldap=1271 rm -f $TMPFILE272 ret=1273 else274 ldap=0275 ret=0276 fi277 232 } 278 233 … … 337 292 fi 338 293 339 if [ "$ldap" = "auto" ]; then340 detect_ldap341 fi342 343 if [ "$ldap" = 0 ]; then344 echo "LDAP_OBJ=" >> Makefile.settings345 echo "#undef WITH_LDAP" >> config.h346 elif [ "$ldap" = 1 ]; then347 echo "#define WITH_LDAP 1" >> config.h348 echo "LDAP_OBJ=storage_ldap.o" >> Makefile.settings349 fi350 351 294 if [ "$strip" = 0 ]; then 352 295 echo "STRIP=\# skip strip" >> Makefile.settings; … … 501 444 echo ' Building without IM-protocol support. We wish you a lot of fun...'; 502 445 fi 503 504 if [ "$ldap" = "0" ]; then505 echo " LDAP storage backend disabled."506 else507 echo " LDAP storage backend enabled."508 fi -
irc.c
rfd03770 r9b63df6 33 33 GSList *irc_connection_list = NULL; 34 34 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; 35 static char *passchange (irc_t *irc, void *set, char *value) 36 { 37 irc_setpass (irc, value); 38 return (NULL); 40 39 } 41 40 … … 330 329 void irc_setpass (irc_t *irc, const char *pass) 331 330 { 332 g_free (irc->password);331 if (irc->password) g_free (irc->password); 333 332 334 333 if (pass) { 335 334 irc->password = g_strdup (pass); 335 irc_usermsg (irc, "Password successfully changed"); 336 336 } else { 337 337 irc->password = NULL; -
protocols/Makefile
rfd03770 r9b63df6 10 10 11 11 # [SH] Program variables 12 objects = nogaim.o12 objects = $(EVENT_HANDLER) http_client.o md5.o nogaim.o proxy.o sha.o $(SSL_CLIENT) 13 13 14 14 # [SH] The next two lines should contain the directory name (in $(subdirs)) -
protocols/nogaim.c
rfd03770 r9b63df6 297 297 b_event_remove( gc->keepalive ); 298 298 gc->flags |= OPT_LOGGING_OUT; 299 300 299 gc->keepalive = 0; 301 300 gc->prpl->close( gc ); -
protocols/yahoo/libyahoo2.c
rfd03770 r9b63df6 89 89 #define vsnprintf _vsnprintf 90 90 #endif 91 92 #include "base64.h"93 91 94 92 #ifdef USE_STRUCT_CALLBACKS … … 697 695 } 698 696 697 static char base64digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 698 "abcdefghijklmnopqrstuvwxyz" 699 "0123456789._"; 700 static void to_y64(unsigned char *out, const unsigned char *in, int inlen) 699 701 /* 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'; 703 725 } 704 726 -
root_commands.c
rfd03770 r9b63df6 139 139 break; 140 140 case STORAGE_OK: 141 irc_usermsg( irc, "Password accepted , settings and accounts loaded" );141 irc_usermsg( irc, "Password accepted" ); 142 142 irc_umode_set( irc, "+R", 1 ); 143 143 break; 144 case STORAGE_OTHER_ERROR:145 144 default: 146 irc_usermsg( irc, " Unknown error while loading configuration" );145 irc_usermsg( irc, "Something very weird happened" ); 147 146 break; 148 147 } … … 307 306 308 307 for( a = irc->accounts; a; a = a->next ) 309 if( !a->gc && a->auto_connect)308 if( !a->gc ) 310 309 account_on( irc, a ); 311 310 } -
storage.c
rfd03770 r9b63df6 6 6 7 7 /* Support for multiple storage backends */ 8 9 /* Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org> */10 8 11 9 /* … … 31 29 32 30 extern storage_t storage_text; 33 extern storage_t storage_xml;34 31 35 static GList *storage_backends = NULL; 32 static GList text_entry = { &storage_text, NULL, NULL }; 33 static GList *storage_backends = &text_entry; 36 34 37 35 void register_storage_backend(storage_t *backend) … … 65 63 int i; 66 64 storage_t *storage; 67 68 register_storage_backend(&storage_text); 69 register_storage_backend(&storage_xml); 70 65 71 66 storage = storage_init_single(primary); 72 67 if (storage == NULL) -
storage.h
rfd03770 r9b63df6 33 33 STORAGE_ALREADY_EXISTS, 34 34 STORAGE_OTHER_ERROR /* Error that isn't caused by user input, such as 35 36 35 a database that is unreachable. log() will be 36 used for the exact error message */ 37 37 } storage_status_t; 38 38 -
unix.c
rfd03770 r9b63df6 48 48 49 49 b_main_init(); 50 50 51 log_init(); 52 51 53 nogaim_init(); 52 53 srand( time( NULL ) ^ getpid() ); 54 54 55 55 CONF_FILE = g_strdup( CONF_FILE_DEF ); 56 56 57 global.helpfile = g_strdup( HELP_FILE ); 57 58 58 59 global.conf = conf_load( argc, argv ); 59 60 if( global.conf == NULL ) 60 61 return( 1 ); 61 62 63 62 64 if( global.conf->runmode == RUNMODE_INETD ) 63 65 { … … 87 89 if( i != 0 ) 88 90 return( i ); 89 91 90 92 global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage ); 91 93 if ( global.storage == NULL) {
Note: See TracChangeset
for help on using the changeset viewer.