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