1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
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 |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
20 |
|
21 */ |
|
22 |
240
|
23 #ifdef HAVE_CONFIG_H |
1192
|
24 #include <config.h> |
1
|
25 #endif |
|
26 |
1346
|
27 #include <cfloat> |
3124
|
28 #include <cmath> |
1343
|
29 #include <cstddef> |
1346
|
30 #include <cstdio> |
1343
|
31 #include <cstdlib> |
|
32 #include <cstring> |
|
33 |
3503
|
34 #include <iostream> |
1728
|
35 #include <string> |
|
36 |
1350
|
37 #ifdef HAVE_UNISTD_H |
2442
|
38 #ifdef HAVE_SYS_TYPES_H |
529
|
39 #include <sys/types.h> |
2442
|
40 #endif |
529
|
41 #include <unistd.h> |
|
42 #endif |
1
|
43 |
1430
|
44 #if defined (HAVE_TERMIOS_H) |
|
45 #include <termios.h> |
|
46 #elif defined (HAVE_TERMIO_H) |
|
47 #include <termio.h> |
|
48 #elif defined (HAVE_SGTTY_H) |
|
49 #include <sgtty.h> |
4067
|
50 #endif |
|
51 |
|
52 #if defined (HAVE_CONIO_H) |
|
53 #include <conio.h> |
1430
|
54 #endif |
|
55 |
3248
|
56 #if defined (HAVE_SYS_IOCTL_H) |
|
57 #include <sys/ioctl.h> |
|
58 #endif |
|
59 |
1463
|
60 #if defined (HAVE_FLOATINGPOINT_H) |
|
61 #include <floatingpoint.h> |
|
62 #endif |
|
63 |
2508
|
64 #if defined (HAVE_IEEEFP_H) |
|
65 #include <ieeefp.h> |
|
66 #endif |
|
67 |
1463
|
68 #if !defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H) |
|
69 #include <sys/utsname.h> |
|
70 #endif |
|
71 |
2926
|
72 #include "cmd-edit.h" |
|
73 #include "file-ops.h" |
2893
|
74 #include "lo-mappers.h" |
2317
|
75 #include "mach-info.h" |
2926
|
76 #include "oct-env.h" |
1769
|
77 |
1352
|
78 #include "defun.h" |
|
79 #include "error.h" |
529
|
80 #include "input.h" |
1755
|
81 #include "oct-obj.h" |
2370
|
82 #include "ov.h" |
3234
|
83 #include "pager.h" |
1352
|
84 #include "sysdep.h" |
1755
|
85 #include "toplev.h" |
529
|
86 #include "utils.h" |
|
87 |
|
88 #ifndef STDIN_FILENO |
|
89 #define STDIN_FILENO 1 |
|
90 #endif |
444
|
91 |
2508
|
92 #if defined (__386BSD__) || defined (__FreeBSD__) |
|
93 static void |
|
94 BSD_init (void) |
|
95 { |
|
96 #if defined (HAVE_FLOATINGPOINT_H) |
|
97 // Disable trapping on common exceptions. |
4164
|
98 #ifndef FP_X_DNML |
|
99 #define FP_X_DNML 0 |
|
100 #endif |
2508
|
101 fpsetmask (~(FP_X_OFL|FP_X_INV|FP_X_DZ|FP_X_DNML|FP_X_UFL|FP_X_IMP)); |
|
102 #endif |
|
103 } |
|
104 #endif |
|
105 |
4091
|
106 #if defined (__CYGWIN__) |
|
107 |
|
108 #include <limits.h> |
|
109 #include <sys/cygwin.h> |
|
110 |
|
111 static void |
|
112 CYGWIN_init (void) |
|
113 { |
|
114 std::string tmpdir = octave_env::getenv ("TMPDIR"); |
|
115 |
|
116 if (tmpdir.empty ()) |
|
117 { |
|
118 char buf [PATH_MAX]; |
|
119 |
|
120 cygwin32_conv_to_win32_path ("/tmp", buf); |
|
121 |
|
122 octave_env::putenv ("TMPDIR", buf); |
|
123 } |
|
124 } |
|
125 #endif |
|
126 |
4284
|
127 #if defined (__DECCXX) |
|
128 |
|
129 // These don't seem to be instantiated automatically... |
|
130 |
|
131 template std::istream& |
|
132 std::operator >> (std::istream&, std::complex<double>&); |
|
133 |
|
134 template std::string& |
|
135 std::string::append (const std::string&, size_t, size_t); |
|
136 |
|
137 #endif |
|
138 |
2610
|
139 #if defined (NeXT) |
1
|
140 extern "C" |
|
141 { |
|
142 typedef void (*_cplus_fcn_int) (int); |
|
143 extern void (*malloc_error (_cplus_fcn_int)) (int); |
|
144 } |
|
145 |
|
146 static void |
|
147 malloc_handler (int code) |
|
148 { |
|
149 if (code == 5) |
217
|
150 warning ("hopefully recoverable malloc error: freeing wild pointer"); |
1
|
151 else |
2926
|
152 panic ("probably irrecoverable malloc error: code %d", code); |
1
|
153 } |
|
154 |
|
155 static void |
|
156 NeXT_init (void) |
|
157 { |
|
158 malloc_error (malloc_handler); |
|
159 } |
3333
|
160 #endif |
1
|
161 |
2546
|
162 #if defined (__EMX__) |
|
163 OS2_init (void) |
|
164 { |
|
165 _control87 ((EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW |
|
166 | EM_UNDERFLOW | EM_INEXACT), MCW_EM); |
|
167 } |
|
168 #endif |
|
169 |
2508
|
170 #if defined (SCO) |
|
171 static void |
|
172 SCO_init (void) |
|
173 { |
|
174 #if defined (HAVE_IEEEFP_H) |
|
175 // Disable trapping on common exceptions. |
|
176 fpsetmask (~(FP_X_OFL|FP_X_INV|FP_X_DZ|FP_X_DNML|FP_X_UFL|FP_X_IMP)); |
|
177 #endif |
|
178 } |
|
179 #endif |
|
180 |
1
|
181 void |
|
182 sysdep_init (void) |
|
183 { |
959
|
184 #if defined (__386BSD__) || defined (__FreeBSD__) |
2508
|
185 BSD_init (); |
4091
|
186 #elif defined (__CYGWIN__) |
|
187 CYGWIN_init (); |
2610
|
188 #elif defined (NeXT) |
1
|
189 NeXT_init (); |
2610
|
190 #elif defined (__EMX__) |
2546
|
191 OS2_init (); |
2508
|
192 #elif defined (SCO) |
|
193 SCO_init (); |
1
|
194 #endif |
444
|
195 |
|
196 octave_ieee_init (); |
1
|
197 } |
|
198 |
767
|
199 // Set terminal in raw mode. From less-177. |
|
200 // |
|
201 // Change terminal to "raw mode", or restore to "normal" mode. |
|
202 // "Raw mode" means |
|
203 // 1. An outstanding read will complete on receipt of a single keystroke. |
|
204 // 2. Input is not echoed. |
|
205 // 3. On output, \n is mapped to \r\n. |
|
206 // 4. \t is NOT expanded into spaces. |
|
207 // 5. Signal-causing characters such as ctrl-C (interrupt), |
|
208 // etc. are NOT disabled. |
|
209 // It doesn't matter whether an input \n is mapped to \r, or vice versa. |
|
210 |
529
|
211 void |
3657
|
212 raw_mode (bool on, bool wait) |
529
|
213 { |
3657
|
214 static bool curr_on = false; |
529
|
215 |
|
216 int tty_fd = STDIN_FILENO; |
|
217 if (! isatty (tty_fd)) |
|
218 { |
|
219 if (interactive) |
|
220 error ("stdin is not a tty!"); |
|
221 return; |
|
222 } |
|
223 |
|
224 if (on == curr_on) |
|
225 return; |
|
226 |
|
227 #if defined (HAVE_TERMIOS_H) |
|
228 { |
|
229 struct termios s; |
|
230 static struct termios save_term; |
|
231 |
|
232 if (on) |
|
233 { |
1358
|
234 // Get terminal modes. |
529
|
235 |
|
236 tcgetattr (tty_fd, &s); |
|
237 |
1358
|
238 // Save modes and set certain variables dependent on modes. |
529
|
239 |
|
240 save_term = s; |
|
241 // ospeed = s.c_cflag & CBAUD; |
|
242 // erase_char = s.c_cc[VERASE]; |
|
243 // kill_char = s.c_cc[VKILL]; |
|
244 |
1358
|
245 // Set the modes to the way we want them. |
529
|
246 |
|
247 s.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL); |
|
248 s.c_oflag |= (OPOST|ONLCR); |
|
249 #if defined (OCRNL) |
|
250 s.c_oflag &= ~(OCRNL); |
|
251 #endif |
|
252 #if defined (ONOCR) |
|
253 s.c_oflag &= ~(ONOCR); |
|
254 #endif |
|
255 #if defined (ONLRET) |
|
256 s.c_oflag &= ~(ONLRET); |
|
257 #endif |
3658
|
258 s.c_cc[VMIN] = wait ? 1 : 0; |
529
|
259 s.c_cc[VTIME] = 0; |
|
260 } |
|
261 else |
|
262 { |
1358
|
263 // Restore saved modes. |
|
264 |
529
|
265 s = save_term; |
|
266 } |
3658
|
267 |
529
|
268 tcsetattr (tty_fd, TCSAFLUSH, &s); |
|
269 } |
|
270 #elif defined (HAVE_TERMIO_H) |
|
271 { |
|
272 struct termio s; |
|
273 static struct termio save_term; |
|
274 |
|
275 if (on) |
|
276 { |
1358
|
277 // Get terminal modes. |
529
|
278 |
|
279 ioctl (tty_fd, TCGETA, &s); |
|
280 |
1358
|
281 // Save modes and set certain variables dependent on modes. |
529
|
282 |
|
283 save_term = s; |
|
284 // ospeed = s.c_cflag & CBAUD; |
|
285 // erase_char = s.c_cc[VERASE]; |
|
286 // kill_char = s.c_cc[VKILL]; |
|
287 |
1358
|
288 // Set the modes to the way we want them. |
529
|
289 |
|
290 s.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL); |
|
291 s.c_oflag |= (OPOST|ONLCR); |
|
292 #if defined (OCRNL) |
|
293 s.c_oflag &= ~(OCRNL); |
|
294 #endif |
|
295 #if defined (ONOCR) |
|
296 s.c_oflag &= ~(ONOCR); |
|
297 #endif |
|
298 #if defined (ONLRET) |
|
299 s.c_oflag &= ~(ONLRET); |
|
300 #endif |
3658
|
301 s.c_cc[VMIN] = wait ? 1 : 0; |
529
|
302 } |
|
303 else |
|
304 { |
1358
|
305 // Restore saved modes. |
|
306 |
529
|
307 s = save_term; |
|
308 } |
3658
|
309 |
529
|
310 ioctl (tty_fd, TCSETAW, &s); |
|
311 } |
|
312 #elif defined (HAVE_SGTTY_H) |
|
313 { |
|
314 struct sgttyb s; |
|
315 static struct sgttyb save_term; |
|
316 |
|
317 if (on) |
|
318 { |
1358
|
319 // Get terminal modes. |
529
|
320 |
|
321 ioctl (tty_fd, TIOCGETP, &s); |
|
322 |
1358
|
323 // Save modes and set certain variables dependent on modes. |
529
|
324 |
|
325 save_term = s; |
|
326 // ospeed = s.sg_ospeed; |
|
327 // erase_char = s.sg_erase; |
|
328 // kill_char = s.sg_kill; |
|
329 |
1358
|
330 // Set the modes to the way we want them. |
529
|
331 |
|
332 s.sg_flags |= CBREAK; |
|
333 s.sg_flags &= ~(ECHO); |
|
334 } |
|
335 else |
|
336 { |
1358
|
337 // Restore saved modes. |
|
338 |
529
|
339 s = save_term; |
|
340 } |
3658
|
341 |
529
|
342 ioctl (tty_fd, TIOCSETN, &s); |
|
343 } |
|
344 #else |
4064
|
345 warning ("no support for raw mode console I/O on this system"); |
|
346 |
|
347 // Make sure the current mode doesn't toggle. |
|
348 on = curr_on; |
529
|
349 #endif |
|
350 |
|
351 curr_on = on; |
|
352 } |
|
353 |
767
|
354 // Read one character from the terminal. |
|
355 |
529
|
356 int |
4067
|
357 octave_kbhit (bool wait) |
529
|
358 { |
4067
|
359 #ifdef HAVE__KBHIT |
4081
|
360 int c = (! wait && ! _kbhit ()) ? 0 : std::cin.get (); |
4067
|
361 #else |
3658
|
362 raw_mode (true, wait); |
|
363 |
|
364 int c = std::cin.get (); |
|
365 |
|
366 if (std::cin.fail () || std::cin.eof ()) |
|
367 std::cin.clear (); |
|
368 |
|
369 raw_mode (false, true); |
4067
|
370 #endif |
3658
|
371 |
529
|
372 return c; |
|
373 } |
|
374 |
1957
|
375 DEFUN (clc, , , |
3332
|
376 "-*- texinfo -*-\n\ |
|
377 @deftypefn {Built-in Function} {} clc ()\n\ |
|
378 @deftypefnx {Built-in Function} {} home ()\n\ |
|
379 Clear the terminal screen and move the cursor to the upper left corner.\n\ |
3333
|
380 @end deftypefn") |
529
|
381 { |
2926
|
382 command_editor::clear_screen (); |
529
|
383 |
2926
|
384 return octave_value_list (); |
529
|
385 } |
|
386 |
549
|
387 DEFALIAS (home, clc); |
|
388 |
1957
|
389 DEFUN (getenv, args, , |
3301
|
390 "-*- texinfo -*-\n\ |
|
391 @deftypefn {Built-in Function} {} getenv (@var{var})\n\ |
|
392 Return the value of the environment variable @var{var}. For example,\n\ |
|
393 \n\ |
|
394 @example\n\ |
|
395 getenv (\"PATH\")\n\ |
|
396 @end example\n\ |
|
397 \n\ |
|
398 @noindent\n\ |
|
399 returns a string containing the value of your path.\n\ |
|
400 @end deftypefn") |
529
|
401 { |
4233
|
402 octave_value retval; |
529
|
403 |
|
404 int nargin = args.length (); |
|
405 |
712
|
406 if (nargin == 1) |
529
|
407 { |
3523
|
408 std::string name = args(0).string_value (); |
636
|
409 |
|
410 if (! error_state) |
2926
|
411 retval = octave_env::getenv (name); |
529
|
412 } |
|
413 else |
|
414 print_usage ("getenv"); |
|
415 |
|
416 return retval; |
|
417 } |
|
418 |
1957
|
419 DEFUN (putenv, args, , |
3301
|
420 "-*- texinfo -*-\n\ |
|
421 @deftypefn {Built-in Function} {} putenv (@var{var}, @var{value})\n\ |
|
422 Set the value of the environment variable @var{var} to @var{value}.\n\ |
|
423 @end deftypefn") |
1706
|
424 { |
2086
|
425 octave_value_list retval; |
1706
|
426 |
|
427 int nargin = args.length (); |
|
428 |
|
429 if (nargin == 2) |
|
430 { |
3523
|
431 std::string var = args(0).string_value (); |
1706
|
432 |
|
433 if (! error_state) |
|
434 { |
3523
|
435 std::string val = args(1).string_value (); |
1706
|
436 |
|
437 if (! error_state) |
2926
|
438 octave_env::putenv (var, val); |
1706
|
439 else |
|
440 error ("putenv: second argument should be a string"); |
|
441 } |
|
442 else |
|
443 error ("putenv: first argument should be a string"); |
|
444 } |
|
445 else |
|
446 print_usage ("putenv"); |
|
447 |
|
448 return retval; |
|
449 } |
|
450 |
3372
|
451 // XXX FIXME XXX -- perhaps kbhit should also be able to print a prompt? |
|
452 |
3657
|
453 DEFUN (kbhit, args, , |
3372
|
454 "-*- texinfo -*-\n\ |
|
455 @deftypefn {Built-in Function} {} kbhit ()\n\ |
3657
|
456 Read a single keystroke from the keyboard. If called with one\n\ |
|
457 argument, don't wait for a keypress. For example,\n\ |
3372
|
458 \n\ |
|
459 @example\n\ |
|
460 x = kbhit ();\n\ |
|
461 @end example\n\ |
|
462 \n\ |
|
463 @noindent\n\ |
|
464 will set @var{x} to the next character typed at the keyboard as soon as\n\ |
|
465 it is typed.\n\ |
3657
|
466 \n\ |
|
467 @example\n\ |
|
468 x = kbhit (1);\n\ |
|
469 @end example\n\ |
|
470 \n\ |
|
471 @noindent\n\ |
|
472 identical to the above example, but don't wait for a keypress,\n\ |
|
473 returning the empty string if no key is available.\n\ |
3372
|
474 @end deftypefn") |
529
|
475 { |
4233
|
476 octave_value retval; |
529
|
477 |
1358
|
478 // XXX FIXME XXX -- add timeout and default value args? |
529
|
479 |
3676
|
480 if (interactive || forced_interactive) |
529
|
481 { |
4067
|
482 int c = octave_kbhit (args.length () == 0); |
3657
|
483 |
3658
|
484 if (c == -1) |
|
485 c = 0; |
3657
|
486 |
529
|
487 char *s = new char [2]; |
|
488 s[0] = c; |
|
489 s[1] = '\0'; |
|
490 retval = s; |
|
491 } |
|
492 |
|
493 return retval; |
|
494 } |
|
495 |
1957
|
496 DEFUN (pause, args, , |
3301
|
497 "-*- texinfo -*-\n\ |
|
498 @deftypefn {Built-in Function} {} pause (@var{seconds})\n\ |
|
499 Suspend the execution of the program. If invoked without any arguments,\n\ |
|
500 Octave waits until you type a character. With a numeric argument, it\n\ |
|
501 pauses for the given number of seconds. For example, the following\n\ |
|
502 statement prints a message and then waits 5 seconds before clearing the\n\ |
|
503 screen.\n\ |
|
504 \n\ |
|
505 @example\n\ |
|
506 @group\n\ |
|
507 fprintf (stderr, \"wait please...\n\");\n\ |
|
508 pause (5);\n\ |
|
509 clc;\n\ |
|
510 @end group\n\ |
|
511 @end example\n\ |
|
512 @end deftypefn") |
529
|
513 { |
2086
|
514 octave_value_list retval; |
529
|
515 |
|
516 int nargin = args.length (); |
|
517 |
712
|
518 if (! (nargin == 0 || nargin == 1)) |
529
|
519 { |
|
520 print_usage ("pause"); |
|
521 return retval; |
|
522 } |
|
523 |
1579
|
524 if (nargin == 1) |
529
|
525 { |
1579
|
526 double dval = args(0).double_value (); |
636
|
527 |
1579
|
528 if (! error_state) |
|
529 { |
|
530 if (xisnan (dval)) |
|
531 warning ("pause: NaN is an invalid delay"); |
2630
|
532 else if (xisinf (dval)) |
3234
|
533 { |
|
534 flush_octave_stdout (); |
4067
|
535 octave_kbhit (); |
3234
|
536 } |
1579
|
537 else |
4086
|
538 octave_sleep (dval); |
529
|
539 } |
|
540 } |
1579
|
541 else |
3234
|
542 { |
|
543 flush_octave_stdout (); |
4067
|
544 octave_kbhit (); |
3234
|
545 } |
2630
|
546 |
|
547 return retval; |
|
548 } |
|
549 |
|
550 DEFUN (sleep, args, , |
3301
|
551 "-*- texinfo -*-\n\ |
|
552 @deftypefn {Built-in Function} {} sleep (@var{seconds})\n\ |
|
553 Suspend the execution of the program for the given number of seconds.\n\ |
|
554 @end deftypefn") |
2630
|
555 { |
|
556 octave_value_list retval; |
|
557 |
|
558 if (args.length () == 1) |
1579
|
559 { |
2630
|
560 double dval = args(0).double_value (); |
|
561 |
|
562 if (! error_state) |
|
563 { |
|
564 if (xisnan (dval)) |
|
565 warning ("sleep: NaN is an invalid delay"); |
|
566 else |
4086
|
567 octave_sleep (dval); |
2630
|
568 } |
1579
|
569 } |
2630
|
570 else |
|
571 print_usage ("sleep"); |
|
572 |
|
573 return retval; |
|
574 } |
|
575 |
|
576 DEFUN (usleep, args, , |
3301
|
577 "-*- texinfo -*-\n\ |
|
578 @deftypefn {Built-in Function} {} usleep (@var{microseconds})\n\ |
|
579 Suspend the execution of the program for the given number of\n\ |
|
580 microseconds. On systems where it is not possible to sleep for periods\n\ |
|
581 of time less than one second, @code{usleep} will pause the execution for\n\ |
|
582 @code{round (@var{microseconds} / 1e6)} seconds.\n\ |
|
583 @end deftypefn") |
2630
|
584 { |
|
585 octave_value_list retval; |
|
586 |
|
587 if (args.length () == 1) |
|
588 { |
|
589 double dval = args(0).double_value (); |
|
590 |
|
591 if (! error_state) |
|
592 { |
|
593 if (xisnan (dval)) |
|
594 warning ("usleep: NaN is an invalid delay"); |
|
595 else |
|
596 { |
|
597 int delay = NINT (dval); |
2631
|
598 |
2630
|
599 if (delay > 0) |
3308
|
600 octave_usleep (delay); |
2630
|
601 } |
|
602 } |
|
603 } |
|
604 else |
|
605 print_usage ("usleep"); |
529
|
606 |
|
607 return retval; |
|
608 } |
|
609 |
862
|
610 // XXX FIXME XXX -- maybe this should only return 1 if IEEE floating |
|
611 // point functions really work. |
|
612 |
1957
|
613 DEFUN (isieee, , , |
3301
|
614 "-*- texinfo -*-\n\ |
|
615 @deftypefn {Built-in Function} {} isieee ()\n\ |
|
616 Return 1 if your computer claims to conform to the IEEE standard for\n\ |
|
617 floating point calculations.\n\ |
|
618 @end deftypefn") |
862
|
619 { |
2317
|
620 oct_mach_info::float_format flt_fmt = |
|
621 oct_mach_info::native_float_format (); |
|
622 |
4233
|
623 return octave_value (flt_fmt == oct_mach_info::ieee_little_endian |
|
624 || flt_fmt == oct_mach_info::ieee_big_endian); |
862
|
625 } |
|
626 |
1957
|
627 DEFUN (tilde_expand, args, , |
3301
|
628 "-*- texinfo -*-\n\ |
|
629 @deftypefn {Built-in Function} {} tilde_expand (@var{string})\n\ |
|
630 Performs tilde expansion on @var{string}. If @var{string} begins with a\n\ |
|
631 tilde character, (@samp{~}), all of the characters preceding the first\n\ |
|
632 slash (or all characters, if there is no slash) are treated as a\n\ |
|
633 possible user name, and the tilde and the following characters up to the\n\ |
|
634 slash are replaced by the home directory of the named user. If the\n\ |
|
635 tilde is followed immediately by a slash, the tilde is replaced by the\n\ |
|
636 home directory of the user running Octave. For example,\n\ |
|
637 \n\ |
|
638 @example\n\ |
|
639 @group\n\ |
|
640 tilde_expand (\"~joeuser/bin\")\n\ |
|
641 @result{} \"/home/joeuser/bin\"\n\ |
|
642 tilde_expand (\"~/bin\")\n\ |
|
643 @result{} \"/home/jwe/bin\"\n\ |
|
644 @end group\n\ |
|
645 @end example\n\ |
|
646 @end deftypefn") |
1750
|
647 { |
4233
|
648 octave_value retval; |
1750
|
649 |
|
650 int nargin = args.length (); |
|
651 |
|
652 if (nargin == 1) |
2926
|
653 retval = file_ops::tilde_expand (args(0).all_strings ()); |
1750
|
654 else |
|
655 print_usage ("tilde_expand"); |
|
656 |
|
657 return retval; |
|
658 } |
|
659 |
2552
|
660 #if defined (__EMX__) && defined (OS2) |
|
661 |
4208
|
662 DEFCMD (extproc, , , |
2926
|
663 "extproc: ignored by Octave") |
2552
|
664 { |
|
665 return octave_value_list (); |
|
666 } |
|
667 |
|
668 DEFALIAS (EXTPROC, extproc); |
|
669 |
|
670 #endif |
|
671 |
529
|
672 /* |
1
|
673 ;;; Local Variables: *** |
|
674 ;;; mode: C++ *** |
|
675 ;;; End: *** |
|
676 */ |