title: how to rb_protect everything in ruby
body: <p>I want to call ruby code from my own C code. In case an exception gets raised, I have to rb_protect the ruby code I call. rb_protect looks like this:</p>
  
  <pre><code>VALUE rb_protect(VALUE (* proc) (VALUE), VALUE data, int * state)
  </code></pre>
  
  <p>So <code>proc</code> has to be a function which takes <code>VALUE</code> arguments and returns <code>VALUE</code>. I have to call a lot of functions which do not work that way. How can I <code>rb_protect</code> them from raising exceptions?</p>
  
  <p>I have thought of using <code>Data_Make_Struct</code> to wrap everything into one ruby object and call methods on it. <code>Data_Make_Struct</code> could itself raise an exception. How do I <code>rb_protect</code> <code>Data_Make_Struct</code>?</p>