1797
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1996, 1997, 2000, 2002, 2004, 2005, 2006, 2007 |
|
4 John W. Eaton |
1797
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
1797
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
1797
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
|
28 #include <cstring> |
|
29 |
3504
|
30 #include <iostream> |
2926
|
31 #include <string> |
|
32 |
|
33 #include "cmd-edit.h" |
|
34 #include "cmd-hist.h" |
5872
|
35 #include "file-ops.h" |
2926
|
36 #include "lo-error.h" |
|
37 #include "str-vec.h" |
|
38 |
|
39 command_history *command_history::instance = 0; |
|
40 |
|
41 #if defined (USE_READLINE) |
|
42 |
|
43 #include <cstdlib> |
|
44 |
2444
|
45 #ifdef HAVE_FCNTL_H |
1797
|
46 #include <fcntl.h> |
2444
|
47 #endif |
1797
|
48 |
|
49 #include <sys/types.h> |
|
50 #include <unistd.h> |
|
51 |
3519
|
52 #include "oct-rl-hist.h" |
1797
|
53 |
2926
|
54 #include "file-stat.h" |
1797
|
55 |
2926
|
56 class |
|
57 gnu_history : public command_history |
1797
|
58 { |
2926
|
59 public: |
|
60 |
|
61 gnu_history (void) |
|
62 : command_history (), mark (0) { } |
|
63 |
|
64 ~gnu_history (void) { } |
|
65 |
3504
|
66 void do_add (const std::string&); |
2926
|
67 |
|
68 void do_remove (int); |
1797
|
69 |
2926
|
70 int do_where (void); |
|
71 |
|
72 int do_length (void); |
|
73 |
|
74 int do_max_input_history (void); |
|
75 |
|
76 int do_base (void); |
|
77 |
|
78 int do_current_number (void); |
|
79 |
|
80 void do_stifle (int); |
1797
|
81 |
2926
|
82 int do_unstifle (void); |
|
83 |
|
84 int do_is_stifled (void); |
|
85 |
|
86 void do_set_mark (int); |
1797
|
87 |
4802
|
88 int do_goto_mark (void); |
2926
|
89 |
3504
|
90 void do_read (const std::string&, bool); |
1797
|
91 |
3504
|
92 void do_read_range (const std::string&, int, int, bool); |
1797
|
93 |
3504
|
94 void do_write (const std::string&); |
1797
|
95 |
3504
|
96 void do_append (const std::string&); |
2926
|
97 |
3504
|
98 void do_truncate_file (const std::string&, int); |
2926
|
99 |
|
100 string_vector do_list (int, bool); |
|
101 |
3504
|
102 std::string do_get_entry (int); |
1797
|
103 |
3504
|
104 void do_replace_entry (int, const std::string&); |
2926
|
105 |
3504
|
106 void do_clean_up_and_save (const std::string&, int); |
1797
|
107 |
2926
|
108 private: |
|
109 |
|
110 int mark; |
|
111 }; |
1797
|
112 |
|
113 void |
3504
|
114 gnu_history::do_add (const std::string& s) |
1797
|
115 { |
2926
|
116 if (! do_ignoring_entries ()) |
1797
|
117 { |
2512
|
118 if (s.empty () |
|
119 || (s.length () == 1 && (s[0] == '\r' || s[0] == '\n'))) |
|
120 return; |
|
121 |
3519
|
122 ::octave_add_history (s.c_str ()); |
2926
|
123 |
1797
|
124 lines_this_session++; |
|
125 } |
|
126 } |
|
127 |
|
128 void |
2926
|
129 gnu_history::do_remove (int n) |
1797
|
130 { |
3519
|
131 ::octave_remove_history (n); |
1797
|
132 } |
|
133 |
|
134 int |
2926
|
135 gnu_history::do_where (void) |
1797
|
136 { |
3519
|
137 return ::octave_where_history (); |
1797
|
138 } |
|
139 |
|
140 int |
2926
|
141 gnu_history::do_length (void) |
|
142 { |
3519
|
143 return ::octave_history_length (); |
2926
|
144 } |
|
145 |
|
146 int |
|
147 gnu_history::do_max_input_history (void) |
|
148 { |
3519
|
149 return ::octave_max_input_history (); |
2926
|
150 } |
|
151 |
|
152 int |
|
153 gnu_history::do_base (void) |
1797
|
154 { |
3519
|
155 return ::octave_history_base (); |
1797
|
156 } |
|
157 |
|
158 int |
2926
|
159 gnu_history::do_current_number (void) |
1797
|
160 { |
2926
|
161 return (xsize > 0) ? do_base () + do_where () : -1; |
1797
|
162 } |
|
163 |
|
164 void |
2926
|
165 gnu_history::do_stifle (int n) |
1797
|
166 { |
3519
|
167 ::octave_stifle_history (n); |
1797
|
168 } |
|
169 |
|
170 int |
2926
|
171 gnu_history::do_unstifle (void) |
1797
|
172 { |
3519
|
173 return ::octave_unstifle_history (); |
1797
|
174 } |
|
175 |
|
176 int |
2926
|
177 gnu_history::do_is_stifled (void) |
1797
|
178 { |
3519
|
179 return ::octave_history_is_stifled (); |
1797
|
180 } |
|
181 |
|
182 void |
2926
|
183 gnu_history::do_set_mark (int n) |
2658
|
184 { |
2926
|
185 mark = n; |
2658
|
186 } |
|
187 |
4802
|
188 int |
2926
|
189 gnu_history::do_goto_mark (void) |
|
190 { |
|
191 if (mark) |
|
192 { |
3519
|
193 char *line = ::octave_history_goto_mark (mark); |
2926
|
194 |
3519
|
195 if (line) |
|
196 { |
|
197 command_editor::insert_text (line); |
2926
|
198 |
3519
|
199 command_editor::clear_undo_list (); |
2926
|
200 } |
|
201 } |
|
202 |
|
203 mark = 0; |
|
204 |
5775
|
205 // FIXME -- for operate_and_get_next. |
6913
|
206 command_editor::remove_startup_hook (command_history::goto_mark); |
4802
|
207 |
|
208 return 0; |
2926
|
209 } |
|
210 |
|
211 void |
3504
|
212 gnu_history::do_read (const std::string& f, bool must_exist) |
1797
|
213 { |
|
214 if (! f.empty ()) |
|
215 { |
3519
|
216 int status = ::octave_read_history (f.c_str ()); |
1797
|
217 |
2658
|
218 if (status != 0 && must_exist) |
1797
|
219 error (status); |
|
220 else |
2658
|
221 { |
2926
|
222 lines_in_file = do_where (); |
2658
|
223 |
3519
|
224 ::octave_using_history (); |
2658
|
225 } |
1797
|
226 } |
|
227 else |
2926
|
228 error ("gnu_history::read: missing file name"); |
1797
|
229 } |
|
230 |
2659
|
231 void |
3504
|
232 gnu_history::do_read_range (const std::string& f, int from, int to, |
2926
|
233 bool must_exist) |
1797
|
234 { |
|
235 if (from < 0) |
|
236 from = lines_in_file; |
|
237 |
|
238 if (! f.empty ()) |
|
239 { |
3519
|
240 int status = ::octave_read_history_range (f.c_str (), from, to); |
1797
|
241 |
2658
|
242 if (status != 0 && must_exist) |
1797
|
243 error (status); |
|
244 else |
|
245 { |
2926
|
246 lines_in_file = do_where (); |
2658
|
247 |
3519
|
248 ::octave_using_history (); |
1797
|
249 } |
|
250 } |
|
251 else |
2926
|
252 error ("gnu_history::read_range: missing file name"); |
1797
|
253 } |
|
254 |
|
255 void |
3504
|
256 gnu_history::do_write (const std::string& f_arg) |
1797
|
257 { |
3504
|
258 std::string f = f_arg; |
1797
|
259 |
|
260 if (f.empty ()) |
|
261 f = xfile; |
|
262 |
|
263 if (! f.empty ()) |
|
264 { |
3519
|
265 int status = ::octave_write_history (f.c_str ()); |
1797
|
266 |
|
267 if (status != 0) |
|
268 error (status); |
|
269 } |
|
270 else |
2926
|
271 error ("gnu_history::write: missing file name"); |
1797
|
272 } |
|
273 |
|
274 void |
3504
|
275 gnu_history::do_append (const std::string& f_arg) |
1797
|
276 { |
|
277 if (lines_this_session) |
|
278 { |
2926
|
279 if (lines_this_session < do_where ()) |
1797
|
280 { |
|
281 // Create file if it doesn't already exist. |
|
282 |
3504
|
283 std::string f = f_arg; |
1797
|
284 |
|
285 if (f.empty ()) |
|
286 f = xfile; |
|
287 |
|
288 if (! f.empty ()) |
|
289 { |
|
290 file_stat fs (f); |
|
291 |
|
292 if (! fs) |
|
293 { |
|
294 int tem; |
|
295 |
|
296 tem = open (f.c_str (), O_CREAT, 0666); |
|
297 close (tem); |
|
298 } |
|
299 |
3519
|
300 int status |
|
301 = ::octave_append_history (lines_this_session, f.c_str ()); |
1797
|
302 |
|
303 if (status != 0) |
|
304 error (status); |
|
305 else |
|
306 lines_in_file += lines_this_session; |
|
307 |
|
308 lines_this_session = 0; |
|
309 } |
|
310 else |
2926
|
311 error ("gnu_history::append: missing file name"); |
1797
|
312 } |
|
313 } |
|
314 } |
|
315 |
|
316 void |
3504
|
317 gnu_history::do_truncate_file (const std::string& f_arg, int n) |
1797
|
318 { |
3504
|
319 std::string f = f_arg; |
1797
|
320 |
|
321 if (f.empty ()) |
|
322 f = xfile; |
|
323 |
|
324 if (! f.empty ()) |
3519
|
325 ::octave_history_truncate_file (f.c_str (), n); |
1797
|
326 else |
2926
|
327 error ("gnu_history::truncate_file: missing file name"); |
1797
|
328 } |
|
329 |
|
330 string_vector |
2926
|
331 gnu_history::do_list (int limit, bool number_lines) |
1797
|
332 { |
|
333 string_vector retval; |
|
334 |
|
335 if (limit) |
3519
|
336 retval = ::octave_history_list (limit, number_lines); |
1797
|
337 |
|
338 return retval; |
|
339 } |
|
340 |
3504
|
341 std::string |
2926
|
342 gnu_history::do_get_entry (int n) |
1797
|
343 { |
3504
|
344 std::string retval; |
1797
|
345 |
3519
|
346 char *line = ::octave_history_get (do_base () + n); |
1797
|
347 |
3519
|
348 if (line) |
|
349 retval = line; |
1797
|
350 |
|
351 return retval; |
|
352 } |
|
353 |
|
354 void |
3504
|
355 gnu_history::do_replace_entry (int which, const std::string& line) |
1797
|
356 { |
3519
|
357 ::octave_replace_history_entry (which, line.c_str ()); |
1797
|
358 } |
|
359 |
|
360 void |
3504
|
361 gnu_history::do_clean_up_and_save (const std::string& f_arg, int n) |
1797
|
362 { |
3504
|
363 std::string f = f_arg; |
1797
|
364 |
|
365 if (f.empty ()) |
|
366 f = xfile; |
|
367 |
|
368 if (! f.empty ()) |
|
369 { |
|
370 if (n < 0) |
|
371 n = xsize; |
|
372 |
|
373 stifle (n); |
|
374 |
2926
|
375 do_write (f.c_str ()); |
1797
|
376 } |
|
377 else |
2926
|
378 error ("gnu_history::clean_up_and_save: missing file name"); |
|
379 } |
|
380 |
|
381 #endif |
|
382 |
|
383 bool |
|
384 command_history::instance_ok (void) |
|
385 { |
|
386 bool retval = true; |
|
387 |
|
388 if (! instance) |
|
389 make_command_history (); |
|
390 |
|
391 if (! instance) |
|
392 { |
|
393 (*current_liboctave_error_handler) |
|
394 ("unable to create command history object!"); |
|
395 |
|
396 retval = false; |
|
397 } |
|
398 |
|
399 return retval; |
|
400 } |
|
401 |
|
402 void |
|
403 command_history::make_command_history (void) |
|
404 { |
|
405 #if defined (USE_READLINE) |
|
406 instance = new gnu_history (); |
|
407 #else |
|
408 instance = new command_history (); |
|
409 #endif |
|
410 } |
|
411 |
|
412 void |
5872
|
413 command_history::set_file (const std::string& f_arg) |
2926
|
414 { |
|
415 if (instance_ok ()) |
5872
|
416 { |
|
417 std::string f = file_ops::tilde_expand (f_arg); |
|
418 |
|
419 instance->do_set_file (f); |
|
420 } |
2926
|
421 } |
|
422 |
3504
|
423 std::string |
2926
|
424 command_history::file (void) |
|
425 { |
|
426 return (instance_ok ()) |
3504
|
427 ? instance->do_file () : std::string (); |
2926
|
428 } |
|
429 |
|
430 void |
|
431 command_history::set_size (int n) |
|
432 { |
|
433 if (instance_ok ()) |
|
434 instance->do_set_size (n); |
|
435 } |
|
436 |
|
437 int |
|
438 command_history::size (void) |
|
439 { |
|
440 return (instance_ok ()) |
|
441 ? instance->do_size () : 0; |
|
442 } |
|
443 |
|
444 void |
|
445 command_history::ignore_entries (bool flag) |
|
446 { |
|
447 if (instance_ok ()) |
|
448 instance->do_ignore_entries (flag); |
|
449 } |
|
450 |
|
451 bool |
|
452 command_history::ignoring_entries (void) |
|
453 { |
|
454 return (instance_ok ()) |
|
455 ? instance->do_ignoring_entries () : false; |
|
456 } |
|
457 |
|
458 void |
3504
|
459 command_history::add (const std::string& s) |
2926
|
460 { |
|
461 if (instance_ok ()) |
|
462 instance->do_add (s); |
|
463 } |
|
464 |
|
465 void |
|
466 command_history::remove (int n) |
|
467 { |
|
468 if (instance_ok ()) |
|
469 instance->do_remove (n); |
|
470 } |
|
471 |
|
472 int |
|
473 command_history::where (void) |
|
474 { |
|
475 return (instance_ok ()) |
|
476 ? instance->do_where () : 0; |
|
477 } |
|
478 |
|
479 int |
|
480 command_history::length (void) |
|
481 { |
|
482 return (instance_ok ()) |
|
483 ? instance->do_length () : 0; |
|
484 } |
|
485 |
|
486 int |
|
487 command_history::max_input_history (void) |
|
488 { |
|
489 return (instance_ok ()) |
|
490 ? instance->do_max_input_history () : 0; |
|
491 } |
|
492 |
|
493 int |
|
494 command_history::base (void) |
|
495 { |
|
496 return (instance_ok ()) |
|
497 ? instance->do_base () : 0; |
|
498 } |
|
499 |
|
500 int |
|
501 command_history::current_number (void) |
|
502 { |
|
503 return (instance_ok ()) |
|
504 ? instance->do_current_number () : 0; |
|
505 } |
|
506 |
|
507 void |
|
508 command_history::stifle (int n) |
|
509 { |
|
510 if (instance_ok ()) |
|
511 instance->do_stifle (n); |
|
512 } |
|
513 |
|
514 int |
|
515 command_history::unstifle (void) |
|
516 { |
|
517 return (instance_ok ()) |
|
518 ? instance->do_unstifle () : 0; |
|
519 } |
|
520 |
|
521 int |
|
522 command_history::is_stifled (void) |
|
523 { |
|
524 return (instance_ok ()) |
|
525 ? instance->do_is_stifled () : 0; |
|
526 } |
|
527 |
|
528 void |
|
529 command_history::set_mark (int n) |
|
530 { |
|
531 if (instance_ok ()) |
|
532 instance->do_set_mark (n); |
|
533 } |
|
534 |
4802
|
535 int |
3519
|
536 command_history::goto_mark (void) |
2926
|
537 { |
4802
|
538 return (instance_ok ()) |
|
539 ? instance->do_goto_mark () : 0; |
2926
|
540 } |
|
541 |
|
542 void |
|
543 command_history::read (bool must_exist) |
|
544 { |
3522
|
545 read (file (), must_exist); |
2926
|
546 } |
|
547 |
|
548 void |
3504
|
549 command_history::read (const std::string& f, bool must_exist) |
2926
|
550 { |
|
551 if (instance_ok ()) |
|
552 instance->do_read (f, must_exist); |
|
553 } |
|
554 |
|
555 void |
|
556 command_history::read_range (int from, int to, bool must_exist) |
|
557 { |
3522
|
558 read_range (file (), from, to, must_exist); |
2926
|
559 } |
|
560 |
|
561 void |
3504
|
562 command_history::read_range (const std::string& f, int from, int to, |
2926
|
563 bool must_exist) |
|
564 { |
|
565 if (instance_ok ()) |
|
566 instance->do_read_range (f, from, to, must_exist); |
|
567 } |
|
568 |
|
569 void |
3504
|
570 command_history::write (const std::string& f) |
2926
|
571 { |
|
572 if (instance_ok ()) |
|
573 instance->do_write (f); |
|
574 } |
|
575 |
|
576 void |
3504
|
577 command_history::append (const std::string& f) |
2926
|
578 { |
|
579 if (instance_ok ()) |
|
580 instance->do_append (f); |
|
581 } |
|
582 |
|
583 void |
3504
|
584 command_history::truncate_file (const std::string& f, int n) |
2926
|
585 { |
|
586 if (instance_ok ()) |
|
587 instance->do_truncate_file (f, n); |
|
588 } |
|
589 |
|
590 string_vector |
|
591 command_history::list (int limit, bool number_lines) |
|
592 { |
|
593 return (instance_ok ()) |
|
594 ? instance->do_list (limit, number_lines) : string_vector (); |
|
595 } |
|
596 |
3504
|
597 std::string |
2926
|
598 command_history::get_entry (int n) |
|
599 { |
|
600 return (instance_ok ()) |
3504
|
601 ? instance->do_get_entry (n) : std::string (); |
2926
|
602 } |
|
603 |
|
604 void |
3504
|
605 command_history::replace_entry (int which, const std::string& line) |
2926
|
606 { |
|
607 if (instance_ok ()) |
|
608 instance->do_replace_entry (which, line); |
|
609 } |
|
610 |
|
611 void |
3504
|
612 command_history::clean_up_and_save (const std::string& f, int n) |
2926
|
613 { |
|
614 if (instance_ok ()) |
|
615 instance->do_clean_up_and_save (f, n); |
|
616 } |
|
617 |
|
618 void |
3504
|
619 command_history::do_set_file (const std::string& f) |
2926
|
620 { |
|
621 xfile = f; |
|
622 } |
|
623 |
3504
|
624 std::string |
2926
|
625 command_history::do_file (void) |
|
626 { |
|
627 return xfile; |
|
628 } |
|
629 |
|
630 void |
|
631 command_history::do_set_size (int n) |
|
632 { |
|
633 xsize = n; |
|
634 } |
|
635 |
|
636 int |
|
637 command_history::do_size (void) |
|
638 { |
|
639 return xsize; |
|
640 } |
|
641 |
|
642 void |
|
643 command_history::do_ignore_entries (bool flag) |
|
644 { |
|
645 ignoring_additions = flag; |
|
646 } |
|
647 |
|
648 bool |
|
649 command_history::do_ignoring_entries (void) |
|
650 { |
|
651 return ignoring_additions; |
|
652 } |
|
653 |
|
654 void |
3504
|
655 command_history::do_add (const std::string&) |
2926
|
656 { |
|
657 } |
|
658 |
|
659 void |
|
660 command_history::do_remove (int) |
|
661 { |
|
662 } |
|
663 |
|
664 int |
|
665 command_history::do_where (void) |
|
666 { |
|
667 return 0; |
|
668 } |
|
669 |
|
670 int |
|
671 command_history::do_length (void) |
|
672 { |
|
673 return 0; |
|
674 } |
|
675 |
|
676 int |
|
677 command_history::do_max_input_history (void) |
|
678 { |
|
679 return 0; |
|
680 } |
|
681 |
|
682 int |
|
683 command_history::do_base (void) |
|
684 { |
|
685 return 0; |
|
686 } |
|
687 |
|
688 int |
|
689 command_history::do_current_number (void) |
|
690 { |
|
691 return (xsize > 0) ? do_base () + do_where () : -1; |
|
692 } |
|
693 |
|
694 void |
|
695 command_history::do_stifle (int) |
|
696 { |
|
697 } |
|
698 |
|
699 int |
|
700 command_history::do_unstifle (void) |
|
701 { |
|
702 return -1; |
|
703 } |
|
704 |
|
705 int |
|
706 command_history::do_is_stifled (void) |
|
707 { |
|
708 return 0; |
|
709 } |
|
710 |
|
711 void |
|
712 command_history::do_set_mark (int) |
|
713 { |
|
714 } |
|
715 |
4802
|
716 int |
2926
|
717 command_history::do_goto_mark (void) |
|
718 { |
4802
|
719 return 0; |
2926
|
720 } |
|
721 |
|
722 void |
3504
|
723 command_history::do_read (const std::string& f, bool) |
2926
|
724 { |
|
725 if (f.empty ()) |
|
726 error ("command_history::read: missing file name"); |
|
727 } |
|
728 |
|
729 void |
3504
|
730 command_history::do_read_range (const std::string& f, int, int, bool) |
2926
|
731 { |
|
732 if (f.empty ()) |
|
733 error ("command_history::read_range: missing file name"); |
|
734 } |
|
735 |
|
736 void |
3504
|
737 command_history::do_write (const std::string& f_arg) |
2926
|
738 { |
3504
|
739 std::string f = f_arg; |
2926
|
740 |
|
741 if (f.empty ()) |
|
742 f = xfile; |
|
743 |
|
744 if (f.empty ()) |
|
745 error ("command_history::write: missing file name"); |
|
746 } |
|
747 |
|
748 void |
3504
|
749 command_history::do_append (const std::string& f_arg) |
2926
|
750 { |
|
751 if (lines_this_session) |
|
752 { |
|
753 if (lines_this_session < do_where ()) |
|
754 { |
|
755 // Create file if it doesn't already exist. |
|
756 |
3504
|
757 std::string f = f_arg; |
2926
|
758 |
|
759 if (f.empty ()) |
|
760 f = xfile; |
|
761 |
|
762 if (f.empty ()) |
|
763 error ("command_history::append: missing file name"); |
|
764 } |
|
765 } |
|
766 } |
|
767 |
|
768 void |
3504
|
769 command_history::do_truncate_file (const std::string& f_arg, int) |
2926
|
770 { |
3504
|
771 std::string f = f_arg; |
2926
|
772 |
|
773 if (f.empty ()) |
|
774 f = xfile; |
|
775 |
|
776 if (f.empty ()) |
|
777 error ("command_history::truncate_file: missing file name"); |
|
778 } |
|
779 |
|
780 string_vector |
|
781 command_history::do_list (int, bool) |
|
782 { |
|
783 return string_vector (); |
|
784 } |
|
785 |
3504
|
786 std::string |
2926
|
787 command_history::do_get_entry (int) |
|
788 { |
3504
|
789 return std::string (); |
2926
|
790 } |
|
791 |
|
792 void |
3504
|
793 command_history::do_replace_entry (int, const std::string&) |
2926
|
794 { |
|
795 } |
|
796 |
|
797 void |
3504
|
798 command_history::do_clean_up_and_save (const std::string& f_arg, int) |
2926
|
799 { |
3504
|
800 std::string f = f_arg; |
2926
|
801 |
|
802 if (f.empty ()) |
|
803 f = xfile; |
|
804 |
|
805 if (f.empty ()) |
1797
|
806 error ("command_history::clean_up_and_save: missing file name"); |
|
807 } |
|
808 |
|
809 void |
2470
|
810 command_history::error (int err_num) |
1797
|
811 { |
2470
|
812 (*current_liboctave_error_handler) ("%s", strerror (err_num)); |
1797
|
813 } |
|
814 |
|
815 void |
3504
|
816 command_history::error (const std::string& s) |
1797
|
817 { |
|
818 (*current_liboctave_error_handler) ("%s", s.c_str ()); |
|
819 } |