tos->obs = obs;
if (rb_obj_is_kind_of(obs, cTreeObserver)) tos->obs = obs; else { tos->obs = Qnil; rb_raise(rb_eTypeError, "Error must have kind of TreeObserver in setTreeObserver"); }
static VALUE rbtm_settreeobserver(VALUE self, VALUE obs){  struct TreeObserver *to;  struct TreeObserverState *tos;  struct TreeMaster *tm;  Data_Get_Struct(self, struct TreeMaster, tm);  to = gcalloc(sizeof(*to), 1);  tos = gcalloc(sizeof(*tos), 1);  tos->obs = obs;  tos->th = Qnil;//  rb_gc_mark(tos->obs);  to->ptr = tos;  to->treesearchstarted = rbtmto_treesearchstarted;  to->treeimproved = rbtmto_treeimproved;  to->treedone = rbtmto_treedone;  to->treerejected = rbtmto_treerejected;  //rb_raise(rb_eTypeError, "Error setTreeObserver disabled.");  setTreeObserver(tm, to);}