Mercurial > octave
comparison src/octave.cc @ 315:260863721a51
[project @ 1994-01-28 04:22:45 by jwe]
author | jwe |
---|---|
date | Fri, 28 Jan 1994 04:22:45 +0000 |
parents | 5325afdb0ef5 |
children | 1412ea9fc828 |
comparison
equal
deleted
inserted
replaced
314:1738f4390384 | 315:260863721a51 |
---|---|
108 tree *global_command = (tree *) NULL; | 108 tree *global_command = (tree *) NULL; |
109 | 109 |
110 // Pointer to function that is currently being evaluated. | 110 // Pointer to function that is currently being evaluated. |
111 tree_function *curr_function = (tree_function *) NULL; | 111 tree_function *curr_function = (tree_function *) NULL; |
112 | 112 |
113 // Nonzero means input is coming from startup file. | |
114 int input_from_startup_file = 0; | |
115 | |
113 // Top level context (?) | 116 // Top level context (?) |
114 jmp_buf toplevel; | 117 jmp_buf toplevel; |
115 | 118 |
116 // This is not really the right place to do this... | 119 // This is not really the right place to do this... |
117 typedef void (*one_arg_error_handler_t) (const char*); | 120 typedef void (*one_arg_error_handler_t) (const char*); |
263 * Initialize by reading startup files. | 266 * Initialize by reading startup files. |
264 */ | 267 */ |
265 static void | 268 static void |
266 execute_startup_files (void) | 269 execute_startup_files (void) |
267 { | 270 { |
271 begin_unwind_frame ("execute_startup_files"); | |
272 | |
273 unwind_protect_int (input_from_startup_file); | |
274 input_from_startup_file = 1; | |
275 | |
268 // Execute commands from the site-wide configuration file. | 276 // Execute commands from the site-wide configuration file. |
269 | 277 |
270 char *sd = get_site_defaults (); | 278 char *sd = get_site_defaults (); |
271 | 279 |
272 parse_and_execute (sd, 0); | 280 parse_and_execute (sd, 0); |
289 struct stat dot_rc_statbuf; | 297 struct stat dot_rc_statbuf; |
290 stat ("./.octaverc", &dot_rc_statbuf); | 298 stat ("./.octaverc", &dot_rc_statbuf); |
291 | 299 |
292 if (home_rc_statbuf.st_ino != dot_rc_statbuf.st_ino) | 300 if (home_rc_statbuf.st_ino != dot_rc_statbuf.st_ino) |
293 parse_and_execute ("./.octaverc", 0); | 301 parse_and_execute ("./.octaverc", 0); |
302 | |
303 run_unwind_frame ("execute_startup_files"); | |
294 } | 304 } |
295 | 305 |
296 /* | 306 /* |
297 * Usage message with extra help. | 307 * Usage message with extra help. |
298 */ | 308 */ |
435 | 445 |
436 initialize_symbol_tables (); | 446 initialize_symbol_tables (); |
437 | 447 |
438 install_builtins (); | 448 install_builtins (); |
439 | 449 |
450 initialize_readline (); | |
451 | |
452 initialize_pager (); | |
453 | |
454 install_signal_handlers (); | |
455 | |
440 if (read_init_files) | 456 if (read_init_files) |
441 { | 457 { |
442 saving_history = 0; | 458 saving_history = 0; |
443 execute_startup_files (); | 459 execute_startup_files (); |
444 saving_history = 1; | 460 saving_history = 1; |
445 } | 461 } |
446 | |
447 initialize_readline (); | |
448 | |
449 initialize_pager (); | |
450 | 462 |
451 // Avoid counting commands executed from startup files. | 463 // Avoid counting commands executed from startup files. |
452 current_command_number = 1; | 464 current_command_number = 1; |
453 | 465 |
454 // If there is an extra argument, see if it names a file to read. | 466 // If there is an extra argument, see if it names a file to read. |
489 } | 501 } |
490 | 502 |
491 if (! (interactive || forced_interactive)) | 503 if (! (interactive || forced_interactive)) |
492 using_readline = 0; | 504 using_readline = 0; |
493 | 505 |
494 install_signal_handlers (); | |
495 | |
496 if (! inhibit_startup_message) | 506 if (! inhibit_startup_message) |
497 { | 507 { |
498 cout << "Octave, version " << version_string | 508 cout << "Octave, version " << version_string |
499 << ". Copyright (C) 1992, 1993, 1994 John W. Eaton.\n" | 509 << ". Copyright (C) 1992, 1993, 1994 John W. Eaton.\n" |
500 << "This is free software with ABSOLUTELY NO WARRANTY.\n" | 510 << "This is free software with ABSOLUTELY NO WARRANTY.\n" |