23 #if defined (HAVE_CONFIG_H)
67 #if defined (OCTAVE_DEFAULT_PAGER)
68 if (pager_binary.empty ())
118 std::cerr <<
"warning: connection to external pager lost (pid = "
119 << pid <<
")" << std::endl;
120 std::cerr <<
"warning: flushing pending output (please wait)"
145 do_sync (
const char *msg,
int len,
bool bypass_pager)
151 std::cout.write (msg, len);
156 if (! external_pager)
172 if (external_pager->good ())
174 external_pager->write (msg, len);
176 external_pager->flush ();
180 external_pager->setstate (std::ios::failbit);
193 std::cout.write (msg, len);
213 int chars_this_line = 0;
215 for (
int i = 0;
i < len;
i++)
219 count += chars_this_line / cols + 1;
226 if (count > available_rows)
236 if (! octave::application::interactive ()
237 || octave::application::forced_interactive ()
238 || really_flush_to_pager
239 || (Vpage_screen_output && Vpage_output_immediately)
240 || ! Vpage_screen_output)
242 char *buf = eback ();
244 int len = pptr () - buf;
246 bool bypass_pager = (! octave::application::interactive ()
247 || octave::application::forced_interactive ()
248 || ! Vpage_screen_output
249 || (really_flush_to_pager
250 && Vpage_screen_output
251 && ! Vpage_output_immediately
256 do_sync (buf, len, bypass_pager);
260 seekoff (0, std::ios::beg);
272 size_t len = pptr () - buf;
290 char *buf = eback ();
292 int len = pptr () - buf;
298 seekoff (0, std::ios::beg);
387 error (
"unable to create pager_stream object!");
448 error (
"unable to create diary_stream object!");
456 if (! flushing_output_to_pager)
463 really_flush_to_pager =
true;
464 flushing_output_to_pager =
true;
557 write_to_diary_file =
true;
560 else if (arg ==
"off")
563 write_to_diary_file =
false;
568 write_to_diary_file =
true;
576 DEFUN (__diaryfile__, , ,
585 DEFUN (__diarystate__, , ,
591 return ovl (write_to_diary_file);
614 std::string arg =
args(0).xstring_value (
"more: argument must be string \"on\" or \"off\"");
617 Vpage_screen_output =
true;
618 else if (arg ==
"off")
619 Vpage_screen_output =
false;
621 error (
"more: argument must be \"on\" or \"off\"");
629 DEFUN (terminal_size, , ,
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
OCTINTERP_API void print_usage(void)
static bool instance_ok(void)
static void remove(pid_t pid)
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
#define SET_INTERNAL_VARIABLE(NM)
static void cleanup_instance(void)
static std::string getenv(const std::string &name)
static octave_diary_stream * instance
bool wifsignaled(int status)
static int terminal_rows(void)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
#define OCTAVE_DEFAULT_PAGER
~octave_diary_stream(void)
#define SET_NONEMPTY_INTERNAL_STRING_VARIABLE(NM)
bool wifexited(int status)
static void insert(pid_t pid, child::child_event_handler f)
octave::unwind_protect frame
=val(i)}if ode{val(i)}occurs in table i
static int terminal_cols(void)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
static std::ostream & stream(void)
octave_diary_stream(void)