1 /* BEGIN INCLUDE FILE gtss_filact_intp2x.incl.pl1 */
  2 /*
  3   Created: (Wardd Multics)  07/13/79 2116.0 mst Fri
  4 */
  5 get_ascii_file_name: proc (fnia, cfdl, acfp)returns (bit (1));
  6 
  7 /**       Obtain the catalog/file description
  8           in ascii.
  9    Changed: R. Barstad        82/06/11 - to fix stringsize condition on acf.name
 10                                          assign to callers_buf...
 11 **/
 12 dcl  fnia                     bit(1)parm          /* "1"b => file name in ascii. */;
 13 dcl  cfdl                     fixed bin(18)unsigned unal parm         /* Location of catalog file description. */;
 14 dcl  acfp                     ptr parm  /* Pointer to ascii_cat_file structure. */;
 15 
 16           ap = acfp;                                        /* Local value. */
 17           cat_filedescr_name_offset = 0;                    /* => offset to "current" name in catalog file description. */
 18 
 19           if (cfdl < mem_bottom) |
 20           (cfdl+5 > mem_top) then do;
 21                goto return_err4;
 22           end;                                              /* Require USERID and atleast file name. */
 23           descriptor_ptr = addrel (gseg, cfdl);
 24 
 25           if cfd2.USERID = -1 then do;                      /* cfd2.USERID is that of current terminal user. */
 26                descriptor_ptr -> bit72 = gtss_ust.lid;
 27                cfd2.USERID_password = (12)"20"b3;
 28           end;
 29 
 30           cat_filedescr_name_offset = cfdl;
 31 
 32           do nic = 0 to 5;                                  /* Search for end of list. */
 33                if nic = 0 then
 34                     if cdf4.end_of_list = -1 then do;       /* Only a USERID. */
 35                          acf.nn = 1;
 36                          goto gal;
 37                     end;
 38 
 39                if (cfdl+ (nic*2)+6) > mem_top then do;
 40                     goto return_err4;
 41                end;                                         /* cat/filedescr entry out of memory. */
 42 
 43                if cfd2.end_of_list = -1 then do;            /* cat/filedescr isolated. */
 44                     cat_filedescr_name_offset = cfdl + (nic*4) + 4; /* Offset to name entry (global). */
 45                     acf.nn = nic+2;
 46 
 47 gal:                ;
 48                     do i = 1 to acf.nn;
 49 
 50 /**       Store catalog file description for expand path. **/
 51 
 52                          if (i > 1) & (i = acf.nn) & fnia then do;
 53                               callers_buf.restore_switch = "000000000001"b3; /* => file name in ascii. */
 54                               acf.name (i) = translate (cfd3 (i).name,
 55                                    "abcdefghijklmnopqrstuvwxyz",
 56                                    "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
 57                          end;
 58                          else
 59                          call gtss_bcd_ascii_$lc (
 60                               addr (cfd3 (i).name)
 61                               , 12
 62                               , addr (acf.name (i))
 63                               );
 64                     end;
 65 
 66                     if substr (string (gtss_ext_$db), 09, 11) then do;
 67                          call ioa_ ("cat/filedescr:");
 68                          do i = 1 to acf.nn;
 69                               call ioa_ ("^3i. ""^a""", i, acf.name (i));
 70                          end;
 71                     end;
 72 
 73                     if substr (acf.name (1), 1, 6) = "!!!!!!"
 74                     then acf.name (1) = gse_ext_$umc_name;
 75                     callers_buf.file_id_in_ascii = substr(acf.name (acf.nn),1,8);
 76                     return ("0"b);                          /* Success. */
 77                end;
 78           end;
 79 
 80 /**       cat/filedescr has no end of list marker. **/
 81           cat_filedescr_name_offset = 0;
 82           return ("1"b);                                    /* Failure. */
 83 
 84 dcl  ap                       ptr       /* Local acfp */;
 85 dcl 1 acf aligned based(ap) like ascii_cat_file;
 86 
 87 dcl 1 callers_buf             aligned based(buffer_ptr),
 88       3 restore_switch        bit(36),
 89       3 file_id_in_ascii      char(8);
 90 
 91 dcl 1 cfd2                    aligned based(descriptor_ptr) /* 2nd description of catalog/file list. */
 92 ,     3 user_master_catalog
 93 ,       4 USERID              fixed bin(71)
 94 ,       4 USERID_password     bit(72)
 95 ,     3 intermediate_catalogs (nic)
 96 ,       4 CATALOG             bit(72)
 97 ,       4 CATALOG_password    bit(72)
 98 ,     3 file_to_be_accessed
 99 ,       4 FILENAME            bit(72)
100 ,       4 FILENAME_password   bit(72)
101 ,     3 end_of_list           fixed bin(35)
102 ;
103 
104 dcl 1 cfd3                    (7) aligned based(descriptor_ptr)       /* 3rd description of catalog/file list. */
105 ,     3 name                  char(8)
106 ,     3 password              bit(72)
107 ;
108 
109 dcl 1 cdf4                    aligned based(descriptor_ptr) /* 4th description of catalog/file list. */
110 ,     3 user_master_catalog
111 ,       4 USERID              fixed bin(71)
112 ,       4 USERID_password     bit(72)
113 ,     3 end_of_list           fixed bin(35)
114 ;
115      end                                                    /* get_ascii_file_name */;
116 
117 /*   END INCLUDE FILE gtss_filact_intp2x.incl.pl1 */