readline: add a free function