On 06/03/2017 22:27, Bruno Albuquerque wrote:

In 0.4, Class_bootstrap is declared as

    Class_bootstrap(const cfish_ClassSpec *specs, size_t num_specs);

and cfish_ClassSpec is

     typedef struct cfish_ClassSpec {
         cfish_Class **klass;
         cfish_Class **parent;
         const char   *name;
         size_t        ivars_size;
         size_t       *ivars_offset_ptr;
         uint32_t      num_novel_meths;
         uint32_t      num_overridden_meths;
         uint32_t      num_inherited_meths;
         const cfish_NovelMethSpec      *novel_meth_specs;
         const cfish_OverriddenMethSpec *overridden_meth_specs;
         const cfish_InheritedMethSpec  *inherited_meth_specs;
     } cfish_ClassSpec;

So something like the following should work:

     size_t MyAnalyzer_IVARS_OFFSET;

     // Create a subclass with ivars at runtime.
     static Class*
     S_class_var(void) {
         StackString *class_name = SSTR_WRAP_UTF8("MyAnalyzer", 10);
         Class *klass = Class_fetch_class((String*)class_name);
         if (!klass) {
             cfish_ClassSpec class_spec = {
                 0, 0, 0,
                 NULL, NULL, NULL
             Class_bootstrap(&class_spec, 1);
         return klass;

NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB