1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 4    *                                                         *
 5    * Copyright (c) 1972 by Massachusetts Institute of        *
 6    * Technology and Honeywell Information Systems, Inc.      *
 7    *                                                         *
 8    *********************************************************** */
 9 
10 
11 tolts_overseer_:  procedure;
12 
13 /* Modified BIM 5/82 set the homedir. */
14 
15 dcl iox_$user_io ext static ptr;
16 
17 dcl       error_code          fixed bin(35);
18 
19 dcl    1  search_rules  aligned  internal static options (constant),
20           2  num_rules  fixed bin  init(5),
21           2  rules (5)  char(168)  aligned
22              init ( "initiated_segments",
23                     "referencing_dir",
24                     ">system_library_standard",
25                     ">system_library_1",
26                     ">system_library_tools");
27 
28 dcl       ( addr, baseptr, pointer )  builtin;
29 
30 dcl       1 logout_info aligned,
31           2 version fixed bin,
32           2 hold bit (1) unaligned,
33           2 brief bit (1) unaligned,
34           2 pad bit (34) unaligned;
35 
36 dcl       1 init_error aligned,
37           2 version fixed bin,
38           2 error_code fixed bin (35);
39 
40 dcl       based_quoi                    based;
41 
42 dcl       homedir                       char (168);
43 
44 dcl       any_other                     condition;
45 
46 dcl       hcs_$initiate_search_rules    entry  (ptr, fixed bin(35));
47 dcl       ioa_                          entry  options (variable);
48 dcl       iox_$control                  entry (ptr, char(*), ptr, fixed bin(35));
49 dcl       com_err_                      entry  options(variable);
50 dcl       cu_$set_cl_intermediary       entry (entry);
51 dcl       cu_$set_command_processor     entry (entry);
52 dcl       default_error_handler_$wall   entry;
53 dcl       terminate_process_            entry (character (*), pointer);
54 
55 dcl       bound_tolts_$tolts_  entry  options(variable);
56 dcl       change_wdir_         entry (char (168), fixed bin (35));
57 dcl       user_info_$homedir   entry (char(*));
58 
59 ^L
60 
61           call hcs_$initiate_search_rules (addr(search_rules), error_code);
62           if   error_code ^= 0
63                then goto ERROR;
64 
65           on any_other call default_error_handler_$wall;
66 
67           call cu_$set_cl_intermediary (command_level);
68           call cu_$set_command_processor (command_level);
69 
70           call iox_$control (iox_$user_io, "quit_enable", null (), (0));
71 
72           call user_info_$homedir (homedir);
73           call change_wdir_ (homedir, (0));
74           call bound_tolts_$tolts_;                         /* Call main TOLTS program. */
75 
76           unspec (logout_info) = ""b; /* correct data is all 0 */
77           call terminate_process_ ("logout", addr (logout_info));
78 LOOP:
79           pointer (baseptr (-2), 0) -> based_quoi = 0;
80           go to LOOP;
81 
82 command_level:  entry;                 /* if we ever get to command level we come here. */
83 
84           on any_other go to LOOP;
85           call ioa_("tolts_overseer_:  Illegal attempt to enter user environment.");
86           unspec (logout_info) = ""b;
87           logout_info.hold = "1"b;
88           call terminate_process_ ("logout", addr (logout_info));
89           go to LOOP;
90 
91 ERROR:
92           call com_err_ (error_code, "tolts_overseer_", "Could not set search rules.");
93           unspec (init_error) = ""b;
94           init_error.error_code = error_code;
95           call terminate_process_ ("init_error", addr (init_error));
96           go to LOOP;
97 
98           end   tolts_overseer_;