>>>>> "A" == Amos  <amos+lists.ruby-talk / utdallas.edu> writes:

A> I was wondering if someone has examples of defining and then
A> instantiating class objects in the C API.  While I see stuff like
A> NEWOBJ and rb_class_new in the Ruby source code, it's not mentioned
A> specifically in the README.EXT nor in the "pickaxe" book, so I was
A> hoping to find more examples of how this should be done.

 Well, it's mentioned in README.EXT

   ------------------------------------------------------------
2.1.1 Class/module definition
 
To define class or module, use functions below:
 
  VALUE rb_define_class(const char *name, VALUE super)
  VALUE rb_define_module(const char *name)
 
These functions return the newly created class or module.  You may
want to save this reference into the variable to use later.
 
To define nested class or module, use functions below:
 
  VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
  VALUE rb_define_module_under(VALUE outer, const char *name)
   ------------------------------------------------------------

 use these methods

 You have an example given in README.EXT for a dbm file.

 You have also all the examples in the directory ext of ruby



Guy Decoux