+static int get_intv(ti_index_t *idx, kstring_t *str, ti_intv_t *intv)
+{
+ ti_interval_t x;
+ intv->tid = intv->beg = intv->end = intv->bin = -1;
+ if (ti_get_intv(&idx->conf, str->l, str->s, &x) == 0) {
+ int c = *x.se;
+ *x.se = '\0'; intv->tid = get_tid(idx, x.ss); *x.se = c;
+ intv->beg = x.beg; intv->end = x.end;
+ intv->bin = ti_reg2bin(intv->beg, intv->end);
+ return (intv->tid >= 0 && intv->beg >= 0 && intv->end >= 0)? 0 : -1;
+ } else {
+ fprintf(stderr, "[%s] the following line cannot be parsed and skipped: %s\n", __func__, str->s);
+ return -1;
+ }
+}
+