Mercurial > octave
annotate libinterp/corefcn/pager.cc @ 30149:bba8b70c201f
maint: use "m_" prefix for member variables in class diary_stream.
* pager.cc, pager.h: Use "m_" prefix for member variables in class
diary_stream.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 09 Sep 2021 20:27:36 -0700 |
parents | 7d6709900da7 |
children | 037feca70912 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27926
diff
changeset
|
3 // Copyright (C) 1993-2021 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
1 | 25 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21200
diff
changeset
|
27 # include "config.h" |
1 | 28 #endif |
29 | |
3503 | 30 #include <fstream> |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
31 #include <iostream> |
1755 | 32 #include <string> |
1 | 33 |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
34 #include "child-list.h" |
2926 | 35 #include "cmd-edit.h" |
36 #include "oct-env.h" | |
21921
ecfcc8527661
hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
21748
diff
changeset
|
37 #include "oct-syscalls.h" |
2101 | 38 |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
39 #include "defaults.h" |
1352 | 40 #include "defun.h" |
41 #include "error.h" | |
21100
e39e05d90788
Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents:
21075
diff
changeset
|
42 #include "errwarn.h" |
2110 | 43 #include "input.h" |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
44 #include "interpreter.h" |
25440
893344cee100
rename defaults source files to installation-data
John W. Eaton <jwe@octave.org>
parents:
25439
diff
changeset
|
45 #include "interpreter-private.h" |
22089
c2c668b3051b
use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents:
22049
diff
changeset
|
46 #include "octave.h" |
20940
48b2ad5ee801
maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents:
20939
diff
changeset
|
47 #include "ovl.h" |
1352 | 48 #include "pager.h" |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13951
diff
changeset
|
49 #include "procstream.h" |
990 | 50 #include "sighandlers.h" |
2100 | 51 #include "unwind-prot.h" |
2201 | 52 #include "utils.h" |
2368 | 53 #include "variables.h" |
2093 | 54 |
29960
939bef0b66e0
merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
55 OCTAVE_NAMESPACE_BEGIN |
939bef0b66e0
merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
56 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
57 static bool |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
58 pager_event_handler (pid_t pid, int status) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
59 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
60 bool retval = false; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
61 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
62 if (pid > 0) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
63 { |
27102
84ff9953faa1
where possible, eliminate octave:: namespace qualifier inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
64 if (sys::wifexited (status) || sys::wifsignaled (status)) |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
65 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
66 // Avoid warning() since that will put us back in the pager, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
67 // which would be bad news. |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
68 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
69 std::cerr << "warning: connection to external pager lost (pid = " |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
70 << pid << ')' << std::endl; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
71 std::cerr << "warning: flushing pending output (please wait)" |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
72 << std::endl; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
73 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
74 // Request removal of this PID from the list of child |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
75 // processes. |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
76 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
77 retval = true; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
78 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
79 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
80 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
81 return retval; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
82 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
83 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
84 // Assume our terminal wraps long lines. |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
85 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
86 static bool |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
87 more_than_a_screenful (const char *s, int len) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
88 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
89 if (s) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
90 { |
27102
84ff9953faa1
where possible, eliminate octave:: namespace qualifier inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
91 int available_rows = command_editor::terminal_rows () - 2; |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
92 |
27102
84ff9953faa1
where possible, eliminate octave:: namespace qualifier inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
93 int cols = command_editor::terminal_cols (); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
94 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
95 int count = 0; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
96 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
97 int chars_this_line = 0; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
98 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
99 for (int i = 0; i < len; i++) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
100 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
101 if (*s++ == '\n') |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
102 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
103 count += chars_this_line / cols + 1; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
104 chars_this_line = 0; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
105 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
106 else |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
107 chars_this_line++; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
108 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
109 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
110 if (count > available_rows) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
111 return true; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
112 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
113 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
114 return false; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
115 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
116 |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
117 static std::string default_pager (void) |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
118 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
119 std::string pager_binary = sys::env::getenv ("PAGER"); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
120 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
121 if (pager_binary.empty ()) |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
122 pager_binary = config::default_pager (); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
123 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
124 return pager_binary; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
125 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
126 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
127 int |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
128 pager_buf::sync (void) |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
129 { |
27102
84ff9953faa1
where possible, eliminate octave:: namespace qualifier inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
130 output_system& output_sys = __get_output_system__ ("pager_buf::sync"); |
2093 | 131 |
27926
3b4526d90476
use pbase to access start of put buffer in classes derived from stingbuf
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
132 char *buf = pbase (); |
2093 | 133 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
134 int len = pptr () - buf; |
2093 | 135 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
136 if (output_sys.sync (buf, len)) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
137 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
138 flush_current_contents_to_diary (); |
2093 | 139 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
140 seekoff (0, std::ios::beg); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
141 } |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
142 |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
143 return 0; |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
144 } |
2093 | 145 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
146 void |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
147 pager_buf::flush_current_contents_to_diary (void) |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
148 { |
27926
3b4526d90476
use pbase to access start of put buffer in classes derived from stingbuf
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
149 char *buf = pbase () + diary_skip; |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
150 |
29654
d13d090cb03a
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
151 std::size_t len = pptr () - buf; |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
152 |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
153 octave_diary.write (buf, len); |
2093 | 154 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
155 diary_skip = 0; |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
156 } |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
157 |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
158 void |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
159 pager_buf::set_diary_skip (void) |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
160 { |
27926
3b4526d90476
use pbase to access start of put buffer in classes derived from stingbuf
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
161 diary_skip = pptr () - pbase (); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
162 } |
2093 | 163 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
164 int |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
165 diary_buf::sync (void) |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
166 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
167 output_system& output_sys = __get_output_system__ ("__stdout__"); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
168 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
169 std::ofstream& external_diary_file = output_sys.external_diary_file (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
170 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
171 if (output_sys.write_to_diary_file () && external_diary_file) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
172 { |
27926
3b4526d90476
use pbase to access start of put buffer in classes derived from stingbuf
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
173 char *buf = pbase (); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
174 |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
175 int len = pptr () - buf; |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
176 |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
177 if (len > 0) |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
178 external_diary_file.write (buf, len); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
179 } |
2093 | 180 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
181 seekoff (0, std::ios::beg); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
182 |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
183 return 0; |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
184 } |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
185 |
23795
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23457
diff
changeset
|
186 pager_stream::pager_stream (void) : std::ostream (nullptr), pb (nullptr) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
187 { |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
188 pb = new pager_buf (); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
189 rdbuf (pb); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
190 setf (unitbuf); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
191 } |
3477 | 192 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
193 pager_stream::~pager_stream (void) |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
194 { |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
195 flush (); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
196 delete pb; |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
197 } |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
198 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
199 std::ostream& pager_stream::stream (void) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
200 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
201 return *this; |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
202 } |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
203 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
204 void pager_stream::flush_current_contents_to_diary (void) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
205 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
206 if (pb) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
207 pb->flush_current_contents_to_diary (); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
208 } |
3756 | 209 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
210 void pager_stream::set_diary_skip (void) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
211 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
212 if (pb) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
213 pb->set_diary_skip (); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
214 } |
13266
c053740eb2aa
improve memory use for the pager and diary streams (bug #34431)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
215 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
216 // Reinitialize the pager buffer to avoid hanging on to large internal |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
217 // buffers when they might not be needed. This function should only be |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
218 // called when the pager is not in use. For example, just before |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
219 // getting command-line input. |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
220 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
221 void pager_stream::reset (void) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
222 { |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
223 delete pb; |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
224 pb = new pager_buf (); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
225 rdbuf (pb); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
226 setf (unitbuf); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
227 } |
13266
c053740eb2aa
improve memory use for the pager and diary streams (bug #34431)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
228 |
30149
bba8b70c201f
maint: use "m_" prefix for member variables in class diary_stream.
Rik <rik@octave.org>
parents:
29961
diff
changeset
|
229 diary_stream::diary_stream (void) : std::ostream (nullptr), m_db (nullptr) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
230 { |
30149
bba8b70c201f
maint: use "m_" prefix for member variables in class diary_stream.
Rik <rik@octave.org>
parents:
29961
diff
changeset
|
231 m_db = new diary_buf (); |
bba8b70c201f
maint: use "m_" prefix for member variables in class diary_stream.
Rik <rik@octave.org>
parents:
29961
diff
changeset
|
232 rdbuf (m_db); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
233 setf (unitbuf); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
234 } |
2093 | 235 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
236 diary_stream::~diary_stream (void) |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
237 { |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
238 flush (); |
30149
bba8b70c201f
maint: use "m_" prefix for member variables in class diary_stream.
Rik <rik@octave.org>
parents:
29961
diff
changeset
|
239 delete m_db; |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
240 } |
2093 | 241 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
242 std::ostream& diary_stream::stream (void) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
243 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
244 return *this; |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
245 } |
1 | 246 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
247 // Reinitialize the diary buffer to avoid hanging on to large internal |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
248 // buffers when they might not be needed. This function should only be |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
249 // called when the pager is not in use. For example, just before |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
250 // getting command-line input. |
13266
c053740eb2aa
improve memory use for the pager and diary streams (bug #34431)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
251 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
252 void diary_stream::reset (void) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
253 { |
30149
bba8b70c201f
maint: use "m_" prefix for member variables in class diary_stream.
Rik <rik@octave.org>
parents:
29961
diff
changeset
|
254 delete m_db; |
bba8b70c201f
maint: use "m_" prefix for member variables in class diary_stream.
Rik <rik@octave.org>
parents:
29961
diff
changeset
|
255 m_db = new diary_buf (); |
bba8b70c201f
maint: use "m_" prefix for member variables in class diary_stream.
Rik <rik@octave.org>
parents:
29961
diff
changeset
|
256 rdbuf (m_db); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
257 setf (unitbuf); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
258 } |
13266
c053740eb2aa
improve memory use for the pager and diary streams (bug #34431)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
259 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
260 void flush_stdout (void) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
261 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
262 output_system& output_sys = __get_output_system__ ("flush_stdout"); |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13951
diff
changeset
|
263 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
264 output_sys.flush_stdout (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
265 } |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13951
diff
changeset
|
266 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
267 output_system::output_system (interpreter& interp) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
268 : m_interpreter (interp), m_pager_stream (), m_diary_stream (), |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
269 m_external_pager (nullptr), m_external_diary_file (), |
25460
627d6bde9b8d
solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
270 m_diary_file_name ("diary"), m_PAGER (default_pager ()), |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
271 m_PAGER_FLAGS (), m_page_output_immediately (false), |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
272 m_page_screen_output (false), m_write_to_diary_file (false), |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
273 m_really_flush_to_pager (false), m_flushing_output_to_pager (false) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
274 { } |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13951
diff
changeset
|
275 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
276 octave_value output_system::PAGER (const octave_value_list& args, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
277 int nargout) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
278 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
279 return set_internal_variable (m_PAGER, args, nargout, "PAGER", false); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
280 } |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13951
diff
changeset
|
281 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
282 octave_value output_system::PAGER_FLAGS (const octave_value_list& args, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
283 int nargout) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
284 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
285 return set_internal_variable (m_PAGER_FLAGS, args, nargout, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
286 "PAGER_FLAGS", false); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
287 } |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13951
diff
changeset
|
288 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
289 octave_value |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
290 output_system::page_output_immediately (const octave_value_list& args, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
291 int nargout) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
292 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
293 return set_internal_variable (m_page_output_immediately, args, nargout, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
294 "page_output_immediately"); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
295 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
296 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
297 octave_value |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
298 output_system::page_screen_output (const octave_value_list& args, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
299 int nargout) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
300 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
301 return set_internal_variable (m_page_screen_output, args, nargout, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
302 "page_screen_output"); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
303 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
304 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
305 std::string output_system::pager_command (void) const |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
306 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
307 std::string cmd = m_PAGER; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
308 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
309 if (! (cmd.empty () || m_PAGER_FLAGS.empty ())) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
310 cmd += ' ' + m_PAGER_FLAGS; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
311 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
312 return cmd; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
313 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
314 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
315 void output_system::reset (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
316 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
317 flush_stdout (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
318 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
319 m_pager_stream.reset (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
320 m_diary_stream.reset (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
321 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
322 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
323 void output_system::flush_stdout (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
324 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
325 if (! m_flushing_output_to_pager) |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
326 { |
28857
43ad651cf5a0
eliminate unnecessary uses of octave:: namespace qualifier
John W. Eaton <jwe@octave.org>
parents:
28823
diff
changeset
|
327 unwind_protect_var<bool> restore_var1 (m_really_flush_to_pager); |
43ad651cf5a0
eliminate unnecessary uses of octave:: namespace qualifier
John W. Eaton <jwe@octave.org>
parents:
28823
diff
changeset
|
328 unwind_protect_var<bool> restore_var2 (m_flushing_output_to_pager); |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
329 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
330 m_really_flush_to_pager = true; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
331 m_flushing_output_to_pager = true; |
2100 | 332 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
333 std::ostream& pager_ostream = m_pager_stream.stream (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
334 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
335 pager_ostream.flush (); |
2206 | 336 |
23060
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
337 clear_external_pager (); |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
338 } |
baf03cdb28b5
move pager and diary classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22910
diff
changeset
|
339 } |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
340 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
341 void output_system::close_diary (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
342 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
343 // Try to flush the current buffer to the diary now, so that things |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
344 // like |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
345 // |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
346 // function foo () |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
347 // diary on; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
348 // ... |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
349 // diary off; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
350 // endfunction |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
351 // |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
352 // will do the right thing. |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
353 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
354 m_pager_stream.flush_current_contents_to_diary (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
355 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
356 if (m_external_diary_file.is_open ()) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
357 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
358 octave_diary.flush (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
359 m_external_diary_file.close (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
360 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
361 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
362 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
363 void output_system::open_diary (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
364 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
365 close_diary (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
366 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
367 // If there is pending output in the pager buf, it should not go |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
368 // into the diary file. |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
369 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
370 m_pager_stream.set_diary_skip (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
371 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
372 m_external_diary_file.open (m_diary_file_name.c_str (), std::ios::app); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
373 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
374 if (! m_external_diary_file) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
375 error ("diary: can't open diary file '%s'", m_diary_file_name.c_str ()); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
376 } |
1 | 377 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
378 bool output_system::sync (const char *buf, int len) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
379 { |
29254
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
380 // FIXME: The following seems to be a bit of a mess. |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
381 |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
382 if (m_interpreter.server_mode () |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
383 || ! m_interpreter.interactive () |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
384 || application::forced_interactive () |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
385 || m_really_flush_to_pager |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
386 || (m_page_screen_output && m_page_output_immediately) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
387 || ! m_page_screen_output) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
388 { |
29254
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
389 bool bypass_pager = (m_interpreter.server_mode () |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
390 || ! m_interpreter.interactive () |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
391 || application::forced_interactive () |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
392 || ! m_page_screen_output |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
393 || (m_really_flush_to_pager |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
394 && m_page_screen_output |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
395 && ! m_page_output_immediately |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
396 && ! more_than_a_screenful (buf, len))); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
397 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
398 if (len > 0) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
399 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
400 do_sync (buf, len, bypass_pager); |
3477 | 401 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
402 return true; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
403 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
404 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
405 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
406 return false; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
407 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
408 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
409 void output_system::clear_external_pager (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
410 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
411 if (m_external_pager) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
412 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
413 child_list& kids = m_interpreter.get_child_list (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
414 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
415 kids.remove (m_external_pager->pid ()); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
416 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
417 delete m_external_pager; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
418 m_external_pager = nullptr; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
419 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
420 } |
3477 | 421 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
422 void output_system::start_external_pager (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
423 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
424 if (m_external_pager) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
425 return; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
426 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
427 std::string pgr = pager_command (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
428 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
429 if (! pgr.empty ()) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
430 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
431 m_external_pager = new oprocstream (pgr.c_str ()); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
432 |
27102
84ff9953faa1
where possible, eliminate octave:: namespace qualifier inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
433 child_list& kids = m_interpreter.get_child_list (); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
434 |
26369
0249ba4c9589
Fix static analyzer detected V668 issues (bug #55347).
Andreas Weber <octave@josoansi.de>
parents:
25460
diff
changeset
|
435 kids.insert (m_external_pager->pid (), |
0249ba4c9589
Fix static analyzer detected V668 issues (bug #55347).
Andreas Weber <octave@josoansi.de>
parents:
25460
diff
changeset
|
436 pager_event_handler); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
437 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
438 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
439 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
440 void output_system::do_sync (const char *msg, int len, bool bypass_pager) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
441 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
442 if (msg && len > 0) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
443 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
444 if (bypass_pager) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
445 { |
29254
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
446 if (m_interpreter.server_mode ()) |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
447 { |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
448 event_manager& evmgr = m_interpreter.get_event_manager (); |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
449 |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
450 evmgr.interpreter_output (std::string (msg, len)); |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
451 } |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
452 else |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
453 { |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
454 std::cout.write (msg, len); |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
455 std::cout.flush (); |
11343ca3c125
allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents:
28857
diff
changeset
|
456 } |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
457 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
458 else |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
459 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
460 start_external_pager (); |
1 | 461 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
462 if (m_external_pager) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
463 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
464 if (m_external_pager->good ()) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
465 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
466 m_external_pager->write (msg, len); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
467 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
468 m_external_pager->flush (); |
581 | 469 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
470 #if defined (EPIPE) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
471 if (errno == EPIPE) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
472 m_external_pager->setstate (std::ios::failbit); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
473 #endif |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
474 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
475 else |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
476 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
477 // FIXME: something is not right with the |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
478 // pager. If it died then we should receive a |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
479 // signal for that. If there is some other problem, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
480 // then what? |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
481 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
482 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
483 else |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
484 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
485 std::cout.write (msg, len); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
486 std::cout.flush (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
487 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
488 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
489 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
490 } |
3756 | 491 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
492 std::ostream& __stdout__ (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
493 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
494 output_system& output_sys = __get_output_system__ ("__stdout__"); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
495 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
496 return output_sys.__stdout__ (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
497 } |
581 | 498 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
499 std::ostream& __diary__ (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
500 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
501 output_system& output_sys = __get_output_system__ ("__diary__"); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
502 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
503 return output_sys.__diary__ (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
504 } |
29958
32c3a5805893
move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
505 |
27444
160930a3e5ee
eliminate some calls to global __get_SUBSYSTEM__ functions
John W. Eaton <jwe@octave.org>
parents:
27301
diff
changeset
|
506 DEFMETHOD (diary, interp, args, nargout, |
160930a3e5ee
eliminate some calls to global __get_SUBSYSTEM__ functions
John W. Eaton <jwe@octave.org>
parents:
27301
diff
changeset
|
507 doc: /* -*- texinfo -*- |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
508 @deftypefn {} {} diary |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
509 @deftypefnx {} {} diary on |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
510 @deftypefnx {} {} diary off |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
511 @deftypefnx {} {} diary @var{filename} |
22820
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
512 @deftypefnx {} {[@var{status}, @var{diaryfile}] =} diary |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
513 Record a list of all commands @emph{and} the output they produce, mixed |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
514 together just as they appear on the terminal. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
515 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
516 Valid options are: |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
517 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
518 @table @asis |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
519 @item on |
22820
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
520 Start recording a session in a file called @file{diary} in the current working |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
521 directory. |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
522 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
523 @item off |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
524 Stop recording the session in the diary file. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
525 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
526 @item @var{filename} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
527 Record the session in the file named @var{filename}. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
528 @end table |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
529 |
22820
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
530 With no input or output arguments, @code{diary} toggles the current diary |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
531 state. |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
532 |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
533 If output arguments are requested, @code{diary} ignores inputs and returns |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
534 the current status. The boolean @var{status} indicates whether recording is on |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
535 or off, and @var{diaryfile} is the name of the file where the session is |
22910
23847979b91e
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
22820
diff
changeset
|
536 stored. |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
537 @seealso{history, evalc} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
538 @end deftypefn */) |
581 | 539 { |
20817
3d551b2ae928
Use variable name nargin consistently in C++ code.
Rik <rik@octave.org>
parents:
20801
diff
changeset
|
540 int nargin = args.length (); |
1755 | 541 |
20817
3d551b2ae928
Use variable name nargin consistently in C++ code.
Rik <rik@octave.org>
parents:
20801
diff
changeset
|
542 if (nargin > 1) |
20801
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
543 print_usage (); |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
544 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
545 output_system& output_sys = interp.get_output_system (); |
1306 | 546 |
22820
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
547 if (nargout > 0) |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
548 { |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
549 // Querying diary variables |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
550 if (nargout == 1) |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
551 return ovl (output_sys.write_to_diary_file ()); |
22820
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
552 else |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
553 return ovl (output_sys.write_to_diary_file (), |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
554 output_sys.diary_file_name ()); |
22820
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
555 } |
c97b26662858
Add Octave-only query mode for diary command to find status.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
556 |
20817
3d551b2ae928
Use variable name nargin consistently in C++ code.
Rik <rik@octave.org>
parents:
20801
diff
changeset
|
557 if (nargin == 0) |
581 | 558 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
559 output_sys.write_to_diary_file (! output_sys.write_to_diary_file ()); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
560 output_sys.open_diary (); |
20801
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
561 } |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
562 else |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
563 { |
20817
3d551b2ae928
Use variable name nargin consistently in C++ code.
Rik <rik@octave.org>
parents:
20801
diff
changeset
|
564 std::string arg = args(0).xstring_value ("diary: argument must be a string"); |
1755 | 565 |
20801
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
566 if (arg == "on") |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
567 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
568 output_sys.write_to_diary_file (true); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
569 output_sys.open_diary (); |
20801
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
570 } |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
571 else if (arg == "off") |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
572 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
573 output_sys.close_diary (); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
574 output_sys.write_to_diary_file (false); |
20801
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
575 } |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
576 else |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
577 { |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
578 output_sys.diary_file_name (arg); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
579 output_sys.write_to_diary_file (true); |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
580 output_sys.open_diary (); |
20801
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
581 } |
581 | 582 } |
20820
eed8ec05f1c8
always return value from DEFUN functions
John W. Eaton <jwe@octave.org>
parents:
20817
diff
changeset
|
583 |
20941
a4f5da7c5463
maint: Replace "octave_value_list ()" with "ovl ()".
Rik <rik@octave.org>
parents:
20940
diff
changeset
|
584 return ovl (); |
581 | 585 } |
586 | |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
587 DEFMETHOD (more, interp, args, , |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
588 doc: /* -*- texinfo -*- |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
589 @deftypefn {} {} more |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
590 @deftypefnx {} {} more on |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
591 @deftypefnx {} {} more off |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
592 Turn output pagination on or off. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
593 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
594 Without an argument, @code{more} toggles the current state. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
595 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
596 The current state can be determined via @code{page_screen_output}. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
597 @seealso{page_screen_output, page_output_immediately, PAGER, PAGER_FLAGS} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
598 @end deftypefn */) |
1409 | 599 { |
20897
9aad16a799c9
maint: Replace argc variable name with nargin in C++ code.
Rik <rik@octave.org>
parents:
20853
diff
changeset
|
600 int nargin = args.length (); |
1409 | 601 |
20897
9aad16a799c9
maint: Replace argc variable name with nargin in C++ code.
Rik <rik@octave.org>
parents:
20853
diff
changeset
|
602 if (nargin > 1) |
20801
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
603 print_usage (); |
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
604 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
605 output_system& output_sys = interp.get_output_system (); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
606 |
20897
9aad16a799c9
maint: Replace argc variable name with nargin in C++ code.
Rik <rik@octave.org>
parents:
20853
diff
changeset
|
607 if (nargin > 0) |
1409 | 608 { |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
609 std::string arg = args(0).xstring_value (R"(more: argument must be string "on" or "off")"); |
1409 | 610 |
1755 | 611 if (arg == "on") |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
612 output_sys.page_screen_output (true); |
1755 | 613 else if (arg == "off") |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
614 output_sys.page_screen_output (false); |
1409 | 615 else |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
616 error (R"(more: argument must be "on" or "off")"); |
1409 | 617 } |
20801
a542a9bf177e
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
618 else |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
619 output_sys.page_screen_output (! output_sys.page_screen_output ()); |
1409 | 620 |
20941
a4f5da7c5463
maint: Replace "octave_value_list ()" with "ovl ()".
Rik <rik@octave.org>
parents:
20940
diff
changeset
|
621 return ovl (); |
1409 | 622 } |
623 | |
27159
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
624 DEFUN (terminal_size, args, , |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
625 doc: /* -*- texinfo -*- |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
626 @deftypefn {} {} terminal_size () |
27159
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
627 Query or set the size of the terminal window. If called with no |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
628 arguments, return a two-element row vector containing the current size |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
629 of the terminal window in characters (rows and columns). If called with |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
630 a two-element vector of integer values, set the terminal size and return |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
631 the previous setting. Setting the size manually should not be needed |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
632 when using readline for command-line editing. |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
633 @seealso{list_in_columns} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
634 @end deftypefn */) |
5673 | 635 { |
27159
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
636 int nargin = args.length (); |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
637 |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
638 if (nargin > 1) |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
639 print_usage (); |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
640 |
5673 | 641 RowVector size (2, 0.0); |
642 | |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
643 size(0) = command_editor::terminal_rows (); |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
644 size(1) = command_editor::terminal_cols (); |
5673 | 645 |
27159
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
646 if (nargin == 1) |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
647 { |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
648 Matrix m = args(0).xmatrix_value ("argument must be a 2-element array"); |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
649 |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
650 if (m.numel () != 2) |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
651 error ("terminal_size: argument must be a 2-element array"); |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
652 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
653 int rows = math::x_nint (m(0)); |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
654 int cols = math::x_nint (m(1)); |
27159
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
655 |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
656 if (rows <= 0 || cols <= 0) |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
657 error ("terminal_size: rows and columns must be positive integers"); |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
658 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
659 command_editor::set_screen_size (rows, cols); |
27159
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
660 } |
25d0c4b5a3aa
allow terminal_size function to set screen size
John W. Eaton <jwe@octave.org>
parents:
27102
diff
changeset
|
661 |
21127
df7891224709
maint: Use "return ovl (...)" in DEFUN macros.
Rik <rik@octave.org>
parents:
21100
diff
changeset
|
662 return ovl (size); |
5673 | 663 } |
664 | |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
665 DEFMETHOD (page_output_immediately, interp, args, nargout, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
666 doc: /* -*- texinfo -*- |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
667 @deftypefn {} {@var{val} =} page_output_immediately () |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
668 @deftypefnx {} {@var{old_val} =} page_output_immediately (@var{new_val}) |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
669 @deftypefnx {} {} page_output_immediately (@var{new_val}, "local") |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
670 Query or set the internal variable that controls whether Octave sends |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
671 output to the pager as soon as it is available. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
672 |
27579
f6417502613a
doc: expand page_output_immediately doc string, mention page_screen_output
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
673 When the value is @code{false}, Octave buffers its output and waits until just |
f6417502613a
doc: expand page_output_immediately doc string, mention page_screen_output
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
674 before the prompt is printed to flush it to the pager. This is the default. |
f6417502613a
doc: expand page_output_immediately doc string, mention page_screen_output
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
675 |
f6417502613a
doc: expand page_output_immediately doc string, mention page_screen_output
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
676 When @code{page_screen_output} is @code{false}, this variable has no effect. |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
677 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
678 When called from inside a function with the @qcode{"local"} option, the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
679 variable is changed locally for the function and any subroutines it calls. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
680 The original variable value is restored when exiting the function. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
681 @seealso{page_screen_output, more, PAGER, PAGER_FLAGS} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
682 @end deftypefn */) |
2097 | 683 { |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
684 output_system& output_sys = interp.get_output_system (); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
685 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
686 return output_sys.page_output_immediately (args, nargout); |
2164 | 687 } |
688 | |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
689 DEFMETHOD (page_screen_output, interp, args, nargout, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
690 doc: /* -*- texinfo -*- |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
691 @deftypefn {} {@var{val} =} page_screen_output () |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
692 @deftypefnx {} {@var{old_val} =} page_screen_output (@var{new_val}) |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
693 @deftypefnx {} {} page_screen_output (@var{new_val}, "local") |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
694 Query or set the internal variable that controls whether output intended |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
695 for the terminal window that is longer than one page is sent through a |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
696 pager. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
697 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
698 This allows you to view one screenful at a time. Some pagers |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
699 (such as @code{less}---see @ref{Installation}) are also capable of moving |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
700 backward on the output. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
701 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
702 When called from inside a function with the @qcode{"local"} option, the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
703 variable is changed locally for the function and any subroutines it calls. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
704 The original variable value is restored when exiting the function. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
705 @seealso{more, page_output_immediately, PAGER, PAGER_FLAGS} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
706 @end deftypefn */) |
2164 | 707 { |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
708 output_system& output_sys = interp.get_output_system (); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
709 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
710 return output_sys.page_screen_output (args, nargout); |
2164 | 711 } |
712 | |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
713 DEFMETHOD (PAGER, interp, args, nargout, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
714 doc: /* -*- texinfo -*- |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
715 @deftypefn {} {@var{val} =} PAGER () |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
716 @deftypefnx {} {@var{old_val} =} PAGER (@var{new_val}) |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
717 @deftypefnx {} {} PAGER (@var{new_val}, "local") |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
718 Query or set the internal variable that specifies the program to use |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
719 to display terminal output on your system. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
720 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
721 The default value is normally @qcode{"less"}, @qcode{"more"}, or |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
722 @qcode{"pg"}, depending on what programs are installed on your system. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
723 @xref{Installation}. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
724 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
725 When called from inside a function with the @qcode{"local"} option, the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
726 variable is changed locally for the function and any subroutines it calls. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
727 The original variable value is restored when exiting the function. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
728 @seealso{PAGER_FLAGS, page_output_immediately, more, page_screen_output} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
729 @end deftypefn */) |
5794 | 730 { |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
731 output_system& output_sys = interp.get_output_system (); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
732 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
733 return output_sys.PAGER (args, nargout); |
2097 | 734 } |
735 | |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
736 DEFMETHOD (PAGER_FLAGS, interp, args, nargout, |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
737 doc: /* -*- texinfo -*- |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
738 @deftypefn {} {@var{val} =} PAGER_FLAGS () |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
739 @deftypefnx {} {@var{old_val} =} PAGER_FLAGS (@var{new_val}) |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
740 @deftypefnx {} {} PAGER_FLAGS (@var{new_val}, "local") |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
741 Query or set the internal variable that specifies the options to pass |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
742 to the pager. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
743 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
744 When called from inside a function with the @qcode{"local"} option, the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
745 variable is changed locally for the function and any subroutines it calls. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
746 The original variable value is restored when exiting the function. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
747 @seealso{PAGER, more, page_screen_output, page_output_immediately} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
748 @end deftypefn */) |
6144 | 749 { |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29960
diff
changeset
|
750 output_system& output_sys = interp.get_output_system (); |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
751 |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
752 return output_sys.PAGER_FLAGS (args, nargout); |
6144 | 753 } |
29958
32c3a5805893
move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
754 |
32c3a5805893
move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
755 OCTAVE_NAMESPACE_END |