.HD "RUN/REINIT/START" run reinit start .SH NAME run \- initialize variables and execute \*emain\*p .br start \- execute \*emain\*p without initializing variables .br reinit \- reinitialize all variables .SH SYNOPSIS .CS void run() .PP .CS void run(command_line) .CS char *command_line ; .PP .CS void start() .PP .CS void start(command_line) .CS char *command_line ; .PP .CS void reinit() .PP .CS void reinit(variable_name) .CS char *variable_name ; .SH OPTIONS .FS program_name =\ "a.out" .FS auto_reload (set) .FS win_io (unset on ascii terminals) .FS win_io_opts (unset on ascii terminals) .SH DESCRIPTION .CO Run initializes all variables (by calling .CO reinit ), processes command line arguments, executes .EX main (by calling .CO start ), and closes open files when .EX main returns. If .CO run is called from a break level, it first resets to the top level of the environment. .PP .CO Start processes command line arguments and executes .EX main without resetting the break level, initializing variables, or closing files when .EX main returns. .PP Both .CO run and .CO start use the .FL program_name option for the first argument to main .KW (argv[0]) and the command line for the remaining arguments. If a command line is not supplied, the command line arguments from the previous call to .CO run or .CO start are reused. If the argument is an empty string, .EX main is called with only the program name as an argument. .PP The command line can contain the input and output redirection symbols shown below. Pipelining input and output is not supported. .sp .ip " > file" 23 .ns .ip " >& file" 23 redirect standard output to a file. If the file does not exists, create it. If the file exists, truncate it to zero length before writing to it. If the .EX & symbol is used, both standard output and standard error are redirected to the file. .sp .ip " >> file" 23 .ns .ip " >>& file" 23 append standard output to the end of a file. If the file does not exists, create it. If the .I & symbol is used, both standard output and standard error are redirected to the file. .sp .ip " < file" 23 redirect standard input to a file. .PP .CO Reinit reinitializes all global variables, frees allocated memory, closes open files, and reinitializes all signal handlers. If .CO reinit is called with a variable name, only the specified variable will be initialized. .PP If .CO reinit is called from a break level, errors may be introduced when global variables are reinitialized to their initial values. In addition, .CO reinit will free allocated memory which may still be used. .SH OPTIONS If the .FL win_io option is set and the .CO run command is called, then program input and output will be redirected to a separate window or terminal. If \*n is running in a windowing environment using X windows or Sunview, a new window will appear automatically. If \*n is running in a non-windowing environment, the user will be prompted for the name of another terminal to use for the input and output. .PP If the .FL auto_reload flag is set, .CO run and .CO start will automatically reload any modified files before executing the program. If the option is unset, the user will be prompted before reloading any files. .SH SEE ALSO freealloc