ruby-libgtop2 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +5 -0
- data/INSTALL.txt +1 -1
- data/Manifest.txt +1 -0
- data/ext/libgtop/Makefile +11 -11
- data/ext/libgtop/mkmf.log +14 -2
- data/ext/libgtop/rb_glibtop.c +3 -0
- data/ext/libgtop/rb_glibtop_proc_wd.c +46 -0
- data/lib/libgtop/version.rb +1 -1
- metadata +15 -7
data/CHANGELOG.txt
CHANGED
data/INSTALL.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -40,6 +40,7 @@ ext/libgtop/rb_glibtop_proc_signal.c
|
|
40
40
|
ext/libgtop/rb_glibtop_proc_state.c
|
41
41
|
ext/libgtop/rb_glibtop_proc_time.c
|
42
42
|
ext/libgtop/rb_glibtop_proc_uid.c
|
43
|
+
ext/libgtop/rb_glibtop_proc_wd.c
|
43
44
|
ext/libgtop/rb_glibtop_proclist.c
|
44
45
|
ext/libgtop/rb_glibtop_sem_limits.c
|
45
46
|
ext/libgtop/rb_glibtop_shm_limits.c
|
data/ext/libgtop/Makefile
CHANGED
@@ -8,7 +8,7 @@ topdir = /usr/lib/ruby/1.8/i686-linux
|
|
8
8
|
hdrdir = $(topdir)
|
9
9
|
VPATH = $(srcdir):$(topdir):$(hdrdir)
|
10
10
|
prefix = $(DESTDIR)/usr
|
11
|
-
exec_prefix = $(
|
11
|
+
exec_prefix = $(prefix)
|
12
12
|
sitedir = $(DESTDIR)/usr/lib/ruby/site_ruby
|
13
13
|
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
14
14
|
docdir = $(datarootdir)/doc/$(PACKAGE)
|
@@ -24,7 +24,7 @@ includedir = $(prefix)/include
|
|
24
24
|
infodir = $(DESTDIR)/usr/share/info
|
25
25
|
sysconfdir = $(DESTDIR)/etc
|
26
26
|
mandir = $(DESTDIR)/usr/share/man
|
27
|
-
libdir = $(
|
27
|
+
libdir = $(exec_prefix)/lib
|
28
28
|
sharedstatedir = $(prefix)/com
|
29
29
|
oldincludedir = $(DESTDIR)/usr/include
|
30
30
|
pdfdir = $(docdir)
|
@@ -37,15 +37,15 @@ libexecdir = $(exec_prefix)/libexec
|
|
37
37
|
CC = i686-pc-linux-gnu-gcc
|
38
38
|
LIBRUBY = $(LIBRUBY_SO)
|
39
39
|
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
40
|
-
LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir) -
|
40
|
+
LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
|
41
41
|
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
42
42
|
|
43
43
|
RUBY_EXTCONF_H =
|
44
|
-
CFLAGS = -fPIC -march=athlon-xp -O2 -pipe -fPIC -I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
|
44
|
+
CFLAGS = -fPIC -march=athlon-xp -O2 -pipe -fno-strict-aliasing -fPIC -I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
|
45
45
|
INCFLAGS = -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I.
|
46
46
|
CPPFLAGS = -DHAVE_GLIBTOP_H
|
47
47
|
CXXFLAGS = $(CFLAGS)
|
48
|
-
DLDFLAGS =
|
48
|
+
DLDFLAGS = -L. -rdynamic -Wl,-export-dynamic
|
49
49
|
LDSHARED = $(CC) -shared
|
50
50
|
AR = i686-pc-linux-gnu-ar
|
51
51
|
EXEEXT =
|
@@ -68,11 +68,11 @@ COPY = cp
|
|
68
68
|
|
69
69
|
preload =
|
70
70
|
|
71
|
-
libpath = $(libdir)
|
72
|
-
LIBPATH = -L'$(libdir)' -Wl,-R'$(libdir)'
|
71
|
+
libpath = . $(libdir)
|
72
|
+
LIBPATH = -L'.' -L'$(libdir)' -Wl,-R'$(libdir)'
|
73
73
|
DEFFILE =
|
74
74
|
|
75
|
-
CLEANFILES =
|
75
|
+
CLEANFILES = mkmf.log
|
76
76
|
DISTCLEANFILES =
|
77
77
|
|
78
78
|
extout =
|
@@ -80,8 +80,8 @@ extout_prefix =
|
|
80
80
|
target_prefix =
|
81
81
|
LOCAL_LIBS =
|
82
82
|
LIBS = $(LIBRUBYARG_SHARED) -lgtop-2.0 -lgtop-2.0 -lglib-2.0 -lpthread -ldl -lcrypt -lm -lc
|
83
|
-
SRCS = rb_glibtop_mountlist.c rb_glibtop_fsusage.c rb_glibtop_init.c rb_glibtop_ppp.c rb_glibtop_proc_open_files.c rb_glibtop_proclist.c rb_glibtop_proc_map.c rb_glibtop_proc_signal.c rb_glibtop_proc_mem.c rb_glibtop_proc_kernel.c rb_glibtop_proc_state.c rb_glibtop_uptime.c rb_glibtop_proc_uid.c rb_glibtop_sem_limits.c rb_glibtop_msg_limits.c rb_glibtop_shm_limits.c rb_glibtop_swap.c rb_glibtop_loadavg.c rb_glibtop_mem.c rb_glibtop_proc_args.c rb_glibtop.c rb_glibtop_proc_time.c rb_glibtop_netlist.c rb_glibtop_cpu.c rb_glibtop_proc_segment.c rb_glibtop_netload.c rb_glibtop_sysdeps.c
|
84
|
-
OBJS = rb_glibtop_mountlist.o rb_glibtop_fsusage.o rb_glibtop_init.o rb_glibtop_ppp.o rb_glibtop_proc_open_files.o rb_glibtop_proclist.o rb_glibtop_proc_map.o rb_glibtop_proc_signal.o rb_glibtop_proc_mem.o rb_glibtop_proc_kernel.o rb_glibtop_proc_state.o rb_glibtop_uptime.o rb_glibtop_proc_uid.o rb_glibtop_sem_limits.o rb_glibtop_msg_limits.o rb_glibtop_shm_limits.o rb_glibtop_swap.o rb_glibtop_loadavg.o rb_glibtop_mem.o rb_glibtop_proc_args.o rb_glibtop.o rb_glibtop_proc_time.o rb_glibtop_netlist.o rb_glibtop_cpu.o rb_glibtop_proc_segment.o rb_glibtop_netload.o rb_glibtop_sysdeps.o
|
83
|
+
SRCS = rb_glibtop_mountlist.c rb_glibtop_fsusage.c rb_glibtop_init.c rb_glibtop_ppp.c rb_glibtop_proc_open_files.c rb_glibtop_proclist.c rb_glibtop_proc_map.c rb_glibtop_proc_signal.c rb_glibtop_proc_mem.c rb_glibtop_proc_kernel.c rb_glibtop_proc_state.c rb_glibtop_uptime.c rb_glibtop_proc_uid.c rb_glibtop_sem_limits.c rb_glibtop_msg_limits.c rb_glibtop_shm_limits.c rb_glibtop_swap.c rb_glibtop_loadavg.c rb_glibtop_mem.c rb_glibtop_proc_args.c rb_glibtop.c rb_glibtop_proc_time.c rb_glibtop_netlist.c rb_glibtop_cpu.c rb_glibtop_proc_segment.c rb_glibtop_netload.c rb_glibtop_sysdeps.c rb_glibtop_proc_wd.c
|
84
|
+
OBJS = rb_glibtop_mountlist.o rb_glibtop_fsusage.o rb_glibtop_init.o rb_glibtop_ppp.o rb_glibtop_proc_open_files.o rb_glibtop_proclist.o rb_glibtop_proc_map.o rb_glibtop_proc_signal.o rb_glibtop_proc_mem.o rb_glibtop_proc_kernel.o rb_glibtop_proc_state.o rb_glibtop_uptime.o rb_glibtop_proc_uid.o rb_glibtop_sem_limits.o rb_glibtop_msg_limits.o rb_glibtop_shm_limits.o rb_glibtop_swap.o rb_glibtop_loadavg.o rb_glibtop_mem.o rb_glibtop_proc_args.o rb_glibtop.o rb_glibtop_proc_time.o rb_glibtop_netlist.o rb_glibtop_cpu.o rb_glibtop_proc_segment.o rb_glibtop_netload.o rb_glibtop_sysdeps.o rb_glibtop_proc_wd.o
|
85
85
|
TARGET = libgtop
|
86
86
|
DLLIB = $(TARGET).so
|
87
87
|
EXTSTATIC =
|
@@ -142,7 +142,7 @@ site-install-rb: install-rb
|
|
142
142
|
|
143
143
|
$(DLLIB): $(OBJS)
|
144
144
|
@-$(RM) $@
|
145
|
-
$(LDSHARED) $(
|
145
|
+
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
146
146
|
|
147
147
|
|
148
148
|
|
data/ext/libgtop/mkmf.log
CHANGED
@@ -5,7 +5,7 @@ libs: -lgtop-2.0 -lglib-2.0
|
|
5
5
|
|
6
6
|
have_header: checking for glibtop.h... -------------------- yes
|
7
7
|
|
8
|
-
"i686-pc-linux-gnu-gcc -E -I. -I/usr/lib/ruby/1.8/i686-linux -I. -march=athlon-xp -O2 -pipe -fPIC -I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include conftest.c -o conftest.i"
|
8
|
+
"i686-pc-linux-gnu-gcc -E -I. -I/usr/lib/ruby/1.8/i686-linux -I. -march=athlon-xp -O2 -pipe -fno-strict-aliasing -fPIC -I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include conftest.c -o conftest.i"
|
9
9
|
checked program was:
|
10
10
|
/* begin */
|
11
11
|
1: #include <glibtop.h>
|
@@ -15,7 +15,19 @@ checked program was:
|
|
15
15
|
|
16
16
|
have_library: checking for glibtop_init_r() in -lgtop-2.0... -------------------- yes
|
17
17
|
|
18
|
-
"i686-pc-linux-gnu-gcc -o conftest -I. -I/usr/lib/ruby/1.8/i686-linux -I. -march=athlon-xp -O2 -pipe -fPIC -I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include conftest.c -L'/usr/lib' -Wl,-R'/usr/lib'
|
18
|
+
"i686-pc-linux-gnu-gcc -o conftest -I. -I/usr/lib/ruby/1.8/i686-linux -I. -march=athlon-xp -O2 -pipe -fno-strict-aliasing -fPIC -I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include conftest.c -L'.' -L'/usr/lib' -Wl,-R'/usr/lib' -L. -rdynamic -Wl,-export-dynamic -lgtop-2.0 -lglib-2.0 -lruby18-static -lgtop-2.0 -lgtop-2.0 -lglib-2.0 -lpthread -ldl -lcrypt -lm -lc"
|
19
|
+
conftest.c: In function `t':
|
20
|
+
conftest.c:3: error: `glibtop_init_r' ���������Ƥ��ޤ��� (���δؿ���Ǻǽ������)
|
21
|
+
conftest.c:3: error: (̤����γ��ѿ��ˤĤ��Ƥϡ����줬�ǽ�˸���줿���줾��δؿ�
|
22
|
+
conftest.c:3: error: ���Ф��ư��٤�����𤵤�ޤ���)
|
23
|
+
checked program was:
|
24
|
+
/* begin */
|
25
|
+
1: /*top*/
|
26
|
+
2: int main() { return 0; }
|
27
|
+
3: int t() { void ((*volatile p)()); p = (void ((*)()))glibtop_init_r; return 0; }
|
28
|
+
/* end */
|
29
|
+
|
30
|
+
"i686-pc-linux-gnu-gcc -o conftest -I. -I/usr/lib/ruby/1.8/i686-linux -I. -march=athlon-xp -O2 -pipe -fno-strict-aliasing -fPIC -I/usr/include/libgtop-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include conftest.c -L'.' -L'/usr/lib' -Wl,-R'/usr/lib' -L. -rdynamic -Wl,-export-dynamic -lgtop-2.0 -lglib-2.0 -lruby18-static -lgtop-2.0 -lgtop-2.0 -lglib-2.0 -lpthread -ldl -lcrypt -lm -lc"
|
19
31
|
checked program was:
|
20
32
|
/* begin */
|
21
33
|
1: /*top*/
|
data/ext/libgtop/rb_glibtop.c
CHANGED
@@ -46,6 +46,9 @@ void Init_libgtop()
|
|
46
46
|
Init_glibtop_proc_kernel();
|
47
47
|
Init_glibtop_proc_segment();
|
48
48
|
Init_glibtop_proc_args();
|
49
|
+
#if (LIBGTOP_CHECK_VERSION(2, 19, 2))
|
50
|
+
Init_glibtop_proc_wd();
|
51
|
+
#endif
|
49
52
|
#if (LIBGTOP_CHECK_VERSION(2, 9, 0))
|
50
53
|
Init_glibtop_netlist();
|
51
54
|
#endif
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/*
|
2
|
+
* GLibTop is a wrapper library of a libgtop-2.x
|
3
|
+
*
|
4
|
+
* @author DATE Ken <itacchi@gmail.com>
|
5
|
+
* @see http://rubyforge.org/projects/ruby-libgtop2/
|
6
|
+
*/
|
7
|
+
|
8
|
+
#include <ruby.h>
|
9
|
+
#include <rb_glibtop.h>
|
10
|
+
#if (LIBGTOP_CHECK_VERSION(2, 19, 2))
|
11
|
+
#include <glibtop/procwd.h>
|
12
|
+
|
13
|
+
|
14
|
+
static VALUE rb_glibtop_proc_wd(VALUE self, VALUE pid)
|
15
|
+
{
|
16
|
+
glibtop_proc_wd buf;
|
17
|
+
char **_dirs, **_dir;
|
18
|
+
VALUE hash, dirs;
|
19
|
+
|
20
|
+
_dirs = glibtop_get_proc_wd(&buf, NUM2LONG(pid));
|
21
|
+
|
22
|
+
hash = rb_hash_new();
|
23
|
+
|
24
|
+
rb_hash_aset(hash, rb_str_new2("flags"), rb_uint2inum(buf.flags));
|
25
|
+
rb_hash_aset(hash, rb_str_new2("number"), rb_uint2inum(buf.number));
|
26
|
+
rb_hash_aset(hash, rb_str_new2("root"), rb_str_new2(buf.root));
|
27
|
+
rb_hash_aset(hash, rb_str_new2("exe"), rb_str_new2(buf.exe));
|
28
|
+
|
29
|
+
dirs = rb_ary_new();
|
30
|
+
rb_hash_aset(hash, rb_str_new2("dirs"), dirs);
|
31
|
+
|
32
|
+
for (_dir = _dirs; *_dir; ++_dir) {
|
33
|
+
rb_ary_push(dirs, rb_str_new2(*_dir));
|
34
|
+
}
|
35
|
+
|
36
|
+
g_strfreev(_dirs);
|
37
|
+
|
38
|
+
return hash;
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
void Init_glibtop_proc_wd()
|
43
|
+
{
|
44
|
+
rb_define_method(cLibGTop, "proc_wd", rb_glibtop_proc_wd, 1);
|
45
|
+
}
|
46
|
+
#endif
|
data/lib/libgtop/version.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.4
|
3
3
|
specification_version: 1
|
4
4
|
name: ruby-libgtop2
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date:
|
6
|
+
version: 0.1.1
|
7
|
+
date: 2008-02-12 00:00:00 +09:00
|
8
8
|
summary: Ruby bindings for GNOME libgtop version2.x.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -26,6 +26,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
26
26
|
platform: ruby
|
27
27
|
signing_key:
|
28
28
|
cert_chain:
|
29
|
+
post_install_message:
|
29
30
|
authors:
|
30
31
|
- date
|
31
32
|
files:
|
@@ -71,6 +72,7 @@ files:
|
|
71
72
|
- ext/libgtop/rb_glibtop_proc_state.c
|
72
73
|
- ext/libgtop/rb_glibtop_proc_time.c
|
73
74
|
- ext/libgtop/rb_glibtop_proc_uid.c
|
75
|
+
- ext/libgtop/rb_glibtop_proc_wd.c
|
74
76
|
- ext/libgtop/rb_glibtop_proclist.c
|
75
77
|
- ext/libgtop/rb_glibtop_sem_limits.c
|
76
78
|
- ext/libgtop/rb_glibtop_shm_limits.c
|
@@ -84,10 +86,16 @@ files:
|
|
84
86
|
- test/test_helper.rb
|
85
87
|
test_files:
|
86
88
|
- test/ruby-libgtop2_test.rb
|
87
|
-
rdoc_options:
|
88
|
-
|
89
|
-
|
90
|
-
|
89
|
+
rdoc_options:
|
90
|
+
- --main
|
91
|
+
- README.txt
|
92
|
+
extra_rdoc_files:
|
93
|
+
- CHANGELOG.txt
|
94
|
+
- History.txt
|
95
|
+
- INSTALL.txt
|
96
|
+
- Manifest.txt
|
97
|
+
- README.txt
|
98
|
+
- TUTORIAL.txt
|
91
99
|
executables: []
|
92
100
|
|
93
101
|
extensions:
|