Use scm_current_input_port instead of scm_cur_inp. Use scm_std_select