Changes in / [c7d0f41:0fd8559]
- Files:
-
- 3 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
rc7d0f41 r0fd8559 13 13 .gdb_history 14 14 tests/check 15 *.gcda 16 *.gcov 17 *.gcno 18 *.o -
Makefile
rc7d0f41 r0fd8559 40 40 clean: $(subdirs) 41 41 rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode 42 $(MAKE) -C tests clean 42 43 43 44 distclean: clean $(subdirs) 44 45 rm -f Makefile.settings config.h bitlbee.pc 45 46 find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \; 47 $(MAKE) -C test distclean 46 48 47 check: 49 check: all 48 50 $(MAKE) -C tests 51 52 gcov: check 53 gcov *.c 49 54 50 55 install-doc: -
bitlbee.c
rc7d0f41 r0fd8559 69 69 70 70 #ifdef IPV6 71 memset( &listen_addr6, 0, sizeof( listen_addr6 ) ); 71 72 listen_addr6.sin6_family = AF_INET6; 72 73 listen_addr6.sin6_port = htons( global.conf->port ); … … 76 77 use_ipv6 = 0; 77 78 #endif 79 memset( &listen_addr, 0, sizeof( listen_addr ) ); 78 80 listen_addr.sin_family = AF_INET; 79 81 listen_addr.sin_port = htons( global.conf->port ); -
conf.c
rc7d0f41 r0fd8559 63 63 conf->configdir = g_strdup( CONFIG ); 64 64 conf->plugindir = g_strdup( PLUGINDIR ); 65 conf->pidfile = g_strdup( "/var/run/bitlbee.pid");65 conf->pidfile = g_strdup( PIDFILE ); 66 66 conf->motdfile = g_strdup( ETCDIR "/motd.txt" ); 67 67 conf->ping_interval = 180; -
configure
rc7d0f41 r0fd8559 18 18 libevent='/usr/' 19 19 pidfile='/var/run/bitlbee.pid' 20 ipcsocket='/var/run/bitlbee '20 ipcsocket='/var/run/bitlbee.sock' 21 21 pcdir='$prefix/lib/pkgconfig' 22 22 … … 28 28 debug=0 29 29 strip=1 30 gcov=0 30 31 ipv6=1 31 32 … … 67 68 --debug=0/1 Disable/enable debugging $debug 68 69 --strip=0/1 Disable/enable binary stripping $strip 70 --gcov=0/1 Disable/enable test coverage reporting $gcov 69 71 70 72 --ipv6=0/1 IPv6 socket support $ipv6 … … 105 107 PLUGINDIR=$plugindir 106 108 CONFIG=$config 107 IPCSOCKET=$ipcsocket108 109 INCLUDEDIR=$includedir 109 110 PCDIR=$pcdir … … 345 346 echo "#undef WITH_LDAP" >> config.h 346 347 elif [ "$ldap" = 1 ]; then 348 echo 349 echo 'LDAP support is a work in progress and does NOT work AT ALL right now.' 350 echo 351 exit 1 352 347 353 echo "#define WITH_LDAP 1" >> config.h 348 354 STORAGES="$STORAGES ldap" … … 374 380 fi 375 381 382 if [ "$gcov" = "1" ]; then 383 echo "CFLAGS+=-ftest-coverage -fprofile-arcs" >> Makefile.settings 384 echo "EFLAGS+=-lgcov" >> Makefile.settings 385 fi 386 376 387 echo 377 388 if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then … … 466 477 echo 'STRIP=\# skip strip' >> Makefile.settings 467 478 ;; 479 AIX ) 480 echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings 481 ;; 468 482 CYGWIN* ) 469 483 echo 'Cygwin is not officially supported.' -
doc/user-guide/docbook.xsl
rc7d0f41 r0fd8559 83 83 84 84 <xsl:template name="cmd"> 85 <xsl:param name="prefix"/> 85 86 <xsl:variable name="thiscmd"><xsl:value-of select="$prefix"/><xsl:value-of select="@name"/></xsl:variable> 86 87 <xsl:attribute name="id"> -
doc/user-guide/help.xsl
rc7d0f41 r0fd8559 31 31 32 32 <xsl:template name="subject"> 33 <xsl:param name="id"/> 33 34 <xsl:message><xsl:text>Processing: </xsl:text><xsl:value-of select="$id"/></xsl:message> 34 35 <xsl:text>?</xsl:text><xsl:value-of select="$id"/><xsl:text> </xsl:text> … … 122 123 123 124 <xsl:template name="cmd"> 125 <xsl:param name="prefix"/> 124 126 <xsl:variable name="thiscmd"><xsl:value-of select="$prefix"/><xsl:value-of select="@name"/></xsl:variable> 125 127 <xsl:message><xsl:text>Processing command '</xsl:text><xsl:value-of select="$thiscmd"/><xsl:text>'</xsl:text></xsl:message> -
ipc.c
rc7d0f41 r0fd8559 99 99 { "die", 0, ipc_master_cmd_die, 0 }, 100 100 { "wallops", 1, NULL, IPC_CMD_TO_CHILDREN }, 101 { " lilo", 1, NULL, IPC_CMD_TO_CHILDREN },101 { "wall", 1, NULL, IPC_CMD_TO_CHILDREN }, 102 102 { "opermsg", 1, NULL, IPC_CMD_TO_CHILDREN }, 103 103 { "rehash", 0, ipc_master_cmd_rehash, 0 }, … … 122 122 } 123 123 124 static void ipc_child_cmd_ lilo( irc_t *irc, char **cmd )124 static void ipc_child_cmd_wall( irc_t *irc, char **cmd ) 125 125 { 126 126 if( !( irc->status & USTATUS_LOGGED_IN ) ) … … 175 175 { "die", 0, ipc_child_cmd_die, 0 }, 176 176 { "wallops", 1, ipc_child_cmd_wallops, 0 }, 177 { " lilo", 1, ipc_child_cmd_lilo, 0 },177 { "wall", 1, ipc_child_cmd_wall, 0 }, 178 178 { "opermsg", 1, ipc_child_cmd_opermsg, 0 }, 179 179 { "rehash", 0, ipc_child_cmd_rehash, 0 }, -
irc.c
rc7d0f41 r0fd8559 256 256 257 257 while (irc->accounts) 258 account_del(irc, irc->accounts); 258 if (irc->accounts->gc == NULL) 259 account_del(irc, irc->accounts); 260 else 261 /* Nasty hack, but account_del() doesn't work in this 262 case and we don't want infinite loops, do we? ;-) */ 263 irc->accounts = irc->accounts->next; 259 264 260 265 while (irc->set) … … 585 590 the queue. If it's FALSE, we emptied the buffer and saved ourselves some work 586 591 in the event queue. */ 587 if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) ) 588 irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc ); 592 /* Really can't be done as long as the code doesn't do error checking very well: 593 if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) ) */ 594 595 /* So just always do it via the event handler. */ 596 irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc ); 589 597 } 590 598 -
irc_commands.c
rc7d0f41 r0fd8559 593 593 { "die", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER }, 594 594 { "wallops", 1, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER }, 595 { " lilo", 1, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },595 { "wall", 1, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER }, 596 596 { "rehash", 0, irc_cmd_rehash, IRC_CMD_OPER_ONLY }, 597 597 { "restart", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER }, -
lib/Makefile
rc7d0f41 r0fd8559 17 17 # [SH] Phony targets 18 18 all: lib.o 19 check: all 20 gcov: 21 gcov *.c 19 22 20 23 .PHONY: all clean distclean -
protocols/Makefile
rc7d0f41 r0fd8559 26 26 # [SH] Phony targets 27 27 all: protocols.o 28 check: all 29 gcov: 30 gcov *.c 28 31 29 32 .PHONY: all clean distclean $(subdirs) -
protocols/jabber/Makefile
rc7d0f41 r0fd8559 17 17 # [SH] Phony targets 18 18 all: jabber_mod.o 19 check: all 20 gcov: 21 gcov *.c 19 22 20 23 .PHONY: all clean distclean -
protocols/msn/Makefile
rc7d0f41 r0fd8559 17 17 # [SH] Phony targets 18 18 all: msn_mod.o 19 check: all 20 gcov: 21 gcov *.c 19 22 20 23 .PHONY: all clean distclean -
protocols/msn/sb.c
rc7d0f41 r0fd8559 122 122 if( sb->ready ) 123 123 { 124 char cmd[1024], *buf;124 char *packet, *buf; 125 125 int i, j; 126 126 127 /* Build the message. Convert LF to CR-LF for normal messages. */ 127 128 if( strcmp( text, TYPING_NOTIFICATION_MESSAGE ) != 0 ) 128 129 { … … 142 143 { 143 144 i = strlen( MSN_TYPING_HEADERS ) + strlen( sb->gc->username ); 144 buf = g_new0( char, strlen( MSN_TYPING_HEADERS ) + strlen( sb->gc->username ));145 buf = g_new0( char, i ); 145 146 i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->gc->username ); 146 147 } 147 148 148 g_snprintf( cmd, sizeof( cmd ), "MSG %d N %d\r\n", ++sb->trId, i ); 149 if( msn_sb_write( sb, cmd, strlen( cmd ) ) && msn_sb_write( sb, buf, i ) ) 150 { 151 g_free( buf ); 149 /* Build the final packet (MSG command + the message). */ 150 packet = g_strdup_printf( "MSG %d N %d\r\n%s", ++sb->trId, i, buf ); 151 g_free( buf ); 152 if( msn_sb_write( sb, packet, strlen( packet ) ) ) 153 { 154 g_free( packet ); 152 155 return( 1 ); 153 156 } 154 157 else 155 158 { 156 g_free( buf);159 g_free( packet ); 157 160 return( 0 ); 158 161 } -
protocols/oscar/Makefile
rc7d0f41 r0fd8559 17 17 # [SH] Phony targets 18 18 all: oscar_mod.o 19 check: all 20 gcov: 21 gcov *.c 19 22 20 23 .PHONY: all clean distclean -
protocols/yahoo/Makefile
rc7d0f41 r0fd8559 17 17 # [SH] Phony targets 18 18 all: yahoo_mod.o 19 check: all 20 gcov: 21 gcov *.c 19 22 20 23 .PHONY: all clean distclean -
storage_xml.c
rc7d0f41 r0fd8559 395 395 396 396 strcat( path, "~" ); 397 if( ( fd = open( path, O_WRONLY | O_CREAT , 0600 ) ) < 0 )397 if( ( fd = open( path, O_WRONLY | O_CREAT | O_TRUNC, 0600 ) ) < 0 ) 398 398 { 399 399 irc_usermsg( irc, "Error while opening configuration file." ); -
tests/Makefile
rc7d0f41 r0fd8559 3 3 LFLAGS +=-lcheck 4 4 5 all: check 6 ./check 5 all: check 6 ./check $(CHECKFLAGS) 7 7 8 main_objs = 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 url.o user.o util.o 8 clean: 9 rm -f check *.o 9 10 10 check: check.o check_util.o check_nick.o $(addprefix ../, $(main_objs)) ../protocols/protocols.o 11 main_objs = 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_xml.o storage_text.o user.o 12 13 test_objs = check.o check_util.o check_nick.o check_md5.o check_irc.o 14 15 check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o 11 16 @echo '*' Linking $@ 12 17 @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS) -
tests/check.c
rc7d0f41 r0fd8559 4 4 #include <check.h> 5 5 #include "bitlbee.h" 6 #include "testsuite.h" 6 7 7 8 global_t global; /* Against global namespace pollution */ 9 10 gboolean g_io_channel_pair(GIOChannel **ch1, GIOChannel **ch2) 11 { 12 int sock[2]; 13 if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, sock) < 0) { 14 perror("socketpair"); 15 return FALSE; 16 } 17 18 *ch1 = g_io_channel_unix_new(sock[0]); 19 *ch2 = g_io_channel_unix_new(sock[1]); 20 return TRUE; 21 } 8 22 9 23 double gettime() … … 21 35 Suite *nick_suite(void); 22 36 23 int main (void) 37 /* From check_md5.c */ 38 Suite *md5_suite(void); 39 40 /* From check_irc.c */ 41 Suite *irc_suite(void); 42 43 int main (int argc, char **argv) 24 44 { 25 45 int nf; 26 SRunner *sr = srunner_create(util_suite()); 46 SRunner *sr; 47 GOptionContext *pc; 48 gboolean no_fork = FALSE; 49 gboolean verbose = FALSE; 50 GOptionEntry options[] = { 51 {"no-fork", 'n', 0, G_OPTION_ARG_NONE, &no_fork, "Don't fork" }, 52 {"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL }, 53 { NULL } 54 }; 55 int i; 56 57 pc = g_option_context_new(""); 58 g_option_context_add_main_entries(pc, options, NULL); 59 60 if(!g_option_context_parse(pc, &argc, &argv, NULL)) 61 return 1; 62 63 g_option_context_free(pc); 64 65 log_init(); 66 67 if (verbose) { 68 log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE ); 69 log_link( LOGLVL_DEBUG, LOGOUTPUT_CONSOLE ); 70 log_link( LOGLVL_INFO, LOGOUTPUT_CONSOLE ); 71 log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE ); 72 } 73 74 global.conf = conf_load( 0, NULL); 75 global.conf->runmode = RUNMODE_DAEMON; 76 77 sr = srunner_create(util_suite()); 27 78 srunner_add_suite(sr, nick_suite()); 28 srunner_run_all (sr, CK_NORMAL); 79 srunner_add_suite(sr, md5_suite()); 80 srunner_add_suite(sr, irc_suite()); 81 if (no_fork) 82 srunner_set_fork_status(sr, CK_NOFORK); 83 srunner_run_all (sr, verbose?CK_VERBOSE:CK_NORMAL); 29 84 nf = srunner_ntests_failed(sr); 30 85 srunner_free(sr); -
tests/check_nick.c
rc7d0f41 r0fd8559 6 6 #include "irc.h" 7 7 #include "set.h" 8 #include " util.h"8 #include "misc.h" 9 9 10 10 START_TEST(test_nick_strip) … … 23 23 24 24 for (i = 0; get[i]; i++) { 25 char copy[ 30];25 char copy[60]; 26 26 strcpy(copy, get[i]); 27 27 nick_strip(copy); -
tests/check_util.c
rc7d0f41 r0fd8559 6 6 #include "irc.h" 7 7 #include "set.h" 8 #include " util.h"8 #include "misc.h" 9 9 10 10 START_TEST(test_strip_linefeed)
Note: See TracChangeset
for help on using the changeset viewer.