[Goodies-commits] r5178 - in xfce4-taskmanager/trunk: . src

Mike Massonnet mmassonnet at xfce.org
Thu Jul 31 00:42:44 CEST 2008


Author: mmassonnet
Date: 2008-07-30 22:42:44 +0000 (Wed, 30 Jul 2008)
New Revision: 5178

Added:
   xfce4-taskmanager/trunk/src/taskmanager-bsd.c
   xfce4-taskmanager/trunk/src/taskmanager-linux.c
   xfce4-taskmanager/trunk/src/taskmanager.h
Removed:
   xfce4-taskmanager/trunk/src/xfce-taskmanager-linux.c
   xfce4-taskmanager/trunk/src/xfce-taskmanager-linux.h
Modified:
   xfce4-taskmanager/trunk/ChangeLog
   xfce4-taskmanager/trunk/configure.in.in
   xfce4-taskmanager/trunk/src/Makefile.am
   xfce4-taskmanager/trunk/src/callbacks.h
   xfce4-taskmanager/trunk/src/functions.c
   xfce4-taskmanager/trunk/src/functions.h
Log:
Apply patch for BSD support from Landry Breuil


Modified: xfce4-taskmanager/trunk/ChangeLog
===================================================================
--- xfce4-taskmanager/trunk/ChangeLog	2008-07-30 21:44:38 UTC (rev 5177)
+++ xfce4-taskmanager/trunk/ChangeLog	2008-07-30 22:42:44 UTC (rev 5178)
@@ -1,3 +1,7 @@
+2008-07-31	Mike Massonnet <mmassonnet at xfce.org>
+
+	* Apply patch for BSD support from Landry Breuil
+
 2008-05-11	Mike Massonnet <mmassonnet at xfce.org>
 
 === Release 0.4.0 ===

Modified: xfce4-taskmanager/trunk/configure.in.in
===================================================================
--- xfce4-taskmanager/trunk/configure.in.in	2008-07-30 21:44:38 UTC (rev 5177)
+++ xfce4-taskmanager/trunk/configure.in.in	2008-07-30 22:42:44 UTC (rev 5178)
@@ -72,6 +72,20 @@
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.2.0])
 
 dnl ***********************************
+dnl ******* Check for OS family *******
+dnl ***********************************
+AC_MSG_CHECKING([for operating system family])
+case "$target_os" in
+  dragonfly*|freebsd*|netbsd*|openbsd*|darwin*)
+    ac_taskmanager_os_family=bsd
+    ;;
+  *)
+    ac_taskmanager_os_family=linux
+  esac
+AC_MSG_RESULT([$ac_taskmanager_os_family])
+AM_CONDITIONAL([OS_BSD_FAMILY], [test x"$ac_taskmanager_os_family" = x"bsd"])
+
+dnl ***********************************
 dnl *** Check for debugging support ***
 dnl ***********************************
 BM_DEBUG_SUPPORT()
@@ -82,3 +96,13 @@
 po/Makefile.in
 ])
 
+dnl ***************************
+dnl *** Print configuration ***
+dnl ***************************
+echo
+echo "Build Configuration:"
+echo
+echo "* Target OS:     $target_os"
+echo "* Debug Support: $enable_debug"
+echo
+

Modified: xfce4-taskmanager/trunk/src/Makefile.am
===================================================================
--- xfce4-taskmanager/trunk/src/Makefile.am	2008-07-30 21:44:38 UTC (rev 5177)
+++ xfce4-taskmanager/trunk/src/Makefile.am	2008-07-30 22:42:44 UTC (rev 5178)
@@ -18,10 +18,15 @@
 	functions.h							\
 	interface.c							\
 	interface.h							\
-	xfce-taskmanager-linux.c					\
-	xfce-taskmanager-linux.h					\
+	taskmanager.h							\
 	types.h
 
+if OS_BSD_FAMILY
+xfce4_taskmanager_SOURCES += taskmanager-bsd.c
+else
+xfce4_taskmanager_SOURCES += taskmanager-linux.c
+endif
+
 xfce4_taskmanager_CFLAGS =						\
 	$(LIBXFCEGUI4_CFLAGS)						\
 	$(LIBXFCE4UTIL_CFLAGS)						\

Modified: xfce4-taskmanager/trunk/src/callbacks.h
===================================================================
--- xfce4-taskmanager/trunk/src/callbacks.h	2008-07-30 21:44:38 UTC (rev 5177)
+++ xfce4-taskmanager/trunk/src/callbacks.h	2008-07-30 22:42:44 UTC (rev 5178)
@@ -32,7 +32,7 @@
 #include "interface.h"
 
 
-#include "xfce-taskmanager-linux.h"
+#include "taskmanager.h"
 
 void on_preferences(GtkButton *button);
 void on_information(GtkButton *button);

Modified: xfce4-taskmanager/trunk/src/functions.c
===================================================================
--- xfce4-taskmanager/trunk/src/functions.c	2008-07-30 21:44:38 UTC (rev 5177)
+++ xfce4-taskmanager/trunk/src/functions.c	2008-07-30 22:42:44 UTC (rev 5178)
@@ -51,18 +51,22 @@
 
 			if(new_tmp->pid == tmp->pid)
 			{
+/* FIXME refresh me? */
+#ifdef __linux
 				tmp->old_time = tmp->time;
 				tmp->time = new_tmp->time;
 
 				tmp->old_time_percentage = tmp->time_percentage;
 				tmp->time_percentage = (gdouble)(tmp->time - tmp->old_time) * (gdouble)(1/num_cpus);
-
+#endif
 				if(
 				    tmp->ppid != new_tmp->ppid ||
 				    strcmp(tmp->state,new_tmp->state) ||
 				    tmp->vsize != new_tmp->vsize ||
 				    tmp->rss != new_tmp->rss ||
+#ifdef __linux
 				    tmp->time_percentage != tmp->old_time_percentage ||
+#endif
 				    tmp->prio != new_tmp->prio
 				 )
 				{

Modified: xfce4-taskmanager/trunk/src/functions.h
===================================================================
--- xfce4-taskmanager/trunk/src/functions.h	2008-07-30 21:44:38 UTC (rev 5177)
+++ xfce4-taskmanager/trunk/src/functions.h	2008-07-30 22:42:44 UTC (rev 5178)
@@ -35,15 +35,8 @@
 
 #include "types.h"
 #include "interface.h"
+#include "taskmanager.h"
 
-#ifdef __LINUX__
-#include "xfce-taskmanager-linux.h"
-#endif
-
-#define PROC_DIR_1 "/compat/linux/proc"
-#define PROC_DIR_2 "/emul/linux/proc"
-#define PROC_DIR_3 "/proc"
-
 gboolean refresh_task_list(void);
 gdouble get_cpu_usage(system_status *sys_stat);
 

Added: xfce4-taskmanager/trunk/src/taskmanager-bsd.c
===================================================================
--- xfce4-taskmanager/trunk/src/taskmanager-bsd.c	                        (rev 0)
+++ xfce4-taskmanager/trunk/src/taskmanager-bsd.c	2008-07-30 22:42:44 UTC (rev 5178)
@@ -0,0 +1,169 @@
+/* $Id$
+ *
+ * Copyright (c) 2008 Landry Breuil <landry at xfce.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "taskmanager.h"
+/* for getpwuid() */
+#include <sys/types.h>
+#include <pwd.h>
+/* for sysctl() */
+#include <sys/param.h>
+#include <sys/sysctl.h>
+/* for kill() */
+#include <signal.h>
+#include <err.h>
+
+char	*state_abbrev[] = {
+	"", "start", "run", "sleep", "stop", "zomb", "dead", "onproc"
+};
+
+GArray *get_task_list(void)
+{
+	GArray *task_list;
+	int mib[6];
+	size_t size;
+	struct kinfo_proc2 *kp;
+	struct task t;
+	struct passwd *passwdp;
+	double d;
+	char **args, **ptr;
+	char buf[127];
+	int nproc, i;
+	fixpt_t ccpu; /* The scheduler exponential decay value. */
+	int fscale; /* The kernel fixed-point scale factor. */
+
+	task_list = g_array_new (FALSE, FALSE, sizeof (struct task));
+
+	mib[0] = CTL_KERN;
+	mib[1] = KERN_PROC2;
+	mib[2] = KERN_PROC_ALL;
+	mib[3] = 0;
+	mib[4] = sizeof(struct kinfo_proc2);
+	mib[5] = 0;
+	if (sysctl(mib, 6, NULL, &size, NULL, 0) < 0)
+		errx(1, "could not get kern.proc2 size");
+	size = 5 * size / 4;		/* extra slop */
+	if ((kp = malloc(size)) == NULL)
+		errx(1,"failed to allocate memory for proc structures");
+	mib[5] = (int)(size / sizeof(struct kinfo_proc2));
+	if (sysctl(mib, 6, kp, &size, NULL, 0) < 0)
+		errx(1, "could not read kern.proc2");
+	nproc = (int)(size / sizeof(struct kinfo_proc2));
+	for (i=0 ; i < nproc ; i++)
+	{
+		struct kinfo_proc2 p = kp[i];
+		t.checked = FALSE;
+		t.pid = p.p_pid;
+		t.ppid = p.p_ppid;
+		t.uid = p.p_uid;
+		t.prio = p.p_priority - 22;
+		t.vsize = p.p_vm_dsize + p.p_vm_ssize + p.p_vm_tsize;
+		t.vsize *= getpagesize();
+		t.rss = p.p_vm_rssize;
+		g_snprintf(t.state, sizeof t.state, "%s", state_abbrev[p.p_stat]);
+		/* shamelessly stolen from top/machine.c */
+		/* short version: g_strlcpy(t.name, p.p_comm, strlen(p.p_comm) + 1); */
+		size = 128;
+		if ((args = malloc(size)) == NULL)
+			errx(1,"failed to allocate memory for argv structures");
+		for (;; size *= 2) {
+			if ((args = realloc(args, size)) == NULL)
+				errx(1,"failed to allocate memory for argv structures");
+			mib[0] = CTL_KERN;
+			mib[1] = KERN_PROC_ARGS;
+			mib[2] = t.pid;
+			mib[3] = KERN_PROC_ARGV;
+			if (sysctl(mib, 4, args, &size, NULL, 0) == 0)
+				break;
+		}
+		buf[0] = '\0';
+		for (ptr = args; *ptr != NULL; ptr++) {
+			if (ptr != args)
+				strlcat(buf, " ", sizeof(buf));
+			strlcat(buf, *ptr, sizeof(buf));
+		}
+		g_snprintf(t.name, sizeof t.name, "%s", buf);
+
+		t.time_percentage = (100.0 * ((double) p.p_pctcpu / FSCALE));
+		/* get username from uid */
+		passwdp = getpwuid(t.uid);
+		if(passwdp != NULL && passwdp->pw_name != NULL)
+			g_strlcpy(t.uname, passwdp->pw_name, sizeof t.uname);
+		g_array_append_val(task_list, t);
+	}
+
+	return task_list;
+}
+
+gboolean get_cpu_usage_from_proc(system_status *sys_stat)
+{
+	/* tosee: remove this, get cpu perc from CPTIME */
+	return FALSE;
+}
+
+/* vmtotal values in #pg, mem wanted in kB */
+#define pagetok(nb) ((nb) * (getpagesize() / 1024))
+
+gboolean get_system_status (system_status *sys_stat)
+{
+	int mib[] = {CTL_VM, VM_METER};
+	struct vmtotal vmtotal;
+	size_t size;
+	size = sizeof(vmtotal);
+	if (sysctl(mib, 2, &vmtotal, &size, NULL, 0) < 0)
+		errx(1,"failed to get vm.meter");
+	/* cheat : rm = tot used, add free to get total */
+	sys_stat->mem_total = pagetok(vmtotal.t_rm + vmtotal.t_free);
+	sys_stat->mem_free = pagetok(vmtotal.t_free);
+	sys_stat->mem_cached = 0;
+	sys_stat->mem_buffers = pagetok(vmtotal.t_rm - vmtotal.t_arm);
+	size = sizeof(sys_stat->cpu_count);
+	mib[0] = CTL_HW;
+	mib[1] = HW_NCPU;
+	if (sysctl(mib, 2, &sys_stat->cpu_count, &size, NULL, 0) == -1)
+		errx(1,"failed to get cpu count");
+	/* cpu_user/idle/system unused atm so we don't care */
+	return TRUE;
+}
+
+void send_signal_to_task(gint task_id, gint signal)
+{
+	if(task_id > 0 && signal != 0)
+	{
+		gint ret = 0;
+		
+		ret = kill(task_id, signal);
+
+		if(ret != 0)
+			xfce_err(_("Couldn't send signal to the task with ID %d"), signal, task_id);
+	}
+}
+
+
+void set_priority_to_task(gint task_id, gint prio)
+{
+	if(task_id > 0)
+	{
+		gchar command[128] = "";
+		g_sprintf(command, "renice %d %d > /dev/null", prio, task_id);
+		
+		if(system(command) != 0)
+			xfce_err(_("Couldn't set priority %d to the task with ID %d"), prio, task_id);
+	}
+}
+


Property changes on: xfce4-taskmanager/trunk/src/taskmanager-bsd.c
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: xfce4-taskmanager/trunk/src/taskmanager-linux.c (from rev 5070, xfce4-taskmanager/trunk/src/xfce-taskmanager-linux.c)
===================================================================
--- xfce4-taskmanager/trunk/src/taskmanager-linux.c	                        (rev 0)
+++ xfce4-taskmanager/trunk/src/taskmanager-linux.c	2008-07-30 22:42:44 UTC (rev 5178)
@@ -0,0 +1,323 @@
+/* $Id$
+ *
+ * Copyright (c) 2006  Johannes Zellner <webmaster at nebulon.de>
+ *               2008  Mike Massonnet <mmassonnet at xfce.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "taskmanager.h"
+
+struct task get_task_details(gint pid)
+{
+	FILE *task_file;
+	FILE *cmdline_file;
+	gchar dummy[255];
+	gint idummy;
+	gchar buffer_status[1024];
+	struct task task;
+	struct passwd *passwdp;
+	struct stat status;
+	gchar filename[255];
+	gchar cmdline_filename[255];
+
+	sprintf(filename, "/proc/%i/stat", pid);
+	sprintf(cmdline_filename, "/proc/%i/cmdline", pid);
+
+	stat(filename, &status);
+
+	task.pid = -1;
+	task.checked = FALSE;
+
+	if (pagesize == 0)
+	  {
+		pagesize = sysconf(_SC_PAGESIZE);
+		if (pagesize == 0)
+			pagesize = 4*1024;
+	  }
+
+
+	if((task_file = fopen(filename,"r")) != NULL)
+	{
+		gint utime = 0;
+		gint stime = 0;
+
+		fgets(buffer_status, sizeof(buffer_status), task_file);
+
+		sscanf(buffer_status, "%i (%255s %1s %i %i %i %i %i %255s %255s %255s %255s %255s %i %i %i %i %i %i %i %i %i %i %i %255s %255s %255s %i %255s %255s %255s %255s %255s %255s %255s %255s %255s %255s %i %255s %255s",
+				&task.pid,	// processid
+				task.name,	// processname
+				task.state,	// processstate
+				&task.ppid,	// parentid
+				&idummy,	// processs groupid
+
+				&idummy,	// session id
+				&idummy,	// tty id
+				&idummy,	// tpgid: The process group ID of the process running on tty of the process
+				dummy,		// flags
+				dummy,		// minflt minor faults the process has maid
+
+				dummy,		// cminflt
+				dummy,		// majflt
+				dummy,		// cmajflt
+				&utime,		// utime the number of jiffies that this process has scheduled in user mode
+				&stime,		// stime " kernel mode
+
+				&idummy,	// cutime " waited for children in user
+				&idummy,	// cstime " kernel mode
+				&idummy,	// priority (nice value + fifteen)
+				&task.prio,	// nice range from 19 to -19	/* my change */
+				&idummy,	// hardcoded 0
+
+				&idummy,	// itrealvalue time in jiffies to next SIGALRM send to this process
+				&idummy,	// starttime jiffies the process startet after system boot
+				&task.vsize,	// vsize in bytes
+				&task.rss,	// rss (number of pages in real memory)
+				dummy,		// rlim limit in bytes for rss
+
+				dummy,		// startcode
+				dummy,		// endcode
+				&idummy,	// startstack
+				dummy,		// kstkesp value of esp (stack pointer)
+				dummy, 		// kstkeip value of EIP (instruction pointer)
+
+				dummy,		// signal. bitmap of pending signals
+				dummy,		// blocked: bitmap of blocked signals
+				dummy,		// sigignore: bitmap of ignored signals
+				dummy,		// sigcatch: bitmap of catched signals
+				dummy,		// wchan
+
+				dummy,		// nswap
+				dummy,		// cnswap
+				dummy,		// exit_signal
+				&idummy,	// CPU number last executed on
+				dummy,
+
+				dummy
+				);
+
+		task.old_time = task.time;
+		task.time = stime + utime;
+		task.time_percentage = 0;
+		task.rss *= pagesize;
+
+		task.uid = status.st_uid;
+		passwdp = getpwuid(task.uid);
+		if(passwdp != NULL && passwdp->pw_name != NULL)
+			g_strlcpy(task.uname, passwdp->pw_name, sizeof task.uname);
+	}
+
+
+	if(task_file != NULL)
+		fclose(task_file);
+
+	if((cmdline_file = fopen(cmdline_filename,"r")) != NULL)
+	{
+		gchar dummy[255];
+		strcpy(dummy, "");
+		fscanf(cmdline_file, "%255s", dummy);
+		if(strcmp(dummy, "") != 0)
+		{
+			if(g_strrstr(dummy,"/") != NULL)
+				g_strlcpy(task.name, g_strrstr(dummy,"/")+1, 255);
+			else
+				g_strlcpy(task.name, dummy, 255);
+
+			// workaround for cmd-line entries with leading "-"
+			if(g_str_has_prefix(task.name, "-"))
+				sscanf(task.name, "-%255s", task.name);
+		}
+	}
+
+	if(cmdline_file != NULL)
+		fclose(cmdline_file);
+
+	if(g_str_has_suffix(task.name, ")"))
+		*g_strrstr(task.name, ")") = '\0';
+
+	return task;
+}
+
+GArray *get_task_list(void)
+{
+	DIR *dir;
+	struct dirent *dir_entry;
+	GArray *task_list;
+
+	task_list = g_array_new (FALSE, FALSE, sizeof (struct task));
+
+	if((dir = opendir("/proc/")) == NULL)
+	{
+		fprintf(stderr, "Error: couldn't load the /proc directory\n");
+		return NULL;
+	}
+
+	gint count = 0;
+
+	while((dir_entry = readdir(dir)) != NULL)
+	{
+		if(atoi(dir_entry->d_name) != 0)
+		{
+			struct task task = get_task_details(atoi(dir_entry->d_name));
+			if(task.pid != -1)
+				g_array_append_val(task_list, task);
+		}
+		count++;
+	}
+
+	closedir(dir);
+
+	return task_list;
+}
+
+gboolean get_cpu_usage_from_proc(system_status *sys_stat)
+{
+	const gchar *file_name = "/proc/stat";
+	gchar buffer[100];
+	gboolean retval = FALSE;
+	FILE *file;
+
+	if ( sys_stat->valid_proc_reading == TRUE ) {
+		sys_stat->cpu_old_jiffies =
+			sys_stat->cpu_user +
+			sys_stat->cpu_nice +
+			sys_stat->cpu_system+
+			sys_stat->cpu_idle;
+		sys_stat->cpu_old_used =
+			sys_stat->cpu_user +
+			sys_stat->cpu_nice +
+			sys_stat->cpu_system;
+	} else {
+		sys_stat->cpu_old_jiffies = 0;
+	}
+
+	sys_stat->valid_proc_reading = FALSE;
+
+	if (!g_file_test (file_name, G_FILE_TEST_EXISTS))
+	{
+		return FALSE;
+	}
+
+
+	file = fopen (file_name, "r");
+
+	if (file)
+	{
+		if ( fgets (buffer, 100, file) != NULL )
+		{
+			if ( sscanf (buffer, "cpu\t%u %u %u %u",
+				     &sys_stat->cpu_user,
+				     &sys_stat->cpu_nice,
+				     &sys_stat->cpu_system,
+				     &sys_stat->cpu_idle
+				    ) == 4 )
+			{
+				sys_stat->valid_proc_reading = TRUE;
+				retval = TRUE;
+			}
+		}
+		fclose( file );
+	}
+        return retval;
+}
+
+gboolean get_system_status (system_status *sys_stat)
+{
+	FILE *file;
+	gchar *file_name;
+	gchar *buffer;
+
+	buffer = g_new (gchar, 100);
+
+	file_name = g_strdup ("/proc/meminfo");
+
+	if (!g_file_test (file_name, G_FILE_TEST_EXISTS))
+	{
+		g_free(file_name);
+		return FALSE;
+	}
+
+	file = fopen (file_name, "r");
+
+	if (file)
+	{
+		while (fgets (buffer, 100, file) != NULL)
+		{
+			sscanf (buffer, "MemTotal:\t%u kB", &sys_stat->mem_total);
+			sscanf (buffer, "MemFree:\t%u kB", &sys_stat->mem_free);
+			sscanf (buffer, "Cached:\t%u kB", &sys_stat->mem_cached);
+			sscanf (buffer, "Buffers:\t%u kB", &sys_stat->mem_buffers);
+		}
+		fclose (file);
+	}
+	g_free (buffer);
+	g_free (file_name);
+
+	buffer = g_new (gchar, 100);
+
+	file_name = g_strdup ("/proc/cpuinfo");
+
+	if (!g_file_test (file_name, G_FILE_TEST_EXISTS))
+	{
+		g_free(file_name);
+		return FALSE;
+	}
+
+	file = fopen (file_name, "r");
+
+	sys_stat->cpu_count = -1;
+
+	if (file)
+	{
+
+		while (fgets (buffer, 100, file) != NULL)
+		{
+			sscanf (buffer, "processor : %i", &sys_stat->cpu_count);
+		}
+		fclose (file);
+		sys_stat->cpu_count++;
+	}
+	g_free (buffer);
+	g_free (file_name);
+
+	return TRUE;
+}
+
+void send_signal_to_task(gint task_id, gint signal)
+{
+	if(task_id > 0 && signal != 0)
+	{
+		gint ret = 0;
+		
+		ret = kill(task_id, signal);
+
+		if(ret != 0)
+			xfce_err(_("Couldn't send signal to the task with ID %d"), signal, task_id);
+	}
+}
+
+
+void set_priority_to_task(gint task_id, gint prio)
+{
+	if(task_id > 0)
+	{
+		gchar command[128] = "";
+		g_sprintf(command, "renice %d %d > /dev/null", prio, task_id);
+		
+		if(system(command) != 0)
+			xfce_err(_("Couldn't set priority %d to the task with ID %d"), prio, task_id);
+	}
+}
+


Property changes on: xfce4-taskmanager/trunk/src/taskmanager-linux.c
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:mergeinfo
   + 

Copied: xfce4-taskmanager/trunk/src/taskmanager.h (from rev 5070, xfce4-taskmanager/trunk/src/xfce-taskmanager-linux.h)
===================================================================
--- xfce4-taskmanager/trunk/src/taskmanager.h	                        (rev 0)
+++ xfce4-taskmanager/trunk/src/taskmanager.h	2008-07-30 22:42:44 UTC (rev 5178)
@@ -0,0 +1,53 @@
+/* $Id$
+ *
+ * Copyright (c) 2006 Johannes Zellner, <webmaster at nebulon.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef XFCE4_TASKMANAGER_LINUX_H
+#define XFCE4_TASKMANAGER_LINUX_H
+
+#include <glib.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#ifdef __linux
+#include <dirent.h>
+#include <pwd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#endif
+
+#include "types.h"
+
+#define SIGNAL_NO	0
+#define SIGNAL_KILL	SIGKILL
+#define SIGNAL_TERM	SIGINT
+#define SIGNAL_CONT	SIGCONT
+#define SIGNAL_STOP	SIGSTOP
+
+static gint pagesize = 0;
+
+struct task get_task_details(gint pid);
+GArray *get_task_list(void); 
+gboolean get_system_status(system_status *sys_stat);
+gboolean get_cpu_usage_from_proc(system_status *sys_stat);
+void send_signal_to_task(gint task_id, gint signal);
+void set_priority_to_task(gint task_id, gint prio);
+
+#endif


Property changes on: xfce4-taskmanager/trunk/src/taskmanager.h
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:mergeinfo
   + 

Deleted: xfce4-taskmanager/trunk/src/xfce-taskmanager-linux.c

Deleted: xfce4-taskmanager/trunk/src/xfce-taskmanager-linux.h




More information about the Goodies-commits mailing list