GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
cmd-hist.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1996-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <cstring>
31 
32 #include <fstream>
33 #include <sstream>
34 #include <string>
35 
36 #include "cmd-edit.h"
37 #include "cmd-hist.h"
38 #include "file-ops.h"
39 #include "lo-error.h"
40 #include "lo-sysdep.h"
41 #include "singleton-cleanup.h"
42 #include "str-vec.h"
43 
44 #if defined (USE_READLINE)
45 #include <cstdlib>
46 
47 #include "oct-rl-hist.h"
48 
49 #include "file-stat.h"
50 #endif
51 
52 namespace octave
53 {
54  command_history *command_history::s_instance = nullptr;
55 
56 #if defined (USE_READLINE)
57 
58  class
59  gnu_history : public command_history
60  {
61  public:
62 
63  gnu_history (void)
64  : command_history (), mark (0) { }
65 
66  ~gnu_history (void) = default;
67 
68  void do_process_histcontrol (const std::string&);
69 
70  std::string do_histcontrol (void) const;
71 
72  bool do_add (const std::string&);
73 
74  void do_remove (int);
75 
76  void do_clear (void);
77 
78  int do_where (void) const;
79 
80  int do_length (void) const;
81 
82  int do_max_input_history (void) const;
83 
84  int do_base (void) const;
85 
86  int do_current_number (void) const;
87 
88  void do_stifle (int);
89 
90  int do_unstifle (void);
91 
92  int do_is_stifled (void) const;
93 
94  void do_set_mark (int);
95 
96  int do_goto_mark (void);
97 
98  void do_read (const std::string&, bool);
99 
100  void do_read_range (const std::string&, int, int, bool);
101 
102  void do_write (const std::string&) const;
103 
104  void do_append (const std::string&);
105 
106  void do_truncate_file (const std::string&, int) const;
107 
108  string_vector do_list (int, bool) const;
109 
110  std::string do_get_entry (int) const;
111 
112  void do_replace_entry (int, const std::string&);
113 
114  void do_clean_up_and_save (const std::string&, int);
115 
116  private:
117 
118  int mark;
119  };
120 
121  void
122  gnu_history::do_process_histcontrol (const std::string& control_arg)
123  {
124  m_history_control = 0;
125 
126  size_t len = control_arg.length ();
127  size_t beg = 0;
128 
129  while (beg < len)
130  {
131  if (control_arg[beg] == ':')
132  beg++;
133  else
134  {
135  size_t end = control_arg.find (':', beg);
136 
137  if (end == std::string::npos)
138  end = len;
139 
140  std::string tmp = control_arg.substr (beg, end-beg);
141 
142  if (tmp == "erasedups")
143  m_history_control |= HC_ERASEDUPS;
144  else if (tmp == "ignoreboth")
145  m_history_control |= (HC_IGNDUPS | HC_IGNSPACE);
146  else if (tmp == "ignoredups")
147  m_history_control |= HC_IGNDUPS;
148  else if (tmp == "ignorespace")
149  m_history_control |= HC_IGNSPACE;
150  else
152  ("Octave:history-control",
153  "unknown histcontrol directive %s", tmp.c_str ());
154 
155  if (end != std::string::npos)
156  beg = end + 1;
157  }
158  }
159  }
160 
161  std::string
162  gnu_history::do_histcontrol (void) const
163  {
164  // FIXME: instead of reconstructing this value, should we just save
165  // the string we were given when constructing the command_history object?
166 
167  std::string retval;
168 
169  if (m_history_control & HC_IGNSPACE)
170  retval.append ("ignorespace");
171 
172  if (m_history_control & HC_IGNDUPS)
173  {
174  if (retval.length () > 0)
175  retval += ':';
176 
177  retval.append ("ignoredups");
178  }
179 
180  if (m_history_control & HC_ERASEDUPS)
181  {
182  if (retval.length () > 0)
183  retval += ':';
184 
185  retval.append ("erasedups");
186  }
187 
188  return retval;
189  }
190 
191  bool
192  gnu_history::do_add (const std::string& s)
193  {
194  if (! do_ignoring_entries ())
195  {
196  if (s.empty ()
197  || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n')))
198  return false;
199 
200  // Strip newline before adding to list
201  std::string stmp = s;
202  if (stmp.back () == '\n')
203  stmp.pop_back ();
204 
205  int added = ::octave_add_history (stmp.c_str (), m_history_control);
206  m_lines_this_session += added;
207  return added > 0 ? true : false;
208  }
209  return false;
210  }
211 
212  void
213  gnu_history::do_remove (int n)
214  {
216  }
217 
218  void
219  gnu_history::do_clear (void)
220  {
222  }
223 
224  int
225  gnu_history::do_where (void) const
226  {
228  }
229 
230  int
231  gnu_history::do_length (void) const
232  {
234  }
235 
236  int
237  gnu_history::do_max_input_history (void) const
238  {
240  }
241 
242  int
243  gnu_history::do_base (void) const
244  {
246  }
247 
248  int
249  gnu_history::do_current_number (void) const
250  {
251  return m_size > 0 ? do_base () + do_where () : -1;
252  }
253 
254  void
255  gnu_history::do_stifle (int n)
256  {
258  }
259 
260  int
261  gnu_history::do_unstifle (void)
262  {
264  }
265 
266  int
267  gnu_history::do_is_stifled (void) const
268  {
270  }
271 
272  void
273  gnu_history::do_set_mark (int n)
274  {
275  mark = n;
276  }
277 
278  int
279  gnu_history::do_goto_mark (void)
280  {
281  if (mark)
282  {
283  char *line = ::octave_history_goto_mark (mark);
284 
285  if (line)
286  {
288 
290  }
291  }
292 
293  mark = 0;
294 
295  // FIXME: for operate_and_get_next.
297 
298  return 0;
299  }
300 
301  void
302  gnu_history::do_read (const std::string& f, bool must_exist)
303  {
304  if (! f.empty ())
305  {
306  int status = ::octave_read_history (f.c_str ());
307 
308  if (status != 0 && must_exist)
309  {
310  std::string msg = "reading file '" + f + "'";
311 
312  error (status, msg);
313  }
314  else
315  {
316  m_lines_in_file = do_where ();
317 
319  }
320  }
321  else
322  error ("gnu_history::read: missing filename");
323  }
324 
325  void
326  gnu_history::do_read_range (const std::string& f, int from, int to,
327  bool must_exist)
328  {
329  if (from < 0)
330  from = m_lines_in_file;
331 
332  if (! f.empty ())
333  {
334  int status = ::octave_read_history_range (f.c_str (), from, to);
335 
336  if (status != 0 && must_exist)
337  {
338  std::ostringstream buf;
339  buf << "reading lines " << from << " to " << to
340  << " from file '" << f << "'";
341 
342  error (status, buf.str ());
343  }
344  else
345  {
346  m_lines_in_file = do_where ();
347 
349  }
350  }
351  else
352  error ("gnu_history::read_range: missing filename");
353  }
354 
355  void
356  gnu_history::do_write (const std::string& f_arg) const
357  {
358  if (m_initialized)
359  {
360  std::string f = f_arg;
361 
362  if (f.empty ())
363  f = m_file;
364 
365  if (! f.empty ())
366  {
367  int status = ::octave_write_history (f.c_str ());
368 
369  if (status != 0)
370  {
371  std::string msg = "writing file '" + f + "'";
372 
373  error (status, msg);
374  }
375  }
376  else
377  error ("gnu_history::write: missing filename");
378  }
379  }
380 
381  void
382  gnu_history::do_append (const std::string& f_arg)
383  {
384  if (m_initialized)
385  {
386  if (m_lines_this_session)
387  {
388  if (m_lines_this_session < do_where ())
389  {
390  // Create file if it doesn't already exist.
391 
392  std::string f = f_arg;
393 
394  if (f.empty ())
395  f = m_file;
396 
397  if (! f.empty ())
398  {
399  sys::file_stat fs (f);
400 
401  if (! fs)
402  {
403  std::ofstream tmp = sys::ofstream (f, std::ios::out);
404  tmp.close ();
405  }
406 
407  int status
408  = ::octave_append_history (m_lines_this_session, f.c_str ());
409 
410  if (status != 0)
411  {
412  std::string msg = "appending to file '" + f_arg + "'";
413 
414  error (status, msg);
415  }
416  else
417  m_lines_in_file += m_lines_this_session;
418 
419  m_lines_this_session = 0;
420  }
421  else
422  error ("gnu_history::append: missing filename");
423  }
424  }
425  }
426  }
427 
428  void
429  gnu_history::do_truncate_file (const std::string& f_arg, int n) const
430  {
431  if (m_initialized)
432  {
433  std::string f = f_arg;
434 
435  if (f.empty ())
436  f = m_file;
437 
438  if (! f.empty ())
439  ::octave_history_truncate_file (f.c_str (), n);
440  else
441  error ("gnu_history::truncate_file: missing filename");
442  }
443  }
444 
446  gnu_history::do_list (int limit, bool number_lines) const
447  {
449 
450  if (limit)
451  retval = ::octave_history_list (limit, number_lines);
452 
453  return retval;
454  }
455 
456  std::string
457  gnu_history::do_get_entry (int n) const
458  {
459  std::string retval;
460 
461  char *line = ::octave_history_get (do_base () + n);
462 
463  if (line)
464  retval = line;
465 
466  return retval;
467  }
468 
469  void
470  gnu_history::do_replace_entry (int which, const std::string& line)
471  {
472  ::octave_replace_history_entry (which, line.c_str ());
473  }
474 
475  void
476  gnu_history::do_clean_up_and_save (const std::string& f_arg, int n)
477  {
478  if (m_initialized)
479  {
480  std::string f = f_arg;
481 
482  if (f.empty ())
483  f = m_file;
484 
485  if (! f.empty ())
486  {
487  if (n < 0)
488  n = m_size;
489 
490  stifle (n);
491 
492  do_write (f.c_str ());
493  }
494  else
495  error ("gnu_history::clean_up_and_save: missing filename");
496  }
497  }
498 
499 #endif
500 
501  bool
503  {
504  bool retval = true;
505 
506  if (! s_instance)
507  {
509 
510  if (s_instance)
512  }
513 
514  if (! s_instance)
515  (*current_liboctave_error_handler)
516  ("unable to create command history object!");
517 
518  return retval;
519  }
520 
521  void
523  {
524 #if defined (USE_READLINE)
525  s_instance = new gnu_history ();
526 #else
527  s_instance = new command_history ();
528 #endif
529  }
530 
531  void
532  command_history::initialize (bool read_history_file,
533  const std::string& f_arg, int sz,
534  const std::string & control_arg)
535  {
536  if (instance_ok ())
537  s_instance->do_initialize (read_history_file, f_arg, sz, control_arg);
538  }
539 
540  bool
542  {
543  // We just want to check the status of an existing instance, not
544  // create one.
546  }
547 
548  void
549  command_history::set_file (const std::string& f_arg)
550  {
551  if (instance_ok ())
552  {
553  std::string f = sys::file_ops::tilde_expand (f_arg);
554 
556  }
557  }
558 
559  std::string
561  {
562  return instance_ok () ? s_instance->do_file () : "";
563  }
564 
565  void
566  command_history::process_histcontrol (const std::string& control_arg)
567  {
568  if (instance_ok ())
569  s_instance->do_process_histcontrol (control_arg);
570  }
571 
572  std::string
574  {
575  return instance_ok () ? s_instance->do_histcontrol () : "";
576  }
577 
578  void
580  {
581  if (instance_ok ())
583  }
584 
585  int
587  {
588  return instance_ok () ? s_instance->do_size () : 0;
589  }
590 
591  void
593  {
594  if (instance_ok ())
596  }
597 
598  bool
600  {
601  return instance_ok () ? s_instance->do_ignoring_entries () : false;
602  }
603 
604  bool
605  command_history::add (const std::string& s)
606  {
607  if (instance_ok ())
608  return s_instance->do_add (s);
609  return false;
610  }
611 
612  void
614  {
615  if (instance_ok ())
617  }
618 
619  void
621  {
622  if (instance_ok ())
623  s_instance->do_clear ();
624  }
625 
626  int
628  {
629  return instance_ok () ? s_instance->do_where () : 0;
630  }
631 
632  int
634  {
635  return instance_ok () ? s_instance->do_length () : 0;
636  }
637 
638  int
640  {
641  return instance_ok () ? s_instance->do_max_input_history () : 0;
642  }
643 
644  int
646  {
647  return instance_ok () ? s_instance->do_base () : 0;
648  }
649 
650  int
652  {
653  return instance_ok () ? s_instance->do_current_number () : 0;
654  }
655 
656  void
658  {
659  if (instance_ok ())
661  }
662 
663  int
665  {
666  return instance_ok () ? s_instance->do_unstifle () : 0;
667  }
668 
669  int
671  {
672  return instance_ok () ? s_instance->do_is_stifled () : 0;
673  }
674 
675  void
677  {
678  if (instance_ok ())
680  }
681 
682  int
684  {
685  return instance_ok () ? s_instance->do_goto_mark () : 0;
686  }
687 
688  void
689  command_history::read (bool must_exist)
690  {
691  read (file (), must_exist);
692  }
693 
694  void
695  command_history::read (const std::string& f, bool must_exist)
696  {
697  if (instance_ok ())
698  s_instance->do_read (f, must_exist);
699  }
700 
701  void
702  command_history::read_range (int from, int to, bool must_exist)
703  {
704  read_range (file (), from, to, must_exist);
705  }
706 
707  void
708  command_history::read_range (const std::string& f, int from, int to,
709  bool must_exist)
710  {
711  if (instance_ok ())
712  s_instance->do_read_range (f, from, to, must_exist);
713  }
714 
715  void
716  command_history::write (const std::string& f)
717  {
718  if (instance_ok ())
719  s_instance->do_write (f);
720  }
721 
722  void
723  command_history::append (const std::string& f)
724  {
725  if (instance_ok ())
727  }
728 
729  void
730  command_history::truncate_file (const std::string& f, int n)
731  {
732  if (instance_ok ())
734  }
735 
737  command_history::list (int limit, bool number_lines)
738  {
739  return (instance_ok ()
740  ? s_instance->do_list (limit, number_lines) : string_vector ());
741  }
742 
743  std::string
745  {
746  return instance_ok () ? s_instance->do_get_entry (n) : "";
747  }
748 
749  void
750  command_history::replace_entry (int which, const std::string& line)
751  {
752  if (instance_ok ())
753  s_instance->do_replace_entry (which, line);
754  }
755 
756  void
757  command_history::clean_up_and_save (const std::string& f, int n)
758  {
759  if (instance_ok ())
761  }
762 
763  void
765  { }
766 
767  void
768  command_history::do_initialize (bool read_history_file,
769  const std::string& f_arg, int sz,
770  const std::string & control_arg)
771  {
775 
776  if (read_history_file)
777  command_history::read (false);
778 
779  m_initialized = true;
780  }
781 
782  bool
784  {
785  return m_initialized;
786  }
787 
788  void
789  command_history::do_set_file (const std::string& f)
790  {
791  m_file = f;
792  }
793 
794  std::string
796  {
797  return m_file;
798  }
799 
800  void
802  {
803  m_size = n;
804  }
805 
806  int
808  {
809  return m_size;
810  }
811 
812  void
814  {
815  m_ignoring_additions = flag;
816  }
817 
818  bool
820  {
821  return m_ignoring_additions;
822  }
823 
824  bool
825  command_history::do_add (const std::string&)
826  {
827  return false;
828  }
829 
830  void
832  { }
833 
834  void
836  { }
837 
838  int
840  {
841  return 0;
842  }
843 
844  int
846  {
847  return 0;
848  }
849 
850  int
852  {
853  return 0;
854  }
855 
856  int
858  {
859  return 0;
860  }
861 
862  int
864  {
865  return m_size > 0 ? do_base () + do_where () : -1;
866  }
867 
868  void
870  { }
871 
872  int
874  {
875  return -1;
876  }
877 
878  int
880  {
881  return 0;
882  }
883 
884  void
886  { }
887 
888  int
890  {
891  return 0;
892  }
893 
894  void
895  command_history::do_read (const std::string& f, bool)
896  {
897  if (f.empty ())
898  error ("command_history::read: missing filename");
899  }
900 
901  void
902  command_history::do_read_range (const std::string& f, int, int, bool)
903  {
904  if (f.empty ())
905  error ("command_history::read_range: missing filename");
906  }
907 
908  void
909  command_history::do_write (const std::string& f_arg) const
910  {
911  if (m_initialized)
912  {
913  std::string f = f_arg;
914 
915  if (f.empty ())
916  f = m_file;
917 
918  if (f.empty ())
919  error ("command_history::write: missing filename");
920  }
921  }
922 
923  void
924  command_history::do_append (const std::string& f_arg)
925  {
926  if (m_initialized)
927  {
929  {
931  {
932  // Create file if it doesn't already exist.
933 
934  std::string f = f_arg;
935 
936  if (f.empty ())
937  f = m_file;
938 
939  if (f.empty ())
940  error ("command_history::append: missing filename");
941  }
942  }
943  }
944  }
945 
946  void
947  command_history::do_truncate_file (const std::string& f_arg, int) const
948  {
949  if (m_initialized)
950  {
951  std::string f = f_arg;
952 
953  if (f.empty ())
954  f = m_file;
955 
956  if (f.empty ())
957  error ("command_history::truncate_file: missing filename");
958  }
959  }
960 
962  command_history::do_list (int, bool) const
963  {
964  return string_vector ();
965  }
966 
967  std::string
969  {
970  return "";
971  }
972 
973  void
974  command_history::do_replace_entry (int, const std::string&)
975  { }
976 
977  void
978  command_history::do_clean_up_and_save (const std::string& f_arg, int)
979  {
980  if (m_initialized)
981  {
982  std::string f = f_arg;
983 
984  if (f.empty ())
985  f = m_file;
986 
987  if (f.empty ())
988  error ("command_history::clean_up_and_save: missing filename");
989  }
990  }
991 
992  void
993  command_history::error (int err_num, const std::string& msg) const
994  {
995  if (msg.empty ())
996  (*current_liboctave_error_handler) ("%s", std::strerror (err_num));
997  else
998  (*current_liboctave_error_handler) ("%s: %s", msg.c_str (),
999  std::strerror (err_num));
1000  }
1001 
1002  void
1003  command_history::error (const std::string& s) const
1004  {
1005  (*current_liboctave_error_handler) ("%s", s.c_str ());
1006  }
1007 }
static void clear_undo_list(void)
Definition: cmd-edit.cc:1493
static void remove_startup_hook(startup_hook_fcn f)
Definition: cmd-edit.cc:1511
static void insert_text(const std::string &text)
Definition: cmd-edit.cc:1466
static std::string get_entry(int)
Definition: cmd-hist.cc:744
std::string m_file
Definition: cmd-hist.h:238
static int size(void)
Definition: cmd-hist.cc:586
virtual std::string do_get_entry(int) const
Definition: cmd-hist.cc:968
static void make_command_history(void)
Definition: cmd-hist.cc:522
static void process_histcontrol(const std::string &)
Definition: cmd-hist.cc:566
virtual void do_process_histcontrol(const std::string &)
Definition: cmd-hist.cc:764
static std::string histcontrol(void)
Definition: cmd-hist.cc:573
static void read_range(int=-1, int=-1, bool=true)
Definition: cmd-hist.cc:702
virtual std::string do_histcontrol(void) const
Definition: cmd-hist.h:158
virtual void do_truncate_file(const std::string &, int) const
Definition: cmd-hist.cc:947
static void ignore_entries(bool=true)
Definition: cmd-hist.cc:592
virtual int do_goto_mark(void)
Definition: cmd-hist.cc:889
virtual void do_read(const std::string &, bool)
Definition: cmd-hist.cc:895
static bool instance_ok(void)
Definition: cmd-hist.cc:502
static bool is_initialized(void)
Definition: cmd-hist.cc:541
static void clear(void)
Definition: cmd-hist.cc:620
static void set_file(const std::string &)
Definition: cmd-hist.cc:549
virtual int do_where(void) const
Definition: cmd-hist.cc:839
virtual void do_clear(void)
Definition: cmd-hist.cc:835
virtual void do_read_range(const std::string &, int, int, bool)
Definition: cmd-hist.cc:902
static std::string file(void)
Definition: cmd-hist.cc:560
virtual void do_append(const std::string &)
Definition: cmd-hist.cc:924
virtual bool do_add(const std::string &)
Definition: cmd-hist.cc:825
virtual int do_length(void) const
Definition: cmd-hist.cc:845
static int max_input_history(void)
Definition: cmd-hist.cc:639
static void truncate_file(const std::string &="", int=-1)
Definition: cmd-hist.cc:730
virtual void do_ignore_entries(bool)
Definition: cmd-hist.cc:813
virtual int do_unstifle(void)
Definition: cmd-hist.cc:873
void error(int, const std::string &msg="") const
Definition: cmd-hist.cc:993
static int where(void)
Definition: cmd-hist.cc:627
static int is_stifled(void)
Definition: cmd-hist.cc:670
static void stifle(int)
Definition: cmd-hist.cc:657
virtual void do_initialize(bool, const std::string &, int, const std::string &)
Definition: cmd-hist.cc:768
static void set_mark(int n)
Definition: cmd-hist.cc:676
virtual void do_clean_up_and_save(const std::string &, int)
Definition: cmd-hist.cc:978
virtual int do_max_input_history(void) const
Definition: cmd-hist.cc:851
static int base(void)
Definition: cmd-hist.cc:645
virtual void do_set_mark(int)
Definition: cmd-hist.cc:885
static bool ignoring_entries(void)
Definition: cmd-hist.cc:599
virtual void do_remove(int)
Definition: cmd-hist.cc:831
static int current_number(void)
Definition: cmd-hist.cc:651
static void initialize(bool, const std::string &, int, const std::string &)
Definition: cmd-hist.cc:532
virtual bool do_ignoring_entries(void) const
Definition: cmd-hist.cc:819
static void append(const std::string &="")
Definition: cmd-hist.cc:723
static int goto_mark(void)
Definition: cmd-hist.cc:683
virtual void do_stifle(int)
Definition: cmd-hist.cc:869
static void clean_up_and_save(const std::string &="", int=-1)
Definition: cmd-hist.cc:757
virtual void do_set_size(int)
Definition: cmd-hist.cc:801
static void remove(int)
Definition: cmd-hist.cc:613
virtual void do_set_file(const std::string &)
Definition: cmd-hist.cc:789
virtual void do_write(const std::string &) const
Definition: cmd-hist.cc:909
static bool add(const std::string &)
Definition: cmd-hist.cc:605
static command_history * s_instance
Definition: cmd-hist.h:138
virtual std::string do_file(void)
Definition: cmd-hist.cc:795
static int unstifle(void)
Definition: cmd-hist.cc:664
static int length(void)
Definition: cmd-hist.cc:633
virtual int do_size(void) const
Definition: cmd-hist.cc:807
virtual int do_base(void) const
Definition: cmd-hist.cc:857
virtual int do_current_number(void) const
Definition: cmd-hist.cc:863
static void cleanup_instance(void)
Definition: cmd-hist.h:140
virtual string_vector do_list(int, bool) const
Definition: cmd-hist.cc:962
static void set_size(int)
Definition: cmd-hist.cc:579
virtual int do_is_stifled(void) const
Definition: cmd-hist.cc:879
static void read(bool=true)
Definition: cmd-hist.cc:689
virtual void do_replace_entry(int, const std::string &)
Definition: cmd-hist.cc:974
static void replace_entry(int, const std::string &)
Definition: cmd-hist.cc:750
static void write(const std::string &="")
Definition: cmd-hist.cc:716
virtual bool do_is_initialized(void) const
Definition: cmd-hist.cc:783
static string_vector list(int=-1, bool=false)
Definition: cmd-hist.cc:737
static void add(fptr f)
void error(const char *fmt,...)
Definition: error.cc:968
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
Definition: lo-error.c:41
liboctave_warning_with_id_handler current_liboctave_warning_with_id_handler
Definition: lo-error.c:53
octave_idx_type n
Definition: mx-inlines.cc:753
std::string tilde_expand(const std::string &name)
Definition: file-ops.cc:286
std::ofstream ofstream(const std::string &filename, const std::ios::openmode mode)
Definition: lo-sysdep.cc:395
static double f(double k, double l_nu, double c_pm)
Definition: randpoisson.cc:118
void octave_stifle_history(int)
int octave_unstifle_history(void)
int octave_where_history(void)
void octave_clear_history(void)
char * octave_history_goto_mark(int n)
int octave_read_history_range(const char *, int, int)
int octave_write_history(const char *)
int octave_append_history(int, const char *)
int octave_read_history(const char *)
char ** octave_history_list(int, int)
int octave_max_input_history(void)
@ HC_IGNDUPS
Definition: oct-rl-hist.h:39
@ HC_ERASEDUPS
Definition: oct-rl-hist.h:40
@ HC_IGNSPACE
Definition: oct-rl-hist.h:38
int octave_history_length(void)
void octave_replace_history_entry(int, const char *)
char * octave_history_get(int n)
int octave_history_base(void)
int octave_add_history(const char *, int)
int octave_history_truncate_file(const char *, int)
void octave_using_history(void)
int octave_history_is_stifled(void)
void octave_remove_history(int)
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811
F77_RET_T len
Definition: xerbla.cc:61