ext/ruby_grokdiscover.c in jls-grok-0.2.3092 vs ext/ruby_grokdiscover.c in jls-grok-0.2.3102

- old
+ new

@@ -44,11 +44,26 @@ cstr_input = rb_str2cstr(input, &unused_input_len); grok_discover(gdt, cstr_input, &cstr_discovery, &discovery_len); return rb_str_new(cstr_discovery, discovery_len); } +VALUE rGrokDiscover_get_logmask(VALUE self) { + grok_discover_t *gdt; + Data_Get_Struct(self, grok_discover_t, gdt); + return INT2FIX(gdt->logmask); +} + +VALUE rGrokDiscover_set_logmask(VALUE self, VALUE mask) { + grok_discover_t *gdt; + Data_Get_Struct(self, grok_discover_t, gdt); + gdt->logmask = FIX2INT(mask); + return Qnil; +} + void Init_GrokDiscover() { cGrokDiscover = rb_define_class("GrokDiscover", rb_cObject); rb_define_singleton_method(cGrokDiscover, "new", rGrokDiscover_new, 1); rb_define_method(cGrokDiscover, "initialize", rGrokDiscover_initialize, 1); rb_define_method(cGrokDiscover, "discover", rGrokDiscover_discover, 1); + rb_define_method(cGrokDiscover, "logmask=", rGrokDiscover_set_logmask, 1); + rb_define_method(cGrokDiscover, "logmask", rGrokDiscover_get_logmask, 0); }