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