1 /*  START OF:       mbuild_script_info_attr.incl.pl1          *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
  2 
  3 /****^  HISTORY COMMENTS:
  4   1) change(2022-10-14,GDixon), approve(2022-10-24,MCR10126a),
  5      audit(2022-10-25,Swenson), install(2022-10-25,MR12.8-1043):
  6       A) Initial version of include file added to mbuild_2.01 code.
  7                                                    END HISTORY COMMENTS */
  8 
  9 /* ====================================================================================================
 10     Code in this include file is shared by:  mbuild.pl1, mbuild_set_.pl1, mbuild_script_info_.rd
 11     so make any future changes in a fashion that is compatible with needs of all three of these
 12     programs.
 13 
 14     In particular, notice that all four of the Reduction Syntax Routines (see below) test the syntax
 15     of a variable called token_value.  The LEX and NEXT_STMT calls in the reduction statements
 16     (at the top of mbuild_script_info_.rd source) choose which input data item is overlaid by the
 17     token_value variable.  token_value is a based character string declared in lex_descriptors_.incl.pl1.
 18 
 19 
 20     However,  mbuild.pl1 (the mbuild command)   and   mbuild_set_.pl1 (the mbuild set request)  use
 21     these same Reduction Syntax Routines to examine the current argument returned by:
 22        call ssu_$arg_ptr( sciP, argI, argP, argL );
 23     In those sources, argI, argP, argL and arg are declared in one of the ssu_-specific include
 24     files:  ssu_standalone_command_.incl.pl1  or  ssu_request_dcls_.incl.pl1.
 25 
 26     In both mbuild.pl1 and mbuild_set_.pl1, a declare statement for token_value is added to their
 27     controlArgs subroutine.  This declare makes use of argP and argL values to overlay the current
 28     arg (returned by ssu_$arg_ptr) with the token_value based string.
 29 
 30 
 31     This difference in token_value declaration allows  source programs with different methods for
 32     selecting input data to examine a particular data item  using one of the shared
 33     Reduction Syntax Routines  coded below.
 34     ==================================================================================================== */
 35 
 36 %page;
 37           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
 38           /*                                                                                                */
 39           /*  Reduction  Syntax  Routines                                                                   */
 40           /*                                                                                                */
 41           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
 42 
 43 approve_ID:                                                 /* Validate prefix and length of Approve_ID               */
 44      proc() returns (bit(1) aligned);
 45 
 46      if  ( substr(token_value, 1, 3) = "MCR"
 47          | substr(token_value, 1, 3) = "PBF")
 48       &  length(token_value) <= 24
 49      then  return (T);
 50 
 51      else if  substr(token_value, 1, 4) = "MECR"
 52            &  length(token_value) <= 24
 53           then  return (T);
 54 
 55      return (F);
 56 
 57 
 58 install_ID:                                                 /* Validate start and length of Install_ID                */
 59      entry() returns (bit(1) aligned);
 60 
 61      if  substr(token_value, 1, 2) = "MR"
 62       &  length(token_value) <= 20
 63      then return (T);
 64 
 65      return(F);
 66 
 67 
 68 phase:                                                      /* Validate against defined phase values.                 */
 69      entry() returns (bit(1) aligned);
 70 
 71      if  token_value = "developing"                         /* Only three phase values are supported.                 */
 72       |  token_value = "auditing"
 73       |  token_value = "installing"
 74      then return (T);
 75      else return (F);
 76 
 77 
 78 user_ID:                                                    /* Validate  person_id.project_id format of User_ID       */
 79      entry()  returns (bit(1) aligned);
 80 
 81      if  length(token_value) <= 32
 82       &  index(token_value, ".") > 1
 83       &  length( before(token_value, "." ))      <= 22
 84       &  length( after( token_value, "." ))      > 0
 85       &  length( after( token_value, "." ))      <= 9
 86       &  index( after(  token_value, "." ), ".") = 0
 87      then return (T);
 88      else return (F);
 89 
 90      end approve_ID;
 91 
 92 
 93 
 94           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
 95           /*                                                                                                */
 96           /*  Default  Attribute  Values                                                                    */
 97           /*                                                                                                */
 98           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
 99 
100   dcl  default_Phase char(10) int static options(constant) init( "developing" );
101 
102 
103           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
104           /*                                                                                                */
105           /*  Valid  Token  Description  Strings                                                            */
106           /*                                                                                                */
107           /*  NOTE:  See also mbuild_data_.incl.pl1 which declares BS_phase_default = "developing".  Any    */
108           /*         change to the  valid_Phase declaration  and/or  phase()  function might require a      */
109           /*         change to that variable as well.                                                       */
110           /*                                                                                                */
111           /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *   */
112 
113   dcl  valid_Approve_ID char(79) int static options(constant) init(
114           "Operand must begin with MCR, MECR, or PBF and be no longer than 24 characters." );
115 
116   dcl  valid_Install_ID char(64) int static options(constant) init(
117           "Operand must begin with MR and be no longer than 20 characters." );
118 
119   dcl  valid_Phase char(58) int static options(constant) init(
120           "Operand must be one of:  developing  auditing  installing" );
121 
122   dcl  valid_User_ID char(80) int static options(constant) init(
123           "Operand must be a Person_ID and Project_ID separated by a period (.) character." );
124 
125 
126 
127 /*  END OF:         mbuild_script_info_attr.incl.pl1          *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */