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 release: rl:        proc;
 12 
 13 /* This procedure implements the start and release commands. It exists so that
 14    the code involved does not have to be in the main body of listen_ */
 15 
 16 /* Initially coded in May 1972 by V. Voydock as part of the fast command loop */
 17 /* Fixed to reject extra arguments 06/30/82 S. Herbst */
 18 /* Changed to use listener_info.incl.pl1 12/11/84 Steve Herbst */
 19 
 20 
 21 dcl       ioa_ ext entry options(variable);
 22 
 23 dcl       temp_ptr ptr;
 24 
 25 dcl       arg_count fixed bin;
 26 dcl       arg_length fixed bin (21);
 27 dcl       (code,
 28            error_table_$badopt external
 29                                                   ) fixed bin(35);
 30 
 31 dcl       argument char(arg_length) based(temp_ptr);
 32 
 33 dcl       cu_$arg_count entry (fixed bin);
 34 dcl       cu_$arg_ptr entry (fixed bin, ptr, fixed bin (21), fixed bin (35));
 35 dcl       (com_err_, com_err_$suppress_name) ext entry options(variable);
 36 
 37 dcl       (null, substr) builtin;
 38 %page;
 39 /* If there is no frame to release to, print message and return. */
 40 /*
 41           if listen_static_data_.control_ptr -> based_listener_control.prev_ptr=null() then do;
 42                call ioa_("""release"" ignored.");
 43                return;
 44           end;
 45 */
 46 
 47 /* See if we are to release to "top". That is "rl -all" was typed */
 48 
 49           call cu_$arg_count (arg_count);
 50           if arg_count > 1 then do;
 51 RL_USAGE:      call com_err_$suppress_name (0, "release", "Usage:  release {-control_arg}");
 52                return;
 53           end;
 54 
 55           call cu_$arg_ptr(1,temp_ptr,arg_length,code);
 56           if code=0 then
 57                if (argument = "-all") | (argument = "-a") then
 58                     go to listen_static_data_.control_ptr -> based_listener_control.release_all;
 59                else if substr (argument, 1, 1) = "-" then do;
 60                     call com_err_ (error_table_$badopt, "release", argument);
 61                     return;
 62                end;
 63                else go to RL_USAGE;
 64 
 65 /* Set the release switch */
 66 
 67           go to listen_static_data_.control_ptr -> based_listener_control.release;
 68 %page;
 69 start: sr: entry;
 70 
 71 /* If there is no frame to "start" to, print message and return */
 72 
 73           if listen_static_data_.control_ptr -> based_listener_control.release =
 74                listen_static_data_.control_ptr -> based_listener_control.new_release then do;
 75                call ioa_("""start"" ignored.");
 76                return;
 77           end;
 78 
 79 /* See if we are to not restore io attachments (that is, "start -no_restore" was typed) */
 80 
 81           call cu_$arg_count (arg_count);
 82           if arg_count > 1 then do;
 83 SR_USAGE:      call com_err_$suppress_name (0, "start", "Usage:  start {-control_arg}");
 84                return;
 85           end;
 86 
 87           call cu_$arg_ptr(1,temp_ptr,arg_length,code);
 88           if code=0 then
 89                if (argument="-no_restore") | (argument="-nr") then
 90                     listen_static_data_.control_ptr -> based_listener_control.dont_restore_sw = "1"b;
 91                else if substr (argument, 1, 1) = "-" then do;
 92                     call com_err_ (error_table_$badopt, "start", argument);
 93                     return;
 94                end;
 95                else go to SR_USAGE;
 96 
 97 /* Set the start switch */
 98 
 99           go to listen_static_data_.control_ptr -> based_listener_control.start;
100 %page;
101 %include listener_info;
102 
103 
104 end release;