COMPILATION LISTING OF SEGMENT mtape_position_ Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 06/11/85 1249.5 mst Tue Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 mtape_position_: procedure (arg_iocbp, arg_type, arg_n, arg_code); 7 8 /* format: style4 */ 9 10 /* * This program is part of the mtape_ I/O module and as such is not 11* * called directly by users, but through the iox_ I/O system. 12* * This program contains the entries necessary to implement the 13* * iox_$position and iox_$read_length entries for the mtape_ I/O module. 14* * 15* * Modification History: 16* * 17* * Created by J. A. Bush 12/13/82 18* * Modified by J. A. Bush 12/01/83 for performance improvements 19**/ 20 21 /* ARGUMENT DATA */ 22 23 dcl arg_iocbp ptr; /* Pointer to our IOCB */ 24 dcl arg_type fixed bin; /* Type of positioning to be done */ 25 dcl arg_n fixed bin (21); /* Number of elements to position, or the length of record */ 26 dcl arg_code fixed bin (35); /* Return error code */ 27 28 /* AUTOMATIC DATA */ 29 30 dcl code fixed bin (35); 31 dcl (i, tot_rcds, fwd_rcds, n_its, n_chars, n, rcd_len) fixed bin (21); 32 dcl (j, idx) fixed bin; 33 dcl found bit (1) aligned; 34 35 /* EXTERNAL STATIC DATA */ 36 37 dcl error_table_$no_operation fixed bin (35) ext static; 38 39 /* BUILTIN FUNCTIONS */ 40 41 dcl (abs, addr, hbound, lbound, null, sum) builtin; 42 43 /* EXTERNAL ENTRIES */ 44 45 dcl mtape_io_$order entry (ptr, char (*), fixed bin, ptr, fixed bin (35)); 46 dcl mtape_io_$read_block entry (ptr, fixed bin (35)); 47 48 /* BASED DATA */ 49 50 51 /* Start of the mtape_position_ entry. This implements the iox_$position entry */ 52 53 call SETUP; /* get things set up */ 54 if arg_type < -1 | arg_type > 3 | 55 (arg_type = 3 & mtape_open_info.open_mode ^= Stream_input) then do; /* Invalid type? */ 56 arg_code = error_table_$no_operation; /* yes, can't do this type of positioning */ 57 return; 58 end; 59 n = abs (arg_n); /* get the absolute value of arg_n */ 60 go to action (arg_type); /* go do appropriate positioning */ 61 62 action (-1): /* Position to beginning of file */ 63 mtape_close_info.position = 1; /* simulate closing the file, and position to BOF */ 64 call mtape_data.file_close (mtdp, code); /* call the PFM entry to close the file */ 65 go to position_exit; 66 67 action (+1): /* Position to end of file */ 68 mtape_close_info.position = 2; /* simulate closing the file, and position to EOF */ 69 call mtape_data.file_close (mtdp, code); /* call the PFM entry to close the file */ 70 go to position_exit; 71 72 action (0): /* Position fwd or backward arg_n records */ 73 if mtape_open_info.open_mode = Stream_input | mtape_open_info.open_mode = Stream_input_output then do; 74 code = error_table_$no_operation; /* Type 0 not supported for Stream I/O */ 75 go to position_exit; 76 end; 77 if arg_n = 0 then /* if nothing to do, return */ 78 go to position_exit; 79 if arg_n > 0 then /* position fwd n records */ 80 call FORWARD_SPACE (n); 81 else call BACKSPACE (n); /* backspace n records */ 82 go to position_exit; 83 84 action (2): /* position to absolute record or character */ 85 if n = mtape_data.tot_lrec then ; /* we are there now */ 86 else if n > mtape_data.tot_lrec then do; /* position forward from this point */ 87 fwd_rcds = n - mtape_data.tot_lrec; 88 call FORWARD_SPACE (fwd_rcds); /* go forward delta amount */ 89 end; 90 else do; /* must backspace to get there */ 91 n = mtape_data.tot_lrec - n; /* adjust count */ 92 call BACKSPACE (n); /* and backup this many records */ 93 end; 94 go to position_exit; 95 96 action (3): /* position fwd arg_n characters (stream_input only) */ 97 call FORWARD_SPACE (n); /* this should do it */ 98 99 position_exit: 100 arg_code = code; /* copy return error code */ 101 return; 102 103 /* The following entry implements the iox_$read_length entry for mtape_ */ 104 105 read_length: entry (arg_iocbp, arg_n, arg_code); 106 107 call SETUP; /* get things set up */ 108 mtape_data.arg_buf_ptr = null; /* don't have a buffer */ 109 mtape_data.arg_buf_len = 0; 110 call mtape_data.read (mtdp, code); /* read the next logical record */ 111 arg_n = mtape_data.arg_rec_len; /* copy length for user */ 112 if code = 0 then /* only reposition if no error */ 113 call BACKSPACE (1); /* yes, must backspace a block */ 114 arg_code = code; /* copy return error code */ 115 return; 116 117 /* SETUP - internal procedure to initialize our processing enviornment */ 118 119 SETUP: proc; 120 121 mtdp = arg_iocbp -> iocb.actual_iocb_ptr -> iocb.attach_data_ptr; /* get ptr to our control structure */ 122 fi_ptr = mtape_data.fi_current; /* and pointer to our current file structure */ 123 moip = mtape_data.open_info_ptr; 124 mcip = mtape_data.close_info_ptr; 125 code = 0; /* reset error code */ 126 127 end SETUP; 128 129 /* FORWARD_SPACE - internal procedure to position forward desired records or chars */ 130 131 FORWARD_SPACE: proc (fn); 132 133 dcl fn fixed bin (21); 134 135 if mtape_open_info.open_mode = Sequential_input | mtape_open_info.open_mode = Sequential_input_output then do; 136 n_its = fn; /* reading records, set number of iterations */ 137 mtape_data.arg_buf_len = 0; /* and characters to read to 0 */ 138 end; 139 else do; /* Stream_input or Stream_input_output */ 140 n_its = 1; /* set iterations to 1 and */ 141 mtape_data.arg_buf_len = fn; /* characters to read forward */ 142 end; 143 mtape_data.arg_buf_ptr = null; /* We don't have a buffer for data */ 144 do i = 1 to n_its while (code = 0); /* go forward desired number of records */ 145 call mtape_data.read (mtdp, code); 146 end; 147 148 end FORWARD_SPACE; 149 150 /* BACKSPACE - internal procedure to position backwards desired records or chars */ 151 152 BACKSPACE: proc (bn); 153 154 dcl bn fixed bin (21); 155 156 if bn <= hbound (mtape_data.lrec_rrc.block_no, 1) + 1 then do; /* Record in lrec history? */ 157 idx = mtape_data.lrec_rrcx - 1; /* yes, repostion to apropriate log record */ 158 do i = 1 to bn; 159 if i ^= bn then do; 160 idx = idx - 1; 161 if idx < lbound (mtape_data.lrec_rrc.block_no, 1) then /* if we have reached the bottom */ 162 idx = hbound (mtape_data.lrec_rrc.block_no, 1); /* reset to top */ 163 end; 164 end; 165 if mtape_data.lrec_rrc (idx).block_no < mtape_data.phy_block then do; 166 j = mtape_data.phy_block - mtape_data.lrec_rrc (idx).block_no + 1; /* we have to bks "j" blocks */ 167 call mtape_io_$order (mtdp, "bsr", j, null, code); 168 if code ^= 0 then return; 169 mtape_data.prev_block_no = mtape_data.prev_block_no - (j - 1); /* correct prev block */ 170 call mtape_io_$read_block (mtdp, code); 171 if code ^= 0 then return; 172 end; 173 mtape_data.log_record_ptr = addr (tape_blk (mtape_data.lrec_rrc (idx).byte_offset)); 174 mtape_data.processed = mtape_data.lrec_rrc (idx).byte_offset - 1; 175 mtape_data.length = mtape_data.lrec_rrc (idx).block_len; 176 mtape_data.log_record = mtape_data.lrec_rrc (idx).lrec_no; 177 mtape_data.remain = mtape_data.length - mtape_data.processed; 178 mtape_data.lrec_rrcx = idx; /* reset lrec history index */ 179 end; 180 else do; /* no, is it in the block history? */ 181 if bn <= mtape_data.log_record then do; /* reposition within current block */ 182 fwd_rcds = mtape_data.log_record - bn; /* compute rcds fwd from 1st rcd in blk */ 183 mtape_data.log_record = 0; /* reset logical records in this blk */ 184 mtape_data.processed = mtape_data.buffer_offset; 185 mtape_data.remain = mtape_data.length - mtape_data.processed; 186 mtape_data.log_record_ptr = addr (tape_blk (mtape_data.processed + 1)); 187 mtape_data.tot_lrec = mtape_data.tot_lrec - bn; /* adjust total log records */ 188 end; 189 190 else if bn <= sum (mtape_data.blk_rrrc) then do; /* repositon by backspacing blocks */ 191 idx = mtape_data.blk_rrcx - 1; /* start from last block stored */ 192 if idx < lbound (mtape_data.blk_rrrc, 1) then /* if at bottom of queue.. */ 193 idx = hbound (mtape_data.blk_rrrc, 1); /* go to top */ 194 tot_rcds = mtape_data.log_record; /* preload total with count of current blk */ 195 j = 1; /* initialize blocks to backspace (including current) */ 196 found = "0"b; 197 do i = idx by -1 while (^found); /* scan the queue */ 198 j = j + 1; /* increment blocks to backspace */ 199 tot_rcds = tot_rcds + mtape_data.blk_rrrc (i); /* increment total */ 200 mtape_data.blk_rrrc (i) = 0; /* clear this position */ 201 if bn <= tot_rcds then 202 found = "1"b; /* found the right block */ 203 else if i - 1 < lbound (mtape_data.blk_rrrc, 1) then /* if at bottom of queue.. */ 204 i = hbound (mtape_data.blk_rrrc, 1) + 1; /* set for the top */ 205 end; 206 mtape_data.blk_rrcx = i + 1; /* reset block index */ 207 fwd_rcds = tot_rcds - bn; /* compute the number of rcds forward */ 208 call mtape_io_$order (mtdp, "bsr", j, null, code); /* backspace j blocks */ 209 if code ^= 0 then return; /* bad error return */ 210 mtape_data.log_record_ptr = null; /* force block read */ 211 mtape_data.remain = 0; 212 mtape_data.tot_lrec = mtape_data.tot_lrec - bn; /* adjust total log records */ 213 end; 214 else do; /* must go to beginning of file */ 215 fwd_rcds = mtape_data.tot_lrec - bn; /* get number forward */ 216 mtape_close_info.position = 3; /* position to beginning of file section */ 217 call mtape_data.file_close (mtdp, code);/* simulate closing */ 218 if code ^= 0 then return; 219 end; 220 call FORWARD_SPACE (fwd_rcds); /* now position forward for indicated records */ 221 end; 222 223 end BACKSPACE; 224 1 1 /* BEGIN INCLUDE FILE ..... iocb.incl.pl1 ..... 13 Feb 1975, M. Asherman */ 1 2 /* Modified 11/29/82 by S. Krupp to add new entries and to change 1 3* version number to IOX2. */ 1 4 /* format: style2 */ 1 5 1 6 dcl 1 iocb aligned based, /* I/O control block. */ 1 7 2 version character (4) aligned, /* IOX2 */ 1 8 2 name char (32), /* I/O name of this block. */ 1 9 2 actual_iocb_ptr ptr, /* IOCB ultimately SYNed to. */ 1 10 2 attach_descrip_ptr ptr, /* Ptr to printable attach description. */ 1 11 2 attach_data_ptr ptr, /* Ptr to attach data structure. */ 1 12 2 open_descrip_ptr ptr, /* Ptr to printable open description. */ 1 13 2 open_data_ptr ptr, /* Ptr to open data structure (old SDB). */ 1 14 2 reserved bit (72), /* Reserved for future use. */ 1 15 2 detach_iocb entry (ptr, fixed (35)),/* detach_iocb(p,s) */ 1 16 2 open entry (ptr, fixed, bit (1) aligned, fixed (35)), 1 17 /* open(p,mode,not_used,s) */ 1 18 2 close entry (ptr, fixed (35)),/* close(p,s) */ 1 19 2 get_line entry (ptr, ptr, fixed (21), fixed (21), fixed (35)), 1 20 /* get_line(p,bufptr,buflen,actlen,s) */ 1 21 2 get_chars entry (ptr, ptr, fixed (21), fixed (21), fixed (35)), 1 22 /* get_chars(p,bufptr,buflen,actlen,s) */ 1 23 2 put_chars entry (ptr, ptr, fixed (21), fixed (35)), 1 24 /* put_chars(p,bufptr,buflen,s) */ 1 25 2 modes entry (ptr, char (*), char (*), fixed (35)), 1 26 /* modes(p,newmode,oldmode,s) */ 1 27 2 position entry (ptr, fixed, fixed (21), fixed (35)), 1 28 /* position(p,u1,u2,s) */ 1 29 2 control entry (ptr, char (*), ptr, fixed (35)), 1 30 /* control(p,order,infptr,s) */ 1 31 2 read_record entry (ptr, ptr, fixed (21), fixed (21), fixed (35)), 1 32 /* read_record(p,bufptr,buflen,actlen,s) */ 1 33 2 write_record entry (ptr, ptr, fixed (21), fixed (35)), 1 34 /* write_record(p,bufptr,buflen,s) */ 1 35 2 rewrite_record entry (ptr, ptr, fixed (21), fixed (35)), 1 36 /* rewrite_record(p,bufptr,buflen,s) */ 1 37 2 delete_record entry (ptr, fixed (35)),/* delete_record(p,s) */ 1 38 2 seek_key entry (ptr, char (256) varying, fixed (21), fixed (35)), 1 39 /* seek_key(p,key,len,s) */ 1 40 2 read_key entry (ptr, char (256) varying, fixed (21), fixed (35)), 1 41 /* read_key(p,key,len,s) */ 1 42 2 read_length entry (ptr, fixed (21), fixed (35)), 1 43 /* read_length(p,len,s) */ 1 44 2 open_file entry (ptr, fixed bin, char (*), bit (1) aligned, fixed bin (35)), 1 45 /* open_file(p,mode,desc,not_used,s) */ 1 46 2 close_file entry (ptr, char (*), fixed bin (35)), 1 47 /* close_file(p,desc,s) */ 1 48 2 detach entry (ptr, char (*), fixed bin (35)); 1 49 /* detach(p,desc,s) */ 1 50 1 51 declare iox_$iocb_version_sentinel 1 52 character (4) aligned external static; 1 53 1 54 /* END INCLUDE FILE ..... iocb.incl.pl1 ..... */ 225 226 2 1 /* BEGIN INCLUDE FILE mtape_data.incl.pl1. Created by J. A. Bush 10/06/82 */ 2 2 /* format: style4 */ 2 3 2 4 dcl mtdp ptr; 2 5 2 6 dcl mtape_data_version_1 char (8) int static options (constant) init ("mtdv0001"); 2 7 2 8 dcl 1 mtape_data aligned based (mtdp), 2 9 2 version char (8), /* Current structure version */ 2 10 2 areap ptr, /* Pointer to an allocation area */ 2 11 2 iocb_ptr ptr, /* Pointer to our IO control block */ 2 12 2 atdp ptr, /* Pointer to the attach description string */ 2 13 2 opdp ptr, /* Pointer to the open description string */ 2 14 2 cldp ptr, /* Pointer to close description string */ 2 15 2 dtdp ptr, /* Pointer to detach description string */ 2 16 2 cmtdp ptr, /* If non-null, Ptr to allocated copy of mtape_data */ 2 17 2 vs_head ptr, /* Pointer to the first volume_set structure */ 2 18 2 vs_tail ptr, /* Pointer to the last volume_set structure */ 2 19 2 vs_current ptr, /* Pointer to the current volume_set structure */ 2 20 2 vs_mounted_tail ptr, /* Pointer to MRM volume_set member */ 2 21 2 fi_head ptr, /* Pointer to the first file_info structure */ 2 22 2 fi_tail ptr, /* Pointer to the last file_info structure */ 2 23 2 fi_current ptr, /* Pointer to the current file_info structure */ 2 24 2 tape_infop ptr, /* Pointer to rcp tape info structure */ 2 25 2 last_ur_status_ptr ptr, /* If non-null, Ptr to last unrecoverable status */ 2 26 2 io_echan fixed bin (71), /* Fast wait channel for I/O interrupts */ 2 27 2 mount_echan fixed bin (71), /* Regular wait channel for mount requests */ 2 28 2 data_xfer_args, /* Arguments for time critical (read/write) calls */ 2 29 3 arg_buf_ptr ptr, /* Pointer to users buffer */ 2 30 3 arg_buf_len fixed bin (21), /* Length of users buffer in bytes */ 2 31 3 arg_rec_len fixed bin (21), /* Length of record read in bytes */ 2 32 2 error_lock fixed bin (35), /* if ^= 0 = file locked error code */ 2 33 2 abs_ans char (3), /* Query answer (yes or no) for abs user */ 2 34 2 user_type bit (1), /* "1"b => interactive; "0"b => absentee */ 2 35 2 display_errors bit (1), /* "1"b => display verbose error messages */ 2 36 2 force_end_of_volume bit (1), /* "1"b => simulate EOV on next write */ 2 37 2 opd_len fixed bin (21), /* Allocated length of open description */ 2 38 2 drives_in_use fixed bin, /* Number of tape drives currently in use */ 2 39 2 data_buffers, /* Info about data buffers */ 2 40 3 buf_ptrs (8) ptr, /* Pointers to a subset of ioi buffers */ 2 41 3 blind_buf_ptrs (8) ptr, /* Pointers to other subset of buffers */ 2 42 3 buf_len (8) fixed bin (21), /* Length of buffers in 9 bit bytes */ 2 43 3 blind_buf_len (8) fixed bin (21), /* Lengths of other subset of buffers */ 2 44 3 nbufs fixed bin, /* Number of data buffers currently in use */ 2 45 3 buf_size fixed bin (21), /* Allocated size of data buffers in bytes */ 2 46 3 bufs_per_subset fixed bin, /* Number of buffers to write/read per I/O */ 2 47 3 cur_buf_idx fixed bin, /* Index into subset of current buffer */ 2 48 3 run bit (1), /* "1"b => wrt I/O queued thru tape_ioi_; "0"b => ^Queued */ 2 49 2 label_buffer, /* Info about label record buffer */ 2 50 3 lab_bufp ptr, /* Pointer to label I/O buffer */ 2 51 3 lab_buf_len fixed bin (21), /* Length of label buffer in 9 bit bytes */ 2 52 2 tlb ptr, /* Pointer to a temp label record structure */ 2 53 2 position, /* Position on current volume */ 2 54 3 phy_file fixed bin, /* physical file number */ 2 55 3 phy_block fixed bin, /* physical block within physical file */ 2 56 2 current_file, /* instantanious info about current file */ 2 57 3 cur_block, /* info about current block */ 2 58 4 cur_buf_ptr ptr, /* Pointer to the current data buffer */ 2 59 4 log_record_ptr ptr, /* Pointer to current logical record */ 2 60 4 length fixed bin (21), /* Length of current block in bytes */ 2 61 4 processed fixed bin (21), /* Number of chars processed already */ 2 62 4 remain fixed bin (21), /* Number of chars remaining to be processed */ 2 63 4 log_record fixed bin (21), /* Log. record within the current block */ 2 64 3 char_size fixed bin, /* Size in bits of the data chars of this file */ 2 65 3 padding_char char (1), /* To pad blocks to mod 4 on binary writes */ 2 66 3 length_mode fixed bin, /* 0 => W/R mod 4 blocks; 1 => W/R non-mod 4 blocks */ 2 67 3 hdw_mode fixed bin, /* Hardware recording mode: 2 68* 1 = binary; 2 = nine track; 3 = BCD */ 2 69 3 conversion fixed bin, /* File data conversion: 2 70* 0 = no conversion; 1 = ASCII<->EBCDIC; 2 = ASCII<->BCD */ 2 71 3 buffer_offset fixed bin, /* Number of bytes prior to data */ 2 72 3 block_size fixed bin (21), /* Maximum block size for this file */ 2 73 3 record_size fixed bin (21), /* Maximum record size for this file */ 2 74 3 prev_block_no fixed bin (21), /* Number of previous block read */ 2 75 3 ad_file_format fixed bin, /* 1 = U; 2 = F; 3 = D or V; 4 = S or VS */ 2 76 3 file_blocked bit (1), /* "1"b => file is blocked */ 2 77 3 native_file bit (1), /* "1"b => current file written by mtape_ PFM */ 2 78 3 write_after_read bit (1), /* "1"b => truncate file (and file_set) at this record */ 2 79 3 first_file bit (1), /* "1"b => first file has been processed */ 2 80 3 tot_bytes_processed fixed bin (35), /* total bytes in this file section */ 2 81 3 last_io fixed bin, /* Last I/O operation (1 = read; 2 = write) */ 2 82 3 lrec_rrcx fixed bin, /* current index of the lrec round robin counter */ 2 83 3 lrec_rrc, /* history of last n logical records */ 2 84 4 block_no (0:7) fixed bin (35), /* block (within file section) where lrec starts */ 2 85 4 block_len (0:7) fixed bin (35), /* block len of current block */ 2 86 4 lrec_no (0:7) fixed bin (35), /* logical record within currnt block */ 2 87 4 abs_byte (0:7) fixed bin (35), /* byte (within file section) where lrec starts */ 2 88 4 byte_offset (0:7) fixed bin, /* offset of 1st byte of lrec (within block) */ 2 89 3 blk_rrcx fixed bin, /* index into blk_rrrc array of last block */ 2 90 3 blk_rrrc (0:7) fixed bin (35), /* contains Lrec count of last n blocks */ 2 91 3 tot_lrec fixed bin (35), /* Total logical records processed in current file */ 2 92 2 tioi_id bit (36), /* Identifier used for calls to tape_ioi_ */ 2 93 2 attach_info_ptr ptr, /* Pointer to attach option info */ 2 94 2 open_info_ptr ptr, /* Pointer to open option info */ 2 95 2 close_info_ptr ptr, /* Pointer to close option info */ 2 96 2 detach_info_ptr ptr, /* Pointer to detach option info */ 2 97 2 pfm_info_ptr ptr, /* Pointer to PFM info block */ 2 98 2 saved_pfm_info_ptr ptr, /* Pointer to info for "change_module" control OP */ 2 99 2 pfm_name char (32), /* Name of Per-Format module */ 2 100 2 pfm_required_entries like pfm_entries, /* Required entry point declarations in PFM */ 2 101 2 pfm_work_area (32) fixed bin (35); /* PFM work buffer */ 2 102 2 103 dcl 1 pfm_entries based aligned, /* Entry declarations for PFM entries */ 2 104 2 pfm_init entry (ptr, fixed bin (35)), /* PFM initialization entry */ 2 105 2 file_open entry (ptr, fixed bin (35)), /* PFM file_open entry */ 2 106 2 file_close entry (ptr, fixed bin (35)), /* PFM file_close entry */ 2 107 2 read entry (ptr, fixed bin (35)), /* PFM read entry */ 2 108 2 write entry (ptr, fixed bin (35)), /* PFM write entry */ 2 109 2 order entry (ptr, char (*), ptr, ptr, fixed bin (35)), /* PFM control order entry */ 2 110 2 decode_file_labels entry (ptr, ptr, fixed bin, fixed bin, fixed bin (35)), 2 111 2 encode_file_labels entry (ptr, ptr, fixed bin, fixed bin, fixed bin, fixed bin (35)); 2 112 2 113 dcl all_buf_ptrs (16) ptr based (addr (mtape_data.buf_ptrs)); 2 114 dcl all_buf_lens (16) fixed bin (21) based (addr (mtape_data.buf_len)); 2 115 dcl tape_blk (mtape_data.length) char (1) unaligned based (mtape_data.cur_buf_ptr); /* template for a tape block */ 2 116 2 117 /* END INCLUDE FILE mtape_data.incl.pl1 */ 227 228 3 1 /* BEGIN INCLUDE FILE mtape_open_close_info.incl.pl1. Created by J. A. Bush 06/13/83 */ 3 2 /* format: style4 */ 3 3 3 4 dcl moip ptr; /* Pointer to mtape_open_info structure */ 3 5 dcl mcip ptr; /* Pointer to mtape_close_info structure */ 3 6 3 7 dcl mtape_open_info_version_1 char (8) int static options (constant) init ("moiv0001"); 3 8 dcl mtape_close_info_version_1 char (8) int static options (constant) init ("mciv0001"); 3 9 3 10 dcl 1 mtape_open_info aligned based (moip), 3 11 2 version char (8), /* Current structure version */ 3 12 2 cs_ptr ptr, /* Pointer to arg processing control structure */ 3 13 2 cal_ptr ptr, /* Pointer to arg processing ctl arg list */ 3 14 2 so_ptr ptr, /* Pointer to last saved iox_ options */ 3 15 2 open_mode fixed bin, /* iox_ opening mode */ 3 16 2 comment char (80), /* Display on user_output after open */ 3 17 2 expiration char (24), /* File expiration date */ 3 18 2 file_format char (3), /* File format code */ 3 19 2 recording_mode char (6), /* Ascii, ebcdic, or binary */ 3 20 2 file_name char (32), /* Name of file to be recorded */ 3 21 2 replace_id char (32), /* Name of file to replace */ 3 22 2 init_to_zero, /* Enables clearing rest of structure */ 3 23 3 block_length fixed bin (35), /* Block size in bytes */ 3 24 3 record_length fixed bin (35), /* Record length specified by user */ 3 25 3 default_span_rlen fixed bin (35), /* Default record length for spanned records */ 3 26 3 default_var_rlen fixed bin (35), /* Default record length for variable records */ 3 27 3 default_fix_rlen fixed bin (35), /* Default record length for fixed records */ 3 28 3 seq_number fixed bin (35), /* File sequence number */ 3 29 3 append bit (1), /* "1"b => append file to end of file set */ 3 30 3 create bit (1), /* "1"b => create this file */ 3 31 3 display bit (1), /* "1"b => display the open description */ 3 32 3 extend bit (1), /* "1"b => extend the current file */ 3 33 3 force bit (1), /* "1"b => disregard file expiration when creating */ 3 34 3 last_file bit (1), /* "1"b => position to last file of file set */ 3 35 3 next_file bit (1), /* "1"b => position to next file of file set */ 3 36 3 modify bit (1), /* "1"b => modify the current file */ 3 37 3 label_entry_present bit (1), /* "1"b => user label entry is valid */ 3 38 3 user_label entry (ptr, char (*), fixed bin, fixed bin, fixed bin, fixed bin (35)), 3 39 3 pfm_args like pfm_arg_values; /* see structure below */ 3 40 3 41 dcl 1 mtape_close_info aligned based (mcip), 3 42 2 version char (8), /* Current structure version */ 3 43 2 cs_ptr ptr, /* Pointer to arg processing control structure */ 3 44 2 cal_ptr ptr, /* Pointer to arg processing ctl arg list */ 3 45 2 so_ptr ptr, /* Pointer to last saved iox_ options */ 3 46 2 comment char (80), /* Display on user_output after open */ 3 47 2 init_to_zero, /* Enables clearing rest of structure */ 3 48 3 display bit (1), /* Display open description for user */ 3 49 3 position fixed bin, /* For positioning on file closing: 3 50* 0 = Leave at current position; 3 51* 1 = Position to beginning of file; 3 52* 2 = Position to end of file; 3 53* 3 = Position to beginning of file section; 3 54* 4 = Position to end of file section */ 3 55 3 pfm_args like pfm_arg_values; /* see structure below */ 3 56 3 57 dcl 1 pfm_arg_values aligned based, /* Common to open and close_info */ 3 58 2 pfm_opt_sw (5) bit (1), /* PFM dependent */ 3 59 2 pfm_opt_value (5) fixed bin (35), /* PFM dependent */ 3 60 2 pfm_opt_str (5) char (32); /* PFM dependent */ 3 61 3 62 /* END INCLUDE FILE mtape_open_close_info.incl.pl1 */ 229 230 4 1 /* BEGIN INCLUDE FILE mtape_file_info.incl.pl1. Created by J. A. Bush 10/13/82 */ 4 2 /* format: style4 */ 4 3 4 4 dcl fi_ptr ptr; 4 5 4 6 dcl mtape_fi_version_1 char (8) int static options (constant) init ("mtfiv001"); 4 7 4 8 dcl 1 mtape_file_info aligned based (fi_ptr), 4 9 2 version char (8), /* Current version */ 4 10 2 prev_fi_ptr ptr, /* Pointer to the previous file info structure */ 4 11 2 next_fi_ptr ptr, /* Pointer to the next file info structure */ 4 12 2 first_file_lab_ptr ptr, /* Pointer to 1st label record struc. */ 4 13 2 last_file_lab_ptr ptr, /* Pointer to last label record struc. */ 4 14 2 first_file_trail_ptr ptr, /* Pointer to 1st trailer record struc. */ 4 15 2 last_file_trail_ptr ptr, /* Pointer to last trailer record struc. */ 4 16 2 first_file_section_ptr ptr, /* Pointer to file_info struct. of 1st file section */ 4 17 2 begin_vs_ptr ptr, /* Pointer to 1st volume set struct. containing this file */ 4 18 2 end_vs_ptr ptr, /* Pointer to last volume set struct. containing this file */ 4 19 2 position_within_file fixed bin, /* 0 = In HDR; 1 = In data file; 2 = In trailer; 4 20* 3 = Not positioned within this file 4 21* 4 = At beginning of data file; 5 = At EOF */ 4 22 2 per_file_info, /* Information pertaining to entire file */ 4 23 3 file_id char (32), /* File identifier or name */ 4 24 3 file_set_id char (32), /* Identifies the file set */ 4 25 3 creation_date char (6), /* File creation date in form " yyddd" */ 4 26 3 expiration_date char (6), /* File expiration date in form " yyddd" */ 4 27 3 file_code char (3), /* Printable file code */ 4 28 3 file_format fixed bin, /* Current file format: 4 29* 0 = unspecified; 1 = U; 2 = F; 3 = D or V; 4 30* 4 = S or VS; 5 = FB; 4 31* 6 = DB or VB; 7 = SB or VBS; */ 4 32 3 seq_number fixed bin, /* File sequence number */ 4 33 3 generation fixed bin, /* File generation number, if supported */ 4 34 3 gen_version fixed bin, /* File generation version number, if supported */ 4 35 3 char_size fixed bin, /* Size in bits of the data chars of this file */ 4 36 3 hdw_mode fixed bin, /* Hardware mode: 1 = binary; 2 = nine; 3 = BCD */ 4 37 3 conversion fixed bin, /* File data conversion: 4 38* 1 = no conversion; 2 = ASCII<->EBCDIC; 3 = ASCII<->BCD */ 4 39 3 buffer_offset fixed bin, /* Number of bytes prior to data */ 4 40 3 length_mode fixed bin, /* 0 => W/R mod 4 blocks; 1 => W/R non-mod 4 blocks */ 4 41 3 block_size fixed bin (21), /* Maximum block size for this file */ 4 42 3 record_size fixed bin (21), /* Maximum record size for this file */ 4 43 3 native_file bit (1), /* "1"b => current file written by mtape_ PFM */ 4 44 3 user_labels_present bit (1), /* "1"b => UHL/UTL are present */ 4 45 3 unlabeled_file bit (1), /* "1"b => this is unlabeled file */ 4 46 3 pfm_opt_sw (5) bit (1), /* PFM dependent */ 4 47 3 pfm_opt_value (5) fixed bin (35), /* PFM dependent */ 4 48 3 pfm_opt_str (5) char (32), /* PFM dependent */ 4 49 2 per_section_info, /* Information pertaining only to this file section */ 4 50 3 section fixed bin, /* File section number for multi-volume files */ 4 51 3 phy_file fixed bin, /* Phy. file of HDR label GRP, on the current volume */ 4 52 3 first_file_on_volume bit (1), /* "1"b => First file or file section on this volume */ 4 53 3 end_of_file_set bit (1), /* "1"b => This is last file of file set */ 4 54 3 block_count fixed bin (35), /* Number of blocks in this file section */ 4 55 3 read_errors fixed bin (35), /* of errors encountered reading this file */ 4 56 3 write_errors fixed bin (35); /* of errors encountered writing this file */ 4 57 4 58 /* END INCLUDE FILE mtape_file_info.incl.pl1 */ 231 232 5 1 /* Begin include file ..... iox_modes.incl.pl1 */ 5 2 5 3 /* Written by C. D. Tavares, 03/17/75 */ 5 4 /* Updated 10/31/77 by CDT to include short iox mode strings */ 5 5 5 6 dcl iox_modes (13) char (24) int static options (constant) aligned initial 5 7 ("stream_input", "stream_output", "stream_input_output", 5 8 "sequential_input", "sequential_output", "sequential_input_output", "sequential_update", 5 9 "keyed_sequential_input", "keyed_sequential_output", "keyed_sequential_update", 5 10 "direct_input", "direct_output", "direct_update"); 5 11 5 12 dcl short_iox_modes (13) char (4) int static options (constant) aligned initial 5 13 ("si", "so", "sio", "sqi", "sqo", "sqio", "squ", "ksqi", "ksqo", "ksqu", "di", "do", "du"); 5 14 5 15 dcl (Stream_input initial (1), 5 16 Stream_output initial (2), 5 17 Stream_input_output initial (3), 5 18 Sequential_input initial (4), 5 19 Sequential_output initial (5), 5 20 Sequential_input_output initial (6), 5 21 Sequential_update initial (7), 5 22 Keyed_sequential_input initial (8), 5 23 Keyed_sequential_output initial (9), 5 24 Keyed_sequential_update initial (10), 5 25 Direct_input initial (11), 5 26 Direct_output initial (12), 5 27 Direct_update initial (13)) fixed bin int static options (constant); 5 28 5 29 /* End include file ..... iox_modes.incl.pl1 */ 233 234 235 end mtape_position_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 06/11/85 1244.4 mtape_position_.pl1 >spec>online>pbf-06/10/85>mtape_position_.pl1 225 1 05/20/83 1846.4 iocb.incl.pl1 >ldd>include>iocb.incl.pl1 227 2 02/16/84 1452.3 mtape_data.incl.pl1 >ldd>include>mtape_data.incl.pl1 229 3 06/11/85 1238.7 mtape_open_close_info.incl.pl1 >spec>online>pbf-06/10/85>mtape_open_close_info.incl.pl1 231 4 02/16/84 1452.3 mtape_file_info.incl.pl1 >ldd>include>mtape_file_info.incl.pl1 233 5 02/02/78 1229.7 iox_modes.incl.pl1 >ldd>include>iox_modes.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. Sequential_input constant fixed bin(17,0) initial dcl 5-15 ref 135 Sequential_input_output constant fixed bin(17,0) initial dcl 5-15 ref 135 Stream_input constant fixed bin(17,0) initial dcl 5-15 ref 54 72 Stream_input_output constant fixed bin(17,0) initial dcl 5-15 ref 72 abs builtin function dcl 41 ref 59 actual_iocb_ptr 12 based pointer level 2 dcl 1-6 ref 121 addr builtin function dcl 41 ref 173 186 arg_buf_len 50 based fixed bin(21,0) level 3 dcl 2-8 set ref 109* 137* 141* arg_buf_ptr 46 based pointer level 3 dcl 2-8 set ref 108* 143* arg_code parameter fixed bin(35,0) dcl 26 set ref 6 56* 99* 105 114* arg_iocbp parameter pointer dcl 23 ref 6 105 121 arg_n parameter fixed bin(21,0) dcl 25 set ref 6 59 77 79 105 111* arg_rec_len 51 based fixed bin(21,0) level 3 dcl 2-8 ref 111 arg_type parameter fixed bin(17,0) dcl 24 ref 6 54 54 54 60 attach_data_ptr 16 based pointer level 2 dcl 1-6 ref 121 blk_rrcx 261 based fixed bin(17,0) level 3 dcl 2-8 set ref 191 206* blk_rrrc 262 based fixed bin(35,0) array level 3 dcl 2-8 set ref 190 192 192 199 200* 203 203 block_len 221 based fixed bin(35,0) array level 4 dcl 2-8 ref 175 block_no 211 based fixed bin(35,0) array level 4 dcl 2-8 ref 156 161 161 165 166 bn parameter fixed bin(21,0) dcl 154 ref 152 156 158 159 181 182 187 190 201 207 212 215 buffer_offset 175 based fixed bin(17,0) level 3 dcl 2-8 ref 184 byte_offset 251 based fixed bin(17,0) array level 4 dcl 2-8 ref 173 174 close_info_ptr 300 based pointer level 2 dcl 2-8 ref 124 code 000100 automatic fixed bin(35,0) dcl 30 set ref 64* 69* 74* 99 110* 112 114 125* 144 145* 167* 168 170* 171 208* 209 217* 218 cur_block 160 based structure level 3 dcl 2-8 cur_buf_ptr 160 based pointer level 4 dcl 2-8 ref 173 186 current_file 160 based structure level 2 dcl 2-8 data_xfer_args 46 based structure level 2 dcl 2-8 error_table_$no_operation 000010 external static fixed bin(35,0) dcl 37 ref 56 74 fi_current 34 based pointer level 2 dcl 2-8 ref 122 fi_ptr 000120 automatic pointer dcl 4-4 set ref 122* file_close 330 based entry variable level 3 dcl 2-8 ref 64 69 217 fn parameter fixed bin(21,0) dcl 133 ref 131 136 141 found 000110 automatic bit(1) dcl 33 set ref 196* 197 201* fwd_rcds 000103 automatic fixed bin(21,0) dcl 31 set ref 87* 88* 182* 207* 215* 220* hbound builtin function dcl 41 ref 156 161 192 203 i 000101 automatic fixed bin(21,0) dcl 31 set ref 144* 158* 159* 197* 199 200 203 203* 206 idx 000107 automatic fixed bin(17,0) dcl 32 set ref 157* 160* 160 161 161* 165 166 173 174 175 176 178 191* 192 192* 197 init_to_zero 34 based structure level 2 dcl 3-41 iocb based structure level 1 dcl 1-6 j 000106 automatic fixed bin(17,0) dcl 32 set ref 166* 167* 169 195* 198* 198 208* lbound builtin function dcl 41 ref 161 192 203 length 164 based fixed bin(21,0) level 4 dcl 2-8 set ref 175* 177 185 log_record 167 based fixed bin(21,0) level 4 dcl 2-8 set ref 176* 181 182 183* 194 log_record_ptr 162 based pointer level 4 dcl 2-8 set ref 173* 186* 210* lrec_no 231 based fixed bin(35,0) array level 4 dcl 2-8 ref 176 lrec_rrc 211 based structure level 3 dcl 2-8 lrec_rrcx 210 based fixed bin(17,0) level 3 dcl 2-8 set ref 157 178* mcip 000116 automatic pointer dcl 3-5 set ref 62 67 124* 216 moip 000114 automatic pointer dcl 3-4 set ref 54 72 72 123* 135 135 mtape_close_info based structure level 1 dcl 3-41 mtape_data based structure level 1 dcl 2-8 mtape_io_$order 000012 constant entry external dcl 45 ref 167 208 mtape_io_$read_block 000014 constant entry external dcl 46 ref 170 mtape_open_info based structure level 1 dcl 3-10 mtdp 000112 automatic pointer dcl 2-4 set ref 64 64* 69 69* 84 86 87 91 108 109 110 110* 111 121* 122 123 124 137 141 143 145 145* 156 157 161 161 165 165 166 166 167* 169 169 170* 173 173 173 174 174 175 175 176 176 177 177 177 178 181 182 183 184 184 185 185 185 186 186 186 187 187 190 191 192 192 194 199 200 203 203 206 208* 210 211 212 212 215 217 217* n 000105 automatic fixed bin(21,0) dcl 31 set ref 59* 79* 81* 84 86 87 91* 91 92* 96* n_its 000104 automatic fixed bin(21,0) dcl 31 set ref 136* 140* 144 null builtin function dcl 41 ref 108 143 167 167 208 208 210 open_info_ptr 276 based pointer level 2 dcl 2-8 ref 123 open_mode 10 based fixed bin(17,0) level 2 dcl 3-10 ref 54 72 72 135 135 pfm_arg_values based structure level 1 dcl 3-57 pfm_entries based structure level 1 dcl 2-103 pfm_required_entries 320 based structure level 2 dcl 2-8 phy_block 157 based fixed bin(17,0) level 3 dcl 2-8 ref 165 166 position 156 based structure level 2 in structure "mtape_data" dcl 2-8 in procedure "mtape_position_" position 35 based fixed bin(17,0) level 3 in structure "mtape_close_info" dcl 3-41 in procedure "mtape_position_" set ref 62* 67* 216* prev_block_no 200 based fixed bin(21,0) level 3 dcl 2-8 set ref 169* 169 processed 165 based fixed bin(21,0) level 4 dcl 2-8 set ref 174* 177 184* 185 186 read 334 based entry variable level 3 dcl 2-8 ref 110 145 remain 166 based fixed bin(21,0) level 4 dcl 2-8 set ref 177* 185* 211* sum builtin function dcl 41 ref 190 tape_blk based char(1) array unaligned dcl 2-115 set ref 173 186 tot_lrec 272 based fixed bin(35,0) level 3 dcl 2-8 set ref 84 86 87 91 187* 187 212* 212 215 tot_rcds 000102 automatic fixed bin(21,0) dcl 31 set ref 194* 199* 199 201 207 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. Direct_input internal static fixed bin(17,0) initial dcl 5-15 Direct_output internal static fixed bin(17,0) initial dcl 5-15 Direct_update internal static fixed bin(17,0) initial dcl 5-15 Keyed_sequential_input internal static fixed bin(17,0) initial dcl 5-15 Keyed_sequential_output internal static fixed bin(17,0) initial dcl 5-15 Keyed_sequential_update internal static fixed bin(17,0) initial dcl 5-15 Sequential_output internal static fixed bin(17,0) initial dcl 5-15 Sequential_update internal static fixed bin(17,0) initial dcl 5-15 Stream_output internal static fixed bin(17,0) initial dcl 5-15 all_buf_lens based fixed bin(21,0) array dcl 2-114 all_buf_ptrs based pointer array dcl 2-113 iox_$iocb_version_sentinel external static char(4) dcl 1-51 iox_modes internal static char(24) initial array dcl 5-6 mtape_close_info_version_1 internal static char(8) initial unaligned dcl 3-8 mtape_data_version_1 internal static char(8) initial unaligned dcl 2-6 mtape_fi_version_1 internal static char(8) initial unaligned dcl 4-6 mtape_file_info based structure level 1 dcl 4-8 mtape_open_info_version_1 internal static char(8) initial unaligned dcl 3-7 n_chars automatic fixed bin(21,0) dcl 31 rcd_len automatic fixed bin(21,0) dcl 31 short_iox_modes internal static char(4) initial array dcl 5-12 NAMES DECLARED BY EXPLICIT CONTEXT. BACKSPACE 000337 constant entry internal dcl 152 ref 81 92 112 FORWARD_SPACE 000265 constant entry internal dcl 131 ref 79 88 96 220 SETUP 000246 constant entry internal dcl 119 ref 53 107 action 000000 constant label array(-1:3) dcl 62 ref 60 mtape_position_ 000025 constant entry external dcl 6 position_exit 000174 constant label dcl 99 ref 65 70 75 77 82 94 read_length 000203 constant entry external dcl 105 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1056 1074 771 1066 Length 1354 771 16 244 64 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME mtape_position_ 154 external procedure is an external procedure. SETUP internal procedure shares stack frame of external procedure mtape_position_. FORWARD_SPACE internal procedure shares stack frame of external procedure mtape_position_. BACKSPACE internal procedure shares stack frame of external procedure mtape_position_. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME mtape_position_ 000100 code mtape_position_ 000101 i mtape_position_ 000102 tot_rcds mtape_position_ 000103 fwd_rcds mtape_position_ 000104 n_its mtape_position_ 000105 n mtape_position_ 000106 j mtape_position_ 000107 idx mtape_position_ 000110 found mtape_position_ 000112 mtdp mtape_position_ 000114 moip mtape_position_ 000116 mcip mtape_position_ 000120 fi_ptr mtape_position_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_var call_ext_out_desc call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. mtape_io_$order mtape_io_$read_block THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$no_operation LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 6 000020 53 000037 54 000040 56 000053 57 000056 59 000057 60 000064 62 000066 64 000071 65 000102 67 000103 69 000106 70 000117 72 000120 74 000126 75 000131 77 000132 79 000134 81 000140 82 000142 84 000143 86 000147 87 000150 88 000156 89 000160 91 000161 92 000167 94 000171 96 000172 99 000174 101 000176 105 000177 107 000215 108 000216 109 000221 110 000222 111 000232 112 000235 114 000243 115 000245 119 000246 121 000247 122 000255 123 000257 124 000261 125 000263 127 000264 131 000265 135 000267 136 000275 137 000277 138 000301 140 000302 141 000304 143 000307 144 000311 145 000323 146 000334 148 000336 152 000337 156 000341 157 000344 158 000350 159 000357 160 000362 161 000364 164 000370 165 000372 166 000377 167 000406 168 000442 169 000445 170 000453 171 000464 173 000467 174 000477 175 000504 176 000506 177 000510 178 000513 179 000515 181 000516 182 000522 183 000525 184 000526 185 000530 186 000533 187 000537 188 000547 190 000550 191 000572 192 000575 194 000600 195 000602 196 000604 197 000605 198 000612 199 000613 200 000621 201 000622 203 000630 205 000635 206 000640 207 000644 208 000650 209 000704 210 000707 211 000712 212 000714 213 000723 215 000724 216 000732 217 000735 218 000745 220 000750 223 000752 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved