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