added lock item
emit_item consistent with scan_item
emit the value,number,double var.ids for tfun
emit tfun.descr with tfun_valids,tfun_numids,tfun_dblids...
better tfun descr
missing scan_node for primitive