cmpi-bindings 0.9.0 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/cmpi-bindings/cmpi_wrap.c +732 -206
- data/ext/cmpi-bindings/string_array.h +4 -4
- data/ext/src/cmpi_provider.c +9 -9
- data/ext/src/target_ruby.c +7 -2
- data/lib/cmpi.rb +35 -9
- metadata +15 -24
@@ -110,15 +110,15 @@ static void string_array_print(char** array)
|
|
110
110
|
{
|
111
111
|
char** p;
|
112
112
|
|
113
|
-
|
114
|
-
|
113
|
+
fprintf(stderr, "string_array\n");
|
114
|
+
fprintf(stderr, "{\n");
|
115
115
|
|
116
116
|
for (p = array; *p; p++)
|
117
117
|
{
|
118
|
-
|
118
|
+
fprintf(stderr, " {%s}\n", *p);
|
119
119
|
}
|
120
120
|
|
121
|
-
|
121
|
+
fprintf(stderr, "}\n");
|
122
122
|
}
|
123
123
|
#endif
|
124
124
|
|
data/ext/src/cmpi_provider.c
CHANGED
@@ -1054,7 +1054,7 @@ authorizeFilter(
|
|
1054
1054
|
|
1055
1055
|
TARGET_THREAD_BEGIN_BLOCK;
|
1056
1056
|
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
|
1057
|
-
_filter = SWIG_NewPointerObj((void*)
|
1057
|
+
_filter = SWIG_NewPointerObj((void*)wrap_select_filter(filter, NULL), SWIGTYPE_p__CMPISelectExp, 0);
|
1058
1058
|
_classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0);
|
1059
1059
|
_className = string2target(className);
|
1060
1060
|
_owner = string2target(owner);
|
@@ -1090,12 +1090,12 @@ activateFilter(
|
|
1090
1090
|
Target_Type _classPath;
|
1091
1091
|
Target_Type _firstActivation;
|
1092
1092
|
Target_Type _className;
|
1093
|
-
|
1093
|
+
|
1094
1094
|
_SBLIM_TRACE(1,("activateFilter() called, ctx %p, filter %p, className %s, classPath %p, firstActivation %d", ctx, filter, className, classPath, firstActivation));
|
1095
1095
|
|
1096
1096
|
TARGET_THREAD_BEGIN_BLOCK;
|
1097
1097
|
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
|
1098
|
-
_filter = SWIG_NewPointerObj((void*)
|
1098
|
+
_filter = SWIG_NewPointerObj((void*)wrap_select_filter(filter, NULL), SWIGTYPE_p__CMPISelectExp, 0);
|
1099
1099
|
_classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0);
|
1100
1100
|
_firstActivation = Target_Bool(firstActivation);
|
1101
1101
|
_className = string2target(className);
|
@@ -1136,7 +1136,7 @@ deActivateFilter(
|
|
1136
1136
|
|
1137
1137
|
TARGET_THREAD_BEGIN_BLOCK;
|
1138
1138
|
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
|
1139
|
-
_filter = SWIG_NewPointerObj((void*)
|
1139
|
+
_filter = SWIG_NewPointerObj((void*)wrap_select_filter(filter, NULL), SWIGTYPE_p__CMPISelectExp, 0);
|
1140
1140
|
_classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0);
|
1141
1141
|
_lastActivation = Target_Bool(lastActivation);
|
1142
1142
|
_className = string2target(className);
|
@@ -1180,7 +1180,7 @@ mustPoll(
|
|
1180
1180
|
TARGET_THREAD_BEGIN_BLOCK;
|
1181
1181
|
_ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0);
|
1182
1182
|
//Target_Type _rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0);
|
1183
|
-
_filter = SWIG_NewPointerObj((void*)
|
1183
|
+
_filter = SWIG_NewPointerObj((void*)wrap_select_filter(filter, NULL), SWIGTYPE_p__CMPISelectExp, 0);
|
1184
1184
|
_classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0);
|
1185
1185
|
_className = string2target(className);
|
1186
1186
|
|
@@ -1305,11 +1305,11 @@ static int
|
|
1305
1305
|
createInit(ProviderMIHandle* miHdl, CMPIStatus* st)
|
1306
1306
|
{
|
1307
1307
|
const char *trace_level = getenv("CMPI_BINDINGS_TRACE_LEVEL");
|
1308
|
-
_SBLIM_TRACE(
|
1308
|
+
_SBLIM_TRACE(1,(">>>>> createInit() called, broker %p, miname= %s (ctx=%p), status %p, trace_level %s", miHdl->broker, miHdl->miName, miHdl->context, st, trace_level?trace_level:"(null)"));
|
1309
1309
|
|
1310
1310
|
if (trace_level) {
|
1311
1311
|
cmpi_bindings_trace_level = *trace_level - '0';
|
1312
|
-
_SBLIM_TRACE(0,("tracing at level %d
|
1312
|
+
_SBLIM_TRACE(0,("tracing at level %d", cmpi_bindings_trace_level));
|
1313
1313
|
}
|
1314
1314
|
return TargetInitialize(miHdl, st);
|
1315
1315
|
}
|
@@ -1321,7 +1321,7 @@ CMPI##ptype##MI* _Generic_Create_##ptype##MI(const CMPIBroker* broker, \
|
|
1321
1321
|
{ \
|
1322
1322
|
CMPI##ptype##MI *mi; \
|
1323
1323
|
ProviderMIHandle *hdl; \
|
1324
|
-
_SBLIM_TRACE(1, ("
|
1324
|
+
_SBLIM_TRACE(1, (">>>>> in FACTORY: CMPI"#ptype"MI* _Generic_Create_"#ptype"MI... miname=%s", miname)); \
|
1325
1325
|
hdl = (ProviderMIHandle*)malloc(sizeof(ProviderMIHandle)); \
|
1326
1326
|
if (hdl) { \
|
1327
1327
|
hdl->implementation = Target_Null; \
|
@@ -1340,7 +1340,7 @@ CMPI##ptype##MI* _Generic_Create_##ptype##MI(const CMPIBroker* broker, \
|
|
1340
1340
|
mi->ft = &ptype##MIFT__; \
|
1341
1341
|
} \
|
1342
1342
|
++_MI_COUNT; \
|
1343
|
-
_SBLIM_TRACE(1, ("
|
1343
|
+
_SBLIM_TRACE(1, (">>>>> CMPI"#ptype"MI(%s) _MI_COUNT %d: returning mi=%p : miHdl=%p, hdl->implementation=%p, mi->ft=%p", miname, _MI_COUNT, mi, mi->hdl, hdl->implementation, mi->ft)); \
|
1344
1344
|
return mi; \
|
1345
1345
|
}
|
1346
1346
|
|
data/ext/src/target_ruby.c
CHANGED
@@ -176,6 +176,11 @@ get_exc_trace(const CMPIBroker* broker)
|
|
176
176
|
CMPIString *result;
|
177
177
|
|
178
178
|
if (NIL_P(exception)) {
|
179
|
+
_SBLIM_TRACE(1,("<%d> Ruby: get_exc_trace: no exception", getpid()));
|
180
|
+
return NULL;
|
181
|
+
}
|
182
|
+
if (NIL_P(trace)) {
|
183
|
+
_SBLIM_TRACE(1,("<%d> Ruby: get_exc_trace: no trace ($@ is nil)", getpid()));
|
179
184
|
return NULL;
|
180
185
|
}
|
181
186
|
backtrace = rb_funcall(trace, rb_intern("join"), 1, rb_str_new("\n\t", 2));
|
@@ -496,13 +501,13 @@ TargetCleanup(ProviderMIHandle * hdl)
|
|
496
501
|
if (--_MI_COUNT > 0)
|
497
502
|
{
|
498
503
|
pthread_mutex_unlock(&_CMPI_INIT_MUTEX);
|
499
|
-
_SBLIM_TRACE(
|
504
|
+
_SBLIM_TRACE(0,("_MI_COUNT > 0: %d", _MI_COUNT));
|
500
505
|
return;
|
501
506
|
}
|
502
507
|
|
503
508
|
if (_TARGET_INIT) // if Ruby is initialized and _MI_COUNT == 0, call ruby_finalize
|
504
509
|
{
|
505
|
-
_SBLIM_TRACE(
|
510
|
+
_SBLIM_TRACE(0,("Calling ruby_finalize(), unloading Ruby"));
|
506
511
|
ruby_finalize();
|
507
512
|
_TARGET_INIT = 0; // false
|
508
513
|
}
|
data/lib/cmpi.rb
CHANGED
@@ -105,7 +105,14 @@ module Cmpi
|
|
105
105
|
def self.charsptr
|
106
106
|
((16+10)<<8)
|
107
107
|
end
|
108
|
-
|
108
|
+
def self.embedded_object
|
109
|
+
((1)<<14)
|
110
|
+
end
|
111
|
+
def self.embedded_instance
|
112
|
+
((1)<<15)
|
113
|
+
end
|
114
|
+
|
115
|
+
|
109
116
|
unless defined? CMPI_ARRAY
|
110
117
|
CMPI_ARRAY = ((1)<<13)
|
111
118
|
end
|
@@ -178,6 +185,12 @@ module Cmpi
|
|
178
185
|
def self.charsptrA
|
179
186
|
CMPI_ARRAY | self.charsptrA
|
180
187
|
end
|
188
|
+
def self.embedded_objectA
|
189
|
+
CMPI_ARRAY | self.embedded_object
|
190
|
+
end
|
191
|
+
def self.embedded_instanceA
|
192
|
+
CMPI_ARRAY | self.embedded_instance
|
193
|
+
end
|
181
194
|
|
182
195
|
#
|
183
196
|
# Convert CIM DateTime string representation (see DSP0004, 2.2.1)
|
@@ -263,7 +276,7 @@ module Cmpi
|
|
263
276
|
def self.method_missing name, *args
|
264
277
|
v = self.map[name.to_s]
|
265
278
|
return v if v
|
266
|
-
STDERR.puts "#{self
|
279
|
+
STDERR.puts "#{self}.#{name} ?"
|
267
280
|
nil
|
268
281
|
end
|
269
282
|
end
|
@@ -322,10 +335,16 @@ module Cmpi
|
|
322
335
|
v = args[0]
|
323
336
|
n = s.chop
|
324
337
|
# -> http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
338
|
+
unless @typemap
|
339
|
+
begin
|
340
|
+
@typemap = Cmpi.const_get(self.objectpath.classname).typemap
|
341
|
+
rescue NoMethodError
|
342
|
+
raise "Cmpi::#{self.objectpath.classname}.typemap not defined"
|
343
|
+
end
|
344
|
+
end
|
345
|
+
t = @typemap[n]
|
346
|
+
raise "Property '#{n}' of Cmpi::#{self.objectpath.classname}.typemap not defined" unless t
|
347
|
+
# STDERR.printf "Instance.%s = %s[%s]:%04x\n" % [n, v, v.class, t]
|
329
348
|
self[n,v] = t
|
330
349
|
else
|
331
350
|
# STDERR.puts "CMPIInstance.#{name} -> #{self[s].inspect}"
|
@@ -348,9 +367,16 @@ module Cmpi
|
|
348
367
|
v = args[0]
|
349
368
|
n = s.chop
|
350
369
|
# -> http://blog.sidu.in/2008/02/loading-classes-from-strings-in-ruby.html
|
351
|
-
|
352
|
-
|
353
|
-
|
370
|
+
unless @typemap
|
371
|
+
begin
|
372
|
+
@typemap = Cmpi.const_get(self.classname).typemap
|
373
|
+
rescue NameError
|
374
|
+
raise "Cmpi::#{self.classname}.typemap not defined"
|
375
|
+
end
|
376
|
+
end
|
377
|
+
t = @typemap[n]
|
378
|
+
raise "Property '#{n}' of Cmpi::#{self.classname}.typemap not defined" unless t
|
379
|
+
# STDERR.printf "ObjectPath.%s = %s[%s]:%04x\n" % [n, v, v.class, t]
|
354
380
|
self[n,v] = t
|
355
381
|
else
|
356
382
|
# STDERR.puts "CMPIObjectPath.#{name} -> #{self[s].inspect}"
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmpi-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
5
|
-
prerelease:
|
4
|
+
version: 0.9.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Klaus Kämpf
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake-compiler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: mocha
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0.9'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0.9'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: yard
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0.5'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0.5'
|
62
55
|
description: The cmpi-bindings gem provides a Ruby API to write CIM providers
|
@@ -76,28 +69,26 @@ files:
|
|
76
69
|
- ext/cmpi-bindings/extconf.rb
|
77
70
|
homepage: http://www.github.com/kkaempf/cmpi-bindings
|
78
71
|
licenses: []
|
79
|
-
|
80
|
-
|
72
|
+
metadata: {}
|
73
|
+
post_install_message: " ____\n/@ ~-.\n/ __ .- | remember to have fun! \n // //
|
74
|
+
\ @ \n\n"
|
81
75
|
rdoc_options: []
|
82
76
|
require_paths:
|
83
77
|
- lib
|
84
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
79
|
requirements:
|
87
|
-
- -
|
80
|
+
- - '>='
|
88
81
|
- !ruby/object:Gem::Version
|
89
82
|
version: '0'
|
90
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
84
|
requirements:
|
93
|
-
- -
|
85
|
+
- - '>='
|
94
86
|
- !ruby/object:Gem::Version
|
95
87
|
version: 1.3.6
|
96
88
|
requirements: []
|
97
89
|
rubyforge_project:
|
98
|
-
rubygems_version:
|
90
|
+
rubygems_version: 2.0.3
|
99
91
|
signing_key:
|
100
|
-
specification_version:
|
92
|
+
specification_version: 4
|
101
93
|
summary: Write CIM providers in Ruby
|
102
94
|
test_files: []
|
103
|
-
has_rdoc:
|