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