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