Add some API to handle scan_info from outside expr.c (substitute of #106)

I rewrote patch because #106 is too changed to merge.a