# $Id$
+2006-11-04 pkovacs
+ * Removed broken mldonkey and seti support.
+
2006-11-03 pkovacs
- * Removed direct support for Xmms, BMP and Infopipe from conky.
+ * Removed support for Xmms, BMP and Infopipe from conky.
The Xmms and Bmp players are projects are dead and distros such
as Gentoo are slating them for removal.
- * Added direct support for Audacious with conventional linking.
+ * Added support for Audacious with conventional linking.
2006-10-18
* Implement WiFi signal level detection on FreeBSD (patch
./configure --prefix=/usr --mandir=/usr/share/man --in-
fodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --local-
statedir=/var/lib --enable-xft --enable-own-window --enable-proc-uptime
- --enable-audacious --enable-bmpx --enable-seti --enable-hddtemp --en-
- able-mpd --enable-xmms2 --enable-imlib2 --enable-portmon --enable-ml-
- donkey --enable-debug --enable-double-buffer --enable-xdamage --en-
- able-x11
+ --enable-audacious --enable-bmpx --enable-hddtemp --enable-mpd --en-
+ able-xmms2 --enable-imlib2 --enable-portmon --enable-debug --en-
+ able-double-buffer --enable-xdamage --enable-x11
make
(if 0 or not set, default is 256)
- mldonkey_hostname
- Hostname for mldonkey stuff, defaults to localhost
-
-
- mldonkey_port
- Mldonkey port, 4001 default
-
-
- mldonkey_login
- Mldonkey login, default none
-
-
- mldonkey_password
- Mldonkey password, default none
-
-
mpd_host
Host of MPD server
Uptime in a shorter format
- seti_prog
- Seti@home current progress
-
-
- seti_progbar (height),(width)
- Seti@home current progress bar
-
-
- seti_credit
- Seti@home total user credit
-
-
voffset (pixels)
Change vertical offset by N pixels. Negative values will cause
text to overlap. See also $offset.
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
-IUSE="truetype X ipv6 bmpx bmp xmms xmms2 infopipe audacious"
+IUSE="truetype X ipv6 audacious bmpx"
DEPEND_COMMON="
virtual/libc
x11-libs/libX11
x11-libs/libSM
x11-libs/libXrender
+ x11-libs/libXdamage
x11-libs/libXft
)
virtual/x11
)
truetype? ( >=media-libs/freetype-2 )
+ audacious? ( >=media-sound/audacious-0.1 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
- audacious? ( >=media-sound/audacious-0.1 )
- xmms2? ( medis-sound/xmms2 )
)"
RDEPEND="${DEPEND_COMMON}"
fi
local myconf
myconf="--enable-double-buffer --enable-own-window --enable-proc-uptime \
- --enable-mpd --enable-mldonkey"
+ --enable-mpd"
econf \
${myconf} \
$(use_enable truetype xft) \
$(use_enable X x11) \
- $(use_enable bmpx) \
- $(use_enable xmms2) \
$(use_enable audacious) \
+ $(use_enable bmpx) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86 ~alpha"
-IUSE="truetype X ipv6 bmpx bmp xmms infopipe audacious"
+IUSE="truetype X ipv6 audacious bmpx"
DEPEND_COMMON="
virtual/libc
virtual/x11
)
truetype? ( >=media-libs/freetype-2 )
+ audacious? ( >=media-sound/audacious-0.1 )
bmpx? ( media-sound/bmpx
>=sys-apps/dbus-0.35
)
- bmp? ( media-sound/beep-media-player )
- audacious? ( media-sound/audacious )
- infopipe? ( || ( media-plugins/xmms-infopipe media-plugins/bmp-infopipe ) )
- xmms? ( media-sound/xmms )
)"
RDEPEND="${DEPEND_COMMON}"
fi
local myconf
myconf="--enable-double-buffer --enable-own-window --enable-proc-uptime \
- --enable-mpd --enable-mldonkey"
+ --enable-mpd"
econf \
${myconf} \
$(use_enable truetype xft) \
$(use_enable X x11) \
- $(use_enable bmpx) \
- $(use_enable bmp) \
- $(use_enable xmms) \
$(use_enable audacious) \
- $(use_enable infopipe) \
+ $(use_enable bmpx) \
$(use_enable !ipv6 portmon) || die "econf failed"
emake ${mymake} || die "compile failed"
}
AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
fi
-dnl
-dnl Seti@Home
-dnl
-
-AC_ARG_ENABLE([seti],
- AC_HELP_STRING([--enable-seti], [enable if you want SETI at Home stats [[default=yes]]]),
- [want_seti="$enableval"], [want_seti=yes])
-
-AM_CONDITIONAL(BUILD_SETI, test x$want_seti = xyes)
-if test x$want_seti = xyes; then
- AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
-fi
dnl
dnl Hddtemp
dnl Cairo
dnl
-dnl
-dnl MLDonkey
-dnl
-
-AC_ARG_ENABLE([mldonkey],
- AC_HELP_STRING([--enable-mldonkey], [enable if you want MLDonkey support [[default=no]]]),
- [want_mldonkey="$enableval"], [want_mldonkey=no])
-
-AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
-if test x$want_mldonkey = xyes; then
- AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
-fi
dnl
dnl ICONV
* music detection:
audacious: $want_audacious
bmpx: $want_bmpx
- xmms2: $want_xmms2
mpd: $want_mpd
+ xmms2: $want_xmms2
* general:
+ hddtemp: $want_hddtemp
portmon: $want_portmon
- mldonkey: $want_mldonkey
- hddtemp: $want_hddtemp
EOF
</varlistentry>
<varlistentry>
- <term><command><option>mldonkey_hostname</option></command></term>
- <listitem>
- Hostname for mldonkey stuff, defaults to localhost
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><command><option>mldonkey_port</option></command></term>
- <listitem>
- Mldonkey port, 4001 default
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><command><option>mldonkey_login</option></command></term>
- <listitem>
- Mldonkey login, default none
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term><command><option>mldonkey_password</option></command></term>
- <listitem>
- Mldonkey password, default none
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
<term><command><option>mpd_host</option></command></term>
<listitem>
Host of MPD server
.TP
\fB\*(T<\fBsh autogen.sh\fR\*(T>\fR \*(T<\fB# Only required if building from Svn\fR\*(T>
.TP
-\fB\*(T<\fB\&./configure \fR\*(T>\fR\*(T<\fB\-\-prefix=/usr \-\-mandir=/usr/share/man \-\-infodir=/usr/share/info \-\-datadir=/usr/share \-\-sysconfdir=/etc \-\-localstatedir=/var/lib \-\-enable\-xft \-\-enable\-own\-window \-\-enable\-proc\-uptime \-\-enable\-audacious \-\-enable\-bmpx \-\-enable\-seti \-\-enable\-hddtemp \-\-enable\-mpd \-\-enable\-xmms2 \-\-enable\-imlib2 \-\-enable\-portmon \-\-enable\-mldonkey \-\-enable\-debug \-\-enable\-double\-buffer \-\-enable\-xdamage \-\-enable\-x11\fR\*(T>
+\fB\*(T<\fB\&./configure \fR\*(T>\fR\*(T<\fB\-\-prefix=/usr \-\-mandir=/usr/share/man \-\-infodir=/usr/share/info \-\-datadir=/usr/share \-\-sysconfdir=/etc \-\-localstatedir=/var/lib \-\-enable\-xft \-\-enable\-own\-window \-\-enable\-proc\-uptime \-\-enable\-audacious \-\-enable\-bmpx \-\-enable\-hddtemp \-\-enable\-mpd \-\-enable\-xmms2 \-\-enable\-imlib2 \-\-enable\-portmon \-\-enable\-debug \-\-enable\-double\-buffer \-\-enable\-xdamage \-\-enable\-x11\fR\*(T>
.TP
\fB\*(T<\fBmake\fR\*(T>\fR
.TP
Allow each port monitor to track at least this many connections (if 0 or not set, default is 256)
.TP
-\fB\*(T<\fBmldonkey_hostname\fR\*(T>\fR
-Hostname for mldonkey stuff, defaults to localhost
-
-.TP
-\fB\*(T<\fBmldonkey_port\fR\*(T>\fR
-Mldonkey port, 4001 default
-
-.TP
-\fB\*(T<\fBmldonkey_login\fR\*(T>\fR
-Mldonkey login, default none
-
-.TP
-\fB\*(T<\fBmldonkey_password\fR\*(T>\fR
-Mldonkey password, default none
-
-.TP
\fB\*(T<\fBmpd_host\fR\*(T>\fR
Host of MPD server
Uptime in a shorter format
.TP
-\fB\*(T<\fBseti_prog\fR\*(T>\fR
-Seti@home current progress
-
-.TP
-\fB\*(T<\fBseti_progbar\fR\*(T>\fR \*(T<\fB(height),(width)\fR\*(T>
-Seti@home current progress bar
-
-.TP
-\fB\*(T<\fBseti_credit\fR\*(T>\fR
-Seti@home total user credit
-
-.TP
\fB\*(T<\fBvoffset\fR\*(T>\fR \*(T<\fB(pixels)\fR\*(T>
Change vertical offset by N pixels. Negative values will cause text to overlap. See also $offset.
</varlistentry>
<varlistentry>
<term>
- <command><option>./configure </option></command><option>--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-xft --enable-own-window --enable-proc-uptime --enable-audacious --enable-bmpx --enable-seti --enable-hddtemp --enable-mpd --enable-xmms2 --enable-imlib2 --enable-portmon --enable-mldonkey --enable-debug --enable-double-buffer --enable-xdamage --enable-x11</option>
+ <command><option>./configure </option></command><option>--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-xft --enable-own-window --enable-proc-uptime --enable-audacious --enable-bmpx --enable-hddtemp --enable-mpd --enable-xmms2 --enable-imlib2 --enable-portmon --enable-debug --enable-double-buffer --enable-xdamage --enable-x11</option>
</term>
</varlistentry>
<varlistentry>
<varlistentry>
<term>
- <command><option>seti_prog</option></command>
- </term>
- <listitem>
- Seti@home current progress
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term>
- <command><option>seti_progbar</option></command>
- <option>(height),(width)</option>
- </term>
- <listitem>
- Seti@home current progress bar
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term>
- <command><option>seti_credit</option></command>
- </term>
- <listitem>
- Seti@home total user credit
- <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
- <term>
<command><option>voffset</option></command>
<option>(pixels)</option>
</term>
bmpx = bmpx.c
endif
-if BUILD_SETI
-seti = seti.c
-endif
-
if BUILD_MPD
mpd = mpd.c libmpdclient.c
endif
port_monitors = libtcp-portmon.h libtcp-portmon.c hash.h hash.c
endif
-if BUILD_MLDONKEY
-mldonkey = mldonkey.c
-endif
-
if BUILD_X11
x11 = x11.c
endif
$(linux) \
mail.c \
mixer.c \
- $(mldonkey) \
$(mpd) \
$(netbsd) \
$(port_monitors) \
- $(seti) \
$(solaris) \
remotec.c \
remotec.h \
libmpdclient.h \
libtcp-portmon.c \
libtcp-portmon.h \
- mldonkey.c \
mpd.c \
netbsd.c \
- seti.c \
solaris.c \
top.h \
x11.c \
update_i8k();
#endif /* __linux__ */
-#ifdef MLDONKEY
- if (NEED(INFO_MLDONKEY))
- get_mldonkey_status(&mlconfig, &mlinfo);
-#endif
-
-#ifdef SETI
- if (NEED(INFO_SETI))
- update_seti();
-#endif
-
#ifdef MPD
if (NEED(INFO_MPD))
update_mpd();
#ifdef BMPX
" * bmpx\n"
#endif /* BMPX */
-#ifdef XMMS2
- " * xmms2\n"
-#endif /* XMMS2 */
#ifdef MPD
" * mpd\n"
#endif /* MPD */
+#ifdef XMMS2
+ " * xmms2\n"
+#endif /* XMMS2 */
"\n General features:\n"
+#ifdef HDDTEMP
+ " * hddtemp\n"
+#endif /* HDDTEMP */
#ifdef TCP_PORT_MONITOR
" * portmon\n"
#endif /* TCP_PORT_MONITOR */
-#ifdef MLDONKEY
- " * mldonkey\n"
-#endif /* MLDONKEY */
-#ifdef HDDTEMP
- " * hddtemp\n"
-#endif /* HDDTEMP */
-#ifdef SETI
- " * seti\n"
-#endif /* SETI*/
"\n");
exit(0);
"${color grey}Networking:\n"
" Up:$color ${upspeed eth0} k/s${color grey} - Down:$color ${downspeed eth0} k/s\n"
"$hr\n"
-#ifdef SETI
- "${color grey}SETI@Home Statistics:\n"
- "${color grey}Seti Unit Number:$color $seti_credit\n"
- "${color grey}Seti Progress:$color $seti_prog% $seti_progbar\n"
-#endif
#ifdef MPD
"${color grey}MPD: $mpd_status $mpd_artist - $mpd_title from $mpd_album at $mpd_vol\n"
"Bitrate: $mpd_bitrate\n" "Progress: $mpd_bar\n"
OBJ_new_mails,
OBJ_nodename,
OBJ_pre_exec,
-#ifdef MLDONKEY
- OBJ_ml_upload_counter,
- OBJ_ml_download_counter,
- OBJ_ml_nshared_files,
- OBJ_ml_shared_counter,
- OBJ_ml_tcp_upload_rate,
- OBJ_ml_tcp_download_rate,
- OBJ_ml_udp_upload_rate,
- OBJ_ml_udp_download_rate,
- OBJ_ml_ndownloaded_files,
- OBJ_ml_ndownloading_files,
-#endif
OBJ_processes,
OBJ_running_processes,
OBJ_shadecolor,
OBJ_apm_battery_time,
OBJ_apm_battery_life,
#endif /* __FreeBSD__ */
-#ifdef SETI
- OBJ_seti_prog,
- OBJ_seti_progbar,
- OBJ_seti_credit,
-#endif
#ifdef MPD
OBJ_mpd_title,
OBJ_mpd_artist,
return obj;
}
-#ifdef MLDONKEY
-void ml_cleanup()
-{
- if (mlconfig.mldonkey_hostname) {
- free(mlconfig.mldonkey_hostname);
- mlconfig.mldonkey_hostname = NULL;
- }
-}
-#endif
-
static void free_text_objects(unsigned int count, struct text_object *objs)
{
unsigned int i;
scan_mixer_bar(arg, &obj->data.mixerbar.l,
&obj->data.mixerbar.w, &obj->data.mixerbar.h);
END
-#ifdef MLDONKEY
- OBJ(ml_upload_counter, INFO_MLDONKEY)
- END OBJ(ml_download_counter, INFO_MLDONKEY)
- END OBJ(ml_nshared_files, INFO_MLDONKEY)
- END OBJ(ml_shared_counter, INFO_MLDONKEY)
- END OBJ(ml_tcp_upload_rate, INFO_MLDONKEY)
- END OBJ(ml_tcp_download_rate, INFO_MLDONKEY)
- END OBJ(ml_udp_upload_rate, INFO_MLDONKEY)
- END OBJ(ml_udp_download_rate, INFO_MLDONKEY)
- END OBJ(ml_ndownloaded_files, INFO_MLDONKEY)
- END OBJ(ml_ndownloading_files, INFO_MLDONKEY) END
-#endif
OBJ(new_mails, INFO_MAIL)
END OBJ(nodename, 0)
END OBJ(processes, INFO_PROCS)
OBJ(apm_battery_life, 0) END
OBJ(apm_battery_time, 0) END
#endif /* __FreeBSD__ */
-#ifdef SETI
- OBJ(seti_prog, INFO_SETI) END OBJ(seti_progbar, INFO_SETI)
- (void) scan_bar(arg, &obj->data.pair.a, &obj->data.pair.b);
- END OBJ(seti_credit, INFO_SETI) END
-#endif
OBJ(imap_unseen, 0)
if (arg) {
// proccss
text_object_count = 0;
text_objects = NULL;
-#ifdef MLDONKEY
- ml_cleanup();
-#endif /* MLDONKEY */
-
list = extract_variable_text_internal(p);
text_objects = list->text_objects;
OBJ(new_mails) {
snprintf(p, p_max_size, "%d", cur->new_mail_count);
}
-#ifdef MLDONKEY
- OBJ(ml_upload_counter) {
- snprintf(p, p_max_size, "%lld",
- mlinfo.upload_counter / 1048576);
- }
- OBJ(ml_download_counter) {
- snprintf(p, p_max_size, "%lld",
- mlinfo.download_counter /
- 1048576);
- }
- OBJ(ml_nshared_files) {
- snprintf(p, p_max_size, "%i", mlinfo.nshared_files);
- }
- OBJ(ml_shared_counter) {
- snprintf(p, p_max_size, "%lld",
- mlinfo.shared_counter / 1048576);
- }
- OBJ(ml_tcp_upload_rate) {
- snprintf(p, p_max_size, "%.2f",
- (float) mlinfo.tcp_upload_rate /
- 1024);
- }
- OBJ(ml_tcp_download_rate) {
- snprintf(p, p_max_size, "%.2f",
- (float) mlinfo.tcp_download_rate /
- 1024);
- }
- OBJ(ml_udp_upload_rate) {
- snprintf(p, p_max_size, "%.2f",
- (float) mlinfo.udp_upload_rate /
- 1024);
- }
- OBJ(ml_udp_download_rate) {
- snprintf(p, p_max_size, "%.2f",
- (float) mlinfo.udp_download_rate /
- 1024);
- }
- OBJ(ml_ndownloaded_files) {
- snprintf(p, p_max_size, "%i",
- mlinfo.ndownloaded_files);
- }
- OBJ(ml_ndownloading_files) {
- snprintf(p, p_max_size, "%i",
- mlinfo.ndownloading_files);
- }
-#endif
OBJ(nodename) {
snprintf(p, p_max_size, "%s",
free(msg);
}
#endif /* __FreeBSD__ */
-#ifdef SETI
- OBJ(seti_prog) {
- snprintf(p, p_max_size, "%.2f",
- cur->seti_prog * 100.0f);
- }
- OBJ(seti_progbar) {
- new_bar(p, obj->data.pair.a,
- obj->data.pair.b,
- (int) (cur->seti_prog * 255.0f));
- }
- OBJ(seti_credit) {
- snprintf(p, p_max_size, "%.0f", cur->seti_credit);
- }
-#endif
#ifdef MPD
OBJ(mpd_title) {
text_object_count = 0;
text_objects = NULL;
-#ifdef MLDONKEY
- ml_cleanup();
-#endif /* MLDONKEY */
-
if (text != original_text)
free(text);
free(current_config);
free(current_mail_spool);
-#ifdef SETI
- free(seti_dir);
-#endif
#ifdef TCP_PORT_MONITOR
destroy_tcp_port_monitor_collection( info.p_tcp_port_monitor_collection );
info.p_tcp_port_monitor_collection = NULL;
no_buffers = 1;
update_interval = 10.0;
stuff_in_upper_case = 0;
-#ifdef MLDONKEY
- mlconfig.mldonkey_hostname = strdup("127.0.0.1");
- mlconfig.mldonkey_port = 4001;
- mlconfig.mldonkey_login = NULL;
- mlconfig.mldonkey_password = NULL;
-#endif
#ifdef TCP_PORT_MONITOR
tcp_port_monitor_collection_args.min_port_monitors = MIN_PORT_MONITORS_DEFAULT;
CONF("no_buffers") {
no_buffers = string_to_bool(value);
}
-#ifdef MLDONKEY
- CONF("mldonkey_hostname") {
- if (value) {
- if (mlconfig.mldonkey_hostname != NULL) {
- free(mlconfig.mldonkey_hostname);
- }
- mlconfig.mldonkey_hostname = strdup(value);
- }
- else
- CONF_ERR;
- }
- CONF("mldonkey_port") {
- if (value)
- mlconfig.mldonkey_port = atoi(value);
- else
- CONF_ERR;
- }
- CONF("mldonkey_login") {
- if (value) {
- if (mlconfig.mldonkey_login != NULL) {
- free(mlconfig.mldonkey_login);
- }
- mlconfig.mldonkey_login = strdup(value);
- }
- else
- CONF_ERR;
- }
- CONF("mldonkey_password") {
- if (value) {
- if (mlconfig.mldonkey_password != NULL) {
- free(mlconfig.mldonkey_password);
- }
- mlconfig.mldonkey_password = strdup(value);
- }
- else
- CONF_ERR;
- }
-#endif
CONF("pad_percents") {
pad_percents = atoi(value);
}
CONF("uppercase") {
stuff_in_upper_case = string_to_bool(value);
}
-#ifdef SETI
- CONF("seti_dir") {
- seti_dir = (char *)
- malloc(strlen(value)
- + 1);
- strcpy(seti_dir, value);
- }
-#endif
CONF("text") {
if (text != original_text)
free(text);
INFO_MAIL = 1,
INFO_MEM = 2,
INFO_NET = 3,
-#ifdef SETI
- INFO_SETI = 4,
-#endif
- INFO_PROCS = 5,
- INFO_RUN_PROCS = 6,
- INFO_UPTIME = 7,
- INFO_BUFFERS = 8,
- INFO_FS = 9,
- INFO_I2C = 10,
- INFO_MIXER = 11,
- INFO_LOADAVG = 12,
- INFO_UNAME = 13,
- INFO_FREQ = 14,
+ INFO_PROCS = 4,
+ INFO_RUN_PROCS = 5,
+ INFO_UPTIME = 6,
+ INFO_BUFFERS = 7,
+ INFO_FS = 8,
+ INFO_I2C = 9,
+ INFO_MIXER = 10,
+ INFO_LOADAVG = 11,
+ INFO_UNAME = 12,
+ INFO_FREQ = 13,
#ifdef MPD
- INFO_MPD = 15,
+ INFO_MPD = 14,
#endif
- INFO_TOP = 16,
-#ifdef MLDONKEY
- INFO_MLDONKEY = 18,
-#endif
- INFO_WIFI = 19,
- INFO_DISKIO = 20,
- INFO_I8K = 21,
+ INFO_TOP = 15,
+ INFO_WIFI = 16,
+ INFO_DISKIO = 17,
+ INFO_I8K = 18,
#ifdef TCP_PORT_MONITOR
- INFO_TCP_PORT_MONITOR = 22,
+ INFO_TCP_PORT_MONITOR = 19,
#endif
#ifdef AUDACIOUS
- INFO_AUDACIOUS = 23,
+ INFO_AUDACIOUS = 20,
#endif
#ifdef BMPX
- INFO_BMPX = 24,
+ INFO_BMPX = 21,
#endif
#ifdef XMMS2
- INFO_XMMS2 = 25,
+ INFO_XMMS2 = 22,
#endif
};
int new_mail_count, mail_count;
struct mail_s* mail;
int mail_running;
-#ifdef SETI
- float seti_prog;
- float seti_credit;
-#endif
#ifdef MPD
struct mpd_s mpd;
mpd_Connection *conn;
void update_mail_count();
-/* in seti.c */
-
-#ifdef SETI
-extern char *seti_dir;
-
-void update_seti();
-#endif
-
/* in freebsd.c */
#if defined(__FreeBSD__)
kvm_t *kd;
void update_mpd();
#endif
-/* in xmm2.c */
+/* in xmms2.c */
#ifdef XMMS2
void update_xmms2();
#endif
-#ifdef MLDONKEY
-/* in mldonkey.c */
-typedef long long int64;
-/* The info necessary to connect to mldonkey. login and password can be NULL. */
-typedef struct mldonkey_config {
- char *mldonkey_hostname;
- int mldonkey_port;
- char *mldonkey_login;
- char *mldonkey_password;
-} mldonkey_config;
-
-/* The MLDonkey status returned */
-typedef struct mldonkey_info {
- int64 upload_counter;
- int64 download_counter;
- int nshared_files;
- int64 shared_counter;
- int tcp_upload_rate;
- int tcp_download_rate;
- int udp_upload_rate;
- int udp_download_rate;
- int ndownloaded_files;
- int ndownloading_files;
- int nconnected_networks;
- int connected_networks[1];
-} mldonkey_info;
-
-extern mldonkey_info mlinfo;
-extern mldonkey_config mlconfig;
-
-int get_mldonkey_status(mldonkey_config * config, mldonkey_info * info);
-#endif
-
/* in hddtemp.c */
#ifdef HDDTEMP
int scan_hddtemp(const char *arg, char **dev, char **addr, int *port);
+++ /dev/null
-/*
- * mldonkey.c: MLDonkey stuff for Conky
- *
- * $Id$
- */
-
-#include <arpa/inet.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "conky.h"
-
-int64 buf_to_int(char *buf, int pos, int size);
-void int_to_buf(int64 i, char *buf, int pos, int size);
-
-#define BUF16_TO_INT(buf, pos) buf_to_int((buf), (pos), 2)
-#define BUF32_TO_INT(buf, pos) buf_to_int((buf), (pos), 4)
-#define BUF64_TO_INT(buf, pos) buf_to_int((buf), (pos), 8)
-
-#define INT_TO_BUF16(i, buf, pos) int_to_buf((i), (buf), (pos), 2)
-#define INT_TO_BUF32(i, buf, pos) int_to_buf((i), (buf), (pos), 4)
-#define INT_TO_BUF64(i, buf, pos) int_to_buf((i), (buf), (pos), 8)
-
-mldonkey_info mlinfo;
-mldonkey_config mlconfig;
-
-/* Call this function to update the information about mldonkey.
- * Note that the function will not reconnect to mldonkey if the
- * pointer to the mldonkey_config has not changed. As it uses static
- * data, it cannot be used in a multithreaded env.
- * Returns 1 if connected and info filled, 0 if connected but not filled,
- * -1 otherwise. */
-
-enum to_gui {
- CoreProtocol, /* 0 */
- Options_info,
- RESERVED2,
- DefineSearches,
- Result_info,
- Search_result,
- Search_waiting,
- File_info,
- File_downloaded,
- File_availability,
- File_source, /* 10 */
- Server_busy,
- Server_user,
- Server_state,
- Server_info,
- Client_info,
- Client_state,
- Client_friend,
- Client_file,
- Console,
- Network_info, /* 20 */
- User_info,
- Room_info,
- Room_message,
- Room_add_user,
- Client_stats,
- Server_info_v2,
- MessageFromClient,
- ConnectedServers,
- DownloadFiles,
- DownloadedFiles, /* 30 */
- Room_info_v2,
- Room_remove_user,
- Shared_file_info,
- Shared_file_upload,
- Shared_file_unshared,
- Add_section_option,
- Client_stats_v2,
- Add_plugin_option,
- Client_stats_v3,
- File_info_v2, /* 40 */
- DownloadFiles_v2,
- DownloadedFiles_v2,
- File_info_v3,
- DownloadFiles_v3,
- DownloadedFiles_v3,
- File_downloaded_v2,
- BadPassword,
- Shared_file_info_v2,
- Client_stats_v4, /* 49 */
-};
-
-#define MLDONKEY_DISCONNECTED 0
-#define MLDONKEY_CONNECTING 1
-#define MLDONKEY_AUTHENTICATING 2
-#define MLDONKEY_CONNECTED 3
-
-#define MAX_MESSAGE_LEN 65000
-static int write_pos = 0;
-static char write_buf[MAX_MESSAGE_LEN];
-static char read_buf[MAX_MESSAGE_LEN];
-static int read_pos;
-static int mldonkey_sock = -1;
-static int mldonkey_state = MLDONKEY_DISCONNECTED;
-static mldonkey_config *old_config = NULL;
-
-/* int64 ------------------------------ */
-
-int64 buf_to_int(char *buf, int pos, int size)
-{
- int i;
- int64 res = 0;
-
- for (i = 0; i < size; i++) {
- res += (buf[pos + i] & 0xFF) << (8 * i);
- }
- return res;
-}
-
-void int_to_buf(int64 i, char *buf, int pos, int size)
-{
- int j;
-
- for (j = 0; j < size; j++) {
- buf[pos + j] = (i & (-1)) >> (8 * j);
- }
-}
-
-/* Write operations --------------------- */
-
-void init_message()
-{
- write_pos = 0;
-}
-
-void write_int8(int code)
-{
- write_buf[write_pos++] = code;
-}
-
-void write_opcode(int code)
-{
- write_buf[write_pos++] = code;
-}
-
-void write_int16(int code)
-{
- INT_TO_BUF16(code, write_buf, write_pos);
- write_pos += 2;
-}
-
-void write_int32(int code)
-{
- INT_TO_BUF32(code, write_buf, write_pos);
- write_pos += 4;
-}
-
-void write_int64(int64 code)
-{
- INT_TO_BUF64(code, write_buf, write_pos);
- write_pos += 8;
-}
-
-void write_string(char *str)
-{
- if (str == NULL) {
- write_int16(0);
- } else {
- int len = strlen(str);
- write_int16(len);
- memcpy((void *) (write_buf + write_pos), (void *) str,
- (size_t) len);
- write_pos += len;
- }
-}
-
-
-int write_message(char *mtype)
-{
- char header[4];
-
- INT_TO_BUF32(write_pos, header, 0);
- if (4 != write(mldonkey_sock, header, 4) ||
- write_pos != write(mldonkey_sock, (void *) write_buf,
- (size_t) write_pos)) {
- ERR("Error in transmitting %s\n", mtype);
- write_pos = 0;
-
- /* Immediatly close the connection */
- close(mldonkey_sock);
- mldonkey_state = MLDONKEY_DISCONNECTED;
- mldonkey_sock = -1;
- return -1;
- } else {
- write_pos = 0;
- return 0;
- }
-}
-
-
-/* Read operations ----------------------------*/
-
-int read_int8()
-{
- return read_buf[read_pos++];
-}
-
-int read_int16()
-{
- int i = BUF16_TO_INT(read_buf, read_pos);
- read_pos += 2;
- return i;
-}
-
-int read_int32()
-{
- int i = BUF32_TO_INT(read_buf, read_pos);
- read_pos += 4;
- return i;
-}
-
-int64 read_int64()
-{
- int64 i = BUF64_TO_INT(read_buf, read_pos);
- read_pos += 8;
- return i;
-}
-
-char *read_string()
-{
- char *buf;
- int len;
-
- len = BUF16_TO_INT(read_buf, read_pos);
- read_pos += 2;
-
- buf = (char *) malloc((size_t) len + 1);
- memmove(read_buf + read_pos, buf, len);
- buf[len] = 0;
- read_pos += len;
-
- return buf;
-}
-
-/* protocol impl. ----------------------------- */
-
-void close_sock();
-
-/* This function returns the number of messages read, 0 if it blocks,
--1 on error. */
-int cut_messages(int reinit)
-{
- int nread;
- static int toread = 0;
- static int pos = 0;
-
- if (reinit) {
- toread = 0;
- pos = 0;
- read_pos = 0;
- return 0;
- }
-
- while (1) {
- if (toread == 0) {
- nread =
- read(mldonkey_sock, read_buf + pos, 4 - pos);
- if (nread <= 0) {
- if (errno == EAGAIN) {
- return 0;
- } else {
- close_sock();
- pos = 0;
- toread = 0;
- return -1;
- }
- }
- pos += nread;
- if (pos == 4) {
- toread = BUF32_TO_INT(read_buf, 0);
- pos = 0;
- }
- } else {
- nread =
- read(mldonkey_sock, read_buf + pos,
- toread - pos);
- if (nread <= 0) {
- if (errno == EAGAIN)
- return 0;
- else {
- pos = 0;
- toread = 0;
- close_sock();
- return -1;
- }
- }
- pos += nread;
- if (pos == toread) {
- /* We have one message !!! */
- int old_pos = pos;
- read_pos = 0;
- pos = 0;
- toread = 0;
-
- return old_pos;
- }
- }
- }
-}
-
-void close_sock()
-{
- old_config = NULL;
- if (mldonkey_sock >= 0)
- close(mldonkey_sock);
- mldonkey_sock = -1;
- mldonkey_state = MLDONKEY_DISCONNECTED;
- cut_messages(1);
-}
-
-int mldonkey_connect(mldonkey_config * config)
-{
- if (config != old_config) {
- struct sockaddr_in sa;
- int retcode;
- close_sock();
-
-
- old_config = config;
- /* resolve hostname */
- memset(&sa, 0, sizeof(sa));
-
- if (config->mldonkey_hostname == NULL)
- config->mldonkey_hostname = "127.0.0.1";
- if (config->mldonkey_hostname[0] >= '0' &&
- config->mldonkey_hostname[0] <= '9') {
-#ifdef HAS_INET_ATON
- if (inet_aton
- (config->mldonkey_hostname, &sa.sin_addr) == 0)
- return -1;
-#else
-
- sa.sin_addr.s_addr =
- inet_addr(config->mldonkey_hostname);
- if (sa.sin_addr.s_addr == (unsigned int) -1)
- return -1;
-#endif
-
- } else {
- struct hostent *hp;
- hp = gethostbyname(config->mldonkey_hostname);
- if (hp == (struct hostent *) NULL)
- return -1;
- sa.sin_addr.s_addr =
- (unsigned long) hp->h_addr_list[0];
- }
-
- sa.sin_port = htons(config->mldonkey_port);
- sa.sin_family = AF_INET;
-
- if ((mldonkey_sock = socket(PF_INET, SOCK_STREAM, 0)) < 0) {
- ERR("Opening socket");
- close_sock();
- return -1;
- }
-
- if (connect
- (mldonkey_sock, (struct sockaddr *) &sa,
- sizeof(sa)) < 0) {
- if (errno != EAGAIN && errno != EINTR
- && errno != EINPROGRESS
- && errno != EWOULDBLOCK) {
-// ERR("Connection failed");
- close_sock();
- return -1;
- }
- }
-
- retcode = fcntl(mldonkey_sock, F_GETFL, 0);
- if (retcode == -1 ||
- fcntl(mldonkey_sock, F_SETFL,
- retcode | O_NONBLOCK) == -1) {
- return -1;
- }
-
-
- mldonkey_state = MLDONKEY_CONNECTING;
- return 0;
- }
-
- return 0;
-}
-
-int mldonkey_can_read()
-{
- return cut_messages(0);
-}
-
-int mldonkey_info_message(mldonkey_info * info)
-{
- int opcode = read_int16();
-
- switch (opcode) {
-
- case CoreProtocol:
- init_message();
-
- write_int16(0); /* GUI protocol */
- write_int32(10); /* Version 10 ! */
- write_message("GuiProtocol");
-
- write_int16(47); /* GUI protocol */
-
- write_int16(1);
- write_int32(1);
- write_int8(1);
- write_message("GuiExtensions");
-
- init_message();
- write_int16(5); /* Password */
- write_string(old_config->mldonkey_password);
- write_message("Password");
-
- break;
-
- case BadPassword:
- ERR("Bad Password\n");
- close_sock();
- break;
-
- case Client_stats:
- case Client_stats_v2:
- case Client_stats_v3:
- ERR("Client stats format too old...\n");
- break;
-
- case Client_stats_v4:
- mldonkey_state = MLDONKEY_CONNECTED;
-
- info->upload_counter = read_int64();
- info->download_counter = read_int64();
- info->shared_counter = read_int64();
- info->nshared_files = read_int32();
- info->tcp_upload_rate = read_int32();
- info->tcp_download_rate = read_int32();
- info->udp_upload_rate = read_int32();
- info->udp_download_rate = read_int32();
- info->ndownloading_files = read_int32();
- info->ndownloaded_files = read_int32();
-
- break;
- }
-
- return 0;
-}
-
-int get_mldonkey_status(mldonkey_config * config, mldonkey_info * info)
-{
- if (mldonkey_connect(config) >= 0) {
- while (mldonkey_can_read() > 0) {
- mldonkey_info_message(info);
- }
- }
- return mldonkey_state;
-}
+++ /dev/null
-/*
- * seti.c: information about SETI for Conky
- *
- * $Id$
- */
-
-#include "conky.h"
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-char *seti_dir = NULL;
-
-/*
- * Need to code for BOINC, because the old SETI@Home does not use xml to store data.
- * Perhaps in the .conkyrc file there could be an option for BOINC or old SETI.
- */
-
-/*static float seti_get_float (FILE *fp, const char *name)
-{
- char buffer[80];
- char *token;
-
- while (!feof(fp) && !ferror (fp))
- {
- fgets(buffer, 80, fp);
- token = strtok(buffer, ">");
-
- if (strcmp(token, name) == 0)
- {
- token = strtok(NULL, "<");
- if ( token != NULL )
- return atof (token);
- break;
- }
- }
- return 0.0f;
-}*/
-
-float seti_get_data(FILE * fp, const char *name)
-{
- char token[1000];
- char buffer[1000];
- float data;
-
- while (fgets(token, 1000, fp) != NULL) //read the file
- if (strncmp(token, name, strlen(name)) == 0) { //and search for the data in name
- strcpy(buffer, strchr(token, '=') + 1); //copy just the number
- break;
- }
- data = atof(buffer);
- return data;
-}
-
-void update_seti()
-{
- if (seti_dir == NULL)
- return;
-
- char filename[80];
-
- struct information *current_info = &info;
-
- current_info->seti_prog = current_info->seti_credit = 0.0f;
-
- /* read total user credit */
-
- /*FILE *fp = fopen(filename, "r");
- if (!fp)
- return;
-
- seti_credit = seti_get_float(fp, "<user_total_credit");
-
- fclose (fp); */
-
- snprintf(filename, 80, "%s/user_info.sah", seti_dir);
-
- FILE *fp = fopen(filename, "r");
-
- if (!fp) {
- return;
- }
-
- current_info->seti_credit = seti_get_data(fp, "nresults");
-
- fclose(fp);
-
- /* read current progress */
-
- /*snprintf(filename, 80, "%s/slots/0/state.sah", seti_dir);
- fp = fopen(filename, "r");
- if (!fp)
- return;
-
- seti_prog = seti_get_float(fp, "<prog");
-
- fclose (fp);
-
- snprintf(filename, 80, "%s/slots/0/init_data.xml", seti_dir); */
-
- snprintf(filename, 80, "%s/state.sah", seti_dir);
-
- fp = fopen(filename, "r");
- if (!fp)
- return;
-
- current_info->seti_prog = seti_get_data(fp, "prog");
-
- fclose(fp);
-
-}