Changeset 4aa0f6b
- Timestamp:
- 2010-06-07T14:31:07Z (14 years ago)
- Branches:
- master
- Children:
- 56699f0
- Parents:
- 0d9d53e (diff), 1fdb0a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 7 added
- 1 deleted
- 49 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r0d9d53e r4aa0f6b 10 10 11 11 # Program variables 12 #objects = chat.o13 12 objects = bitlbee.o dcc.o help.o ipc.o irc.o irc_im.o irc_channel.o irc_commands.o irc_send.o irc_user.o irc_util.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) 14 13 headers = account.h bitlbee.h commands.h conf.h config.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/ftutil.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/ft.h protocols/nogaim.h … … 83 82 install-dev: 84 83 mkdir -p $(DESTDIR)$(INCLUDEDIR) 85 install -m 0644 $(headers) $(DESTDIR)$(INCLUDEDIR) 84 install -m 0644 config.h $(DESTDIR)$(INCLUDEDIR) 85 for i in $(headers); do install -m 0644 $(SRCDIR)$$i $(DESTDIR)$(INCLUDEDIR); done 86 86 mkdir -p $(DESTDIR)$(PCDIR) 87 87 install -m 0644 bitlbee.pc $(DESTDIR)$(PCDIR) … … 94 94 install-etc: 95 95 mkdir -p $(DESTDIR)$(ETCDIR) 96 install -m 0644 motd.txt $(DESTDIR)$(ETCDIR)/motd.txt97 install -m 0644 bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf96 install -m 0644 $(SRCDIR)motd.txt $(DESTDIR)$(ETCDIR)/motd.txt 97 install -m 0644 $(SRCDIR)bitlbee.conf $(DESTDIR)$(ETCDIR)/bitlbee.conf 98 98 99 99 uninstall-etc: … … 111 111 @$(MAKE) -C $@ $(MAKECMDGOALS) 112 112 113 $(objects): %.o: %.c113 $(objects): %.o: $(SRCDIR)%.c 114 114 @echo '*' Compiling $< 115 115 @$(CC) -c $(CFLAGS) $< -o $@ -
bitlbee.c
r0d9d53e r4aa0f6b 121 121 } 122 122 123 global.listen_watch_source_id = b_input_add( global.listen_socket, GAIM_INPUT_READ, bitlbee_io_new_client, NULL );123 global.listen_watch_source_id = b_input_add( global.listen_socket, B_EV_IO_READ, bitlbee_io_new_client, NULL ); 124 124 125 125 #ifndef _WIN32 … … 321 321 child->pid = client_pid; 322 322 child->ipc_fd = fds[0]; 323 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );323 child->ipc_inpa = b_input_add( child->ipc_fd, B_EV_IO_READ, ipc_master_read, child ); 324 324 child_list = g_slist_append( child_list, child ); 325 325 … … 349 349 /* We can store the IPC fd there now. */ 350 350 global.listen_socket = fds[1]; 351 global.listen_watch_source_id = b_input_add( fds[1], GAIM_INPUT_READ, ipc_child_read, irc );351 global.listen_watch_source_id = b_input_add( fds[1], B_EV_IO_READ, ipc_child_read, irc ); 352 352 353 353 close( fds[0] ); -
bitlbee.h
r0d9d53e r4aa0f6b 43 43 44 44 #if HAVE_CONFIG_H 45 #include "config.h"45 #include <config.h> 46 46 #endif 47 47 -
configure
r0d9d53e r4aa0f6b 27 27 yahoo=1 28 28 twitter=1 29 twitter=1 30 purple=0 29 31 30 32 debug=0 … … 67 69 --oscar=0/1 Disable/enable Oscar part (ICQ, AIM) $oscar 68 70 --yahoo=0/1 Disable/enable Yahoo part $yahoo 69 --twitter=0/1 Disable/enable Twitter part $twitter 71 --twitter=0/1 Disable/enable Twitter part $twitter 72 73 --purple=0/1 Disable/enable libpurple support $purple 70 74 71 75 --debug=0/1 Disable/enable debugging $debug … … 121 125 EOF 122 126 127 srcdir="$(dirname $0)" 128 if [ "$srcdir" != "." ]; then 129 echo 130 echo "configure script run from a different directory. Will create some symlinks..." 131 if [ ! -e Makefile -o -L Makefile ]; then 132 COPYDIRS="doc lib protocols tests utils" 133 mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d) 134 find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null 135 dst="$PWD" 136 cd "$srcdir" 137 for i in $(find . -name Makefile -type f); do 138 ln -s "$PWD${i#.}" "$dst/$i"; 139 done 140 cd "$dst" 141 rm -rf .bzr 142 fi 143 144 echo "SRCDIR=$srcdir/" >> Makefile.settings 145 CFLAGS="$CFLAGS -I${dst}" 146 else 147 srcdir=$PWD 148 fi 149 123 150 cat<<EOF>config.h 124 151 /* BitlBee settings, generated by configure … … 158 185 159 186 echo CFLAGS=$CFLAGS >> Makefile.settings 160 echo CFLAGS+=-I `pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings187 echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings 161 188 162 189 echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings … … 508 535 protoobjs='' 509 536 537 if [ "$purple" = 0 ]; then 538 echo '#undef WITH_PURPLE' >> config.h 539 else 540 if ! $PKG_CONFIG purple; then 541 echo 542 echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)' 543 exit 1 544 fi 545 echo '#define WITH_PURPLE' >> config.h 546 cat<<EOF>>Makefile.settings 547 EFLAGS += $($PKG_CONFIG purple --libs) 548 PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags) 549 EOF 550 protocols=$protocols'purple ' 551 protoobjs=$protoobjs'purple_mod.o ' 552 553 # Having both libpurple and native IM modules in one binary may 554 # do strange things. Let's not do that. 555 msn=0 556 jabber=0 557 oscar=0 558 yahoo=0 559 twitter=0 560 561 if [ "$events" = "libevent" ]; then 562 echo 563 echo 'Warning: Some libpurple modules (including msn-pecan) do their event handling' 564 echo 'outside libpurple, talking to GLib directly. At least for now the combination' 565 echo 'libpurple + libevent is *not* recommended!' 566 fi 567 fi 568 510 569 if [ "$msn" = 0 ]; then 511 570 echo '#undef WITH_MSN' >> config.h -
dcc.c
r0d9d53e r4aa0f6b 116 116 117 117 /* watch */ 118 df->watch_in = b_input_add( df->fd, GAIM_INPUT_READ, dccs_send_proto, df );118 df->watch_in = b_input_add( df->fd, B_EV_IO_READ, dccs_send_proto, df ); 119 119 120 120 irc->file_transfers = g_slist_prepend( irc->file_transfers, file ); … … 228 228 file_transfer_t *file = df->ft; 229 229 230 if( ( cond & GAIM_INPUT_READ ) &&230 if( ( cond & B_EV_IO_READ ) && 231 231 ( file->status & FT_STATUS_LISTENING ) ) 232 232 { … … 248 248 249 249 /* reschedule for reading on new fd */ 250 df->watch_in = b_input_add( fd, GAIM_INPUT_READ, dccs_send_proto, df );250 df->watch_in = b_input_add( fd, B_EV_IO_READ, dccs_send_proto, df ); 251 251 252 252 return FALSE; 253 253 } 254 254 255 if( cond & GAIM_INPUT_READ )255 if( cond & B_EV_IO_READ ) 256 256 { 257 257 int ret; … … 325 325 326 326 /* watch */ 327 df->watch_out = b_input_add( df->fd, GAIM_INPUT_WRITE, dccs_recv_proto, df );327 df->watch_out = b_input_add( df->fd, B_EV_IO_WRITE, dccs_recv_proto, df ); 328 328 ft->write_request = dccs_recv_write_request; 329 329 … … 338 338 file_transfer_t *ft = df->ft; 339 339 340 if( ( cond & GAIM_INPUT_WRITE ) &&340 if( ( cond & B_EV_IO_WRITE ) && 341 341 ( ft->status & FT_STATUS_CONNECTING ) ) 342 342 { 343 343 ft->status = FT_STATUS_TRANSFERRING; 344 344 345 //df->watch_in = b_input_add( df->fd, GAIM_INPUT_READ, dccs_recv_proto, df );345 //df->watch_in = b_input_add( df->fd, B_EV_IO_READ, dccs_recv_proto, df ); 346 346 347 347 df->watch_out = 0; … … 349 349 } 350 350 351 if( cond & GAIM_INPUT_READ )351 if( cond & B_EV_IO_READ ) 352 352 { 353 353 int ret, done; … … 406 406 return dcc_abort( df, "BUG: write_request() called while watching" ); 407 407 408 df->watch_in = b_input_add( df->fd, GAIM_INPUT_READ, dccs_recv_proto, df );408 df->watch_in = b_input_add( df->fd, B_EV_IO_READ, dccs_recv_proto, df ); 409 409 410 410 return TRUE; … … 449 449 450 450 if( df->bytes_sent < df->ft->file_size ) 451 df->watch_out = b_input_add( df->fd, GAIM_INPUT_WRITE, dccs_send_can_write, df );451 df->watch_out = b_input_add( df->fd, B_EV_IO_WRITE, dccs_send_can_write, df ); 452 452 453 453 return TRUE; … … 565 565 return NULL; 566 566 } 567 -
debian/bitlbee-common.config
-
Property
mode
changed from
100755
to100644
-
Property
mode
changed from
-
debian/bitlbee.init
-
Property
mode
changed from
100755
to100644
-
Property
mode
changed from
-
debian/bitlbee.postinst
-
Property
mode
changed from
100755
to100644
-
Property
mode
changed from
-
debian/bitlbee.postrm
-
Property
mode
changed from
100755
to100644
-
Property
mode
changed from
-
debian/bitlbee.prerm
-
Property
mode
changed from
100755
to100644
-
Property
mode
changed from
-
debian/changelog
r0d9d53e r4aa0f6b 1 bitlbee (1.3-0) unstable; urgency=low 2 3 * Setting some bogus version number, fix that later. 4 * Now using debhelper to improve maintainability. 5 * Added a bitlbee-libpurple package, and split off docs and stuff into 6 bitlbee-common. 7 8 -- Wilmer van der Gaast <wilmer@gaast.net> Sat, 05 Jun 2010 15:16:38 +0100 9 1 10 bitlbee (1.2.7-1) unstable; urgency=high 2 11 -
debian/control
r0d9d53e r4aa0f6b 4 4 Maintainer: Wilmer van der Gaast <wilmer@gaast.net> 5 5 Uploaders: Jelmer Vernooij <jelmer@samba.org> 6 Standards-Version: 3.8. 07 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), debconf-2.0, po-debconf6 Standards-Version: 3.8.4 7 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), po-debconf, libpurple-dev, debhelper (>= 7) 8 8 Homepage: http://www.bitlbee.org/ 9 9 Vcs-Bzr: http://code.bitlbee.org/bitlbee/ … … 12 12 Package: bitlbee 13 13 Architecture: any 14 Depends: ${shlibs:Depends}, adduser, net-tools, ${debconf-depends}, debianutils (>= 1.16) 15 Description: An IRC to other chat networks gateway 14 Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${bee:Version}) 15 Conflicts: bitlbee-libpurple 16 Replaces: bitlbee-libpurple 17 Description: An IRC to other chat networks gateway (default version) 16 18 This program can be used as an IRC server which forwards everything you 17 19 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and 18 20 Twitter. 19 21 22 Package: bitlbee-libpurple 23 Architecture: any 24 Depends: ${shlibs:Depends}, adduser, debianutils (>= 1.16), bitlbee-common (= ${bee:Version}) 25 Conflicts: bitlbee 26 Replaces: bitlbee 27 Description: An IRC to other chat networks gateway (using libpurple) 28 This program can be used as an IRC server which forwards everything you 29 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and 30 Twitter. 31 . 32 This package contains a version of BitlBee that uses the libpurple instant 33 messaging library instead of built-in code, which adds support for more IM 34 protocols (all protocols supported by Pidgin/Finch) and features (like file 35 transfers), at the price of being less lightweight. 36 . 37 This variant may not be very suitable for BitlBee instances used by many 38 (tens or hundreds) of clients. 39 40 Package: bitlbee-common 41 Architecture: all 42 Depends: ${misc:Depends}, net-tools 43 Replaces: bitlbee 44 Description: An IRC to other chat networks gateway (common files/docs) 45 This program can be used as an IRC server which forwards everything you 46 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and 47 Twitter. 48 . 49 This package contains common files (mostly documentation) for bitlbee and 50 bitlbee-libpurple. 51 20 52 Package: bitlbee-dev 21 53 Architecture: all 22 Depends: bitlbee (>= ${source:Version}), bitlbee (<< ${source:Version}.1~)23 Description: An IRC to other chat networks gateway 54 Depends: ${misc:Depends}, bitlbee (>= ${bee:Version}), bitlbee (<< ${bee:Version}.1~) 55 Description: An IRC to other chat networks gateway (dev files) 24 56 This program can be used as an IRC server which forwards everything you 25 57 say to people on other chat networks: Jabber, ICQ, AIM, MSN, Yahoo! and -
debian/patches/bitlbee.conf.diff
r0d9d53e r4aa0f6b 1 --- debian/bitlbee/etc/bitlbee/bitlbee.conf 2009-06-01 00:20:24.000000000 +01002 +++ debian/bitlbee/etc/bitlbee/bitlbee.conf 2009-06-07 21:16:19.000000000 +01001 --- bitlbee.conf 2009-06-01 00:20:24.000000000 +0100 2 +++ bitlbee.conf 2009-06-07 21:16:19.000000000 +0100 3 3 @@ -23,13 +23,18 @@ 4 4 ## If BitlBee is started by root as a daemon, it can drop root privileges, -
debian/po/POTFILES.in
r0d9d53e r4aa0f6b 1 [type: gettext/rfc822deb] templates1 [type: gettext/rfc822deb] bitlbee-common.templates -
debian/rules
r0d9d53e r4aa0f6b 1 1 #!/usr/bin/make -f 2 # 3 # Finally switching to debhelper. 4 # 5 # Not using debhelper was an exercise suggested to me by my AM (Gergely 6 # Nagy). It was educating at the time but I finally decided that the 7 # exercise is over now. 8 # 2 9 10 BITLBEE_CONFIGURE_FLAGS ?= 3 11 DEBUG ?= 0 4 12 5 ifdef BITLBEE_VERSION 6 BITLBEE_FORCE_VERSION=1 7 else 13 ifndef BITLBEE_VERSION 8 14 # Want to use the full package version number instead of just the release. 9 BITLBEE_VERSION ?= "$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')" 10 export BITLBEE_VERSION 15 BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\" 11 16 endif 12 17 13 build-arch: build-arch-stamp 14 build-arch-stamp: 15 [ -d debian ] 16 ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent 17 $(MAKE) 18 # $(MAKE) -C doc/ all 19 touch build-arch-stamp 18 build: build-stamp 19 build-stamp: 20 dh_testdir 21 22 mkdir -p debian/build-native 23 ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS) 24 $(MAKE) -C debian/build-native 25 26 mkdir -p debian/build-libpurple 27 ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) 28 $(MAKE) -C debian/build-libpurple 29 30 touch build-stamp 20 31 21 32 clean: 22 [ "`whoami`" = "root" -a -d debian ] 23 rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files debian/bitlbee-dev 33 dh_testdir 34 dh_testroot 35 rm -f build-stamp 36 37 rm -rf build-arch-stamp debian/build-* 24 38 $(MAKE) distclean 25 # -$(MAKE) -C doc/ clean26 27 39 28 install-arch: build-arch 29 [ "`whoami`" = "root" -a -d debian ] 30 mkdir -p debian/bitlbee/DEBIAN/ 31 $(MAKE) install install-etc DESTDIR=`pwd`/debian/bitlbee 40 dh_clean 32 41 33 mkdir -p debian/bitlbee/usr/share/doc/bitlbee/ 34 cp doc/user-guide/user-guide.txt debian/bitlbee/usr/share/doc/bitlbee/ 35 cp doc/user-guide/user-guide.html debian/bitlbee/usr/share/doc/bitlbee/ 42 install: build 43 dh_testdir 44 dh_testroot 45 dh_prep 46 dh_installdirs 36 47 37 install-indep: install-arch 38 [ "`whoami`" = "root" -a -d debian ] 39 mkdir -p debian/bitlbee-dev/DEBIAN/ 40 $(MAKE) install-dev DESTDIR=`pwd`/debian/bitlbee-dev 48 $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee 49 $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple 50 $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev 41 51 42 mkdir -p debian/bitlbee-dev/usr/share/doc/bitlbee-dev/ 52 patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff 53 patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff 43 54 44 binary-arch: build-arch install-arch 45 [ "`whoami`" = "root" -a -d debian ] 55 mkdir -p debian/bitlbee-common/usr 56 mv debian/bitlbee/usr/share debian/bitlbee-common/usr 57 rm -rf debian/bitlbee-libpurple/usr/share 46 58 47 chmod 755 debian/post* debian/pre* debian/config debian/bitlbee.init 59 binary-common: 60 dh_testdir 61 dh_testroot 48 62 49 mkdir -p debian/bitlbee/usr/share/doc/bitlbee/examples/ debian/bitlbee/etc/init.d/ 50 -cp doc/RELEASE-SPEECH* debian/bitlbee/usr/share/doc/bitlbee/ && gzip -9 debian/bitlbee/usr/share/doc/bitlbee/RELEASE-SPEECH* 51 cp doc/CREDITS doc/AUTHORS doc/README doc/FAQ debian/README.Debian debian/bitlbee/usr/share/doc/bitlbee/ 52 cp debian/changelog debian/bitlbee/usr/share/doc/bitlbee/changelog.Debian 53 cp debian/copyright debian/bitlbee/usr/share/doc/bitlbee/copyright 54 cp doc/CHANGES debian/bitlbee/usr/share/doc/bitlbee/changelog 55 cp utils/* debian/bitlbee/usr/share/doc/bitlbee/examples/ 56 cp debian/bitlbee.init debian/bitlbee/etc/init.d/bitlbee 57 patch -p0 < debian/patches/bitlbee.conf.diff 58 cd debian/bitlbee/usr/share/; \ 59 gzip -9 doc/bitlbee/changelog.Debian doc/bitlbee/changelog doc/bitlbee/user-guide.txt \ 60 doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5 61 62 chown -R root:root debian/bitlbee/ 63 find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \; 64 find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \; 65 66 cp debian/prerm debian/bitlbee/DEBIAN/ 67 cp debian/postinst debian/bitlbee/DEBIAN/ 68 cp debian/postrm debian/bitlbee/DEBIAN/ 69 cp debian/config debian/bitlbee/DEBIAN/ 63 dh_installdocs --link-doc=bitlbee-common 64 dh_installchangelogs doc/CHANGES 65 dh_installexamples 66 dh_installdebconf 67 dh_installinit 68 ifeq ($(DH_OPTIONS),-a) 69 cp -a debian/bitlbee/etc debian/bitlbee-libpurple 70 endif 71 dh_installman 72 dh_strip 73 dh_link 74 dh_compress 75 dh_fixperms 76 dh_installdeb 77 ifeq ($(DH_OPTIONS),-a) 78 cp -a debian/bitlbee/DEBIAN/{post,pre}* debian/bitlbee-libpurple/DEBIAN 79 endif 80 dh_shlibdeps 81 ifdef BITLBEE_VERSION 82 echo source:Version=1:$(BITLBEE_VERSION)-0 > debian/substvars 83 dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 -Vbee:Version=1:$(BITLBEE_VERSION)-0 84 else 85 dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+[^+]*$$//') 86 endif 87 dh_md5sums 88 dh_builddeb 70 89 71 po2debconf debian/templates > debian/bitlbee/DEBIAN/templates 72 cp debian/conffiles debian/bitlbee/DEBIAN/ 73 74 if [ "$(DEBUG)" = "0" ]; then strip -R .comment -R .note debian/bitlbee/usr/sbin/bitlbee; fi 90 binary-indep: build install 91 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common 75 92 76 cd debian/bitlbee; \ 77 find usr -type f -exec md5sum {} \; > DEBIAN/md5sums 78 dpkg-shlibdeps -Tdebian/bitlbee.substvars -dDepends debian/bitlbee/usr/sbin/bitlbee 79 ifdef BITLBEE_FORCE_VERSION 80 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -v1:$(BITLBEE_VERSION)-0 -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0' 81 else 82 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0' 83 endif 93 binary-arch: build install 94 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common 84 95 85 dpkg --build debian/bitlbee .. 96 binary-%: build install 97 make -f debian/rules binary-common DH_OPTIONS=-p$* 86 98 87 binary-indep: install-indep 88 [ "`whoami`" = "root" -a -d debian ] 89 90 chown -R root.root debian/bitlbee-dev/ 91 find debian/bitlbee-dev/usr/share/ -type d -exec chmod 755 {} \; 92 find debian/bitlbee-dev/usr/share/ -type f -exec chmod 644 {} \; 93 94 cp debian/changelog debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian 95 gzip -9 debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian 96 cp debian/copyright debian/bitlbee-dev/usr/share/doc/bitlbee-dev/copyright 97 98 cd debian/bitlbee-dev; \ 99 find usr -type f -exec md5sum {} \; > DEBIAN/md5sums 100 101 ifdef BITLBEE_FORCE_VERSION 102 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev -v1:$(BITLBEE_VERSION)-0 103 else 104 dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev 105 endif 106 107 dpkg --build debian/bitlbee-dev .. 108 109 binary: binary-arch binary-indep 110 build: build-arch 111 install: install-arch install-indep 112 113 .PHONY: build-arch build clean binary-arch binary install-arch install binary-indep install-indep 99 binary: binary-indep binary-arch 100 .PHONY: build clean binary-indep binary-arch binary-common binary install -
doc/Makefile
r0d9d53e r4aa0f6b 1 1 -include ../Makefile.settings 2 ifdef SRCDIR 3 SRCDIR := $(SRCDIR)doc/ 4 endif 2 5 3 6 all: … … 7 10 install: 8 11 mkdir -p $(DESTDIR)$(MANDIR)/man8/ $(DESTDIR)$(MANDIR)/man5/ 9 install -m 0644 bitlbee.8 $(DESTDIR)$(MANDIR)/man8/10 install -m 0644 bitlbee.conf.5 $(DESTDIR)$(MANDIR)/man5/12 install -m 0644 $(SRCDIR)bitlbee.8 $(DESTDIR)$(MANDIR)/man8/ 13 install -m 0644 $(SRCDIR)bitlbee.conf.5 $(DESTDIR)$(MANDIR)/man5/ 11 14 $(MAKE) -C user-guide $@ 12 15 -
doc/user-guide/Makefile
r0d9d53e r4aa0f6b 1 1 -include ../../Makefile.settings 2 ifdef SRCDIR 3 SRCDIR := $(SRCDIR)doc/user-guide/ 4 endif 5 2 6 EXTRAPARANEWLINE = 1 3 7 # EXTRAPARANEWLINE = 0 … … 38 42 chmod 0755 $(DESTDIR)$(DATADIR) 39 43 rm -f $(DESTDIR)$(DATADIR)/help.txt # Prevent help function from breaking in running sessions 40 install -m 0644 help.txt $(DESTDIR)$(DATADIR)/help.txt44 install -m 0644 $(SRCDIR)help.txt $(DESTDIR)$(DATADIR)/help.txt 41 45 42 46 uninstall: -
help.c
r0d9d53e r4aa0f6b 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-200 5Wilmer van der Gaast and others *4 * Copyright 2002-2009 Wilmer van der Gaast and others * 5 5 \********************************************************************/ 6 6 … … 169 169 return NULL; 170 170 } 171 172 int 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
r0d9d53e r4aa0f6b 46 46 void help_free( help_t **help ); 47 47 char *help_get( help_t **help, char *title ); 48 int help_add_mem( help_t **help, const char *title, const char *content_ ); 48 49 49 50 #endif -
ipc.c
r0d9d53e r4aa0f6b 514 514 } 515 515 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 ); 517 517 518 518 child_list = g_slist_append( child_list, child ); … … 552 552 } 553 553 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 ); 555 555 556 556 return 1; … … 597 597 return 0; 598 598 } 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 ); 600 600 601 601 child_list = g_slist_append( child_list, child ); -
irc.c
r0d9d53e r4aa0f6b 26 26 #include "bitlbee.h" 27 27 #include "ipc.h" 28 #include "dcc.h" 28 29 29 30 GSList *irc_connection_list; … … 48 49 sock_make_nonblocking( irc->fd ); 49 50 50 irc->r_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_READ, bitlbee_io_current_client_read, irc );51 irc->r_watch_source_id = b_input_add( irc->fd, B_EV_IO_READ, bitlbee_io_current_client_read, irc ); 51 52 52 53 irc->status = USTATUS_OFFLINE; … … 143 144 g_free( myhost ); 144 145 g_free( host ); 146 147 nogaim_init(); 145 148 146 149 return irc; … … 550 553 if( now ) 551 554 { 552 bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE );555 bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE ); 553 556 } 554 557 temp = temp->next; … … 605 608 in the event queue. */ 606 609 /* Really can't be done as long as the code doesn't do error checking very well: 607 if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) ) */610 if( bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE ) ) */ 608 611 609 612 /* So just always do it via the event handler. */ 610 irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc );613 irc->w_watch_source_id = b_input_add( irc->fd, B_EV_IO_WRITE, bitlbee_io_current_client_write, irc ); 611 614 } 612 615 … … 736 739 } 737 740 738 739 741 /* Returns 0 if everything seems to be okay, a number >0 when there was a 740 742 timeout. The number returned is the number of seconds we received no -
lib/Makefile
r0d9d53e r4aa0f6b 8 8 9 9 -include ../Makefile.settings 10 ifdef SRCDIR 11 SRCDIR := $(SRCDIR)lib/ 12 endif 10 13 11 14 # [SH] Program variables … … 37 40 $(objects): ../Makefile.settings Makefile 38 41 39 $(objects): %.o: %.c42 $(objects): %.o: $(SRCDIR)%.c 40 43 @echo '*' Compiling $< 41 44 @$(CC) -c $(CFLAGS) $< -o $@ -
lib/events.h
r0d9d53e r4aa0f6b 48 48 the given callback function. */ 49 49 typedef 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, 52 54 } b_input_condition; 53 55 typedef gboolean (*b_event_handler)(gpointer data, gint fd, b_input_condition cond); -
lib/events_glib.c
r0d9d53e r4aa0f6b 49 49 b_event_handler function; 50 50 gpointer data; 51 guint flags; 51 52 } GaimIOClosure; 52 53 … … 76 77 77 78 if (condition & GAIM_READ_COND) 78 gaim_cond |= GAIM_INPUT_READ;79 gaim_cond |= B_EV_IO_READ; 79 80 if (condition & GAIM_WRITE_COND) 80 gaim_cond |= GAIM_INPUT_WRITE;81 gaim_cond |= B_EV_IO_WRITE; 81 82 82 83 event_debug( "gaim_io_invoke( %d, %d, 0x%x )\n", g_io_channel_unix_get_fd(source), condition, data ); … … 87 88 event_debug( "Returned FALSE, cancelling.\n" ); 88 89 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; 90 96 } 91 97 … … 105 111 closure->function = function; 106 112 closure->data = data; 113 closure->flags = condition; 107 114 108 if (condition & GAIM_INPUT_READ)115 if (condition & B_EV_IO_READ) 109 116 cond |= GAIM_READ_COND; 110 if (condition & GAIM_INPUT_WRITE)117 if (condition & B_EV_IO_WRITE) 111 118 cond |= GAIM_WRITE_COND; 112 119 -
lib/events_libevent.c
r0d9d53e r4aa0f6b 60 60 b_event_handler function; 61 61 void *data; 62 guint flags; 62 63 }; 63 64 … … 126 127 { 127 128 if( event & EV_READ ) 128 cond |= GAIM_INPUT_READ;129 cond |= B_EV_IO_READ; 129 130 if( event & EV_WRITE ) 130 cond |= GAIM_INPUT_WRITE;131 cond |= B_EV_IO_WRITE; 131 132 } 132 133 … … 150 151 return; 151 152 } 152 else if( !st )153 else if( !st && !( b_ev->flags & B_EV_FLAG_FORCE_REPEAT ) ) 153 154 { 154 155 event_debug( "Handler returned FALSE: " ); … … 174 175 event_debug( "b_input_add( %d, %d, 0x%x, 0x%x ) ", fd, condition, function, data ); 175 176 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 ) ) ) ) 178 179 { 179 180 /* We'll stick with this libevent entry, but give it a new BitlBee id. */ … … 198 199 199 200 out_cond = EV_PERSIST; 200 if( condition & GAIM_INPUT_READ )201 if( condition & B_EV_IO_READ ) 201 202 out_cond |= EV_READ; 202 if( condition & GAIM_INPUT_WRITE )203 if( condition & B_EV_IO_WRITE ) 203 204 out_cond |= EV_WRITE; 204 205 … … 212 213 } 213 214 215 b_ev->flags = condition; 214 216 g_hash_table_insert( id_hash, &b_ev->id, b_ev ); 215 217 return b_ev->id; -
lib/http_client.c
r0d9d53e r4aa0f6b 149 149 if( req->bytes_written < req->request_length ) 150 150 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, 152 152 http_connected, req ); 153 153 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 ); 155 155 156 156 return FALSE; … … 234 234 /* There will be more! */ 235 235 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, 237 237 http_incoming_data, req ); 238 238 -
lib/proxy.c
r0d9d53e r4aa0f6b 91 91 b_event_remove(phb->inpa); 92 92 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); 94 94 else { 95 phb->func(phb->data, -1, GAIM_INPUT_READ);95 phb->func(phb->data, -1, B_EV_IO_READ); 96 96 g_free(phb); 97 97 } … … 102 102 b_event_remove(phb->inpa); 103 103 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); 105 105 else { 106 phb->func(phb->data, source, GAIM_INPUT_READ);106 phb->func(phb->data, source, B_EV_IO_READ); 107 107 g_free(phb); 108 108 } … … 147 147 return -1; 148 148 } 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); 150 150 phb->fd = fd; 151 151 … … 179 179 if ((memcmp(HTTP_GOODSTRING, inputline, strlen(HTTP_GOODSTRING)) == 0) || 180 180 (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); 182 182 g_free(phb->host); 183 183 g_free(phb); … … 186 186 187 187 close(source); 188 phb->func(phb->data, -1, GAIM_INPUT_READ);188 phb->func(phb->data, -1, B_EV_IO_READ); 189 189 g_free(phb->host); 190 190 g_free(phb); … … 204 204 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 205 205 close(source); 206 phb->func(phb->data, -1, GAIM_INPUT_READ);206 phb->func(phb->data, -1, B_EV_IO_READ); 207 207 g_free(phb->host); 208 208 g_free(phb); … … 215 215 if (send(source, cmd, strlen(cmd), 0) < 0) { 216 216 close(source); 217 phb->func(phb->data, -1, GAIM_INPUT_READ);217 phb->func(phb->data, -1, B_EV_IO_READ); 218 218 g_free(phb->host); 219 219 g_free(phb); … … 230 230 if (send(source, cmd, strlen(cmd), 0) < 0) { 231 231 close(source); 232 phb->func(phb->data, -1, GAIM_INPUT_READ);232 phb->func(phb->data, -1, B_EV_IO_READ); 233 233 g_free(phb->host); 234 234 g_free(phb); … … 240 240 if (send(source, cmd, strlen(cmd), 0) < 0) { 241 241 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); 249 249 250 250 return FALSE; … … 273 273 memset(packet, 0, sizeof(packet)); 274 274 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); 276 276 g_free(phb->host); 277 277 g_free(phb); … … 280 280 281 281 close(source); 282 phb->func(phb->data, -1, GAIM_INPUT_READ);282 phb->func(phb->data, -1, B_EV_IO_READ); 283 283 g_free(phb->host); 284 284 g_free(phb); … … 299 299 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 300 300 close(source); 301 phb->func(phb->data, -1, GAIM_INPUT_READ);301 phb->func(phb->data, -1, B_EV_IO_READ); 302 302 g_free(phb->host); 303 303 g_free(phb); … … 309 309 if (!(hp = gethostbyname(phb->host))) { 310 310 close(source); 311 phb->func(phb->data, -1, GAIM_INPUT_READ);311 phb->func(phb->data, -1, B_EV_IO_READ); 312 312 g_free(phb->host); 313 313 g_free(phb); … … 326 326 if (write(source, packet, 9) != 9) { 327 327 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); 335 335 336 336 return FALSE; … … 359 359 if (read(source, buf, 10) < 10) { 360 360 close(source); 361 phb->func(phb->data, -1, GAIM_INPUT_READ);361 phb->func(phb->data, -1, B_EV_IO_READ); 362 362 g_free(phb->host); 363 363 g_free(phb); … … 366 366 if ((buf[0] != 0x05) || (buf[1] != 0x00)) { 367 367 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); 375 375 g_free(phb->host); 376 376 g_free(phb); … … 396 396 if (write(source, buf, (5 + strlen(phb->host) + 2)) < (5 + strlen(phb->host) + 2)) { 397 397 close(source); 398 phb->func(phb->data, -1, GAIM_INPUT_READ);398 phb->func(phb->data, -1, B_EV_IO_READ); 399 399 g_free(phb->host); 400 400 g_free(phb); … … 402 402 } 403 403 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); 405 405 } 406 406 … … 414 414 if (read(source, buf, 2) < 2) { 415 415 close(source); 416 phb->func(phb->data, -1, GAIM_INPUT_READ);416 phb->func(phb->data, -1, B_EV_IO_READ); 417 417 g_free(phb->host); 418 418 g_free(phb); … … 422 422 if ((buf[0] != 0x01) || (buf[1] != 0x00)) { 423 423 close(source); 424 phb->func(phb->data, -1, GAIM_INPUT_READ);424 phb->func(phb->data, -1, B_EV_IO_READ); 425 425 g_free(phb->host); 426 426 g_free(phb); … … 442 442 if (read(source, buf, 2) < 2) { 443 443 close(source); 444 phb->func(phb->data, -1, GAIM_INPUT_READ);444 phb->func(phb->data, -1, B_EV_IO_READ); 445 445 g_free(phb->host); 446 446 g_free(phb); … … 450 450 if ((buf[0] != 0x05) || (buf[1] == 0xff)) { 451 451 close(source); 452 phb->func(phb->data, -1, GAIM_INPUT_READ);452 phb->func(phb->data, -1, B_EV_IO_READ); 453 453 g_free(phb->host); 454 454 g_free(phb); … … 465 465 if (write(source, buf, 3 + i + j) < 3 + i + j) { 466 466 close(source); 467 phb->func(phb->data, -1, GAIM_INPUT_READ);467 phb->func(phb->data, -1, B_EV_IO_READ); 468 468 g_free(phb->host); 469 469 g_free(phb); … … 471 471 } 472 472 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); 474 474 } else { 475 475 s5_sendconnect(phb, source); … … 491 491 if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 492 492 close(source); 493 phb->func(phb->data, -1, GAIM_INPUT_READ);493 phb->func(phb->data, -1, B_EV_IO_READ); 494 494 g_free(phb->host); 495 495 g_free(phb); … … 513 513 if (write(source, buf, i) < i) { 514 514 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); 522 522 523 523 return FALSE; -
lib/ssl_bogus.c
r0d9d53e r4aa0f6b 59 59 b_input_condition ssl_getdirection( void *conn ) 60 60 { 61 return GAIM_INPUT_READ;61 return B_EV_IO_READ; 62 62 } 63 63 -
lib/ssl_client.h
r0d9d53e r4aa0f6b 71 71 G_MODULE_EXPORT int ssl_getfd( void *conn ); 72 72 73 /* This function returns GAIM_INPUT_READ/WRITE. With SSL connections it's73 /* This function returns B_EV_IO_READ/WRITE. With SSL connections it's 74 74 possible that something has to be read while actually were trying to 75 75 write something (think about key exchange/refresh/etc). So when an -
lib/ssl_gnutls.c
r0d9d53e r4aa0f6b 106 106 struct scd *conn = data; 107 107 108 return ssl_connected( conn, conn->fd, GAIM_INPUT_WRITE );108 return ssl_connected( conn, conn->fd, B_EV_IO_WRITE ); 109 109 } 110 110 … … 244 244 { 245 245 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
r0d9d53e r4aa0f6b 193 193 { 194 194 /* Just in case someone calls us, let's return the most likely case: */ 195 return GAIM_INPUT_READ;195 return B_EV_IO_READ; 196 196 } -
lib/ssl_openssl.c
r0d9d53e r4aa0f6b 102 102 struct scd *conn = data; 103 103 104 return ssl_connected( conn, conn->fd, GAIM_INPUT_WRITE );104 return ssl_connected( conn, conn->fd, B_EV_IO_WRITE ); 105 105 } 106 106 … … 270 270 b_input_condition ssl_getdirection( void *conn ) 271 271 { 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
r0d9d53e r4aa0f6b 275 275 GaimInputCondition ssl_getdirection( void *conn ) 276 276 { 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/Makefile
r0d9d53e r4aa0f6b 8 8 9 9 -include ../Makefile.settings 10 ifdef SRCDIR 11 SRCDIR := $(SRCDIR)protocols/ 12 endif 10 13 11 14 # [SH] Program variables … … 50 53 $(objects): ../Makefile.settings Makefile 51 54 52 $(objects): %.o: %.c55 $(objects): %.o: $(SRCDIR)%.c 53 56 @echo '*' Compiling $< 54 57 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/jabber/Makefile
r0d9d53e r4aa0f6b 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR 11 SRCDIR := $(SRCDIR)protocols/jabber/ 12 endif 10 13 11 14 # [SH] Program variables … … 33 36 $(objects): ../../Makefile.settings Makefile 34 37 35 $(objects): %.o: %.c38 $(objects): %.o: $(SRCDIR)%.c 36 39 @echo '*' Compiling $< 37 40 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/jabber/io.c
r0d9d53e r4aa0f6b 64 64 most cases it probably won't be necessary.) */ 65 65 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 ); 67 67 } 68 68 else … … 504 504 505 505 if( jd->r_inpa <= 0 ) 506 jd->r_inpa = b_input_add( jd->fd, GAIM_INPUT_READ, jabber_read_callback, ic );506 jd->r_inpa = b_input_add( jd->fd, B_EV_IO_READ, jabber_read_callback, ic ); 507 507 508 508 greet = g_strdup_printf( "%s<stream:stream to=\"%s\" xmlns=\"jabber:client\" " -
protocols/jabber/s5bytestream.c
r0d9d53e r4aa0f6b 406 406 bt->phase = BS_PHASE_CONNECTED; 407 407 408 bt->tf->watch_out = b_input_add( fd, GAIM_INPUT_WRITE, jabber_bs_recv_handshake, bt );408 bt->tf->watch_out = b_input_add( fd, B_EV_IO_WRITE, jabber_bs_recv_handshake, bt ); 409 409 410 410 /* since it takes forever(3mins?) till connect() fails on itself we schedule a timeout */ … … 433 433 bt->phase = BS_PHASE_REQUEST; 434 434 435 bt->tf->watch_in = b_input_add( fd, GAIM_INPUT_READ, jabber_bs_recv_handshake, bt );435 bt->tf->watch_in = b_input_add( fd, B_EV_IO_READ, jabber_bs_recv_handshake, bt ); 436 436 437 437 bt->tf->watch_out = 0; … … 590 590 591 591 tf->ft->data = tf; 592 tf->watch_in = b_input_add( tf->fd, GAIM_INPUT_READ, jabber_bs_recv_read, bt );592 tf->watch_in = b_input_add( tf->fd, B_EV_IO_READ, jabber_bs_recv_read, bt ); 593 593 tf->ft->write_request = jabber_bs_recv_write_request; 594 594 … … 632 632 if( ( ret == -1 ) && ( errno == EAGAIN ) ) 633 633 { 634 tf->watch_in = b_input_add( tf->fd, GAIM_INPUT_READ, jabber_bs_recv_read, bt );634 tf->watch_in = b_input_add( tf->fd, B_EV_IO_READ, jabber_bs_recv_read, bt ); 635 635 return FALSE; 636 636 } … … 708 708 imcb_file_finished( tf->ic, ft ); 709 709 else 710 bt->tf->watch_out = b_input_add( tf->fd, GAIM_INPUT_WRITE, jabber_bs_send_can_write, bt );710 bt->tf->watch_out = b_input_add( tf->fd, B_EV_IO_WRITE, jabber_bs_send_can_write, bt ); 711 711 712 712 return TRUE; … … 919 919 bt->streamhosts = g_slist_append( bt->streamhosts, sh ); 920 920 921 bt->tf->watch_in = b_input_add( tf->fd, GAIM_INPUT_READ, jabber_bs_send_handshake, bt );921 bt->tf->watch_in = b_input_add( tf->fd, B_EV_IO_READ, jabber_bs_send_handshake, bt ); 922 922 bt->connect_timeout = b_timeout_add( JABBER_BS_LISTEN_TIMEOUT * 1000, jabber_bs_connect_timeout, bt ); 923 923 } else { … … 1056 1056 bt->phase = BS_PHASE_CONNECTED; 1057 1057 1058 bt->tf->watch_in = b_input_add( fd, GAIM_INPUT_READ, jabber_bs_send_handshake, bt );1058 bt->tf->watch_in = b_input_add( fd, B_EV_IO_READ, jabber_bs_send_handshake, bt ); 1059 1059 return FALSE; 1060 1060 } -
protocols/msn/Makefile
r0d9d53e r4aa0f6b 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR 11 SRCDIR := $(SRCDIR)protocols/msn/ 12 endif 10 13 11 14 # [SH] Program variables … … 33 36 $(objects): ../../Makefile.settings Makefile 34 37 35 $(objects): %.o: %.c38 $(objects): %.o: $(SRCDIR)%.c 36 39 @echo '*' Compiling $< 37 40 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/msn/invitation.c
r0d9d53e r4aa0f6b 209 209 sock_make_nonblocking( fd ); 210 210 211 msn_file->r_event_id = b_input_add( fd, GAIM_INPUT_READ, msn_ftp_read, file );211 msn_file->r_event_id = b_input_add( fd, B_EV_IO_READ, msn_ftp_read, file ); 212 212 213 213 return FALSE; … … 230 230 } 231 231 232 msn_file->r_event_id = b_input_add( msn_file->fd, GAIM_INPUT_READ, msn_ftps_connected, file );232 msn_file->r_event_id = b_input_add( msn_file->fd, B_EV_IO_READ, msn_ftps_connected, file ); 233 233 234 234 g_snprintf( buf, sizeof( buf ), … … 318 318 319 319 sock_make_nonblocking( msn_file->fd ); 320 msn_file->r_event_id = b_input_add( msn_file->fd, GAIM_INPUT_READ, msn_ftp_read, file );320 msn_file->r_event_id = b_input_add( msn_file->fd, B_EV_IO_READ, msn_ftp_read, file ); 321 321 322 322 return FALSE; … … 415 415 ( msn_file->data_sent + msn_file->sbufpos - 3 < file->file_size ) ) { 416 416 if( !msn_file->w_event_id ) 417 msn_file->w_event_id = b_input_add( msn_file->fd, GAIM_INPUT_WRITE, msn_ftp_send, file );417 msn_file->w_event_id = b_input_add( msn_file->fd, B_EV_IO_WRITE, msn_ftp_send, file ); 418 418 return TRUE; 419 419 } … … 452 452 /* we might already be listening if this is data from an overflow */ 453 453 if( !msn_file->w_event_id ) 454 msn_file->w_event_id = b_input_add( msn_file->fd, GAIM_INPUT_WRITE, msn_ftp_send, file );454 msn_file->w_event_id = b_input_add( msn_file->fd, B_EV_IO_WRITE, msn_ftp_send, file ); 455 455 } 456 456 … … 617 617 618 618 msn_file->r_event_id = 619 b_input_add( msn_file->fd, GAIM_INPUT_READ, msn_ftp_read, file );619 b_input_add( msn_file->fd, B_EV_IO_READ, msn_ftp_read, file ); 620 620 621 621 return TRUE; -
protocols/msn/ns.c
r0d9d53e r4aa0f6b 76 76 if( msn_write( ic, s, strlen( s ) ) ) 77 77 { 78 ic->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, ic );78 ic->inpa = b_input_add( md->fd, B_EV_IO_READ, msn_ns_callback, ic ); 79 79 imcb_log( ic, "Connected to server, waiting for reply" ); 80 80 } -
protocols/msn/sb.c
r0d9d53e r4aa0f6b 327 327 328 328 if( msn_sb_write( sb, buf, strlen( buf ) ) ) 329 sb->inp = b_input_add( sb->fd, GAIM_INPUT_READ, msn_sb_callback, sb );329 sb->inp = b_input_add( sb->fd, B_EV_IO_READ, msn_sb_callback, sb ); 330 330 else 331 331 debug( "Error %d while connecting to switchboard server", 2 ); -
protocols/nogaim.c
r0d9d53e r4aa0f6b 112 112 { 113 113 GList *gl; 114 for (gl = protocols; gl; gl = gl->next) 114 115 for( gl = protocols; gl; gl = gl->next ) 115 116 { 116 117 struct prpl *proto = gl->data; 117 if(!g_strcasecmp(proto->name, name)) 118 119 if( g_strcasecmp( proto->name, name ) == 0 ) 118 120 return proto; 119 121 } 122 120 123 return NULL; 121 124 } … … 128 131 extern void jabber_initmodule(); 129 132 extern void twitter_initmodule(); 133 extern void purple_initmodule(); 130 134 131 135 #ifdef WITH_MSN … … 147 151 #ifdef WITH_TWITTER 148 152 twitter_initmodule(); 153 #endif 154 155 #ifdef WITH_PURPLE 156 purple_initmodule(); 149 157 #endif 150 158 -
protocols/nogaim.h
r0d9d53e r4aa0f6b 134 134 * - The user sees this name ie. when imcb_log() is used. */ 135 135 const char *name; 136 void *data; 136 137 137 138 /* Added this one to be able to add per-account settings, don't think … … 321 322 322 323 /* Misc. stuff */ 324 char *set_eval_timezone( set_t *set, char *value ); 323 325 char *set_eval_away_devoice( set_t *set, char *value ); 324 326 gboolean auto_reconnect( gpointer data, gint fd, b_input_condition cond ); -
protocols/oscar/Makefile
r0d9d53e r4aa0f6b 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR 11 SRCDIR := $(SRCDIR)protocols/oscar/ 12 CFLAGS += -I$(SRCDIR) 13 endif 10 14 11 15 # [SH] Program variables … … 33 37 $(objects): ../../Makefile.settings Makefile 34 38 35 $(objects): %.o: %.c39 $(objects): %.o: $(SRCDIR)%.c 36 40 @echo '*' Compiling $< 37 41 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/oscar/auth.c
r0d9d53e r4aa0f6b 120 120 aim_snacid_t snacid; 121 121 aim_tlvlist_t *tl = NULL; 122 struct im_connection *ic = sess->aux_data; 122 123 123 124 if (!sess || !conn || !sn) 124 125 return -EINVAL; 125 126 126 if ( (sn[0] >= '0') && (sn[0] <= '9'))127 if (isdigit(sn[0]) && set_getbool(&ic->acc->set, "old_icq_auth")) 127 128 return goddamnicq(sess, conn, sn); 128 129 -
protocols/oscar/oscar.c
r0d9d53e r4aa0f6b 288 288 odata = (struct oscar_data *)ic->proto_data; 289 289 290 if (condition & GAIM_INPUT_READ) {290 if (condition & B_EV_IO_READ) { 291 291 if (aim_get_command(odata->sess, conn) >= 0) { 292 292 aim_rxdispatch(odata->sess); … … 360 360 361 361 aim_conn_completeconnect(sess, conn); 362 ic->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,362 ic->inpa = b_input_add(conn->fd, B_EV_IO_READ, 363 363 oscar_callback, conn); 364 364 … … 372 372 if (isdigit(acc->user[0])) { 373 373 set_add(&acc->set, "ignore_auth_requests", "false", set_eval_bool, acc); 374 set_add(&acc->set, "old_icq_auth", "false", set_eval_bool, acc); 374 375 } 375 376 … … 490 491 491 492 aim_conn_completeconnect(sess, bosconn); 492 ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,493 ic->inpa = b_input_add(bosconn->fd, B_EV_IO_READ, 493 494 oscar_callback, bosconn); 494 495 imcb_log(ic, _("Connection established, cookie sent")); … … 706 707 707 708 aim_conn_completeconnect(sess, tstconn); 708 odata->cnpa = b_input_add(tstconn->fd, GAIM_INPUT_READ,709 odata->cnpa = b_input_add(tstconn->fd, B_EV_IO_READ, 709 710 oscar_callback, tstconn); 710 711 … … 734 735 735 736 aim_conn_completeconnect(sess, tstconn); 736 odata->paspa = b_input_add(tstconn->fd, GAIM_INPUT_READ,737 odata->paspa = b_input_add(tstconn->fd, B_EV_IO_READ, 737 738 oscar_callback, tstconn); 738 739 … … 770 771 aim_conn_completeconnect(sess, ccon->conn); 771 772 ccon->inpa = b_input_add(tstconn->fd, 772 GAIM_INPUT_READ,773 B_EV_IO_READ, 773 774 oscar_callback, tstconn); 774 775 odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon); -
protocols/twitter/Makefile
r0d9d53e r4aa0f6b 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR 11 SRCDIR := $(SRCDIR)protocols/twitter/ 12 endif 10 13 11 14 # [SH] Program variables … … 33 36 $(objects): ../../Makefile.settings Makefile 34 37 35 $(objects): %.o: %.c38 $(objects): %.o: $(SRCDIR)%.c 36 39 @echo '*' Compiling $< 37 40 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/yahoo/Makefile
r0d9d53e r4aa0f6b 8 8 9 9 -include ../../Makefile.settings 10 ifdef SRCDIR 11 SRCDIR := $(SRCDIR)protocols/yahoo/ 12 endif 10 13 11 14 # [SH] Program variables … … 33 36 $(objects): ../../Makefile.settings Makefile 34 37 35 $(objects): %.o: %.c38 $(objects): %.o: $(SRCDIR)%.c 36 39 @echo '*' Compiling $< 37 40 @$(CC) -c $(CFLAGS) $< -o $@ -
protocols/yahoo/yahoo.c
r0d9d53e r4aa0f6b 686 686 687 687 inp->d = d; 688 d->tag = inp->h = b_input_add( fd, GAIM_INPUT_READ, (b_event_handler) byahoo_read_ready_callback, (gpointer) d );688 d->tag = inp->h = b_input_add( fd, B_EV_IO_READ, (b_event_handler) byahoo_read_ready_callback, (gpointer) d ); 689 689 } 690 690 else if( cond == YAHOO_INPUT_WRITE ) … … 697 697 698 698 inp->d = d; 699 d->tag = inp->h = b_input_add( fd, GAIM_INPUT_WRITE, (b_event_handler) byahoo_write_ready_callback, (gpointer) d );699 d->tag = inp->h = b_input_add( fd, B_EV_IO_WRITE, (b_event_handler) byahoo_write_ready_callback, (gpointer) d ); 700 700 } 701 701 else -
set.c
r0d9d53e r4aa0f6b 29 29 char *SET_INVALID = "nee"; 30 30 31 set_t *set_add( set_t **head, c har *key,char *def, set_eval eval, void *data )31 set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data ) 32 32 { 33 33 set_t *s = set_find( head, key ); … … 63 63 } 64 64 65 set_t *set_find( set_t **head, c har *key )65 set_t *set_find( set_t **head, const char *key ) 66 66 { 67 67 set_t *s = *head; … … 78 78 } 79 79 80 char *set_getstr( set_t **head, c har *key )80 char *set_getstr( set_t **head, const char *key ) 81 81 { 82 82 set_t *s = set_find( head, key ); … … 88 88 } 89 89 90 int set_getint( set_t **head, c har *key )90 int set_getint( set_t **head, const char *key ) 91 91 { 92 92 char *s = set_getstr( head, key ); … … 102 102 } 103 103 104 int set_getbool( set_t **head, c har *key )104 int set_getbool( set_t **head, const char *key ) 105 105 { 106 106 char *s = set_getstr( head, key ); … … 112 112 } 113 113 114 int set_setstr( set_t **head, c har *key, char *value )114 int set_setstr( set_t **head, const char *key, char *value ) 115 115 { 116 116 set_t *s = set_find( head, key ); … … 151 151 } 152 152 153 int set_setint( set_t **head, c har *key, int value )153 int set_setint( set_t **head, const char *key, int value ) 154 154 { 155 155 char s[24]; /* Not quite 128-bit clean eh? ;-) */ … … 159 159 } 160 160 161 void set_del( set_t **head, c har *key )161 void set_del( set_t **head, const char *key ) 162 162 { 163 163 set_t *s = *head, *t = NULL; … … 184 184 } 185 185 186 int set_reset( set_t **head, c har *key )186 int set_reset( set_t **head, const char *key ) 187 187 { 188 188 set_t *s; … … 213 213 { 214 214 return is_bool( value ) ? value : SET_INVALID; 215 } 216 217 char *set_eval_list( set_t *set, char *value ) 218 { 219 GSList *options = set->eval_data, *opt; 220 221 for( opt = options; opt; opt = opt->next ) 222 if( strcmp( value, opt->data ) == 0 ) 223 return value; 224 225 /* TODO: It'd be nice to show the user a list of allowed values, 226 but we don't have enough context here to do that. May 227 want to fix that. */ 228 229 return NULL; 215 230 } 216 231 -
set.h
r0d9d53e r4aa0f6b 70 70 set_setstr() should be able to free() the returned string! */ 71 71 set_eval eval; 72 void *eval_data; 72 73 struct set *next; 73 74 } set_t; 74 75 75 76 /* Should be pretty clear. */ 76 set_t *set_add( set_t **head, c har *key,char *def, set_eval eval, void *data );77 set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data ); 77 78 78 79 /* Returns the raw set_t. Might be useful sometimes. */ 79 set_t *set_find( set_t **head, c har *key );80 set_t *set_find( set_t **head, const char *key ); 80 81 81 82 /* Returns a pointer to the string value of this setting. Don't modify the 82 83 returned string, and don't free() it! */ 83 G_MODULE_EXPORT char *set_getstr( set_t **head, c har *key );84 G_MODULE_EXPORT char *set_getstr( set_t **head, const char *key ); 84 85 85 86 /* Get an integer. In previous versions set_getint() was also used to read 86 87 boolean values, but this SHOULD be done with set_getbool() now! */ 87 G_MODULE_EXPORT int set_getint( set_t **head, c har *key );88 G_MODULE_EXPORT int set_getbool( set_t **head, c har *key );88 G_MODULE_EXPORT int set_getint( set_t **head, const char *key ); 89 G_MODULE_EXPORT int set_getbool( set_t **head, const char *key ); 89 90 90 91 /* set_setstr() strdup()s the given value, so after using this function 91 92 you can free() it, if you want. */ 92 int set_setstr( set_t **head, c har *key, char *value );93 int set_setint( set_t **head, c har *key, int value );94 void set_del( set_t **head, c har *key );95 int set_reset( set_t **head, c har *key );93 int set_setstr( set_t **head, const char *key, char *value ); 94 int set_setint( set_t **head, const char *key, int value ); 95 void set_del( set_t **head, const char *key ); 96 int set_reset( set_t **head, const char *key ); 96 97 97 98 /* Two very useful generic evaluators. */ 98 99 char *set_eval_int( set_t *set, char *value ); 99 100 char *set_eval_bool( set_t *set, char *value ); 101 102 /* Another more complicated one. */ 103 char *set_eval_list( set_t *set, char *value ); 100 104 101 105 /* Some not very generic evaluators that really shouldn't be here... */ -
tests/Makefile
r0d9d53e r4aa0f6b 1 1 -include ../Makefile.settings 2 ifdef SRCDIR 3 SRCDIR := $(SRCDIR)tests/ 4 endif 2 5 3 6 LFLAGS +=-lcheck … … 19 22 @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS) 20 23 21 %.o: %.c24 %.o: $(SRCDIR)%.c 22 25 @echo '*' Compiling $< 23 26 @$(CC) -c $(CFLAGS) $< -o $@ -
unix.c
r0d9d53e r4aa0f6b 56 56 57 57 log_init(); 58 58 59 global.conf_file = g_strdup( CONF_FILE_DEF ); 59 60 global.conf = conf_load( argc, argv ); … … 62 63 63 64 b_main_init(); 64 nogaim_init();65 65 66 66 srand( time( NULL ) ^ getpid() ); 67 67 68 global.helpfile = g_strdup( HELP_FILE ); 69 if( help_init( &global.help, global.helpfile ) == NULL ) 70 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE ); 71 72 global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage ); 73 if( global.storage == NULL ) 74 { 75 log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage ); 76 return( 1 ); 77 } 68 78 69 79 if( global.conf->runmode == RUNMODE_INETD ) … … 116 126 setuid( pw->pw_uid ); 117 127 } 118 }119 120 global.storage = storage_init( global.conf->primary_storage, global.conf->migrate_storage );121 if( global.storage == NULL )122 {123 log_message( LOGLVL_ERROR, "Unable to load storage backend '%s'", global.conf->primary_storage );124 return( 1 );125 128 } 126 129 … … 142 145 if( !getuid() || !geteuid() ) 143 146 log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" ); 144 if( help_init( &global.help, global.helpfile ) == NULL )145 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );146 147 147 148 b_main_run();
Note: See TracChangeset
for help on using the changeset viewer.