comparison libinterp/parse-tree/oct-parse.in.yy @ 16198:2c5c538be353

clean up input.cc and eliminate ff_instream global variable * input.h, input.cc (gnu_readline): Now static. Handle only interactive input. Delete optional force_readline argument. Delete single argument version. Change all callers. (interactive_input): Delete force_readline argument. Delete single argument version. Change all callers. (octave_base_reader::octave_gets): Handle only interactive input. (get_input_from_file): Delete. (ff_instream): Delete global variable. * oct-parse.in.yy (parse_fcn_file): Open file directly here without using get_input_from_file. Don't protect ff_instream.
author John W. Eaton <jwe@octave.org>
date Tue, 05 Mar 2013 17:43:00 -0500
parents b52d2f9294b6
children 810a71122c25
comparison
equal deleted inserted replaced
16197:576daea679fe 16198:2c5c538be353
3373 3373
3374 FILE *in_stream = command_editor::get_input_stream (); 3374 FILE *in_stream = command_editor::get_input_stream ();
3375 3375
3376 frame.add_fcn (command_editor::set_input_stream, in_stream); 3376 frame.add_fcn (command_editor::set_input_stream, in_stream);
3377 3377
3378 frame.protect_var (ff_instream);
3379
3380 frame.protect_var (reading_fcn_file); 3378 frame.protect_var (reading_fcn_file);
3381 frame.protect_var (line_editing); 3379 frame.protect_var (line_editing);
3382 3380
3383 reading_fcn_file = true; 3381 reading_fcn_file = true;
3384 line_editing = false; 3382 line_editing = false;
3386 frame.add_fcn (command_history::ignore_entries, 3384 frame.add_fcn (command_history::ignore_entries,
3387 command_history::ignoring_entries ()); 3385 command_history::ignoring_entries ());
3388 3386
3389 command_history::ignore_entries (); 3387 command_history::ignore_entries ();
3390 3388
3391 FILE *ffile = get_input_from_file (ff, 0); 3389 FILE *ffile = 0;
3390
3391 if (! ff.empty ())
3392 ffile = gnulib::fopen (ff.c_str (), "rb");
3392 3393
3393 frame.add_fcn (safe_fclose, ffile); 3394 frame.add_fcn (safe_fclose, ffile);
3394 3395
3395 if (ffile) 3396 if (ffile)
3396 { 3397 {