openwsman 2.3.0 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1828,7 +1828,7 @@ static swig_module_info swig_module = {swig_types, 29, 0, 0, 0, 0};
1828
1828
 
1829
1829
  /* -------- TYPES TABLE (END) -------- */
1830
1830
 
1831
- #define SWIG_init Init_openwsman
1831
+ #define SWIG_init Init_Openwsman
1832
1832
  #define SWIG_name "Openwsman"
1833
1833
 
1834
1834
  static VALUE mOpenwsman;
@@ -1877,9 +1877,12 @@ static VALUE mOpenwsman;
1877
1877
  #if defined(SWIGRUBY)
1878
1878
  #include <ruby/helpers.h>
1879
1879
 
1880
- SWIGEXPORT void Init_openwsman(void);
1880
+ /* Init_ for the %module, defined by Swig */
1881
+ SWIGEXPORT void Init_Openwsman(void);
1882
+
1883
+ /* Init_ for the .so lib, called by Ruby */
1881
1884
  SWIGEXPORT void Init__openwsman(void) {
1882
- Init_openwsman();
1885
+ Init_Openwsman();
1883
1886
  }
1884
1887
  #endif
1885
1888
  #if defined(SWIGPYTHON)
@@ -1931,6 +1934,102 @@ static WsXmlDocH create_doc_from_file(const char *filename, const char *encoding
1931
1934
  return xml_parser_file_to_doc( filename, encoding, 0);
1932
1935
  }
1933
1936
 
1937
+ static WsXmlDocH create_doc_from_string(const char *buf, const char *encoding);
1938
+
1939
+ static WsXmlDocH create_doc_from_string(const char *buf, const char *encoding) {
1940
+ return xml_parser_memory_to_doc( buf, strlen(buf), encoding, 0);
1941
+ }
1942
+
1943
+ static char *uri_classname(const char *uri);
1944
+ /* get classname from resource URI */
1945
+ static char *uri_classname(const char *uri) {
1946
+ const char *lastslash = strrchr(uri,'/');
1947
+ if (lastslash) {
1948
+ return strdup(lastslash+1);
1949
+ }
1950
+ return NULL;
1951
+ }
1952
+
1953
+
1954
+ static const char *uri_prefix(const char *classname);
1955
+ /* get resource URI prefix for a specific classname (resp class schema) */
1956
+ static const char *uri_prefix(const char *classname) {
1957
+ static struct map {
1958
+ int len;
1959
+ const char *schema;
1960
+ const char *prefix;
1961
+ } mapping[] = {
1962
+ /* dmtf CIM */
1963
+ { 3, "CIM", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2" },
1964
+ /* dmtf reserved */
1965
+ { 3, "PRS", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2" },
1966
+ /* Microsoft WMI */
1967
+ { 5, "Win32", "http://schemas.microsoft.com/wbem/wsman/1/wmi" },
1968
+ /* openwbem.org */
1969
+ { 8, "OpenWBEM", "http://schema.openwbem.org/wbem/wscim/1/cim-schema/2" },
1970
+ /* sblim */
1971
+ { 5, "Linux", "http://sblim.sf.net/wbem/wscim/1/cim-schema/2" },
1972
+ /* omc-project */
1973
+ { 3, "OMC", "http://schema.omc-project.org/wbem/wscim/1/cim-schema/2" },
1974
+ /* pegasus.org */
1975
+ { 2, "PG", "http://schema.openpegasus.org/wbem/wscim/1/cim-schema/2" },
1976
+ /* Intel AMT */
1977
+ { 3, "AMT", "http://intel.com/wbem/wscim/1/amt-schema/1" },
1978
+ /* Intel */
1979
+ { 3, "IPS", "http://intel.com/wbem/wscim/1/ips-schema/1" },
1980
+ { 0, NULL, NULL }
1981
+ };
1982
+ const char *schema_end;
1983
+ struct map *map;
1984
+ int len;
1985
+ if (classname == NULL)
1986
+ return NULL;
1987
+ schema_end = strchr(classname, '_');
1988
+ if (schema_end == NULL)
1989
+ return NULL; /* Bad class name */
1990
+ len = schema_end - classname;
1991
+ map = mapping;
1992
+ while (map->len > 0) {
1993
+ if ((len == map->len)
1994
+ && (strncmp(classname, map->schema, map->len) == 0)) {
1995
+ return map->prefix;
1996
+ }
1997
+ ++map;
1998
+ }
1999
+ return NULL;
2000
+ }
2001
+
2002
+
2003
+ static epr_t *my_epr_deserialize(WsXmlNodeH node);
2004
+ static epr_t *my_epr_deserialize(WsXmlNodeH node) {
2005
+ fprintf(stderr, "my_epr_deserialize(%s)\n", ws_xml_get_node_local_name(node));
2006
+ if (strcmp(WSA_EPR, ws_xml_get_node_local_name(node)) == 0) {
2007
+ /* Use node as-is if its already a WSA_EPR */
2008
+ return epr_deserialize(node, NULL, NULL, 1);
2009
+ }
2010
+ /* else search the WSA_EPR node */
2011
+ return epr_deserialize(node, XML_NS_ADDRESSING, WSA_EPR, 1);
2012
+ }
2013
+
2014
+
2015
+ static char *epr_prefix(const char *uri);
2016
+ /* Get prefix from a EPR uri */
2017
+ static char *epr_prefix(const char *uri) {
2018
+ char *classname = uri_classname(uri);
2019
+ const char *prefix = uri_prefix(classname);
2020
+ if (prefix) {
2021
+ const char *lastslash;
2022
+ if (strncmp(uri, prefix, strlen(prefix)) == 0) {
2023
+ return strdup(prefix);
2024
+ }
2025
+ lastslash = strrchr(uri, '/');
2026
+ if (lastslash) {
2027
+ return strndup(uri, lastslash-uri);
2028
+ }
2029
+ }
2030
+ return strdup(uri);
2031
+ }
2032
+
1934
2033
 
1935
2034
 
1936
2035
  #include <limits.h>
@@ -2237,8 +2336,19 @@ SWIGINTERN WsXmlNodeH __WsXmlNode_get__SWIG_1(struct __WsXmlNode *self,char cons
2237
2336
 
2238
2337
 
2239
2338
  }
2240
- SWIGINTERN WsXmlAttrH __WsXmlNode_attr(struct __WsXmlNode *self,int index){
2241
- return ws_xml_get_node_attr( self, index );
2339
+ SWIGINTERN WsXmlAttrH __WsXmlNode_attr(struct __WsXmlNode *self,VALUE index,VALUE namespace){
2340
+ if (NIL_P(index)) { /* nil */
2341
+ return ws_xml_get_node_attr( self, 0 );
2342
+ } else if (FIXNUM_P(index)) { /* numeric */
2343
+ return ws_xml_get_node_attr( self, FIX2INT(index) );
2344
+ } else { /* convert to string */
2345
+ const char *ns = NULL;
2346
+ const char *name = as_string(index);
2347
+ if (!NIL_P(namespace)) {
2348
+ ns = as_string(namespace);
2349
+ }
2350
+ return ws_xml_find_node_attr( self, ns, name );
2351
+ }
2242
2352
  }
2243
2353
  SWIGINTERN int __WsXmlNode_attr_count(struct __WsXmlNode *self){
2244
2354
  return ws_xml_get_node_attr_count( self );
@@ -2271,8 +2381,34 @@ SWIGINTERN char *__WsXmlAttr_value(struct __WsXmlAttr *self){
2271
2381
  SWIGINTERN void __WsXmlAttr_remove(struct __WsXmlAttr *self){
2272
2382
  ws_xml_remove_node_attr( self );
2273
2383
  }
2274
- SWIGINTERN epr_t *new_epr_t(char const *uri,char const *address){
2275
- return epr_create( uri, NULL, address);
2384
+ SWIGINTERN epr_t *new_epr_t(VALUE uri,VALUE address,VALUE selectors){
2385
+ extern swig_class SwigClassXmlNode;
2386
+ extern swig_class SwigClassXmlDoc;
2387
+ if (!NIL_P(address)) {
2388
+ const char *uri_s = as_string(uri);
2389
+ const char *address_s = as_string(uri);
2390
+ return epr_create(uri_s, value2hash(NULL,selectors), address_s);
2391
+ }
2392
+ else if (CLASS_OF(uri) == SwigClassXmlNode.klass) {
2393
+ WsXmlNodeH node;
2394
+ SWIG_ConvertPtr(uri, (void **)&node, SWIGTYPE_p___WsXmlNode, 0);
2395
+ return my_epr_deserialize(node);
2396
+ }
2397
+ else if (CLASS_OF(uri) == SwigClassXmlDoc.klass) {
2398
+ WsXmlDocH doc;
2399
+ WsXmlNodeH node;
2400
+ SWIG_ConvertPtr(uri, (void **)&doc, SWIGTYPE_p__WsXmlDoc, 0);
2401
+ node = ws_xml_get_soap_body(doc);
2402
+ if (node == NULL)
2403
+ node = ws_xml_get_doc_root(doc);
2404
+ return my_epr_deserialize(node);
2405
+ }
2406
+ else {
2407
+ return epr_from_string(as_string(uri));
2408
+ }
2409
+ }
2410
+ SWIGINTERN epr_t *epr_t_clone(epr_t *self,epr_t *epr){
2411
+ return epr_copy(epr);
2276
2412
  }
2277
2413
  SWIGINTERN void epr_t_add_selector(epr_t *self,char const *name,char const *text){
2278
2414
  epr_add_selector_text(self, name, text);
@@ -2281,13 +2417,14 @@ SWIGINTERN int epr_t_serialize(epr_t *self,WsXmlNodeH node,char const *ns,char c
2281
2417
  return epr_serialize(node, ns, epr_node_name, self, embedded);
2282
2418
  }
2283
2419
  SWIGINTERN int epr_t_cmp(epr_t *self,epr_t *epr2){
2420
+ fprintf(stderr, "%p.cmp(%p)\n", self, epr2);
2284
2421
  return epr_cmp(self, epr2);
2285
2422
  }
2286
2423
  SWIGINTERN char *epr_t_to_xml(epr_t *self,char const *ns,char const *epr_node_name){
2287
- return epr_to_txt(self, ns, epr_node_name);
2424
+ return epr_to_txt(self, ns?ns:"http://schemas.xmlsoap.org/ws/2004/08/addressing", epr_node_name?epr_node_name:"EndpointReference");
2288
2425
  }
2289
2426
  SWIGINTERN char *epr_t_string(epr_t *self){
2290
- return epr_to_txt(self, "http://www.w3.org/2003/05/soap-envelope", "Header");
2427
+ return epr_to_string(self);
2291
2428
  }
2292
2429
  SWIGINTERN int epr_t_selector_count(epr_t *self){
2293
2430
  return epr_selector_count(self);
@@ -2295,8 +2432,77 @@ SWIGINTERN int epr_t_selector_count(epr_t *self){
2295
2432
  SWIGINTERN char *epr_t_resource_uri(epr_t *self){
2296
2433
  return epr_get_resource_uri(self);
2297
2434
  }
2298
- SWIGINTERN char *epr_t_selector(epr_t *self,char const *name){
2299
- return wsman_epr_selector_by_name(self, name);
2435
+ SWIGINTERN char *epr_t_selector(epr_t *self,VALUE v){
2436
+ const char *name = as_string(v);
2437
+
2438
+
2439
+
2440
+ return wsman_epr_selector_by_name(self, name);
2441
+ }
2442
+ SWIGINTERN VALUE epr_t_selector_names(epr_t *self){
2443
+ int i;
2444
+ VALUE ary = rb_ary_new2(self->refparams.selectorset.count);
2445
+ Selector *p = self->refparams.selectorset.selectors;
2446
+ for (i = 0; i < self->refparams.selectorset.count; i++) {
2447
+ rb_ary_store(ary, i, SWIG_FromCharPtr(p->name));
2448
+ ++p;
2449
+ }
2450
+ return ary;
2451
+ }
2452
+ SWIGINTERN void epr_t_each(epr_t *self){
2453
+ int i;
2454
+ Selector *p = NULL;
2455
+ VALUE value, ary;
2456
+ p = self->refparams.selectorset.selectors;
2457
+ for (i = 0; i < self->refparams.selectorset.count; i++) {
2458
+ ary = rb_ary_new2(2);
2459
+ rb_ary_store(ary, 0, SWIG_FromCharPtr(p->name));
2460
+ if (p->type == 0) {
2461
+ value = SWIG_FromCharPtr(p->value);
2462
+ } else {
2463
+ char *epr_value = epr_to_string((epr_t *)p->value);
2464
+ value = SWIG_FromCharPtr(epr_value);
2465
+ u_free(epr_value);
2466
+ }
2467
+ rb_ary_store(ary, 1, value);
2468
+ rb_yield(ary);
2469
+ p++;
2470
+ }
2471
+ }
2472
+ SWIGINTERN char *epr_t_classname(epr_t *self){
2473
+ return uri_classname(self->refparams.uri);
2474
+ }
2475
+ SWIGINTERN char *epr_t_namespace(epr_t *self){
2476
+ char *classname;
2477
+ int classnamelen, namespacelen;
2478
+ const char *prefix;
2479
+ const char *uri;
2480
+
2481
+ /* try to get namespace from selectors (WS-Management style) */
2482
+ char *ns = get_cimnamespace_from_selectorset(&(self->refparams.selectorset));
2483
+ if (ns) {
2484
+ return strdup(ns);
2485
+ }
2486
+ /* WMI style? - extract namespace from uri */
2487
+
2488
+ uri = self->refparams.uri;
2489
+ prefix = epr_prefix(uri);
2490
+ if (prefix == NULL) {
2491
+ return NULL; /* bad classname in URI */
2492
+ }
2493
+ classname = uri_classname(uri);
2494
+ if (classname == NULL)
2495
+ return NULL; /* bad URI */
2496
+ classnamelen = strlen(classname);
2497
+ free(classname);
2498
+ namespacelen = strlen(uri) - classnamelen - strlen(prefix) - 2; /* drop enclosing slashes */
2499
+ if (namespacelen <= 0)
2500
+ return strdup("");
2501
+ /* copy after prefix slash (+ 1) */
2502
+ return strndup(uri + strlen(prefix) + 1, namespacelen);
2503
+ }
2504
+ SWIGINTERN char *epr_t_prefix(epr_t *self){
2505
+ return epr_prefix(self->refparams.uri);
2300
2506
  }
2301
2507
  SWIGINTERN filter_t *new_filter_t(){
2302
2508
  return filter_initialize();
@@ -2713,9 +2919,15 @@ SWIGINTERN void client_opt_t_clear_dump_request(client_opt_t *self){
2713
2919
  SWIGINTERN void client_opt_t_set_flags(client_opt_t *self,int flags){
2714
2920
  wsmc_set_action_option(self, flags);
2715
2921
  }
2922
+ SWIGINTERN unsigned int client_opt_t_get_flags(client_opt_t *self){
2923
+ return wsmc_get_action_option(self);
2924
+ }
2716
2925
  SWIGINTERN void client_opt_t_clear_flags(client_opt_t *self,int flags){
2717
2926
  wsmc_clear_action_option(self, flags);
2718
2927
  }
2928
+ SWIGINTERN void client_opt_t_reset_flags(client_opt_t *self){
2929
+ wsmc_clear_action_option(self, ~0x0000);
2930
+ }
2719
2931
  SWIGINTERN void client_opt_t_set_max_envelope_size(client_opt_t *self,unsigned long size){
2720
2932
  self->max_envelope_size = size;
2721
2933
  }
@@ -3133,15 +3345,17 @@ _wrap_XmlDoc_dump_file(int argc, VALUE *argv, VALUE self) {
3133
3345
  }
3134
3346
  arg1 = (struct _WsXmlDoc *)(argp1);
3135
3347
  {
3136
- struct OpenFile *fptr;
3348
+ struct rb_io_t *fptr;
3349
+
3350
+
3137
3351
 
3138
3352
  Check_Type(argv[0], T_FILE);
3139
3353
  GetOpenFile(argv[0], fptr);
3140
3354
  /*rb_io_check_writable(fptr);*/
3141
3355
 
3356
+ arg2 = rb_io_stdio_file(fptr);
3142
3357
 
3143
3358
 
3144
- arg2 = GetReadFile(fptr);
3145
3359
 
3146
3360
  }
3147
3361
  _WsXmlDoc_dump_file(arg1,arg2);
@@ -3636,15 +3850,17 @@ _wrap_XmlNode_dump_file(int argc, VALUE *argv, VALUE self) {
3636
3850
  }
3637
3851
  arg1 = (struct __WsXmlNode *)(argp1);
3638
3852
  {
3639
- struct OpenFile *fptr;
3853
+ struct rb_io_t *fptr;
3854
+
3855
+
3640
3856
 
3641
3857
  Check_Type(argv[0], T_FILE);
3642
3858
  GetOpenFile(argv[0], fptr);
3643
3859
  /*rb_io_check_writable(fptr);*/
3644
3860
 
3861
+ arg2 = rb_io_stdio_file(fptr);
3645
3862
 
3646
3863
 
3647
- arg2 = GetReadFile(fptr);
3648
3864
 
3649
3865
  }
3650
3866
  __WsXmlNode_dump_file(arg1,arg2);
@@ -4759,7 +4975,7 @@ fail:
4759
4975
  Document-method: Openwsman::XmlNode.attr
4760
4976
 
4761
4977
  call-seq:
4762
- attr(int index=0) -> WsXmlAttrH
4978
+ attr(VALUE index=Qnil, VALUE namespace=Qnil) -> WsXmlAttrH
4763
4979
 
4764
4980
  An instance method.
4765
4981
 
@@ -4767,15 +4983,14 @@ An instance method.
4767
4983
  SWIGINTERN VALUE
4768
4984
  _wrap_XmlNode_attr(int argc, VALUE *argv, VALUE self) {
4769
4985
  struct __WsXmlNode *arg1 = (struct __WsXmlNode *) 0 ;
4770
- int arg2 = (int) 0 ;
4986
+ VALUE arg2 = (VALUE) Qnil ;
4987
+ VALUE arg3 = (VALUE) Qnil ;
4771
4988
  void *argp1 = 0 ;
4772
4989
  int res1 = 0 ;
4773
- int val2 ;
4774
- int ecode2 = 0 ;
4775
4990
  WsXmlAttrH result;
4776
4991
  VALUE vresult = Qnil;
4777
4992
 
4778
- if ((argc < 0) || (argc > 1)) {
4993
+ if ((argc < 0) || (argc > 2)) {
4779
4994
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4780
4995
  }
4781
4996
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p___WsXmlNode, 0 | 0 );
@@ -4784,13 +4999,12 @@ _wrap_XmlNode_attr(int argc, VALUE *argv, VALUE self) {
4784
4999
  }
4785
5000
  arg1 = (struct __WsXmlNode *)(argp1);
4786
5001
  if (argc > 0) {
4787
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
4788
- if (!SWIG_IsOK(ecode2)) {
4789
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","attr", 2, argv[0] ));
4790
- }
4791
- arg2 = (int)(val2);
5002
+ arg2 = argv[0];
5003
+ }
5004
+ if (argc > 1) {
5005
+ arg3 = argv[1];
4792
5006
  }
4793
- result = (WsXmlAttrH)__WsXmlNode_attr(arg1,arg2);
5007
+ result = (WsXmlAttrH)__WsXmlNode_attr(arg1,arg2,arg3);
4794
5008
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p___WsXmlAttr, 0 | 0 );
4795
5009
  return vresult;
4796
5010
  fail:
@@ -5203,88 +5417,6 @@ fail:
5203
5417
  */
5204
5418
  swig_class SwigClassEndPointReference;
5205
5419
 
5206
-
5207
- /*
5208
- Document-method: Openwsman::EndPointReference.address
5209
-
5210
- call-seq:
5211
- address -> char
5212
-
5213
- Get value of attribute.
5214
-
5215
- */
5216
-
5217
- /*
5218
- Document-method: Openwsman::EndPointReference.address=
5219
-
5220
- call-seq:
5221
- address=(x) -> char
5222
-
5223
- Set new value for attribute.
5224
-
5225
- */
5226
- SWIGINTERN VALUE
5227
- _wrap_EndPointReference_address_set(int argc, VALUE *argv, VALUE self) {
5228
- epr_t *arg1 = (epr_t *) 0 ;
5229
- char *arg2 = (char *) 0 ;
5230
- void *argp1 = 0 ;
5231
- int res1 = 0 ;
5232
- int res2 ;
5233
- char *buf2 = 0 ;
5234
- int alloc2 = 0 ;
5235
-
5236
- if ((argc < 1) || (argc > 1)) {
5237
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
5238
- }
5239
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
5240
- if (!SWIG_IsOK(res1)) {
5241
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","address", 1, self ));
5242
- }
5243
- arg1 = (epr_t *)(argp1);
5244
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
5245
- if (!SWIG_IsOK(res2)) {
5246
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","address", 2, argv[0] ));
5247
- }
5248
- arg2 = (char *)(buf2);
5249
- if (arg1->address) free((char*)arg1->address);
5250
- if (arg2) {
5251
- size_t size = strlen((const char *)(arg2)) + 1;
5252
- arg1->address = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
5253
- } else {
5254
- arg1->address = 0;
5255
- }
5256
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5257
- return Qnil;
5258
- fail:
5259
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5260
- return Qnil;
5261
- }
5262
-
5263
-
5264
- SWIGINTERN VALUE
5265
- _wrap_EndPointReference_address_get(int argc, VALUE *argv, VALUE self) {
5266
- epr_t *arg1 = (epr_t *) 0 ;
5267
- void *argp1 = 0 ;
5268
- int res1 = 0 ;
5269
- char *result = 0 ;
5270
- VALUE vresult = Qnil;
5271
-
5272
- if ((argc < 0) || (argc > 0)) {
5273
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
5274
- }
5275
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
5276
- if (!SWIG_IsOK(res1)) {
5277
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","address", 1, self ));
5278
- }
5279
- arg1 = (epr_t *)(argp1);
5280
- result = (char *) ((arg1)->address);
5281
- vresult = SWIG_FromCharPtr((const char *)result);
5282
- return vresult;
5283
- fail:
5284
- return Qnil;
5285
- }
5286
-
5287
-
5288
5420
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
5289
5421
  SWIGINTERN VALUE
5290
5422
  _wrap_EndPointReference_allocate(VALUE self) {
@@ -5307,44 +5439,32 @@ _wrap_EndPointReference_allocate(VALUE self) {
5307
5439
  Document-method: Openwsman::EndPointReference.new
5308
5440
 
5309
5441
  call-seq:
5310
- EndPointReference.new(char uri, char address)
5442
+ EndPointReference.new(VALUE uri, VALUE address=Qnil, VALUE selectors=Qnil)
5311
5443
 
5312
5444
  Class constructor.
5313
5445
 
5314
5446
  */
5315
5447
  SWIGINTERN VALUE
5316
5448
  _wrap_new_EndPointReference(int argc, VALUE *argv, VALUE self) {
5317
- char *arg1 = (char *) 0 ;
5318
- char *arg2 = (char *) 0 ;
5319
- int res1 ;
5320
- char *buf1 = 0 ;
5321
- int alloc1 = 0 ;
5322
- int res2 ;
5323
- char *buf2 = 0 ;
5324
- int alloc2 = 0 ;
5449
+ VALUE arg1 = (VALUE) 0 ;
5450
+ VALUE arg2 = (VALUE) Qnil ;
5451
+ VALUE arg3 = (VALUE) Qnil ;
5325
5452
  epr_t *result = 0 ;
5326
5453
 
5327
- if ((argc < 2) || (argc > 2)) {
5328
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
5454
+ if ((argc < 1) || (argc > 3)) {
5455
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
5329
5456
  }
5330
- res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
5331
- if (!SWIG_IsOK(res1)) {
5332
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","epr_t", 1, argv[0] ));
5457
+ arg1 = argv[0];
5458
+ if (argc > 1) {
5459
+ arg2 = argv[1];
5333
5460
  }
5334
- arg1 = (char *)(buf1);
5335
- res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
5336
- if (!SWIG_IsOK(res2)) {
5337
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","epr_t", 2, argv[1] ));
5461
+ if (argc > 2) {
5462
+ arg3 = argv[2];
5338
5463
  }
5339
- arg2 = (char *)(buf2);
5340
- result = (epr_t *)new_epr_t((char const *)arg1,(char const *)arg2);
5464
+ result = (epr_t *)new_epr_t(arg1,arg2,arg3);
5341
5465
  DATA_PTR(self) = result;
5342
- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5343
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5344
5466
  return self;
5345
5467
  fail:
5346
- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
5347
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5348
5468
  return Qnil;
5349
5469
  }
5350
5470
 
@@ -5358,6 +5478,47 @@ free_epr_t(epr_t *arg1) {
5358
5478
  }
5359
5479
 
5360
5480
 
5481
+ /*
5482
+ Document-method: Openwsman::EndPointReference.clone
5483
+
5484
+ call-seq:
5485
+ clone(epr) -> EndPointReference
5486
+
5487
+ Create a duplicate of the class.
5488
+ */
5489
+ SWIGINTERN VALUE
5490
+ _wrap_EndPointReference_clone(int argc, VALUE *argv, VALUE self) {
5491
+ epr_t *arg1 = (epr_t *) 0 ;
5492
+ epr_t *arg2 = (epr_t *) 0 ;
5493
+ void *argp1 = 0 ;
5494
+ int res1 = 0 ;
5495
+ void *argp2 = 0 ;
5496
+ int res2 = 0 ;
5497
+ epr_t *result = 0 ;
5498
+ VALUE vresult = Qnil;
5499
+
5500
+ if ((argc < 1) || (argc > 1)) {
5501
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
5502
+ }
5503
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
5504
+ if (!SWIG_IsOK(res1)) {
5505
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","clone", 1, self ));
5506
+ }
5507
+ arg1 = (epr_t *)(argp1);
5508
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_epr_t, 0 | 0 );
5509
+ if (!SWIG_IsOK(res2)) {
5510
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "epr_t *","clone", 2, argv[0] ));
5511
+ }
5512
+ arg2 = (epr_t *)(argp2);
5513
+ result = (epr_t *)epr_t_clone(arg1,arg2);
5514
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_epr_t, SWIG_POINTER_OWN | 0 );
5515
+ return vresult;
5516
+ fail:
5517
+ return Qnil;
5518
+ }
5519
+
5520
+
5521
+
5361
5522
  /*
5362
5523
  Document-method: Openwsman::EndPointReference.add_selector
5363
5524
 
@@ -5517,7 +5678,7 @@ _wrap_EndPointReference_cmp(int argc, VALUE *argv, VALUE self) {
5517
5678
  }
5518
5679
  arg2 = (epr_t *)(argp2);
5519
5680
  result = (int)epr_t_cmp(arg1,arg2);
5520
- vresult = SWIG_From_int((int)(result));
5681
+ vresult = (result == 0) ? Qtrue : Qfalse;
5521
5682
  return vresult;
5522
5683
  fail:
5523
5684
  return Qnil;
@@ -5529,7 +5690,7 @@ fail:
5529
5690
  Document-method: Openwsman::EndPointReference.to_xml
5530
5691
 
5531
5692
  call-seq:
5532
- to_xml(char ns, char epr_node_name) -> char
5693
+ to_xml(char ns=nil, char epr_node_name=nil) -> char
5533
5694
 
5534
5695
  An instance method.
5535
5696
 
@@ -5537,8 +5698,8 @@ An instance method.
5537
5698
  SWIGINTERN VALUE
5538
5699
  _wrap_EndPointReference_to_xml(int argc, VALUE *argv, VALUE self) {
5539
5700
  epr_t *arg1 = (epr_t *) 0 ;
5540
- char *arg2 = (char *) 0 ;
5541
- char *arg3 = (char *) 0 ;
5701
+ char *arg2 = (char *) NULL ;
5702
+ char *arg3 = (char *) NULL ;
5542
5703
  void *argp1 = 0 ;
5543
5704
  int res1 = 0 ;
5544
5705
  int res2 ;
@@ -5550,24 +5711,28 @@ _wrap_EndPointReference_to_xml(int argc, VALUE *argv, VALUE self) {
5550
5711
  char *result = 0 ;
5551
5712
  VALUE vresult = Qnil;
5552
5713
 
5553
- if ((argc < 2) || (argc > 2)) {
5554
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
5714
+ if ((argc < 0) || (argc > 2)) {
5715
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
5555
5716
  }
5556
5717
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
5557
5718
  if (!SWIG_IsOK(res1)) {
5558
5719
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","to_xml", 1, self ));
5559
5720
  }
5560
5721
  arg1 = (epr_t *)(argp1);
5561
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
5562
- if (!SWIG_IsOK(res2)) {
5563
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","to_xml", 2, argv[0] ));
5722
+ if (argc > 0) {
5723
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
5724
+ if (!SWIG_IsOK(res2)) {
5725
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","to_xml", 2, argv[0] ));
5726
+ }
5727
+ arg2 = (char *)(buf2);
5564
5728
  }
5565
- arg2 = (char *)(buf2);
5566
- res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
5567
- if (!SWIG_IsOK(res3)) {
5568
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","to_xml", 3, argv[1] ));
5729
+ if (argc > 1) {
5730
+ res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
5731
+ if (!SWIG_IsOK(res3)) {
5732
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","to_xml", 3, argv[1] ));
5733
+ }
5734
+ arg3 = (char *)(buf3);
5569
5735
  }
5570
- arg3 = (char *)(buf3);
5571
5736
  result = (char *)epr_t_to_xml(arg1,(char const *)arg2,(char const *)arg3);
5572
5737
  vresult = SWIG_FromCharPtr((const char *)result);
5573
5738
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
@@ -5582,16 +5747,16 @@ fail:
5582
5747
 
5583
5748
 
5584
5749
  /*
5585
- Document-method: Openwsman::EndPointReference.string
5750
+ Document-method: Openwsman::EndPointReference.to_s
5586
5751
 
5587
5752
  call-seq:
5588
- string -> char
5753
+ to_s -> char
5589
5754
 
5590
5755
  An instance method.
5591
5756
 
5592
5757
  */
5593
5758
  SWIGINTERN VALUE
5594
- _wrap_EndPointReference_string(int argc, VALUE *argv, VALUE self) {
5759
+ _wrap_EndPointReference_to_s(int argc, VALUE *argv, VALUE self) {
5595
5760
  epr_t *arg1 = (epr_t *) 0 ;
5596
5761
  void *argp1 = 0 ;
5597
5762
  int res1 = 0 ;
@@ -5688,7 +5853,7 @@ fail:
5688
5853
  Document-method: Openwsman::EndPointReference.selector
5689
5854
 
5690
5855
  call-seq:
5691
- selector(char name) -> char
5856
+ selector(VALUE v) -> char
5692
5857
 
5693
5858
  An instance method.
5694
5859
 
@@ -5696,12 +5861,9 @@ An instance method.
5696
5861
  SWIGINTERN VALUE
5697
5862
  _wrap_EndPointReference_selector(int argc, VALUE *argv, VALUE self) {
5698
5863
  epr_t *arg1 = (epr_t *) 0 ;
5699
- char *arg2 = (char *) 0 ;
5864
+ VALUE arg2 = (VALUE) 0 ;
5700
5865
  void *argp1 = 0 ;
5701
5866
  int res1 = 0 ;
5702
- int res2 ;
5703
- char *buf2 = 0 ;
5704
- int alloc2 = 0 ;
5705
5867
  char *result = 0 ;
5706
5868
  VALUE vresult = Qnil;
5707
5869
 
@@ -5713,17 +5875,180 @@ _wrap_EndPointReference_selector(int argc, VALUE *argv, VALUE self) {
5713
5875
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","selector", 1, self ));
5714
5876
  }
5715
5877
  arg1 = (epr_t *)(argp1);
5716
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
5717
- if (!SWIG_IsOK(res2)) {
5718
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","selector", 2, argv[0] ));
5878
+ arg2 = argv[0];
5879
+ result = (char *)epr_t_selector(arg1,arg2);
5880
+ vresult = SWIG_FromCharPtr((const char *)result);
5881
+ return vresult;
5882
+ fail:
5883
+ return Qnil;
5884
+ }
5885
+
5886
+
5887
+
5888
+ /*
5889
+ Document-method: Openwsman::EndPointReference.selector_names
5890
+
5891
+ call-seq:
5892
+ selector_names(void ?) -> VALUE
5893
+
5894
+ An instance method.
5895
+
5896
+ */
5897
+ SWIGINTERN VALUE
5898
+ _wrap_EndPointReference_selector_names(int argc, VALUE *argv, VALUE self) {
5899
+ epr_t *arg1 = (epr_t *) 0 ;
5900
+ void *argp1 = 0 ;
5901
+ int res1 = 0 ;
5902
+ VALUE result;
5903
+ VALUE vresult = Qnil;
5904
+
5905
+ if ((argc < 0) || (argc > 0)) {
5906
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
5719
5907
  }
5720
- arg2 = (char *)(buf2);
5721
- result = (char *)epr_t_selector(arg1,(char const *)arg2);
5908
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
5909
+ if (!SWIG_IsOK(res1)) {
5910
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","selector_names", 1, self ));
5911
+ }
5912
+ arg1 = (epr_t *)(argp1);
5913
+ result = (VALUE)epr_t_selector_names(arg1);
5914
+ vresult = result;
5915
+ return vresult;
5916
+ fail:
5917
+ return Qnil;
5918
+ }
5919
+
5920
+
5921
+
5922
+ /*
5923
+ Document-method: Openwsman::EndPointReference.each
5924
+
5925
+ call-seq:
5926
+ each
5927
+
5928
+ Iterate thru each element in the EndPointReference. A block must be provided.
5929
+ */
5930
+ SWIGINTERN VALUE
5931
+ _wrap_EndPointReference_each(int argc, VALUE *argv, VALUE self) {
5932
+ epr_t *arg1 = (epr_t *) 0 ;
5933
+ void *argp1 = 0 ;
5934
+ int res1 = 0 ;
5935
+
5936
+ if ((argc < 0) || (argc > 0)) {
5937
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
5938
+ }
5939
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
5940
+ if (!SWIG_IsOK(res1)) {
5941
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","each", 1, self ));
5942
+ }
5943
+ arg1 = (epr_t *)(argp1);
5944
+ epr_t_each(arg1);
5945
+ return Qnil;
5946
+ fail:
5947
+ return Qnil;
5948
+ }
5949
+
5950
+
5951
+
5952
+ /*
5953
+ Document-method: Openwsman::EndPointReference.classname
5954
+
5955
+ call-seq:
5956
+ classname(void ?) -> char
5957
+
5958
+ An instance method.
5959
+
5960
+ */
5961
+ SWIGINTERN VALUE
5962
+ _wrap_EndPointReference_classname(int argc, VALUE *argv, VALUE self) {
5963
+ epr_t *arg1 = (epr_t *) 0 ;
5964
+ void *argp1 = 0 ;
5965
+ int res1 = 0 ;
5966
+ char *result = 0 ;
5967
+ VALUE vresult = Qnil;
5968
+
5969
+ if ((argc < 0) || (argc > 0)) {
5970
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
5971
+ }
5972
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
5973
+ if (!SWIG_IsOK(res1)) {
5974
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","classname", 1, self ));
5975
+ }
5976
+ arg1 = (epr_t *)(argp1);
5977
+ result = (char *)epr_t_classname(arg1);
5722
5978
  vresult = SWIG_FromCharPtr((const char *)result);
5723
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5979
+ free(result);
5980
+ return vresult;
5981
+ fail:
5982
+ return Qnil;
5983
+ }
5984
+
5985
+
5986
+
5987
+ /*
5988
+ Document-method: Openwsman::EndPointReference.namespace
5989
+
5990
+ call-seq:
5991
+ namespace(void ?) -> char
5992
+
5993
+ An instance method.
5994
+
5995
+ */
5996
+ SWIGINTERN VALUE
5997
+ _wrap_EndPointReference_namespace(int argc, VALUE *argv, VALUE self) {
5998
+ epr_t *arg1 = (epr_t *) 0 ;
5999
+ void *argp1 = 0 ;
6000
+ int res1 = 0 ;
6001
+ char *result = 0 ;
6002
+ VALUE vresult = Qnil;
6003
+
6004
+ if ((argc < 0) || (argc > 0)) {
6005
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
6006
+ }
6007
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
6008
+ if (!SWIG_IsOK(res1)) {
6009
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","namespace", 1, self ));
6010
+ }
6011
+ arg1 = (epr_t *)(argp1);
6012
+ result = (char *)epr_t_namespace(arg1);
6013
+ vresult = SWIG_FromCharPtr((const char *)result);
6014
+ free(result);
6015
+ return vresult;
6016
+ fail:
6017
+ return Qnil;
6018
+ }
6019
+
6020
+
6021
+
6022
+ /*
6023
+ Document-method: Openwsman::EndPointReference.prefix
6024
+
6025
+ call-seq:
6026
+ prefix(void ?) -> char
6027
+
6028
+ An instance method.
6029
+
6030
+ */
6031
+ SWIGINTERN VALUE
6032
+ _wrap_EndPointReference_prefix(int argc, VALUE *argv, VALUE self) {
6033
+ epr_t *arg1 = (epr_t *) 0 ;
6034
+ void *argp1 = 0 ;
6035
+ int res1 = 0 ;
6036
+ char *result = 0 ;
6037
+ VALUE vresult = Qnil;
6038
+
6039
+ if ((argc < 0) || (argc > 0)) {
6040
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
6041
+ }
6042
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_epr_t, 0 | 0 );
6043
+ if (!SWIG_IsOK(res1)) {
6044
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "epr_t *","prefix", 1, self ));
6045
+ }
6046
+ arg1 = (epr_t *)(argp1);
6047
+ result = (char *)epr_t_prefix(arg1);
6048
+ vresult = SWIG_FromCharPtr((const char *)result);
6049
+ free(result);
5724
6050
  return vresult;
5725
6051
  fail:
5726
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
5727
6052
  return Qnil;
5728
6053
  }
5729
6054
 
@@ -12122,6 +12447,40 @@ fail:
12122
12447
 
12123
12448
 
12124
12449
 
12450
+ /*
12451
+ Document-method: Openwsman::ClientOptions.flags
12452
+
12453
+ call-seq:
12454
+ flags -> unsigned int
12455
+
12456
+ An instance method.
12457
+
12458
+ */
12459
+ SWIGINTERN VALUE
12460
+ _wrap_ClientOptions_flags(int argc, VALUE *argv, VALUE self) {
12461
+ client_opt_t *arg1 = (client_opt_t *) 0 ;
12462
+ void *argp1 = 0 ;
12463
+ int res1 = 0 ;
12464
+ unsigned int result;
12465
+ VALUE vresult = Qnil;
12466
+
12467
+ if ((argc < 0) || (argc > 0)) {
12468
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
12469
+ }
12470
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_client_opt_t, 0 | 0 );
12471
+ if (!SWIG_IsOK(res1)) {
12472
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "client_opt_t *","get_flags", 1, self ));
12473
+ }
12474
+ arg1 = (client_opt_t *)(argp1);
12475
+ result = (unsigned int)client_opt_t_get_flags(arg1);
12476
+ vresult = SWIG_From_unsigned_SS_int((unsigned int)(result));
12477
+ return vresult;
12478
+ fail:
12479
+ return Qnil;
12480
+ }
12481
+
12482
+
12483
+
12125
12484
  /*
12126
12485
  Document-method: Openwsman::ClientOptions.clear_flags
12127
12486
 
@@ -12161,6 +12520,37 @@ fail:
12161
12520
 
12162
12521
 
12163
12522
 
12523
+ /*
12524
+ Document-method: Openwsman::ClientOptions.reset_flags
12525
+
12526
+ call-seq:
12527
+ reset_flags
12528
+
12529
+ An instance method.
12530
+
12531
+ */
12532
+ SWIGINTERN VALUE
12533
+ _wrap_ClientOptions_reset_flags(int argc, VALUE *argv, VALUE self) {
12534
+ client_opt_t *arg1 = (client_opt_t *) 0 ;
12535
+ void *argp1 = 0 ;
12536
+ int res1 = 0 ;
12537
+
12538
+ if ((argc < 0) || (argc > 0)) {
12539
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
12540
+ }
12541
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_client_opt_t, 0 | 0 );
12542
+ if (!SWIG_IsOK(res1)) {
12543
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "client_opt_t *","reset_flags", 1, self ));
12544
+ }
12545
+ arg1 = (client_opt_t *)(argp1);
12546
+ client_opt_t_reset_flags(arg1);
12547
+ return Qnil;
12548
+ fail:
12549
+ return Qnil;
12550
+ }
12551
+
12552
+
12553
+
12164
12554
  /*
12165
12555
  Document-method: Openwsman::ClientOptions.max_envelope_size=
12166
12556
 
@@ -13346,15 +13736,17 @@ _wrap_Client_dumpfilee___(int argc, VALUE *argv, VALUE self) {
13346
13736
  }
13347
13737
  arg1 = (WsManClient *)(argp1);
13348
13738
  {
13349
- struct OpenFile *fptr;
13739
+ struct rb_io_t *fptr;
13740
+
13741
+
13350
13742
 
13351
13743
  Check_Type(argv[0], T_FILE);
13352
13744
  GetOpenFile(argv[0], fptr);
13353
13745
  /*rb_io_check_writable(fptr);*/
13354
13746
 
13747
+ arg2 = rb_io_stdio_file(fptr);
13355
13748
 
13356
13749
 
13357
- arg2 = GetReadFile(fptr);
13358
13750
 
13359
13751
  }
13360
13752
  WsManClient_set_dumpfile(arg1,arg2);
@@ -14847,6 +15239,93 @@ fail:
14847
15239
 
14848
15240
 
14849
15241
 
15242
+ /*
15243
+ Document-method: Openwsman.create_doc_from_string
15244
+
15245
+ call-seq:
15246
+ create_doc_from_string(char buf, char encoding="UTF-8") -> WsXmlDocH
15247
+
15248
+ A module function.
15249
+
15250
+ */
15251
+ SWIGINTERN VALUE
15252
+ _wrap_create_doc_from_string(int argc, VALUE *argv, VALUE self) {
15253
+ char *arg1 = (char *) 0 ;
15254
+ char *arg2 = (char *) "UTF-8" ;
15255
+ int res1 ;
15256
+ char *buf1 = 0 ;
15257
+ int alloc1 = 0 ;
15258
+ int res2 ;
15259
+ char *buf2 = 0 ;
15260
+ int alloc2 = 0 ;
15261
+ WsXmlDocH result;
15262
+ VALUE vresult = Qnil;
15263
+
15264
+ if ((argc < 1) || (argc > 2)) {
15265
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
15266
+ }
15267
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
15268
+ if (!SWIG_IsOK(res1)) {
15269
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","create_doc_from_string", 1, argv[0] ));
15270
+ }
15271
+ arg1 = (char *)(buf1);
15272
+ if (argc > 1) {
15273
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
15274
+ if (!SWIG_IsOK(res2)) {
15275
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","create_doc_from_string", 2, argv[1] ));
15276
+ }
15277
+ arg2 = (char *)(buf2);
15278
+ }
15279
+ result = (WsXmlDocH)create_doc_from_string((char const *)arg1,(char const *)arg2);
15280
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p__WsXmlDoc, 0 | 0 );
15281
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
15282
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
15283
+ return vresult;
15284
+ fail:
15285
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
15286
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
15287
+ return Qnil;
15288
+ }
15289
+
15290
+
15291
+
15292
+ /*
15293
+ Document-method: Openwsman.uri_prefix
15294
+
15295
+ call-seq:
15296
+ uri_prefix(char classname) -> char
15297
+
15298
+ A module function.
15299
+
15300
+ */
15301
+ SWIGINTERN VALUE
15302
+ _wrap_uri_prefix(int argc, VALUE *argv, VALUE self) {
15303
+ char *arg1 = (char *) 0 ;
15304
+ int res1 ;
15305
+ char *buf1 = 0 ;
15306
+ int alloc1 = 0 ;
15307
+ char *result = 0 ;
15308
+ VALUE vresult = Qnil;
15309
+
15310
+ if ((argc < 1) || (argc > 1)) {
15311
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
15312
+ }
15313
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
15314
+ if (!SWIG_IsOK(res1)) {
15315
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","uri_prefix", 1, argv[0] ));
15316
+ }
15317
+ arg1 = (char *)(buf1);
15318
+ result = (char *)uri_prefix((char const *)arg1);
15319
+ vresult = SWIG_FromCharPtr((const char *)result);
15320
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
15321
+ return vresult;
15322
+ fail:
15323
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
15324
+ return Qnil;
15325
+ }
15326
+
15327
+
15328
+
14850
15329
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
14851
15330
 
14852
15331
  static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0};
@@ -15219,7 +15698,7 @@ SWIG_PropagateClientData(void) {
15219
15698
  #ifdef __cplusplus
15220
15699
  extern "C"
15221
15700
  #endif
15222
- SWIGEXPORT void Init_openwsman(void) {
15701
+ SWIGEXPORT void Init_Openwsman(void) {
15223
15702
  size_t i;
15224
15703
 
15225
15704
  SWIG_InitRuntime();
@@ -15233,8 +15712,8 @@ SWIGEXPORT void Init_openwsman(void) {
15233
15712
  SWIG_RubyInitializeTrackings();
15234
15713
  rb_define_const(mOpenwsman, "OPENWSMAN_MAJOR", SWIG_From_int((int)(2)));
15235
15714
  rb_define_const(mOpenwsman, "OPENWSMAN_MINOR", SWIG_From_int((int)(3)));
15236
- rb_define_const(mOpenwsman, "OPENWSMAN_PATCH", SWIG_From_int((int)(0)));
15237
- rb_define_const(mOpenwsman, "OPENWSMAN_VERSION", SWIG_FromCharPtr("2.3.0"));
15715
+ rb_define_const(mOpenwsman, "OPENWSMAN_PATCH", SWIG_From_int((int)(2)));
15716
+ rb_define_const(mOpenwsman, "OPENWSMAN_VERSION", SWIG_FromCharPtr("2.3.2"));
15238
15717
 
15239
15718
  SwigClassXmlNs.klass = rb_define_class_under(mOpenwsman, "XmlNs", rb_cObject);
15240
15719
  SWIG_TypeClientData(SWIGTYPE_p___WsXmlNs, (void *) &SwigClassXmlNs);
@@ -15611,16 +16090,21 @@ SWIGEXPORT void Init_openwsman(void) {
15611
16090
  SWIG_TypeClientData(SWIGTYPE_p_epr_t, (void *) &SwigClassEndPointReference);
15612
16091
  rb_define_alloc_func(SwigClassEndPointReference.klass, _wrap_EndPointReference_allocate);
15613
16092
  rb_define_method(SwigClassEndPointReference.klass, "initialize", _wrap_new_EndPointReference, -1);
15614
- rb_define_method(SwigClassEndPointReference.klass, "address=", _wrap_EndPointReference_address_set, -1);
15615
- rb_define_method(SwigClassEndPointReference.klass, "address", _wrap_EndPointReference_address_get, -1);
16093
+ rb_define_method(SwigClassEndPointReference.klass, "clone", _wrap_EndPointReference_clone, -1);
15616
16094
  rb_define_method(SwigClassEndPointReference.klass, "add_selector", _wrap_EndPointReference_add_selector, -1);
15617
16095
  rb_define_method(SwigClassEndPointReference.klass, "serialize", _wrap_EndPointReference_serialize, -1);
15618
16096
  rb_define_method(SwigClassEndPointReference.klass, "cmp", _wrap_EndPointReference_cmp, -1);
16097
+ rb_define_alias(SwigClassEndPointReference.klass, "==", "cmp");
15619
16098
  rb_define_method(SwigClassEndPointReference.klass, "to_xml", _wrap_EndPointReference_to_xml, -1);
15620
- rb_define_method(SwigClassEndPointReference.klass, "string", _wrap_EndPointReference_string, -1);
16099
+ rb_define_method(SwigClassEndPointReference.klass, "to_s", _wrap_EndPointReference_to_s, -1);
15621
16100
  rb_define_method(SwigClassEndPointReference.klass, "selector_count", _wrap_EndPointReference_selector_count, -1);
15622
16101
  rb_define_method(SwigClassEndPointReference.klass, "resource_uri", _wrap_EndPointReference_resource_uri, -1);
15623
16102
  rb_define_method(SwigClassEndPointReference.klass, "selector", _wrap_EndPointReference_selector, -1);
16103
+ rb_define_method(SwigClassEndPointReference.klass, "selector_names", _wrap_EndPointReference_selector_names, -1);
16104
+ rb_define_method(SwigClassEndPointReference.klass, "each", _wrap_EndPointReference_each, -1);
16105
+ rb_define_method(SwigClassEndPointReference.klass, "classname", _wrap_EndPointReference_classname, -1);
16106
+ rb_define_method(SwigClassEndPointReference.klass, "namespace", _wrap_EndPointReference_namespace, -1);
16107
+ rb_define_method(SwigClassEndPointReference.klass, "prefix", _wrap_EndPointReference_prefix, -1);
15624
16108
  SwigClassEndPointReference.mark = 0;
15625
16109
  SwigClassEndPointReference.destroy = (void (*)(void *)) free_epr_t;
15626
16110
  SwigClassEndPointReference.trackObjects = 0;
@@ -16032,7 +16516,9 @@ SWIGEXPORT void Init_openwsman(void) {
16032
16516
  rb_define_method(SwigClassClientOptions.klass, "set_dump_request", _wrap_ClientOptions_set_dump_request, -1);
16033
16517
  rb_define_method(SwigClassClientOptions.klass, "clear_dump_request", _wrap_ClientOptions_clear_dump_request, -1);
16034
16518
  rb_define_method(SwigClassClientOptions.klass, "flags=", _wrap_ClientOptions_flagse___, -1);
16519
+ rb_define_method(SwigClassClientOptions.klass, "flags", _wrap_ClientOptions_flags, -1);
16035
16520
  rb_define_method(SwigClassClientOptions.klass, "clear_flags", _wrap_ClientOptions_clear_flags, -1);
16521
+ rb_define_method(SwigClassClientOptions.klass, "reset_flags", _wrap_ClientOptions_reset_flags, -1);
16036
16522
  rb_define_method(SwigClassClientOptions.klass, "max_envelope_size=", _wrap_ClientOptions_max_envelope_sizee___, -1);
16037
16523
  rb_define_method(SwigClassClientOptions.klass, "max_envelope_size", _wrap_ClientOptions_max_envelope_size, -1);
16038
16524
  rb_define_method(SwigClassClientOptions.klass, "max_elements=", _wrap_ClientOptions_max_elementse___, -1);
@@ -16102,5 +16588,7 @@ SWIGEXPORT void Init_openwsman(void) {
16102
16588
  rb_define_module_function(mOpenwsman, "debug", _wrap_debug, -1);
16103
16589
  rb_define_module_function(mOpenwsman, "create_soap_envelope", _wrap_create_soap_envelope, -1);
16104
16590
  rb_define_module_function(mOpenwsman, "create_doc_from_file", _wrap_create_doc_from_file, -1);
16591
+ rb_define_module_function(mOpenwsman, "create_doc_from_string", _wrap_create_doc_from_string, -1);
16592
+ rb_define_module_function(mOpenwsman, "uri_prefix", _wrap_uri_prefix, -1);
16105
16593
  }
16106
16594
 
@@ -24,4 +24,32 @@ module Openwsman
24
24
  # return nil to abort authentication
25
25
  end
26
26
  end
27
- end
27
+ #
28
+ # return endpoint-reference (EPR) prefix for given classname and namespace
29
+ #
30
+ # * +classname+ - classname (using the <schema>_<name> format)
31
+ # * +namespace+ - optional namespace, required for Windows WMI which embeds the namespace in the EPR
32
+ #
33
+ # ==== Examples
34
+ # prefix = Openwsman.epr_prefix_for "CIM_Managed_Element"
35
+ # prefix = Openwsman.epr_prefix_for "Win32_Foo", "root/cimv2"
36
+ #
37
+ def self.epr_prefix_for classname, namespace = nil
38
+ prefix = Openwsman::uri_prefix classname
39
+ prefix += "/#{namespace}" if namespace
40
+ prefix
41
+ end
42
+
43
+ # create full endpoint reference URI for namespace and classname
44
+ def self.epr_uri_for namespace, classname
45
+ raise "Namespace must not be nil" unless namespace
46
+ raise "Classname must not be nil" unless classname
47
+ "#{self.epr_prefix_for(classname)}/#{namespace}/#{classname}"
48
+ end
49
+
50
+ class EndPointReference
51
+ def method_missing name, *args
52
+ selector(name)
53
+ end
54
+ end
55
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Openwsman
4
4
  require 'rbconfig'
5
- OPENWSMAN_RUBY_VERSION = "1.8"
5
+ OPENWSMAN_RUBY_VERSION = "1.9"
6
6
  SYSTEM_RUBY_VERSION = "#{RbConfig::CONFIG['MAJOR']}.#{RbConfig::CONFIG['MINOR']}"
7
7
  if SYSTEM_RUBY_VERSION != OPENWSMAN_RUBY_VERSION
8
8
  STDERR.puts "** Warning: Ruby version mismatch: Openwsman Ruby #{OPENWSMAN_RUBY_VERSION}, Runtime Ruby #{SYSTEM_RUBY_VERSION}"
metadata CHANGED
@@ -1,79 +1,59 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: openwsman
3
- version: !ruby/object:Gem::Version
4
- hash: 3
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.3.2
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 3
9
- - 0
10
- version: 2.3.0
11
6
  platform: ruby
12
- authors:
13
- - "Klaus K\xC3\xA4mpf"
7
+ authors:
8
+ - Klaus Kämpf
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-02-07 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-03-16 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rake-compiler
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &5667040 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: mocha
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *5667040
25
+ - !ruby/object:Gem::Dependency
26
+ name: mocha
27
+ requirement: &5665920 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 25
44
- segments:
45
- - 0
46
- - 9
47
- version: "0.9"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0.9'
48
33
  type: :development
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: yard
52
34
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *5665920
36
+ - !ruby/object:Gem::Dependency
37
+ name: yard
38
+ requirement: &5665240 !ruby/object:Gem::Requirement
54
39
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 1
59
- segments:
60
- - 0
61
- - 5
62
- version: "0.5"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0.5'
63
44
  type: :development
64
- version_requirements: *id003
65
- description: |-
66
- The openwsman gem provides a Ruby API to manage
67
- systems using the WS-Management protocol.
68
- email:
45
+ prerelease: false
46
+ version_requirements: *5665240
47
+ description: ! 'The openwsman gem provides a Ruby API to manage
48
+
49
+ systems using the WS-Management protocol.'
50
+ email:
69
51
  - kkaempf@suse.de
70
52
  executables: []
71
-
72
- extensions:
53
+ extensions:
73
54
  - ext/openwsman/extconf.rb
74
55
  extra_rdoc_files: []
75
-
76
- files:
56
+ files:
77
57
  - lib/openwsman.rb
78
58
  - lib/openwsman/xmlnode.rb
79
59
  - lib/openwsman/xmldoc.rb
@@ -84,43 +64,30 @@ files:
84
64
  - ext/openwsman/openwsman_wrap.c
85
65
  - ext/openwsman/openwsman.c
86
66
  - ext/openwsman/extconf.rb
87
- has_rdoc: true
88
67
  homepage: http://www.github.com/openwsman/openwsman
89
68
  licenses: []
90
-
91
- post_install_message: " ____\n\
92
- /@ ~-.\n\
93
- / __ .- | remember to have fun! \n // // @ \n\n"
69
+ post_install_message: ! " ____\n/@ ~-.\n/ __ .- | remember to have fun! \n //
70
+ // @ \n\n"
94
71
  rdoc_options: []
95
-
96
- require_paths:
72
+ require_paths:
97
73
  - lib
98
- required_ruby_version: !ruby/object:Gem::Requirement
74
+ required_ruby_version: !ruby/object:Gem::Requirement
99
75
  none: false
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
- version: "0"
107
- required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
81
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 23
113
- segments:
114
- - 1
115
- - 3
116
- - 6
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
117
85
  version: 1.3.6
118
86
  requirements: []
119
-
120
87
  rubyforge_project:
121
- rubygems_version: 1.5.0
88
+ rubygems_version: 1.8.15
122
89
  signing_key:
123
90
  specification_version: 3
124
91
  summary: Ruby client bindings for Openwsman
125
92
  test_files: []
126
-
93
+ has_rdoc: