Makefile.am: top.c was enlisted as Linux-only source, though it is
required for conky on every operating system.
conky.[ch]: top_running definition was inside #ifdef __linux__, though
required by top.c on every operating system.
freebsd.c: Change return type of update_*() to int, as required by
common.h; remove free_all_processes() as it is defined by top.c. The
changes done to freebsd.c must be done to netbsd.c and openbsd.c, too.
I did not do it as I have no opportunity to test conky under NetBSD or
OpenBSD.
Signed-off-by: Alexander Graf <agraf@znc.in>
mboxscan.h read_tcp.c read_tcp.h scroll.c scroll.h specials.c \
specials.h tailhead.c tailhead.h temphelper.c temphelper.h \
text_object.c text_object.h timeinfo.c timeinfo.h algebra.c \
mboxscan.h read_tcp.c read_tcp.h scroll.c scroll.h specials.c \
specials.h tailhead.c tailhead.h temphelper.c temphelper.h \
text_object.c text_object.h timeinfo.c timeinfo.h algebra.c \
- algebra.h proc.c proc.h user.c user.h
+ algebra.h proc.c proc.h user.c user.h top.c top.h
# source files only needed when the apropriate option is enabled
audacious = audacious.c audacious.h
# source files only needed when the apropriate option is enabled
audacious = audacious.c audacious.h
mpd = mpd.c mpd.h libmpdclient.c libmpdclient.h
moc = moc.c moc.h
xmms2 = xmms2.c xmms2.h
mpd = mpd.c mpd.h libmpdclient.c libmpdclient.h
moc = moc.c moc.h
xmms2 = xmms2.c xmms2.h
-linux = linux.c linux.h top.c top.h users.c sony.c sony.h i8k.c i8k.h
+linux = linux.c linux.h users.c sony.c sony.h i8k.c i8k.h
solaris = solaris.c
freebsd = freebsd.c freebsd.h
netbsd = netbsd.c netbsd.h
solaris = solaris.c
freebsd = freebsd.c freebsd.h
netbsd = netbsd.c netbsd.h
#ifdef IOSTATS
int top_io;
#endif
#ifdef IOSTATS
int top_io;
#endif
int output_methods;
static int extra_newline;
enum x_initialiser_state x_initialised = NO;
int output_methods;
static int extra_newline;
enum x_initialiser_state x_initialised = NO;
#ifdef IOSTATS
extern int top_io;
#endif
#ifdef IOSTATS
extern int top_io;
#endif
/* defined in conky.c, needed by top.c */
extern int cpu_separate;
/* defined in conky.c, needed by top.c */
extern int cpu_separate;
-void update_uptime(void)
{
int mib[2] = { CTL_KERN, KERN_BOOTTIME };
struct timeval boottime;
{
int mib[2] = { CTL_KERN, KERN_BOOTTIME };
struct timeval boottime;
fprintf(stderr, "Could not get uptime\n");
info.uptime = 0;
}
fprintf(stderr, "Could not get uptime\n");
info.uptime = 0;
}
}
int check_mount(char *s)
}
int check_mount(char *s)
-void update_meminfo(void)
+int update_meminfo(void)
{
u_int total_pages, inactive_pages, free_pages;
unsigned long swap_avail, swap_free;
{
u_int total_pages, inactive_pages, free_pages;
unsigned long swap_avail, swap_free;
info.swap = 0;
info.swapfree = 0;
}
info.swap = 0;
info.swapfree = 0;
}
-void update_net_stats(void)
+int update_net_stats(void)
{
struct net_stat *ns;
double delta;
{
struct net_stat *ns;
double delta;
/* get delta */
delta = current_update_time - last_update_time;
if (delta <= 0.0001) {
/* get delta */
delta = current_update_time - last_update_time;
if (delta <= 0.0001) {
}
if (getifaddrs(&ifap) < 0) {
}
if (getifaddrs(&ifap) < 0) {
}
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
}
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
-void update_total_processes(void)
+int update_total_processes(void)
{
int n_processes;
kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
info.procs = n_processes;
{
int n_processes;
kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
info.procs = n_processes;
-void update_running_processes(void)
+int update_running_processes(void)
{
struct kinfo_proc *p;
int n_processes;
{
struct kinfo_proc *p;
int n_processes;
}
void get_cpu_count(void)
}
void get_cpu_count(void)
-void update_cpu_usage(void)
+int update_cpu_usage(void)
{
int i, j = 0;
long used, total;
{
int i, j = 0;
long used, total;
-void update_load_average(void)
+int update_load_average(void)
info.loadavg[0] = (double) v[0];
info.loadavg[1] = (double) v[1];
info.loadavg[2] = (double) v[2];
info.loadavg[0] = (double) v[0];
info.loadavg[1] = (double) v[1];
info.loadavg[2] = (double) v[2];
}
double get_acpi_temperature(int fd)
}
double get_acpi_temperature(int fd)
{
proc_find_top(info.cpu, info.memu);
{
proc_find_top(info.cpu, info.memu);
-void update_diskio(void)
{
int devs_count, num_selected, num_selections, dn;
struct device_selection *dev_select = NULL;
{
int devs_count, num_selected, num_selections, dn;
struct device_selection *dev_select = NULL;
if (devstat_getdevs(NULL, &statinfo_cur) < 0) {
free(statinfo_cur.dinfo);
if (devstat_getdevs(NULL, &statinfo_cur) < 0) {
free(statinfo_cur.dinfo);
}
devs_count = statinfo_cur.dinfo->numdevs;
}
devs_count = statinfo_cur.dinfo->numdevs;
}
free(statinfo_cur.dinfo);
}
free(statinfo_cur.dinfo);
}
/* While topless is obviously better, top is also not bad. */
}
/* While topless is obviously better, top is also not bad. */
-
-/* empty stub so conky links */
-void free_all_processes(void)
-{
-}