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 |
|
23 // Born February 20, 1992. |
|
24 |
240
|
25 #ifdef HAVE_CONFIG_H |
1192
|
26 #include <config.h> |
1
|
27 #endif |
|
28 |
1355
|
29 #include <cassert> |
|
30 #include <csignal> |
|
31 #include <cstdlib> |
|
32 #include <cstring> |
|
33 #include <ctime> |
|
34 |
|
35 #include <fstream.h> |
|
36 #include <iostream.h> |
|
37 #include <strstream.h> |
|
38 |
|
39 #ifdef HAVE_UNISTD_H |
2442
|
40 #ifdef HAVE_SYS_TYPES_H |
1
|
41 #include <sys/types.h> |
2442
|
42 #endif |
139
|
43 #include <unistd.h> |
|
44 #endif |
1355
|
45 |
2926
|
46 #include "cmd-edit.h" |
|
47 #include "file-stat.h" |
240
|
48 #include "lo-error.h" |
2926
|
49 #include "oct-env.h" |
1907
|
50 #include "str-vec.h" |
223
|
51 |
2492
|
52 #include <defaults.h> |
1355
|
53 #include "defun.h" |
703
|
54 #include "dynamic-ld.h" |
1355
|
55 #include "error.h" |
|
56 #include "file-io.h" |
|
57 #include "help.h" |
1
|
58 #include "input.h" |
|
59 #include "lex.h" |
1742
|
60 #include "oct-hist.h" |
2375
|
61 #include "ops.h" |
1670
|
62 #include "toplev.h" |
1
|
63 #include "parse.h" |
1355
|
64 #include "pathsearch.h" |
562
|
65 #include "procstream.h" |
1817
|
66 #include "prog-args.h" |
1355
|
67 #include "sighandlers.h" |
|
68 #include "sysdep.h" |
2375
|
69 #include "ov.h" |
1742
|
70 #include "pt-misc.h" |
|
71 #include "pt-plot.h" |
1
|
72 #include "unwind-prot.h" |
1355
|
73 #include "utils.h" |
|
74 #include "variables.h" |
2492
|
75 #include <version.h> |
1
|
76 |
2910
|
77 extern void install_builtins (void); |
|
78 |
1704
|
79 #if !defined (HAVE_ATEXIT) && defined (HAVE_ON_EXIT) |
|
80 extern "C" int on_exit (); |
|
81 #define atexit on_exit |
|
82 #endif |
|
83 |
1792
|
84 // Don't redefine the variables if glibc already has. |
2775
|
85 #if defined (HAVE_PROGRAM_INVOCATION_NAME) || defined (WITH_KPATHSEARCH) |
2470
|
86 extern char *program_invocation_name; |
|
87 extern char *program_invocation_short_name; |
|
88 #else |
1792
|
89 char *program_invocation_name; |
|
90 char *program_invocation_short_name; |
|
91 #endif |
|
92 |
1907
|
93 // The command-line options. |
|
94 static string_vector octave_argv; |
1
|
95 |
2239
|
96 // TRUE means we read ~/.octaverc and ./.octaverc. |
|
97 // (--norc; --no-init-file; -f) |
|
98 static bool read_init_files = true; |
|
99 |
|
100 // TRUE means we read the site-wide octaverc files. |
|
101 // (--norc; --no-site-file; -f) |
2240
|
102 static bool read_site_files = true; |
1
|
103 |
1358
|
104 // Nonzero means we don't print the usual startup message. |
616
|
105 // (--quiet; --silent; -q) |
2239
|
106 static bool inhibit_startup_message = false; |
1
|
107 |
1410
|
108 // Nonzero means we turn on compatibility options. |
|
109 // (--traditional) |
2239
|
110 static bool traditional = false; |
1410
|
111 |
1825
|
112 // If nonzero, print verbose info in some cases. |
|
113 // (--verbose; -V) |
2239
|
114 static bool verbose_flag = false; |
1825
|
115 |
1
|
116 // Usage message |
139
|
117 static const char *usage_string = |
1613
|
118 "octave [-?Vdfhiqvx] [--debug] [--echo-commands] [--exec-path path]\n\ |
2239
|
119 [--help] [--info-file file] [--info-program prog] [--interactive]\n\ |
|
120 [--no-init-file] [--no-line-editing] [--no-site-file] [-p path]\n\ |
|
121 [--path path] [--silent] [--traditional] [--verbose] [--version] [file]"; |
1
|
122 |
1358
|
123 // This is here so that it's more likely that the usage message and |
1410
|
124 // the real set of options will agree. Note: the `+' must come first |
|
125 // to prevent getopt from permuting arguments! |
|
126 static const char *short_opts = "+?Vdfhip:qvx"; |
139
|
127 |
1103
|
128 // Long options. See the comments in getopt.h for the meanings of the |
|
129 // fields in this structure. |
1613
|
130 #define EXEC_PATH_OPTION 1 |
|
131 #define INFO_FILE_OPTION 2 |
|
132 #define INFO_PROG_OPTION 3 |
2240
|
133 #define NO_INIT_FILE_OPTION 4 |
|
134 #define NO_LINE_EDITING_OPTION 5 |
|
135 #define NO_SITE_FILE_OPTION 6 |
|
136 #define TRADITIONAL_OPTION 7 |
1817
|
137 long_options long_opts[] = |
139
|
138 { |
1855
|
139 { "debug", prog_args::no_arg, 0, 'd' }, |
2277
|
140 { "braindead", prog_args::no_arg, 0, TRADITIONAL_OPTION }, |
1855
|
141 { "echo-commands", prog_args::no_arg, 0, 'x' }, |
|
142 { "exec-path", prog_args::required_arg, 0, EXEC_PATH_OPTION }, |
|
143 { "help", prog_args::no_arg, 0, 'h' }, |
|
144 { "info-file", prog_args::required_arg, 0, INFO_FILE_OPTION }, |
|
145 { "info-program", prog_args::required_arg, 0, INFO_PROG_OPTION }, |
|
146 { "interactive", prog_args::no_arg, 0, 'i' }, |
2239
|
147 { "no-init-file", prog_args::no_arg, 0, NO_INIT_FILE_OPTION }, |
1855
|
148 { "no-line-editing", prog_args::no_arg, 0, NO_LINE_EDITING_OPTION }, |
2239
|
149 { "no-site-file", prog_args::no_arg, 0, NO_SITE_FILE_OPTION }, |
1855
|
150 { "norc", prog_args::no_arg, 0, 'f' }, |
|
151 { "path", prog_args::required_arg, 0, 'p' }, |
|
152 { "quiet", prog_args::no_arg, 0, 'q' }, |
|
153 { "silent", prog_args::no_arg, 0, 'q' }, |
|
154 { "traditional", prog_args::no_arg, 0, TRADITIONAL_OPTION }, |
|
155 { "verbose", prog_args::no_arg, 0, 'V' }, |
|
156 { "version", prog_args::no_arg, 0, 'v' }, |
1103
|
157 { 0, 0, 0, 0 } |
139
|
158 }; |
1
|
159 |
1355
|
160 // Store the command-line options for later use. |
|
161 |
|
162 static void |
|
163 intern_argv (int argc, char **argv) |
|
164 { |
2926
|
165 octave_env::set_program_name (argv[0]); |
|
166 |
|
167 // XXX FIXME XXX -- Kpathsea needs this. |
|
168 |
|
169 #if ! defined (HAVE_PROGRAM_INVOCATION_NAME) |
|
170 program_invocation_name |
|
171 = strsave (octave_env::get_program_invocation_name () . c_str ()); |
|
172 |
|
173 program_invocation_short_name |
|
174 = strsave (octave_env::get_program_name () . c_str ()); |
|
175 #endif |
|
176 |
1355
|
177 if (argc > 1) |
|
178 { |
2495
|
179 // Skip program name in argv. |
1572
|
180 |
2495
|
181 octave_argv = string_vector (argv+1, argc-1); |
1411
|
182 |
|
183 bind_builtin_variable ("argv", octave_argv, 1, 1, 0); |
2404
|
184 bind_builtin_variable ("__argv__", octave_argv, 1, 1, 0); |
1355
|
185 } |
1907
|
186 |
2800
|
187 bind_builtin_variable ("nargin", static_cast<double> (argc-1), 1, 1, 0); |
1355
|
188 } |
|
189 |
1792
|
190 static void |
|
191 initialize_pathsearch (void) |
|
192 { |
|
193 // This may seem odd, but doing it this way means that we don't have |
|
194 // to modify the kpathsea library... |
|
195 |
2926
|
196 string odb = octave_env::getenv ("OCTAVE_DB_DIR"); |
1792
|
197 |
2926
|
198 if (odb.empty ()) |
1792
|
199 { |
2926
|
200 string oh = octave_env::getenv ("OCTAVE_HOME"); |
1792
|
201 |
2926
|
202 if (oh.empty ()) |
|
203 octave_env::putenv ("TEXMF", OCTAVE_DATADIR "/octave"); |
|
204 else |
1792
|
205 { |
2926
|
206 oh.append ("/lib/octave"); |
|
207 octave_env::putenv ("TEXMF", oh); |
1792
|
208 } |
|
209 } |
2926
|
210 else |
|
211 octave_env::putenv ("TEXMF", odb); |
1792
|
212 } |
|
213 |
581
|
214 // Initialize by reading startup files. |
|
215 |
1
|
216 static void |
|
217 execute_startup_files (void) |
|
218 { |
315
|
219 begin_unwind_frame ("execute_startup_files"); |
|
220 |
1651
|
221 // XXX FIXME XXX -- need to make it possible to set this in startup |
|
222 // files. |
1588
|
223 |
1651
|
224 unwind_protect_int (input_from_startup_file); |
|
225 |
|
226 input_from_startup_file = 1; |
315
|
227 |
793
|
228 int verbose = (verbose_flag && ! inhibit_startup_message); |
578
|
229 |
2239
|
230 if (read_site_files) |
1
|
231 { |
2239
|
232 // Execute commands from the site-wide configuration file. |
|
233 // First from the file $(prefix)/lib/octave/site/m/octaverc |
|
234 // (if it exists), then from the file |
|
235 // $(prefix)/lib/octave/$(version)/m/octaverc (if it exists). |
1755
|
236 |
2897
|
237 parse_and_execute (Vlocal_site_defaults_file, verbose); |
1755
|
238 |
2897
|
239 parse_and_execute (Vsite_defaults_file, verbose); |
1
|
240 } |
|
241 |
2239
|
242 if (read_init_files) |
|
243 { |
2512
|
244 // Try to execute commands from $HOME/$OCTAVE_INITFILE and |
|
245 // $OCTAVE_INITFILE. If $OCTAVE_INITFILE is not set, .octaverc |
|
246 // is assumed. |
2239
|
247 |
|
248 int home_rc_already_executed = 0; |
2512
|
249 |
2926
|
250 string initfile = octave_env::getenv ("OCTAVE_INITFILE"); |
2512
|
251 |
2926
|
252 if (initfile.empty ()) |
2512
|
253 initfile = ".octaverc"; |
|
254 |
2926
|
255 string home_dir = octave_env::get_home_directory (); |
|
256 |
|
257 string home_rc = home_dir + "/" + initfile; |
2512
|
258 string local_rc = string ("./") + initfile; |
2239
|
259 |
2926
|
260 if (! home_dir.empty ()) |
2239
|
261 { |
2897
|
262 parse_and_execute (home_rc, verbose); |
2239
|
263 |
|
264 // Names alone are not enough. |
|
265 |
|
266 file_stat fs_home_rc (home_rc); |
|
267 |
|
268 if (fs_home_rc) |
|
269 { |
2512
|
270 file_stat fs_dot_rc (local_rc); |
2239
|
271 |
|
272 if (fs_dot_rc && fs_home_rc.ino () == fs_dot_rc.ino ()) |
|
273 home_rc_already_executed = 1; |
|
274 } |
|
275 } |
|
276 |
|
277 if (! home_rc_already_executed) |
2897
|
278 parse_and_execute (local_rc, verbose); |
2239
|
279 } |
315
|
280 |
|
281 run_unwind_frame ("execute_startup_files"); |
1
|
282 } |
|
283 |
581
|
284 // Usage message with extra help. |
|
285 |
1
|
286 static void |
|
287 verbose_usage (void) |
|
288 { |
2375
|
289 cout << OCTAVE_NAME_VERSION_AND_COPYRIGHT "\n\ |
1613
|
290 \n\ |
|
291 Usage: octave [options]\n\ |
|
292 \n\ |
|
293 Options:\n\ |
1119
|
294 \n\ |
1613
|
295 -d, --debug Enter parser debugging mode.\n\ |
|
296 -x, --echo-commands Echo commands as they are executed.\n\ |
|
297 --exec-path PATH Set path for executing subprograms.\n\ |
|
298 -h, -?, --help Print short help message and exit.\n\ |
2239
|
299 -f, --norc Don't read any initialization files.\n\ |
1613
|
300 --info-file FILE Use top-level info file FILE.\n\ |
|
301 --info-program PROGRAM Use PROGRAM for reading info files.\n\ |
|
302 -i, --interactive Force interactive behavior.\n\ |
2470
|
303 --no-init-file Don't read the ~/.octaverc or .octaverc files.\n\ |
2212
|
304 --no-line-editing Don't use readline for command-line editing.\n\ |
2470
|
305 --no-site-file Don't read the site-wide octaverc file.\n\ |
1613
|
306 -p PATH, --path PATH Set initial LOADPATH to PATH.\n\ |
|
307 -q, --silent Don't print message at startup.\n\ |
|
308 --traditional Set compatibility variables.\n\ |
|
309 -V, --verbose Enable verbose output in some cases.\n\ |
|
310 -v, --version Print version number and exit.\n\ |
1119
|
311 \n\ |
1613
|
312 FILE Execute commands from FILE.\n\ |
2375
|
313 \n\ |
|
314 Additional information about Octave is available via the WWW at\n\ |
|
315 http://www.che.wisc.edu/octave.\n\ |
|
316 \n\ |
|
317 Please report bugs to the mailing list `bug-octave@bevo.che.wisc.edu'.\n"; |
285
|
318 |
613
|
319 exit (0); |
1
|
320 } |
|
321 |
581
|
322 // Terse usage messsage. |
|
323 |
1
|
324 static void |
|
325 usage (void) |
|
326 { |
613
|
327 cerr << "usage: " << usage_string << "\n"; |
1
|
328 exit (1); |
|
329 } |
|
330 |
|
331 static void |
|
332 print_version_and_exit (void) |
|
333 { |
1107
|
334 cout << OCTAVE_NAME_AND_VERSION << "\n"; |
1
|
335 exit (0); |
|
336 } |
|
337 |
721
|
338 static void |
|
339 initialize_error_handlers () |
|
340 { |
|
341 set_liboctave_error_handler (error); |
|
342 } |
|
343 |
1410
|
344 // What happens on --traditional. |
|
345 |
|
346 static void |
|
347 maximum_braindamage (void) |
|
348 { |
|
349 bind_builtin_variable ("PS1", ">> "); |
|
350 bind_builtin_variable ("PS2", ""); |
2402
|
351 bind_builtin_variable ("beep_on_error", 1.0); |
1410
|
352 bind_builtin_variable ("default_save_format", "mat-binary"); |
2402
|
353 bind_builtin_variable ("define_all_return_values", 1.0); |
|
354 bind_builtin_variable ("do_fortran_indexing", 1.0); |
|
355 bind_builtin_variable ("empty_list_elements_ok", 1.0); |
|
356 bind_builtin_variable ("implicit_str_to_num_ok", 1.0); |
|
357 bind_builtin_variable ("ok_to_lose_imaginary_part", 1.0); |
|
358 bind_builtin_variable ("page_screen_output", 0.0); |
|
359 bind_builtin_variable ("prefer_column_vectors", 0.0); |
|
360 bind_builtin_variable ("print_empty_dimensions", 0.0); |
|
361 bind_builtin_variable ("treat_neg_dim_as_zero", 1.0); |
|
362 bind_builtin_variable ("warn_function_name_clash", 0.0); |
1410
|
363 bind_builtin_variable ("whitespace_in_literal_matrix", "traditional"); |
|
364 } |
|
365 |
581
|
366 // You guessed it. |
|
367 |
1
|
368 int |
|
369 main (int argc, char **argv) |
|
370 { |
2205
|
371 // The order of these calls is important. The call to |
2926
|
372 // install_defaults must come before install_builtins because |
2205
|
373 // default variable values must be available for the varaibles to be |
|
374 // installed, and the call to install_builtins must come before the |
|
375 // options are processed because some command line options override |
|
376 // defaults by calling bind_builtin_variable. |
721
|
377 |
1
|
378 sysdep_init (); |
|
379 |
721
|
380 initialize_error_handlers (); |
223
|
381 |
2926
|
382 install_defaults (); |
1
|
383 |
1792
|
384 initialize_pathsearch (); |
1744
|
385 |
2205
|
386 install_signal_handlers (); |
|
387 |
|
388 initialize_file_io (); |
|
389 |
2375
|
390 initialize_symbol_tables (); |
|
391 |
|
392 install_types (); |
|
393 |
|
394 install_ops (); |
2205
|
395 |
|
396 install_builtins (); |
|
397 |
1817
|
398 prog_args args (argc, argv, short_opts, long_opts); |
|
399 |
139
|
400 int optc; |
1817
|
401 while ((optc = args.getopt ()) != EOF) |
1
|
402 { |
139
|
403 switch (optc) |
1
|
404 { |
793
|
405 case 'V': |
2239
|
406 verbose_flag = true; |
793
|
407 break; |
|
408 |
1
|
409 case 'd': |
|
410 yydebug++; |
|
411 break; |
777
|
412 |
1
|
413 case 'f': |
2239
|
414 read_init_files = false; |
|
415 read_site_files = false; |
1
|
416 break; |
777
|
417 |
1
|
418 case 'h': |
|
419 case '?': |
|
420 verbose_usage (); |
|
421 break; |
777
|
422 |
1
|
423 case 'i': |
|
424 forced_interactive = 1; |
|
425 break; |
777
|
426 |
1
|
427 case 'p': |
1817
|
428 if (args.optarg ()) |
2205
|
429 bind_builtin_variable ("LOADPATH", args.optarg ()); |
1
|
430 break; |
777
|
431 |
1
|
432 case 'q': |
2239
|
433 inhibit_startup_message = true; |
1
|
434 break; |
777
|
435 |
1
|
436 case 'x': |
2205
|
437 { |
|
438 double tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE); |
|
439 bind_builtin_variable ("echo_executing_commands", tmp); |
|
440 } |
1
|
441 break; |
777
|
442 |
1
|
443 case 'v': |
|
444 print_version_and_exit (); |
|
445 break; |
777
|
446 |
1613
|
447 case EXEC_PATH_OPTION: |
1817
|
448 if (args.optarg ()) |
2205
|
449 bind_builtin_variable ("EXEC_PATH", args.optarg ()); |
1613
|
450 break; |
|
451 |
186
|
452 case INFO_FILE_OPTION: |
1817
|
453 if (args.optarg ()) |
2205
|
454 bind_builtin_variable ("INFO_FILE", args.optarg ()); |
186
|
455 break; |
777
|
456 |
1613
|
457 case INFO_PROG_OPTION: |
1817
|
458 if (args.optarg ()) |
2205
|
459 bind_builtin_variable ("INFO_PROGRAM", args.optarg ()); |
1613
|
460 break; |
|
461 |
2239
|
462 case NO_INIT_FILE_OPTION: |
|
463 read_init_files = false; |
|
464 break; |
|
465 |
1821
|
466 case NO_LINE_EDITING_OPTION: |
2926
|
467 line_editing = 0; |
2239
|
468 break; |
|
469 |
|
470 case NO_SITE_FILE_OPTION: |
|
471 read_site_files = 0; |
1821
|
472 break; |
|
473 |
1410
|
474 case TRADITIONAL_OPTION: |
2239
|
475 traditional = true; |
1410
|
476 break; |
|
477 |
1
|
478 default: |
|
479 usage (); |
|
480 break; |
|
481 } |
|
482 } |
|
483 |
1651
|
484 #if defined (HAVE_ATEXIT) || defined (HAVE_ON_EXIT) |
2077
|
485 // Make sure we clean up when we exit. Also allow users to register |
|
486 // functions. If we don't have atexit or on_exit, we're going to |
|
487 // leave some junk files around if we exit abnormally. |
|
488 |
|
489 atexit (do_octave_atexit); |
|
490 |
1
|
491 atexit (cleanup_tmp_files); |
318
|
492 #endif |
1
|
493 |
1358
|
494 // These can come after command line args since none of them set any |
|
495 // defaults that might be changed by command line options. |
581
|
496 |
2926
|
497 initialize_command_input (); |
315
|
498 |
578
|
499 if (! inhibit_startup_message) |
1106
|
500 cout << OCTAVE_STARTUP_MESSAGE "\n" << endl; |
578
|
501 |
1410
|
502 if (traditional) |
|
503 maximum_braindamage (); |
|
504 |
2239
|
505 execute_startup_files (); |
1651
|
506 |
2926
|
507 command_history::read (false); |
1
|
508 |
578
|
509 if (! inhibit_startup_message && reading_startup_message_printed) |
|
510 cout << endl; |
|
511 |
1358
|
512 // Avoid counting commands executed from startup files. |
|
513 |
2926
|
514 command_editor::reset_current_command_number (1); |
1
|
515 |
1358
|
516 // If there is an extra argument, see if it names a file to read. |
|
517 // Additional arguments are taken as command line options for the |
|
518 // script. |
1
|
519 |
1817
|
520 int last_arg_idx = args.optind (); |
|
521 int remaining_args = argc - last_arg_idx; |
1355
|
522 if (remaining_args > 0) |
149
|
523 { |
984
|
524 reading_script_file = 1; |
1817
|
525 curr_fcn_file_name = argv[last_arg_idx]; |
1608
|
526 curr_fcn_file_full_name = curr_fcn_file_name; |
1411
|
527 |
984
|
528 FILE *infile = get_input_from_file (curr_fcn_file_name); |
1411
|
529 |
529
|
530 if (infile) |
287
|
531 { |
1516
|
532 input_from_command_line_file = 1; |
|
533 |
1411
|
534 bind_builtin_variable ("program_invocation_name", |
|
535 curr_fcn_file_name); |
|
536 |
1755
|
537 size_t pos = curr_fcn_file_name.rfind ('/'); |
|
538 |
|
539 string tmp = (pos != NPOS) |
|
540 ? curr_fcn_file_name.substr (pos+1) : curr_fcn_file_name; |
1411
|
541 |
|
542 bind_builtin_variable ("program_name", tmp); |
|
543 |
1817
|
544 intern_argv (remaining_args, argv+last_arg_idx); |
1411
|
545 |
2926
|
546 command_editor::blink_matching_paren (false); |
|
547 |
287
|
548 switch_to_buffer (create_buffer (infile)); |
|
549 } |
529
|
550 else |
|
551 clean_up_and_exit (1); |
1
|
552 } |
|
553 else |
|
554 { |
1355
|
555 // Is input coming from a terminal? If so, we are probably |
|
556 // interactive. |
1
|
557 |
|
558 interactive = (isatty (fileno (stdin)) && isatty (fileno (stdout))); |
1355
|
559 |
|
560 intern_argv (argc, argv); |
|
561 |
|
562 switch_to_buffer (create_buffer (get_input_from_stdin ())); |
1
|
563 } |
|
564 |
1358
|
565 // Force input to be echoed if not really interactive, but the user |
|
566 // has forced interactive behavior. |
1
|
567 |
1907
|
568 if (! interactive && forced_interactive) |
287
|
569 { |
2926
|
570 command_editor::blink_matching_paren (false); |
1588
|
571 |
|
572 // XXX FIXME XXX -- is this the right thing to do? |
|
573 |
|
574 bind_builtin_variable ("echo_executing_commands", |
2800
|
575 static_cast<double> (ECHO_CMD_LINE)); |
287
|
576 } |
1
|
577 |
1410
|
578 if (! interactive) |
2926
|
579 line_editing = 0; |
1
|
580 |
1907
|
581 int retval = main_loop (); |
1
|
582 |
1005
|
583 if (retval == 1 && ! error_state) |
|
584 retval = 0; |
|
585 |
1
|
586 clean_up_and_exit (retval); |
|
587 } |
|
588 |
560
|
589 /* |
1
|
590 ;;; Local Variables: *** |
|
591 ;;; mode: C++ *** |
|
592 ;;; End: *** |
|
593 */ |