search for: rb_hash_lookup

Displaying 9 results from an estimated 9 matches for "rb_hash_lookup".

2012 Jun 29
4
[PATCH libguestfs 0/3] Fix configure script detection of Ruby.
These three patches ought to fix configure script detection of Ruby, especially on Debian where the Ruby C extensions library can be something like '-lruby1.8'. Rich.
2013 Feb 18
4
Some fixes for building the Debian package for 1.20.2
I needed to add a few patches to be able to build libguestfs 1.20.2 out of tree. Mostly srcdir/builddir issues -- I think that I had posted something for building the daemon before. As mentioned on IRC, I found that compiling (Ruby bindings) caused config.h file shipped with the Ruby headers to be included rather than ${builddir}/config.h. This can be fixed because the relevant checks can be
2015 Oct 05
0
Re: [PATCH] Remove multiple hacks that only apply to RHEL 5.
...uby.ml b/generator/ruby.ml > index 87bb34a..cb187b0 100644 > --- a/generator/ruby.ml > +++ b/generator/ruby.ml > @@ -84,20 +84,6 @@ let rec generate_ruby_c () = > #define RSTRING_PTR(r) (RSTRING((r))->ptr) > #endif > > -/* For RHEL 5 (Ruby 1.8.5) */ > -#ifndef HAVE_RB_HASH_LOOKUP > -VALUE > -rb_hash_lookup (VALUE hash, VALUE key) > -{ > - volatile VALUE val; > - > - if (!st_lookup (RHASH(hash)->tbl, key, &val)) > - return Qnil; > - > - return val; > -} > -#endif /* !HAVE_RB_HASH_LOOKUP */ The have_func("rb_hash_lookup&qu...
2013 Mar 07
7
Fixes from the patch queue of the Debian package
Here are three patches that fix issues with out-of-tree building and one that uses Ruby's own autoconf stuff for determining how Ruby bindings should be built. Cheers, -Hilko
2015 Oct 05
2
[PATCH] Remove multiple hacks that only apply to RHEL 5.
...uot;hello"), [] diff --git a/generator/ruby.ml b/generator/ruby.ml index 87bb34a..cb187b0 100644 --- a/generator/ruby.ml +++ b/generator/ruby.ml @@ -84,20 +84,6 @@ let rec generate_ruby_c () = #define RSTRING_PTR(r) (RSTRING((r))->ptr) #endif -/* For RHEL 5 (Ruby 1.8.5) */ -#ifndef HAVE_RB_HASH_LOOKUP -VALUE -rb_hash_lookup (VALUE hash, VALUE key) -{ - volatile VALUE val; - - if (!st_lookup (RHASH(hash)->tbl, key, &val)) - return Qnil; - - return val; -} -#endif /* !HAVE_RB_HASH_LOOKUP */ - static VALUE m_guestfs; /* guestfs module */ static VALUE c_guestfs; /* guestfs_h handl...
2011 Jan 05
0
Fwd: Review of libguestfs ruby bindings
...the user to pass in the ones that they are interested in. If you care to look, an example in the ruby-libvirt code is ext/libvirt/domain.c:libvirt_dom_memory_peek() 5) The way that hash lookups are done are a little complicated. For instance, ruby_guestfs_add_drive_opts() uses: VALUE v; v = rb_hash_lookup (optargsv, ID2SYM (rb_intern ("readonly"))); to get at the hash symbol. In ruby-libvirt I tend to do: v = rb_hash_aref(optsargv, rb_str_new2("readonly")); That being said, your way may actually be faster since you aren't allocating a new object. Minor in any case, they...
2013 Dec 27
0
[PATCH] ruby: Fix .new method (RHBZ#1046509).
...+ return Data_Wrap_Struct (c_guestfs, NULL, ruby_guestfs_free, g); +} +static unsigned +parse_flags (int argc, VALUE *argv) +{ + volatile VALUE optargsv; unsigned flags = 0; volatile VALUE v; + + optargsv = argc == 1 ? argv[0] : rb_hash_new (); + Check_Type (optargsv, T_HASH); + v = rb_hash_lookup (optargsv, ID2SYM (rb_intern (\"environment\"))); if (v != Qnil && !RTEST (v)) flags |= GUESTFS_CREATE_NO_ENVIRONMENT; @@ -164,6 +170,56 @@ ruby_guestfs_create (int argc, VALUE *argv, VALUE m) if (v != Qnil && !RTEST (v)) flags |= GUESTFS_CREATE_NO_CLOSE_ON...
2012 Jan 09
1
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally useful to any binding which uses camel case by requirement or convention. --- generator/generator_haskell.ml | 4 ++-- generator/generator_java.ml | 10 +++++----- generator/generator_main.ml | 2 +- generator/generator_structs.ml | 12 +++++------- generator/generator_structs.mli | 8 ++++---- 5
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...args...}"] else args in @@ -295,7 +296,7 @@ and generate_ruby_c actions () = List.iter ( fun argt -> let n = name_of_optargt argt in - let uc_n = String.uppercase n in + let uc_n = String.uppercase_ascii n in pr " v = rb_hash_lookup (optargsv, ID2SYM (rb_intern (\"%s\")));\n" n; pr " if (v != Qnil) {\n"; (match argt with @@ -483,7 +484,7 @@ Init__guestfs (void) List.iter ( fun (name, bitmask) -> pr " rb_define_const (m_guestfs, \"EVENT_%s\",\...