DrQueueRubyBindings 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/extconf.rb +7 -7
- data/ext/libdrqueue_ruby.i +13 -6
- metadata +3 -3
data/ext/extconf.rb
CHANGED
@@ -29,7 +29,7 @@ elsif RUBY_PLATFORM =~ /irix6/i
|
|
29
29
|
end
|
30
30
|
|
31
31
|
if File.directory? "drqueue"
|
32
|
-
Dir::chdir 'drqueue'
|
32
|
+
Dir::chdir 'drqueue/src'
|
33
33
|
# try to do a Git pull
|
34
34
|
if xsystem('git pull') == false
|
35
35
|
puts 'Git pull failed'
|
@@ -41,7 +41,7 @@ else
|
|
41
41
|
puts 'Git clone failed'
|
42
42
|
exit 1
|
43
43
|
end
|
44
|
-
Dir::chdir 'drqueue'
|
44
|
+
Dir::chdir 'drqueue/src'
|
45
45
|
end
|
46
46
|
|
47
47
|
# try to build libdrqueue
|
@@ -49,22 +49,22 @@ if xsystem('scons universal_binary=true build_drqman=false libdrqueue') == false
|
|
49
49
|
puts 'libdrqueue build failed'
|
50
50
|
exit 1
|
51
51
|
end
|
52
|
-
Dir::chdir '
|
52
|
+
Dir::chdir '../..'
|
53
53
|
|
54
54
|
# create swig wrapper
|
55
55
|
puts 'generating swig interface file'
|
56
|
-
puts 'swig -ruby -Idrqueue/ -Idrqueue/libdrqueue -D'+rb_os+' -Wall -autorename libdrqueue_ruby.i'
|
57
|
-
xsystem('swig -ruby -Idrqueue/ -Idrqueue/libdrqueue -D'+rb_os+' -Wall -autorename libdrqueue_ruby.i')
|
56
|
+
puts 'swig -ruby -Idrqueue/src/ -Idrqueue/src/libdrqueue -D'+rb_os+' -Wall -autorename libdrqueue_ruby.i'
|
57
|
+
xsystem('swig -ruby -Idrqueue/src/ -Idrqueue/src/libdrqueue -D'+rb_os+' -Wall -autorename libdrqueue_ruby.i')
|
58
58
|
puts 'look for output in mkmf.log'
|
59
59
|
|
60
60
|
# build for os
|
61
61
|
$CFLAGS += ' -D'+rb_os
|
62
62
|
|
63
63
|
# include the headers
|
64
|
-
$CFLAGS += ' -Idrqueue/ -Idrqueue/libdrqueue'
|
64
|
+
$CFLAGS += ' -Idrqueue/src/ -Idrqueue/src/libdrqueue'
|
65
65
|
|
66
66
|
# path to the drqueue lib
|
67
|
-
$LOCAL_LIBS += 'drqueue/libdrqueue/libdrqueue.a'
|
67
|
+
$LOCAL_LIBS += 'drqueue/src/libdrqueue/libdrqueue.a'
|
68
68
|
|
69
69
|
# create the makefile
|
70
70
|
create_makefile('drqueue')
|
data/ext/libdrqueue_ruby.i
CHANGED
@@ -34,7 +34,7 @@ slaves. Also provides access to all data structures of DrQueue."
|
|
34
34
|
|
35
35
|
|
36
36
|
// Tell SWIG to keep track of mappings between C/C++ structs/classes
|
37
|
-
|
37
|
+
%trackobjects;
|
38
38
|
|
39
39
|
|
40
40
|
%include "typemaps.i"
|
@@ -127,10 +127,11 @@ typedef unsigned char uint8_t;
|
|
127
127
|
// these methods generate new objects
|
128
128
|
%newobject *::request_job_list;
|
129
129
|
%newobject *::request_computer_list;
|
130
|
-
|
130
|
+
%newobject *::request_job_xfer;
|
131
131
|
|
132
132
|
// JOB
|
133
133
|
%extend job {
|
134
|
+
%newobject job;
|
134
135
|
job ()
|
135
136
|
{
|
136
137
|
struct job *j;
|
@@ -145,6 +146,7 @@ typedef unsigned char uint8_t;
|
|
145
146
|
|
146
147
|
~job ()
|
147
148
|
{
|
149
|
+
SWIG_RubyRemoveTracking(self);
|
148
150
|
job_init(self);
|
149
151
|
//free (self);
|
150
152
|
job_frame_info_free (self);
|
@@ -175,6 +177,7 @@ typedef unsigned char uint8_t;
|
|
175
177
|
return variable->value;
|
176
178
|
}
|
177
179
|
|
180
|
+
%newobject request_frame_list;
|
178
181
|
VALUE request_frame_list (int who)
|
179
182
|
{
|
180
183
|
VALUE l = rb_ary_new();
|
@@ -516,6 +519,7 @@ typedef unsigned char uint8_t;
|
|
516
519
|
return (VALUE)NULL;
|
517
520
|
}
|
518
521
|
}
|
522
|
+
|
519
523
|
%newobject get_pool;
|
520
524
|
struct pool *get_pool (int n)
|
521
525
|
{
|
@@ -601,6 +605,7 @@ typedef unsigned char uint8_t;
|
|
601
605
|
|
602
606
|
// struct pool
|
603
607
|
%extend pool {
|
608
|
+
%newobject pool;
|
604
609
|
pool (char *name)
|
605
610
|
{
|
606
611
|
struct pool *p;
|
@@ -616,14 +621,15 @@ typedef unsigned char uint8_t;
|
|
616
621
|
|
617
622
|
~pool ()
|
618
623
|
{
|
619
|
-
|
620
|
-
computer_pool_free (self);
|
624
|
+
free (self);
|
625
|
+
//computer_pool_free (self);
|
621
626
|
}
|
622
627
|
}
|
623
628
|
|
624
629
|
|
625
630
|
// COMPUTER
|
626
631
|
%extend computer {
|
632
|
+
%newobject computer;
|
627
633
|
computer ()
|
628
634
|
{
|
629
635
|
struct computer *c;
|
@@ -642,15 +648,16 @@ typedef unsigned char uint8_t;
|
|
642
648
|
computer_free (self);
|
643
649
|
}
|
644
650
|
|
651
|
+
%newobject list_pools;
|
645
652
|
VALUE list_pools (void)
|
646
653
|
{
|
647
654
|
VALUE l = rb_ary_new();
|
648
|
-
|
655
|
+
int npools = self->limits.npools;
|
649
656
|
|
650
657
|
if ((self->limits.pool.ptr = (struct pool *) computer_pool_attach_shared_memory(&self->limits)) == (void*)-1) {
|
651
658
|
rb_raise(rb_eException,drerrno_str());
|
652
659
|
return (VALUE)NULL;
|
653
|
-
|
660
|
+
}
|
654
661
|
|
655
662
|
int i;
|
656
663
|
for (i=0;i<npools;i++) {
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: DrQueueRubyBindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 2
|
10
|
+
version: 0.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andreas Schroeder
|