Changes in / [9b63df6:fd03770]
- Files:
-
- 30 added
- 22 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r9b63df6 rfd03770 10 10 11 11 # Program variables 12 objects = account.o bitlbee.o conf.o crypting.o help.o i ni.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.o12 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 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 14 subdirs = protocols lib 15 16 objects += $(LDAP_OBJ) 15 17 16 18 # Expansion of variables -
account.c
r9b63df6 rfd03770 35 35 { 36 36 for( a = irc->accounts; a->next; a = a->next ); 37 a = a->next = g_new0 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; 47 48 a->irc = irc; 48 49 -
account.h
r9b63df6 rfd03770 34 34 char *server; 35 35 36 int auto_connect; 36 37 int reconnect; 37 38 -
bitlbee.c
r9b63df6 rfd03770 291 291 irc_t *irc; 292 292 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 293 297 /* Close the listening socket, we're a client. */ 294 298 close( global.listen_socket ); -
bitlbee.h
r9b63df6 rfd03770 130 130 #include "query.h" 131 131 #include "sock.h" 132 #include " util.h"132 #include "misc.h" 133 133 #include "proxy.h" 134 134 -
conf.c
r9b63df6 rfd03770 34 34 #include "ipc.h" 35 35 36 #include "pro tocols/proxy.h"36 #include "proxy.h" 37 37 38 38 char *CONF_FILE; … … 55 55 conf->nofork = 0; 56 56 conf->verbose = 0; 57 conf->primary_storage = "text"; 57 conf->primary_storage = "xml"; 58 conf->migrate_storage = g_strsplit( "text", ",", -1 ); 58 59 conf->runmode = RUNMODE_INETD; 59 60 conf->authmode = AUTHMODE_OPEN; -
configure
r9b63df6 rfd03770 31 31 32 32 events=glib 33 ldap=auto 33 34 ssl=auto 34 35 … … 66 67 67 68 --ipv6=0/1 IPv6 socket support $ipv6 69 70 --ldap=0/1/auto LDAP support $ldap 68 71 69 72 --events=... Event handler (glib, libevent) $events … … 141 144 fi 142 145 143 echo CFLAGS+=-I`pwd` -I`pwd`/ protocols -I. >> Makefile.settings146 echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings 144 147 145 148 echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings 146 149 147 150 if [ -n "$CC" ]; then 148 echo "CC=$CC" >> Makefile.settings;151 CC=$CC 149 152 elif type gcc > /dev/null 2> /dev/null; then 150 echo "CC=gcc" >> Makefile.settings;153 CC=gcc 151 154 elif type cc > /dev/null 2> /dev/null; then 152 echo "CC=cc" >> Makefile.settings;155 CC=cc 153 156 else 154 157 echo 'Cannot find a C compiler, aborting.' 155 158 exit 1; 156 159 fi 160 161 echo "CC=$CC" >> Makefile.settings; 157 162 158 163 if [ -n "$LD" ]; then … … 202 207 echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings 203 208 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 204 232 detect_gnutls() 205 233 { … … 230 258 ret=0; 231 259 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 232 277 } 233 278 … … 292 337 fi 293 338 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 294 351 if [ "$strip" = 0 ]; then 295 352 echo "STRIP=\# skip strip" >> Makefile.settings; … … 444 501 echo ' Building without IM-protocol support. We wish you a lot of fun...'; 445 502 fi 503 504 if [ "$ldap" = "0" ]; then 505 echo " LDAP storage backend disabled." 506 else 507 echo " LDAP storage backend enabled." 508 fi -
irc.c
r9b63df6 rfd03770 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 return (NULL); 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; 39 40 } 40 41 … … 329 330 void irc_setpass (irc_t *irc, const char *pass) 330 331 { 331 if (irc->password)g_free (irc->password);332 g_free (irc->password); 332 333 333 334 if (pass) { 334 335 irc->password = g_strdup (pass); 335 irc_usermsg (irc, "Password successfully changed");336 336 } else { 337 337 irc->password = NULL; -
protocols/Makefile
r9b63df6 rfd03770 10 10 11 11 # [SH] Program variables 12 objects = $(EVENT_HANDLER) http_client.o md5.o nogaim.o proxy.o sha.o $(SSL_CLIENT)12 objects = nogaim.o 13 13 14 14 # [SH] The next two lines should contain the directory name (in $(subdirs)) -
protocols/nogaim.c
r9b63df6 rfd03770 297 297 b_event_remove( gc->keepalive ); 298 298 gc->flags |= OPT_LOGGING_OUT; 299 299 300 gc->keepalive = 0; 300 301 gc->prpl->close( gc ); -
protocols/yahoo/libyahoo2.c
r9b63df6 rfd03770 89 89 #define vsnprintf _vsnprintf 90 90 #endif 91 92 #include "base64.h" 91 93 92 94 #ifdef USE_STRUCT_CALLBACKS … … 695 697 } 696 698 697 static char base64digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 698 "abcdefghijklmnopqrstuvwxyz" 699 "0123456789._"; 699 /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */ 700 700 static void to_y64(unsigned char *out, const unsigned char *in, int inlen) 701 /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */ 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'; 701 { 702 base64_encode_real(in, inlen, out, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-"); 725 703 } 726 704 -
root_commands.c
r9b63df6 rfd03770 139 139 break; 140 140 case STORAGE_OK: 141 irc_usermsg( irc, "Password accepted " );141 irc_usermsg( irc, "Password accepted, settings and accounts loaded" ); 142 142 irc_umode_set( irc, "+R", 1 ); 143 143 break; 144 case STORAGE_OTHER_ERROR: 144 145 default: 145 irc_usermsg( irc, " Something very weird happened" );146 irc_usermsg( irc, "Unknown error while loading configuration" ); 146 147 break; 147 148 } … … 306 307 307 308 for( a = irc->accounts; a; a = a->next ) 308 if( !a->gc )309 if( !a->gc && a->auto_connect ) 309 310 account_on( irc, a ); 310 311 } -
storage.c
r9b63df6 rfd03770 6 6 7 7 /* Support for multiple storage backends */ 8 9 /* Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org> */ 8 10 9 11 /* … … 29 31 30 32 extern storage_t storage_text; 33 extern storage_t storage_xml; 31 34 32 static GList text_entry = { &storage_text, NULL, NULL }; 33 static GList *storage_backends = &text_entry; 35 static GList *storage_backends = NULL; 34 36 35 37 void register_storage_backend(storage_t *backend) … … 63 65 int i; 64 66 storage_t *storage; 65 67 68 register_storage_backend(&storage_text); 69 register_storage_backend(&storage_xml); 70 66 71 storage = storage_init_single(primary); 67 72 if (storage == NULL) -
storage.h
r9b63df6 rfd03770 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
r9b63df6 rfd03770 48 48 49 49 b_main_init(); 50 51 50 log_init(); 52 53 51 nogaim_init(); 54 52 53 srand( time( NULL ) ^ getpid() ); 54 55 55 CONF_FILE = g_strdup( CONF_FILE_DEF ); 56 57 56 global.helpfile = g_strdup( HELP_FILE ); 58 57 59 58 global.conf = conf_load( argc, argv ); 60 59 if( global.conf == NULL ) 61 60 return( 1 ); 62 63 61 64 62 if( global.conf->runmode == RUNMODE_INETD ) 65 63 { … … 89 87 if( i != 0 ) 90 88 return( i ); 91 89 92 90 global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage ); 93 91 if ( global.storage == NULL) {
Note: See TracChangeset
for help on using the changeset viewer.