Mercurial > octave
comparison liboctave/util/cmd-hist.cc @ 31771:21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
* mk-opts.pl, external.txi, embedded.cc, make_int.cc, standalone.cc,
standalonebuiltin.cc, BaseControl.cc, BaseControl.h, ButtonControl.cc,
ButtonControl.h, ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h,
CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h,
ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h, Figure.cc,
Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc, GLCanvas.h,
GenericEventNotify.h, KeyMap.cc, ListBoxControl.cc, ListBoxControl.h,
Logger.cc, Logger.h, Menu.cc, Menu.h, MenuContainer.h, Object.cc, Object.h,
ObjectProxy.cc, ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc,
PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h, PushTool.cc,
PushTool.h, RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc,
SliderControl.h, Table.cc, Table.h, TextControl.cc, TextControl.h, TextEdit.h,
ToggleButtonControl.cc, ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h,
ToolBar.cc, ToolBar.h, ToolBarButton.cc, ToolBarButton.h, gl-select.cc,
gl-select.h, qopengl-functions.h, qt-graphics-toolkit.h, qdialog.cpp,
qfontdialog.cpp, qprintdialog_win.cpp, liboctgui-build-info.h,
liboctgui-build-info.in.cc, color-picker.cc, color-picker.h, command-widget.cc,
command-widget.h, community-news.cc, community-news.h, dialog.cc, dialog.h,
documentation-bookmarks.cc, documentation-bookmarks.h,
documentation-dock-widget.cc, documentation-dock-widget.h, documentation.cc,
documentation.h, dw-main-window.cc, dw-main-window.h,
external-editor-interface.cc, external-editor-interface.h,
files-dock-widget.cc, files-dock-widget.h, find-files-dialog.cc,
find-files-dialog.h, find-files-model.cc, find-files-model.h,
gui-preferences.cc, gui-preferences.h, gui-settings.cc, gui-settings.h,
history-dock-widget.cc, history-dock-widget.h, interpreter-qobject.cc,
interpreter-qobject.h, file-editor-interface.h, file-editor-tab.cc,
file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc,
find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc, octave-qscintilla.h,
octave-txt-lexer.cc, octave-txt-lexer.h, main-window.cc, main-window.h,
news-reader.cc, news-reader.h, octave-dock-widget.cc, octave-dock-widget.h,
octave-qobject.cc, octave-qobject.h, qt-application.cc, qt-application.h,
qt-interpreter-events.cc, qt-interpreter-events.h, release-notes.cc,
release-notes.h, set-path-dialog.cc, set-path-dialog.h, set-path-model.cc,
set-path-model.h, settings-dialog.cc, settings-dialog.h,
shortcuts-tree-widget.cc, shortcuts-tree-widget.h, tab-bar.cc, tab-bar.h,
terminal-dock-widget.cc, terminal-dock-widget.h, variable-editor-model.cc,
variable-editor-model.h, variable-editor.cc, variable-editor.h,
welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h,
workspace-view.cc, workspace-view.h, build-env.h, Cell.cc, Cell.h,
__contourc__.cc, __magick_read__.cc, auto-shlib.cc, auto-shlib.h,
base-text-renderer.h, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h,
call-stack.cc, call-stack.h, debug.cc, defaults.cc, defaults.h, defun.cc,
display.cc, display.h, dynamic-ld.cc, dynamic-ld.h, environment.cc,
environment.h, error.cc, error.h, errwarn.cc, errwarn.h, event-manager.cc,
event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h,
ft-text-renderer.cc, ft-text-renderer.h, genprops.awk, gh-manager.cc,
gh-manager.h, gl-render.cc, gl-render.h, gl2ps-print.cc, graphics-toolkit.h,
graphics.cc, graphics.in.h, gtk-manager.cc, gtk-manager.h, help.cc, help.h,
hook-fcn.h, input.cc, input.h, interpreter-private.cc, interpreter-private.h,
interpreter.cc, interpreter.h, jsondecode.cc, latex-text-renderer.cc,
latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h,
ls-hdf5.cc, ls-hdf5.h, mxarray.h, oct-errno.h, oct-errno.in.cc, oct-fstrm.cc,
oct-fstrm.h, oct-handle.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc,
oct-iostrm.h, oct-map.cc, oct-map.h, oct-opengl.h, oct-prcstrm.cc,
oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h, oct-process.h, oct-stdstrm.h,
oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h,
oct-tex-lexer.in.ll, pager.cc, pager.h, pr-flt-fmt.cc, pr-flt-fmt.h,
pr-output.cc, pr-output.h, procstream.cc, procstream.h, settings.cc,
settings.h, sighandlers.cc, sighandlers.h, stack-frame.cc, stack-frame.h,
svd.cc, syminfo.cc, syminfo.h, symrec.cc, symrec.h, symscope.cc, symscope.h,
symtab.cc, symtab.h, sysdep.cc, sysdep.h, text-engine.cc, text-engine.h,
text-renderer.cc, text-renderer.h, toplev.cc, url-handle-manager.cc,
url-handle-manager.h, variables.cc, xpow.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __ode15__.cc, audiodevinfo.cc, gzip.cc,
liboctinterp-build-info.h, liboctinterp-build-info.in.cc,
mk-build-env-features.sh, mk-builtins.pl, cdef-class.cc, cdef-class.h,
cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h,
cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h,
cdef-utils.cc, cdef-utils.h, ov-base-diag.cc, ov-base-diag.h, ov-base-int.cc,
ov-base-int.h, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc,
ov-base-scalar.h, ov-base-sparse.cc, ov-base-sparse.h, ov-base.cc, ov-base.h,
ov-bool-mat.cc, ov-bool-mat.h, ov-bool-sparse.cc, ov-bool-sparse.h, ov-bool.cc,
ov-bool.h, ov-builtin.cc, ov-builtin.h, ov-cell.cc, ov-cell.h, ov-ch-mat.cc,
ov-ch-mat.h, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h,
ov-colon.h, ov-complex.cc, ov-complex.h, ov-cs-list.h, ov-cx-diag.cc,
ov-cx-diag.h, ov-cx-mat.cc, ov-cx-mat.h, ov-cx-sparse.cc, ov-cx-sparse.h,
ov-dld-fcn.cc, ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.cc,
ov-fcn.h, ov-float.cc, ov-float.h, ov-flt-complex.cc, ov-flt-complex.h,
ov-flt-cx-diag.cc, ov-flt-cx-diag.h, ov-flt-cx-mat.cc, ov-flt-cx-mat.h,
ov-flt-re-diag.cc, ov-flt-re-diag.h, ov-flt-re-mat.cc, ov-flt-re-mat.h,
ov-intx.h, ov-java.cc, ov-java.h, ov-lazy-idx.cc, ov-lazy-idx.h,
ov-legacy-range.cc, ov-legacy-range.h, ov-magic-int.cc, ov-magic-int.h,
ov-mex-fcn.cc, ov-mex-fcn.h, ov-null-mat.cc, ov-null-mat.h, ov-oncleanup.cc,
ov-oncleanup.h, ov-perm.cc, ov-perm.h, ov-range.cc, ov-range.h, ov-re-diag.cc,
ov-re-diag.h, ov-re-mat.cc, ov-re-mat.h, ov-re-sparse.cc, ov-re-sparse.h,
ov-scalar.cc, ov-scalar.h, ov-str-mat.cc, ov-str-mat.h, ov-struct.cc,
ov-struct.h, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc,
ov.h, ovl.cc, ovl.h, octave.cc, octave.h, anon-fcn-validator.h, bp-table.cc,
bp-table.h, comment-list.cc, comment-list.h, filepos.h, lex.h, lex.ll,
oct-lvalue.cc, oct-lvalue.h, oct-parse.yy, parse.h, profiler.cc, profiler.h,
pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h, pt-args-block.cc,
pt-args-block.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h,
pt-binop.cc, pt-binop.h, pt-bp.h, pt-cbinop.h, pt-cell.h, pt-check.h,
pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.cc,
pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc,
pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc, pt-id.h, pt-idx.cc,
pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.h, pt-misc.cc, pt-misc.h,
pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-spmd.cc, pt-spmd.h,
pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h,
pt-walk.h, pt.cc, pt.h, token.cc, token.h, usage.h, Array-base.cc, Array.h,
CColVector.cc, CColVector.h, CDiagMatrix.cc, CDiagMatrix.h, CMatrix.cc,
CMatrix.h, CNDArray.cc, CNDArray.h, CRowVector.cc, CRowVector.h, CSparse.cc,
CSparse.h, DiagArray2.cc, DiagArray2.h, MArray.cc, MArray.h, MDiagArray2.h,
MSparse.h, MatrixType.cc, MatrixType.h, PermMatrix.cc, PermMatrix.h, Range.cc,
Range.h, Sparse-b.cc, Sparse.cc, Sparse.h, boolMatrix.cc, boolMatrix.h,
boolNDArray.cc, boolNDArray.h, boolSparse.cc, boolSparse.h, chMatrix.h,
chNDArray.h, dColVector.cc, dColVector.h, dDiagMatrix.cc, dDiagMatrix.h,
dMatrix.cc, dMatrix.h, dNDArray.cc, dNDArray.h, dRowVector.cc, dRowVector.h,
dSparse.cc, dSparse.h, dim-vector.cc, dim-vector.h, fCColVector.cc,
fCColVector.h, fCDiagMatrix.cc, fCDiagMatrix.h, fCMatrix.cc, fCMatrix.h,
fCNDArray.cc, fCNDArray.h, fCRowVector.cc, fCRowVector.h, fColVector.cc,
fColVector.h, fDiagMatrix.cc, fDiagMatrix.h, fMatrix.cc, fMatrix.h,
fNDArray.cc, fNDArray.h, fRowVector.cc, fRowVector.h, idx-vector.cc,
idx-vector.h, intNDArray.cc, intNDArray.h, liboctave-build-info.h,
liboctave-build-info.in.cc, CollocWt.cc, CollocWt.h, DAE.h, DAEFunc.h, DAERT.h,
DAERTFunc.h, DASPK.cc, DASPK.h, DASRT.cc, DASRT.h, DASSL.cc, DASSL.h, DET.h,
EIG.h, LSODE.cc, LSODE.h, ODE.h, ODEFunc.h, ODES.h, ODESFunc.h, Quad.h,
aepbalance.cc, aepbalance.h, base-dae.h, base-de.h, chol.cc, chol.h,
eigs-base.cc, fEIG.h, gepbalance.h, gsvd.cc, gsvd.h, hess.h, lu.cc, lu.h,
oct-fftw.cc, oct-fftw.h, oct-rand.cc, oct-rand.h, oct-spparms.cc,
oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randmtzig.cc, randmtzig.h, schur.h,
sparse-chol.cc, sparse-chol.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc,
sparse-qr.h, svd.cc, svd.h, child-list.cc, child-list.h, dir-ops.cc, dir-ops.h,
file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h,
lo-sysinfo.cc, lo-sysinfo.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h,
oct-group.cc, oct-group.h, oct-password.cc, oct-password.h, oct-syscalls.cc,
oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h,
action-container.h, base-list.h, caseless-str.h, cmd-edit.cc, cmd-edit.h,
cmd-hist.cc, cmd-hist.h, data-conv.cc, file-info.h, glob-match.cc,
glob-match.h, kpse.cc, kpse.h, lo-array-errwarn.cc, lo-array-errwarn.h,
lo-hash.cc, lo-hash.h, lo-ieee.cc, lo-ieee.h, lo-regexp.cc, lo-regexp.h,
oct-inttypes.cc, oct-inttypes.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h,
oct-shlib.cc, oct-shlib.h, oct-sort.cc, oct-sort.h, oct-sparse.cc,
octave-preserve-stream-state.h, pathsearch.cc, pathsearch.h, quit.cc,
singleton-cleanup.cc, singleton-cleanup.h, str-vec.cc, str-vec.h,
unwind-prot.cc, unwind-prot.h, url-transfer.cc, url-transfer.h, version.cc,
version.in.h, cxx-signal-helpers.cc, acinclude.m4, main-cli.cc, main-gui.cc,
main.in.cc, mkoctfile.in.cc, octave-build-info.h, octave-build-info.in.cc,
octave-config.in.cc, octave-svgconvert.cc, shared-fcns.h:
maint: Eliminate "(void)" in C++ function prototypes/declarations.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 24 Jan 2023 17:19:44 -0800 |
parents | 597f3ee61a48 |
children | 45f8b601c992 |
comparison
equal
deleted
inserted
replaced
31770:1d1eff97670e | 31771:21f9b34eb893 |
---|---|
59 class | 59 class |
60 gnu_history : public command_history | 60 gnu_history : public command_history |
61 { | 61 { |
62 public: | 62 public: |
63 | 63 |
64 gnu_history (void) | 64 gnu_history () |
65 : command_history (), mark (0) { } | 65 : command_history (), mark (0) { } |
66 | 66 |
67 ~gnu_history (void) = default; | 67 ~gnu_history () = default; |
68 | 68 |
69 void do_process_histcontrol (const std::string&); | 69 void do_process_histcontrol (const std::string&); |
70 | 70 |
71 std::string do_histcontrol (void) const; | 71 std::string do_histcontrol () const; |
72 | 72 |
73 bool do_add (const std::string&); | 73 bool do_add (const std::string&); |
74 | 74 |
75 void do_remove (int); | 75 void do_remove (int); |
76 | 76 |
77 void do_clear (void); | 77 void do_clear (); |
78 | 78 |
79 int do_where (void) const; | 79 int do_where () const; |
80 | 80 |
81 int do_length (void) const; | 81 int do_length () const; |
82 | 82 |
83 int do_max_input_history (void) const; | 83 int do_max_input_history () const; |
84 | 84 |
85 int do_base (void) const; | 85 int do_base () const; |
86 | 86 |
87 int do_current_number (void) const; | 87 int do_current_number () const; |
88 | 88 |
89 void do_stifle (int); | 89 void do_stifle (int); |
90 | 90 |
91 int do_unstifle (void); | 91 int do_unstifle (); |
92 | 92 |
93 int do_is_stifled (void) const; | 93 int do_is_stifled () const; |
94 | 94 |
95 void do_set_mark (int); | 95 void do_set_mark (int); |
96 | 96 |
97 int do_goto_mark (void); | 97 int do_goto_mark (); |
98 | 98 |
99 void do_read (const std::string&, bool); | 99 void do_read (const std::string&, bool); |
100 | 100 |
101 void do_read_range (const std::string&, int, int, bool); | 101 void do_read_range (const std::string&, int, int, bool); |
102 | 102 |
158 } | 158 } |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 std::string | 162 std::string |
163 gnu_history::do_histcontrol (void) const | 163 gnu_history::do_histcontrol () const |
164 { | 164 { |
165 // FIXME: instead of reconstructing this value, should we just save | 165 // FIXME: instead of reconstructing this value, should we just save |
166 // the string we were given when constructing the command_history object? | 166 // the string we were given when constructing the command_history object? |
167 | 167 |
168 std::string retval; | 168 std::string retval; |
215 { | 215 { |
216 ::octave_remove_history (n); | 216 ::octave_remove_history (n); |
217 } | 217 } |
218 | 218 |
219 void | 219 void |
220 gnu_history::do_clear (void) | 220 gnu_history::do_clear () |
221 { | 221 { |
222 ::octave_clear_history (); | 222 ::octave_clear_history (); |
223 } | 223 } |
224 | 224 |
225 int | 225 int |
226 gnu_history::do_where (void) const | 226 gnu_history::do_where () const |
227 { | 227 { |
228 return ::octave_where_history (); | 228 return ::octave_where_history (); |
229 } | 229 } |
230 | 230 |
231 int | 231 int |
232 gnu_history::do_length (void) const | 232 gnu_history::do_length () const |
233 { | 233 { |
234 return ::octave_history_length (); | 234 return ::octave_history_length (); |
235 } | 235 } |
236 | 236 |
237 int | 237 int |
238 gnu_history::do_max_input_history (void) const | 238 gnu_history::do_max_input_history () const |
239 { | 239 { |
240 return ::octave_max_input_history (); | 240 return ::octave_max_input_history (); |
241 } | 241 } |
242 | 242 |
243 int | 243 int |
244 gnu_history::do_base (void) const | 244 gnu_history::do_base () const |
245 { | 245 { |
246 return ::octave_history_base (); | 246 return ::octave_history_base (); |
247 } | 247 } |
248 | 248 |
249 int | 249 int |
250 gnu_history::do_current_number (void) const | 250 gnu_history::do_current_number () const |
251 { | 251 { |
252 return m_size > 0 ? do_base () + do_where () : -1; | 252 return m_size > 0 ? do_base () + do_where () : -1; |
253 } | 253 } |
254 | 254 |
255 void | 255 void |
257 { | 257 { |
258 ::octave_stifle_history (n); | 258 ::octave_stifle_history (n); |
259 } | 259 } |
260 | 260 |
261 int | 261 int |
262 gnu_history::do_unstifle (void) | 262 gnu_history::do_unstifle () |
263 { | 263 { |
264 return ::octave_unstifle_history (); | 264 return ::octave_unstifle_history (); |
265 } | 265 } |
266 | 266 |
267 int | 267 int |
268 gnu_history::do_is_stifled (void) const | 268 gnu_history::do_is_stifled () const |
269 { | 269 { |
270 return ::octave_history_is_stifled (); | 270 return ::octave_history_is_stifled (); |
271 } | 271 } |
272 | 272 |
273 void | 273 void |
275 { | 275 { |
276 mark = n; | 276 mark = n; |
277 } | 277 } |
278 | 278 |
279 int | 279 int |
280 gnu_history::do_goto_mark (void) | 280 gnu_history::do_goto_mark () |
281 { | 281 { |
282 if (mark) | 282 if (mark) |
283 { | 283 { |
284 char *line = ::octave_history_goto_mark (mark); | 284 char *line = ::octave_history_goto_mark (mark); |
285 | 285 |
510 } | 510 } |
511 | 511 |
512 #endif | 512 #endif |
513 | 513 |
514 bool | 514 bool |
515 command_history::instance_ok (void) | 515 command_history::instance_ok () |
516 { | 516 { |
517 bool retval = true; | 517 bool retval = true; |
518 | 518 |
519 if (! s_instance) | 519 if (! s_instance) |
520 { | 520 { |
530 | 530 |
531 return retval; | 531 return retval; |
532 } | 532 } |
533 | 533 |
534 void | 534 void |
535 command_history::make_command_history (void) | 535 command_history::make_command_history () |
536 { | 536 { |
537 #if defined (USE_READLINE) | 537 #if defined (USE_READLINE) |
538 s_instance = new gnu_history (); | 538 s_instance = new gnu_history (); |
539 #else | 539 #else |
540 s_instance = new command_history (); | 540 s_instance = new command_history (); |
549 if (instance_ok ()) | 549 if (instance_ok ()) |
550 s_instance->do_initialize (read_history_file, f_arg, sz, control_arg); | 550 s_instance->do_initialize (read_history_file, f_arg, sz, control_arg); |
551 } | 551 } |
552 | 552 |
553 bool | 553 bool |
554 command_history::is_initialized (void) | 554 command_history::is_initialized () |
555 { | 555 { |
556 // We just want to check the status of an existing instance, not | 556 // We just want to check the status of an existing instance, not |
557 // create one. | 557 // create one. |
558 return s_instance && s_instance->do_is_initialized (); | 558 return s_instance && s_instance->do_is_initialized (); |
559 } | 559 } |
568 s_instance->do_set_file (f); | 568 s_instance->do_set_file (f); |
569 } | 569 } |
570 } | 570 } |
571 | 571 |
572 std::string | 572 std::string |
573 command_history::file (void) | 573 command_history::file () |
574 { | 574 { |
575 return instance_ok () ? s_instance->do_file () : ""; | 575 return instance_ok () ? s_instance->do_file () : ""; |
576 } | 576 } |
577 | 577 |
578 void | 578 void |
581 if (instance_ok ()) | 581 if (instance_ok ()) |
582 s_instance->do_process_histcontrol (control_arg); | 582 s_instance->do_process_histcontrol (control_arg); |
583 } | 583 } |
584 | 584 |
585 std::string | 585 std::string |
586 command_history::histcontrol (void) | 586 command_history::histcontrol () |
587 { | 587 { |
588 return instance_ok () ? s_instance->do_histcontrol () : ""; | 588 return instance_ok () ? s_instance->do_histcontrol () : ""; |
589 } | 589 } |
590 | 590 |
591 void | 591 void |
594 if (instance_ok ()) | 594 if (instance_ok ()) |
595 s_instance->do_set_size (n); | 595 s_instance->do_set_size (n); |
596 } | 596 } |
597 | 597 |
598 int | 598 int |
599 command_history::size (void) | 599 command_history::size () |
600 { | 600 { |
601 return instance_ok () ? s_instance->do_size () : 0; | 601 return instance_ok () ? s_instance->do_size () : 0; |
602 } | 602 } |
603 | 603 |
604 void | 604 void |
607 if (instance_ok ()) | 607 if (instance_ok ()) |
608 s_instance->do_ignore_entries (flag); | 608 s_instance->do_ignore_entries (flag); |
609 } | 609 } |
610 | 610 |
611 bool | 611 bool |
612 command_history::ignoring_entries (void) | 612 command_history::ignoring_entries () |
613 { | 613 { |
614 return instance_ok () ? s_instance->do_ignoring_entries () : false; | 614 return instance_ok () ? s_instance->do_ignoring_entries () : false; |
615 } | 615 } |
616 | 616 |
617 bool | 617 bool |
628 if (instance_ok ()) | 628 if (instance_ok ()) |
629 s_instance->do_remove (n); | 629 s_instance->do_remove (n); |
630 } | 630 } |
631 | 631 |
632 void | 632 void |
633 command_history::clear (void) | 633 command_history::clear () |
634 { | 634 { |
635 if (instance_ok ()) | 635 if (instance_ok ()) |
636 s_instance->do_clear (); | 636 s_instance->do_clear (); |
637 } | 637 } |
638 | 638 |
639 int | 639 int |
640 command_history::where (void) | 640 command_history::where () |
641 { | 641 { |
642 return instance_ok () ? s_instance->do_where () : 0; | 642 return instance_ok () ? s_instance->do_where () : 0; |
643 } | 643 } |
644 | 644 |
645 int | 645 int |
646 command_history::length (void) | 646 command_history::length () |
647 { | 647 { |
648 return instance_ok () ? s_instance->do_length () : 0; | 648 return instance_ok () ? s_instance->do_length () : 0; |
649 } | 649 } |
650 | 650 |
651 int | 651 int |
652 command_history::max_input_history (void) | 652 command_history::max_input_history () |
653 { | 653 { |
654 return instance_ok () ? s_instance->do_max_input_history () : 0; | 654 return instance_ok () ? s_instance->do_max_input_history () : 0; |
655 } | 655 } |
656 | 656 |
657 int | 657 int |
658 command_history::base (void) | 658 command_history::base () |
659 { | 659 { |
660 return instance_ok () ? s_instance->do_base () : 0; | 660 return instance_ok () ? s_instance->do_base () : 0; |
661 } | 661 } |
662 | 662 |
663 int | 663 int |
664 command_history::current_number (void) | 664 command_history::current_number () |
665 { | 665 { |
666 return instance_ok () ? s_instance->do_current_number () : 0; | 666 return instance_ok () ? s_instance->do_current_number () : 0; |
667 } | 667 } |
668 | 668 |
669 void | 669 void |
672 if (instance_ok ()) | 672 if (instance_ok ()) |
673 s_instance->do_stifle (n); | 673 s_instance->do_stifle (n); |
674 } | 674 } |
675 | 675 |
676 int | 676 int |
677 command_history::unstifle (void) | 677 command_history::unstifle () |
678 { | 678 { |
679 return instance_ok () ? s_instance->do_unstifle () : 0; | 679 return instance_ok () ? s_instance->do_unstifle () : 0; |
680 } | 680 } |
681 | 681 |
682 int | 682 int |
683 command_history::is_stifled (void) | 683 command_history::is_stifled () |
684 { | 684 { |
685 return instance_ok () ? s_instance->do_is_stifled () : 0; | 685 return instance_ok () ? s_instance->do_is_stifled () : 0; |
686 } | 686 } |
687 | 687 |
688 void | 688 void |
691 if (instance_ok ()) | 691 if (instance_ok ()) |
692 s_instance->do_set_mark (n); | 692 s_instance->do_set_mark (n); |
693 } | 693 } |
694 | 694 |
695 int | 695 int |
696 command_history::goto_mark (void) | 696 command_history::goto_mark () |
697 { | 697 { |
698 return instance_ok () ? s_instance->do_goto_mark () : 0; | 698 return instance_ok () ? s_instance->do_goto_mark () : 0; |
699 } | 699 } |
700 | 700 |
701 void | 701 void |
791 | 791 |
792 m_initialized = true; | 792 m_initialized = true; |
793 } | 793 } |
794 | 794 |
795 bool | 795 bool |
796 command_history::do_is_initialized (void) const | 796 command_history::do_is_initialized () const |
797 { | 797 { |
798 return m_initialized; | 798 return m_initialized; |
799 } | 799 } |
800 | 800 |
801 void | 801 void |
803 { | 803 { |
804 m_file = f; | 804 m_file = f; |
805 } | 805 } |
806 | 806 |
807 std::string | 807 std::string |
808 command_history::do_file (void) | 808 command_history::do_file () |
809 { | 809 { |
810 return m_file; | 810 return m_file; |
811 } | 811 } |
812 | 812 |
813 void | 813 void |
815 { | 815 { |
816 m_size = n; | 816 m_size = n; |
817 } | 817 } |
818 | 818 |
819 int | 819 int |
820 command_history::do_size (void) const | 820 command_history::do_size () const |
821 { | 821 { |
822 return m_size; | 822 return m_size; |
823 } | 823 } |
824 | 824 |
825 void | 825 void |
827 { | 827 { |
828 m_ignoring_additions = flag; | 828 m_ignoring_additions = flag; |
829 } | 829 } |
830 | 830 |
831 bool | 831 bool |
832 command_history::do_ignoring_entries (void) const | 832 command_history::do_ignoring_entries () const |
833 { | 833 { |
834 return m_ignoring_additions; | 834 return m_ignoring_additions; |
835 } | 835 } |
836 | 836 |
837 bool | 837 bool |
843 void | 843 void |
844 command_history::do_remove (int) | 844 command_history::do_remove (int) |
845 { } | 845 { } |
846 | 846 |
847 void | 847 void |
848 command_history::do_clear (void) | 848 command_history::do_clear () |
849 { } | 849 { } |
850 | 850 |
851 int | 851 int |
852 command_history::do_where (void) const | 852 command_history::do_where () const |
853 { | 853 { |
854 return 0; | 854 return 0; |
855 } | 855 } |
856 | 856 |
857 int | 857 int |
858 command_history::do_length (void) const | 858 command_history::do_length () const |
859 { | 859 { |
860 return 0; | 860 return 0; |
861 } | 861 } |
862 | 862 |
863 int | 863 int |
864 command_history::do_max_input_history (void) const | 864 command_history::do_max_input_history () const |
865 { | 865 { |
866 return 0; | 866 return 0; |
867 } | 867 } |
868 | 868 |
869 int | 869 int |
870 command_history::do_base (void) const | 870 command_history::do_base () const |
871 { | 871 { |
872 return 0; | 872 return 0; |
873 } | 873 } |
874 | 874 |
875 int | 875 int |
876 command_history::do_current_number (void) const | 876 command_history::do_current_number () const |
877 { | 877 { |
878 return m_size > 0 ? do_base () + do_where () : -1; | 878 return m_size > 0 ? do_base () + do_where () : -1; |
879 } | 879 } |
880 | 880 |
881 void | 881 void |
882 command_history::do_stifle (int) | 882 command_history::do_stifle (int) |
883 { } | 883 { } |
884 | 884 |
885 int | 885 int |
886 command_history::do_unstifle (void) | 886 command_history::do_unstifle () |
887 { | 887 { |
888 return -1; | 888 return -1; |
889 } | 889 } |
890 | 890 |
891 int | 891 int |
892 command_history::do_is_stifled (void) const | 892 command_history::do_is_stifled () const |
893 { | 893 { |
894 return 0; | 894 return 0; |
895 } | 895 } |
896 | 896 |
897 void | 897 void |
898 command_history::do_set_mark (int) | 898 command_history::do_set_mark (int) |
899 { } | 899 { } |
900 | 900 |
901 int | 901 int |
902 command_history::do_goto_mark (void) | 902 command_history::do_goto_mark () |
903 { | 903 { |
904 return 0; | 904 return 0; |
905 } | 905 } |
906 | 906 |
907 void | 907 void |