1 /*  START OF:       ssu_request_dcls_.incl.pl1                *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
 2 
 3 
 4 /****^  HISTORY COMMENTS:
 5   1) change(2019-08-17,GDixon), approve(2019-10-23,MCR10069),
 6      audit(2020-01-20,Swenson), install(2020-01-20,MR12.6g-0035):
 7      Declarations needed by a typical ssu_ subsystem request program.
 8   2) change(2021-02-22,GDixon), approve(2021-02-22,MCR10089),
 9      audit(2021-03-31,Swenson), install(2021-03-31,MR12.6g-0053):
10      Add declarations for ssu_$execute_string and ssu_$get_info_ptr support
11      routines.
12                                                    END HISTORY COMMENTS */
13 
14   dcl  ssu_$abort_line entry() options(variable);           /*  ssu_ request support routines.                        */
15   dcl  ssu_$abort_subsystem entry() options(variable);
16   dcl  ssu_$arg_ptr entry (ptr, fixed bin, ptr, fixed bin(21));
17   dcl  ssu_$execute_line entry (ptr, ptr, fixed bin(21), fixed bin(35));
18   dcl  ssu_$execute_string entry (ptr, char(*), fixed bin(35));
19   dcl  ssu_$get_info_ptr entry (ptr) returns(ptr);
20   dcl  ssu_$get_request_name entry (ptr) returns(char(32));
21   dcl  ssu_$get_subsystem_name entry (ptr) returns(char(32));
22   dcl  ssu_$get_subsystem_and_request_name entry (ptr) returns(char(72) var);
23   dcl  ssu_$print_message entry() options(variable);
24   dcl  ssu_$return_arg entry (ptr, fixed bin, bit(1) aligned, ptr, fixed bin(21));
25 
26   dcl (F init("0"b), T init("1"b)) bit(1) aligned int static options(constant);
27                                                             /* Constants used in this include file.                   */
28 
29   dcl  argCount fixed bin;                                  /* Count of arguments in command/request line.            */
30   dcl  argI fixed bin init (0);                             /* Index of argument last examined.                       */
31 
32   dcl  arg char(argL) based(argP),                          /* Argument returned by ssu_$arg_ptr                      */
33        argL fixed bin(21),
34        argP ptr;
35 
36   dcl  af_ret char (af_retL) varying based(af_retP),        /* When called as active function, this is return value.  */
37        af_retL fixed bin (21),
38        af_retP ptr;
39 
40   dcl  code fixed bin(35);                                  /* Status code.                                           */
41 
42   dcl  isAF bit(1) aligned;                                 /* T: an active request; F: a command request             */
43 
44   dcl  AsciP ptr;                                           /* Pointer to ssu_ invocation data.
45 
46 %page;
47           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
48           /*                                                                                                */
49           /* Support Routines:  argument processing                                                         */
50           /*                                                                                                */
51           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
52 
53 arg_setup:
54           proc (AsciP);
55 
56   dcl  AsciP ptr;
57 
58           call ssu_$return_arg (AsciP, argCount, isAF, af_retP, af_retL);
59           if args_remain() then if isControlArg ("-test") then;
60                                                             /* Avoid compiler warning: routine never invoked          */
61           end arg_setup;
62 
63 
64 args_remain:                                                /* Function to report whether any arguments               */
65           proc () returns (bit (1) aligned);                /*  remain to be processed.                               */
66           return (argI < argCount);
67           end args_remain;
68 
69 
70 isControlArg:                                               /* Returns T if arg is in form of a -control_arg.         */
71           proc (Aarg) returns (bit(1) aligned);
72 
73   dcl  Aarg char(*);
74   dcl  argFirst char(1) defined(Aarg);
75   dcl  length builtin;
76 
77           if  length(Aarg) = 0  then return(F);             /* empty string is not an option.                         */
78           if  argFirst ^= "-"   then return(F);             /* does not start with - , then not an option.            */
79           return(T);
80           end isControlArg;
81 
82 /*  END OF:         ssu_request_dcls_.incl.pl1                *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */