Commit Graph

571 Commits

Author SHA1 Message Date
Martin Baulig
d66768ac55 Return -GLIBTOP_ERROR_NO_SUCH_PROCESS if the process doesn't exist.
1999-12-22  Martin Baulig  <martin@home-of-linux.org>

	* procdata.c (glibtop_get_proc_data_proc_state_s): Return
	-GLIBTOP_ERROR_NO_SUCH_PROCESS if the process doesn't exist.
	(glibtop_get_proc_data_proc_mem_s): Likewise.
	(glibtop_get_proc_data_proc_signal_s): Likewise.
	(glibtop_get_proc_data_proc_kernel_s): Likewise.
	(glibtop_get_proc_data_proc_args_s): Likewise.
	(glibtop_get_proc_data_proc_maps_s): Likewise.
1999-12-22 11:32:18 +00:00
Martin Baulig
339e1f4557 Removed. (glibtop_get_proc_args_*): This now takes a `glibtop_array'
1999-12-12  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/procargs.h (glibtop_proc_args): Removed.
	(glibtop_get_proc_args_*): This now takes a `glibtop_array' parameter
	instead of a `glibtop_proc_args one and returns a `char **'.
1999-12-19 14:37:49 +00:00
Martin Baulig
c5ebf9c12e *** empty log message *** 1999-12-19 13:04:51 +00:00
Martin Baulig
a0056665ae Reflect latest interface changes. 1999-12-18 18:11:27 +00:00
Martin Baulig
9b245d8113 *** empty log message *** 1999-12-18 18:11:00 +00:00
Martin Baulig
1a25c3ade9 New file.
1999-12-12  Martin Baulig  <martin@home-of-linux.org>

	* netinfo.c: New file.

	* interfaces.c: Reflect latest interface changes.
	* netload.c: Likewise.
1999-12-12 16:09:03 +00:00
Martin Baulig
881c2a2086 All functions which return an array now take a `glibtop_array *array'
1999-12-12  Martin Baulig  <martin@home-of-linux.org>

	All functions which return an array now take a `glibtop_array *array'
	parameter instead of a `glibtop_<feature> *buf' one.

	For compatibility, we typedef the corresponding `glibtop_<feature>'s
	to `glibtop_array' in <glibtop/compat_10.h>.

	This has the advantage that scripting languages like Guile with an
	array implementation which stores the length of an array in the
	array don't need the `glibtop_array' parameter at all any longer.

	We'll also add convenient functions which return GPtrArray's here.

	* include/glibtop/proclist.h (glibtop_proclist): Removed.
	(glibtop_get_proclist_*): This now takes a `glibtop_array' parameter
	instead of a `glibtop_proclist' one.

	* include/glibtop/procmap.h (glibtop_proc_map): Removed.
	(glibtop_get_proc_map_*): This now takes a `glibtop_array' parameter
	instead of a `glibtop_proc_map' one.

	* include/glibtop/mountlist.h (glibtop_mountlist): Removed.
	(glibtop_get_mountlist_*): This now takes a `glibtop_array' parameter
	instead of a `glibtop_mountlist' one.

	* include/glibtop/interfaces.h (glibtop_interface_names): Removed.
	(glibtop_get_interface_names_*): This now takes a `glibtop_array'
	parameter instead of a `glibtop_interface_name' one.

	* include/glibtop/compat_10.h: New file. Contains some typedefs and
	#defines to keep compatibility until the big restructurement is
	completely done.
1999-12-12 14:20:17 +00:00
Martin Baulig
4748c6c4d7 Only set smp flags when we're really on a SMP machine.
1999-12-11  Martin Baulig  <martin@home-of-linux.org>

	* cpu.c: Only set smp flags when we're really on a SMP machine.
1999-12-11 15:38:04 +00:00
Martin Baulig
18af9297ea This is a larger source-incompatible commit, but it'll make it easier to
1999-12-11  Martin Baulig  <martin@home-of-linux.org>

	This is a larger source-incompatible commit, but it'll make it
	easier to write automatically generated code (for instance for
	scripting languages).

	Renamed all constants for the flags field to match the field names
	from the features.def and structures.def where this was not already
	the case.

	* include/glibtop/cpu.h: s/GLIBTOP_XCPU_/GLIBTOP_CPU_XCPU_/g.
	* include/glibtop/shm_limits.h: s/GLIBTOP_IPC_/GLIBTOP_SHM_LIMITS_/g.
	* include/glibtop/sem_limits.h: s/GLIBTOP_IPC_/GLIBTOP_SEM_LIMITS_/g.
	* include/glibtop/msg_limits.h: s/GLIBTOP_IPC_/GLIBTOP_MSG_LIMITS_/g.
1999-12-11 14:33:18 +00:00
Martin Baulig
8e9a0fbe99 Moved all Guile code to the libgtop-bindings module.
1999-12-05  Martin Baulig  <martin@home-of-linux.org>

	Moved all Guile code to the libgtop-bindings module.

	* sysdeps/guile/*: Removed.
	* sysdeps/guile/names/*: Removed.

	* libgtopConf.sh.in: Removed all guile variables.

	* configure.in: Don't check for guile any longer.
1999-12-05 22:16:31 +00:00
Martin Baulig
4dccb636e2 *** empty log message *** 1999-12-05 15:02:34 +00:00
Martin Baulig
c40788c5b2 Return vector for functions returning arrays. 1999-12-05 14:55:18 +00:00
Martin Baulig
abaa37c51f Return SCM_BOOL_F on error. 1999-12-05 14:15:49 +00:00
Martin Baulig
4a2fb0a871 Use `array(<type>)' as return value for functions returning an array of
1999-12-05  Martin Baulig  <martin@home-of-linux.org>

	* features.def: Use `array(<type>)' as return value for functions
	returning an array of structures.
1999-12-05 14:07:20 +00:00
Martin Baulig
5ddf25c66a Enable `guile' subdir again. 1999-12-05 13:58:31 +00:00
Martin Baulig
ff9f90c7e6 This is now the low-level guile interface to LibGTop. For each of the
1999-12-05  Martin Baulig  <martin@home-of-linux.org>

	This is now the low-level guile interface to LibGTop. For
	each of the LibGTop structures we create a new smob here and
	let the `glibtop-get-<feature>' functions return such a smob.

	* main.c: New file.
	(glibtop_boot_guile_main): Initialize "glibtop-global-server" here.

	* guile.h: New file.
1999-12-05 13:58:03 +00:00
Martin Baulig
d48d48cafb Reflect latest interface changes. 1999-12-05 13:54:58 +00:00
Martin Baulig
66bab0ec49 Partitially got it working again. 1999-12-02 20:56:42 +00:00
Drazen Kacar
5d224583a1 @#$!%@# gcc!!! 1999-11-29 16:19:28 +00:00
Martin Baulig
f850409d45 Added transport' and protocol' argument to specify transport method and
1999-11-28  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/netload.h (glibtop_get_netload): Added
	`transport' and `protocol' argument to specify transport method
	and protocol.

	* include/glibtop/netinfo.h (glibtop_get_netinfo): Added
	`transport' argument to specify the transport method.
1999-11-28 19:03:05 +00:00
Martin Baulig
d58748ac66 Added `transport' field for the transport method.
1999-11-28  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/netinfo.h (glibtop_netinfo): Added `transport'
	field for the transport method.
1999-11-28 18:41:45 +00:00
Martin Baulig
4a01752467 Split netload into netload and netinfo.
1999-11-28  Martin Baulig  <martin@home-of-linux.org>

	Split netload into netload and netinfo.

	* include/glibtop/netinfo.h: New file.

	* include/glibtop/netload.h (glibtop_netload): Moved `if_flags',
	`mtu', `subnet' and `address' into the new `glibtop_netinfo'.

	* include/glibtop/sysdeps.h (GLIBTOP_SYSDEPS_NETINFO): Added.
	(glibtop_sysdeps): Added `netinfo.
	* include/glibtop/union.h (glibtop_union): Added `netinfo.
	* include/glibtop/command.h (GLIBTOP_CMND_NETINFO): Added.
1999-11-28 18:17:21 +00:00
Martin Baulig
53f9d03e30 Added `instance' argument.
1999-11-28  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/interfaces.h (glibtop_get_interface_names):
	Added `instance' argument.
1999-11-28 17:53:34 +00:00
Martin Baulig
f918792bb6 Temporarily comment out guile subdir. 1999-11-28 16:19:20 +00:00
Martin Baulig
abb3ba2c6a **** Merged from Hardangervidda ****
1999-11-28  Martin Baulig  <martin@home-of-linux.org>

	* procstate.c (glibtop_get_procstate_s): Stat "/proc/<pid>" instead
	of "/proc/<pid>/state" to get `uid' and `gid'. Thanks to Jason Becker
	for pointing out that GTop reported wrong uid's.
1999-11-28 11:58:14 +00:00
Martin Baulig
6380440c00 Reflect latest interface changes. 1999-11-21 19:03:12 +00:00
Martin Baulig
b746f488b0 Added new feature to get a list of network interface names.
1999-11-21  Martin Baulig  <martin@home-of-linux.org>

	Added new feature to get a list of network interface names.

	* features.def: Added `interface_names' feature.

	* include/glibtop/interfaces.h: New file.

	* include/glibtop/sysdeps.h (GLIBTOP_SYSDEPS_INTERFACE_NAMES): Added.
	(glibtop_sysdeps): Added `interface_names'.
	* include/glibtop/union.h (glibtop_union): Added `interface_names'.
	* include/glibtop/command.h (GLIBTOP_CMND_INTERFACE_NAMES): Added.
1999-11-21 18:35:40 +00:00
Martin Baulig
e5a7a5b0e5 New file. (glibtop_init_interface_names_s): New function.
1999-11-21  Martin Baulig  <martin@home-of-linux.org>

	* interfaces.c: New file.
	(glibtop_init_interface_names_s): New function.
	(glibtop_get_interface_names_s): New function.
1999-11-21 18:35:10 +00:00
Martin Baulig
f8aae8f544 Support GLIBTOP_KERN_PROC_PPID.
1999-11-21  Martin Baulig  <martin@home-of-linux.org>

	* proclist.c: (glibtop_get_proclist_s): Support GLIBTOP_KERN_PROC_PPID.
1999-11-21 18:08:10 +00:00
Martin Baulig
81176f8181 Reflect latest interface changes; return 0 on success and -1 on error. 1999-11-21 16:54:36 +00:00
Martin Baulig
7a9bb6e43d Return 0 on success and -1 on error. 1999-10-24 20:17:42 +00:00
Martin Baulig
507f171b63 Use `retval' for the default retval.
1999-10-24  Martin Baulig  <martin@home-of-linux.org>

	* features.def: Use `retval' for the default retval.

	* include/glibtop/command.h (glibtop_command_h): Added
	`int *retval_ptr' parameter to return the retval from the
	sysdeps functions.
1999-10-24 20:04:37 +00:00
Martin Baulig
2dc529b19f New static variable. (glibtop_get_fsusage_s): Return -1 on error;
1999-10-24  Martin Baulig  <martin@home-of-linux.org>

	* fsusage.c (_glibtop_sysdeps_fsusage): New static variable.
	(glibtop_get_fsusage_s): Return -1 on error; otherwise set the
	features and return 0.
1999-10-24 19:16:52 +00:00
Martin Baulig
a5dd7e9063 This is a very big an possibly breaking commit.
It changes the return values of all sysdeps functions which were
previosly returning void to int.

This is the first step to implement better error handling in LibGTop.

Martin

1999-10-24  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/*.h (glibtop_get_*, glibtop_init*): Changed
	the return value of all `glibtop_get_<feature>_* ()' and all
 	`glibtop_init_<feature>_* ()' functions from void to int.

	* features.def: Reflect changes of the return values.
	* sysdeps/*/*.c: Reflect changes of the return values.
1999-10-24 19:09:32 +00:00
Martin Baulig
eae892c9b1 Use glib's malloc functions when compiled with LIBGTOP_USE_GLIB_MALLOC.
1999-10-24  Martin Baulig  <martin@home-of-linux.org>

	* xmalloc.c: Use glib's malloc functions when compiled
	with LIBGTOP_USE_GLIB_MALLOC.
1999-10-24 18:47:50 +00:00
Martin Baulig
eeaa766456 Use glib's malloc functions when compiled with LIBGTOP_ENABLE_DEBUG.
1999-10-24  Martin Baulig  <martin@home-of-linux.org>

	* xmalloc.c: Use glib's malloc functions when compiled
	with LIBGTOP_ENABLE_DEBUG.

	* xmalloc_suid.c: New file.
1999-10-24 16:19:48 +00:00
Martin Baulig
34714be205 Make inclusion of <osreldate.h> conditional to `HAVE_OSRELDATE_H', not to
1999-10-24  Martin Baulig  <martin@home-of-linux.org>

	* glibtop_machine.h: Make inclusion of <osreldate.h> conditional
 	to `HAVE_OSRELDATE_H', not to `__FreeBSD__'.
	* procsignal.c, proctime.c, proctime.c: Likewise.
1999-10-24 14:33:18 +00:00
Martin Baulig
359f5511d7 Fix bug #2909; I made some little mistake when applying a patch here. 1999-10-20 14:35:54 +00:00
Martin Baulig
9043e29b18 Don't cast uptime and idletime to float as suggested by John Kodis.
1999-10-19  Martin Baulig  <martin@home-of-linux.org>

	* uptime.c (glibtop_get_uptime_s): Don't cast uptime and idletime
	to float as suggested by John Kodis.
1999-10-19 00:11:33 +00:00
Martin Baulig
8da7856780 Added `@DL_LIB@'.
1999-10-17  Martin Baulig  <martin@home-of-linux.org>

	* Makefile.am (libgtop_sysdeps_la_LIBADD): Added `@DL_LIB@'.
1999-10-17 21:42:15 +00:00
Martin Baulig
78a6bcd553 Small warning fix. 1999-10-17 21:38:38 +00:00
Martin Baulig
20bc40ac18 Applied all patches from the FreeBSD 3.3 ports collection.
1999-10-16  Martin Baulig  <martin@home-of-linux.org>

	Applied all patches from the FreeBSD 3.3 ports collection.

	* swap.c: Only #include <rlist.h> for __FreeBSD_version < 400005.

	* prockernel.c: Make it compile on FreeBSD / alpha.

	* procsignal.c: Some fixes for FreeBSD-current.
1999-10-16 18:30:52 +00:00
Martin Baulig
7881e4212f Don't use the `GLIBTOP_PROCESS_*' constants for process states for LibGTop
1999-10-16  Martin Baulig  <martin@home-of-linux.org>

	* procstate.c (glibtop_get_proc_state_p): Don't use the
	`GLIBTOP_PROCESS_*' constants for process states for
	LibGTop 1.0.x.
1999-10-16 18:00:54 +00:00
Martin Baulig
be4c952542 Reverted my commit which reverted Radek Doulik's change.
Sorry for being stupid, but I run the diff in the wrong direction; his
patch was absolutely correct.

Martin
1999-09-29 10:23:04 +00:00
Martin Baulig
3274a72cda Reverted incorrect commit from Radek Doulik.
Please make sure your changes at least compile without warnings;
it should be clear that comparing an `unsigned' structure field with
a character constant is wrong.
1999-09-28 22:33:25 +00:00
Radek Doulik
c285171500 fixed idle processes filtering
1999-09-28  Radek Doulik  <rodo@praha.eridan.cz>

	* proclist.c (glibtop_get_proclist_s): fixed idle processes filtering
1999-09-28 17:05:28 +00:00
Drazen Kacar
16156b8e27 Bugfix. It wasn't excluding system, non-tty or idle processes if that was
* proclist.c (glibtop_get_proclist_s): Bugfix. It wasn't
        excluding system, non-tty or idle processes if that was
        requested.
1999-09-28 03:53:08 +00:00
Martin Baulig
9152479981 Fixed all warnings. 1999-07-30 21:03:22 +00:00
Martin Baulig
9bd351abae Fix bug reported by Takis Psarogiannakopoulos: `start_time' are seconds
1999-07-29  Martin Baulig  <martin@home-of-linux.org>

	* proctime.c (glibtop_get_proc_time_p): Fix bug reported by
	Takis Psarogiannakopoulos: `start_time' are seconds since the
 	epoch as it is stated in the manual.
1999-07-29 18:56:26 +00:00
Martin Baulig
60a6d0876e Don't provide rtime' any longer since we must not use rtime = utime +
1999-07-29  Martin Baulig  <martin@home-of-linux.org>

	* proctime.c (glibtop_get_proctime_s): Don't provide `rtime'
	any longer since we must not use `rtime = utime + stime'.
1999-07-29 18:52:58 +00:00