COMPILATION LISTING OF SEGMENT mrds_dsm_read_header Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/18/85 1020.9 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * * 4* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 5* * * 6* * * 7* *********************************************************** */ 8 9 /* ****************************************************** 10* * * 11* * * 12* * Copyright (c) 1972 by Massachusetts Institute of * 13* * Technology and Honeywell Information Systems, Inc. * 14* * * 15* * * 16* ****************************************************** */ 17 18 mrds_dsm_read_header: proc (area_ptr, hd_ptr, iocb_ptr, a_code); 19 20 /* 21* This routine using the input iocb_ptr reads a record with a null 22* key and checks to be sure its a submodel header. If it is not it 23* returns the code mrds_error_$not_dsm. If it is, then for the main 24* entry point it obtains the number of relations loads that number 25* into the header and returns a pointer to the header structure 26* which it allocated in the area pointed to by the area_ptr input 27* parameter. For the version entry point after the header is read 28* and varified the version value is extracted and returned while 29* the space the header record was read into is freed. The db_path 30* entry point is similar to the version entry point but the db_path 31* rather than the version is returned. 32* 33* Known Bugs: 34* 35* Other Problems: 36* 37* HISTORY 38* 39* 80-08-11 Spratt: Remove code to infer database_pn from the dsm 40* . path, which was valid as long as the dsm was always in 41* . the db directory. It became necessary to change this 42* . because dsm's are now only placed in the db when the 43* . -install control argument is used with cmdsm, otherwise 44* . the dsm ends up in the users working directory. 45* 46* 80-12-24 Davids: changed the version comparison from equal to the 47* . lastest version to < 4, since submodel code will be able 48* . to handle version 4 or later code. 49* 50* 81-01-08 Davids: added code description and reformated the 51* . dclarations and history section added the entry version 52* . removed the version check and added a check to be sure 53* . that the record read is indeed a submodel header record. 54* . reworked the code creating the internal procedure 55* . common. 56* 57* 81-01-09 Davids: discovered that the key of the header record was 58* . not the same for version 1, 4, and 5 submodels. all keys 59* . force the header record to the begining of the file but 60* . that can be done with keys of "", low (32) or low (256) 61* . so now the header record is found just by going to the 62* . beginning of the file. 63* 64* 81-01-12 Davids: changed reference of 65* . mrds_dsm_display_rels.incl.pl1 to 66* . mrds_dsm_relation_names.incl.pl1. this expands the 67* . relation names for 32 to 64 characters. 68* 69* 81-01-28 Davids: changed drel_ptr to mrds_dsm_relation_names_ptr 70* . to correspond to changes in the mrds_dsm_relation_names 71* . include file. 72* 73* 81-03-31 Davids: added the db_path entry point, removed the call 74* . to mrds_dsm_get_relation_names to determine the number 75* . of relations in the submodel for version 5 submodels 76* . since for version 5 submodels that information is 77* . correctly stored in the header. 78* 79* 81-05-20 Rickie E. Brinegar: Changed references to 80* . dsm_relation_names to mrds_dsm_relation_names due to a 81* . change in the include file. 82* 83* 81-06-01 Davids: changed mrds_dsm_header_str.incl.pl1 to 84* . mrds_dsm_header.incl.pl1. 85* 86* 84-10-23 Thanh Nguyen: On the opening of an old submodel < 5, 87* . we only need to get the number of relations. Therefore, 88* . the entry mrds_dsm_get_relation_names$number_of_rels 89* . should be called instead of mrds_dsm_get_relation_names. 90* . Another reason for this change is that the allocation 91* . area passing from mrds_dsl_init_res is too small (200 92* . words) to kept more than 6 rel. names to be filled by 93* . mrds_dsm_get_relation_names. Kudo to Hurst from AFDSC 94* . for reporting this problem. 95* 96* 84-11-01 Paul Benjamin: Changed to use local_hd_ptr for manipulation, 97* . only setting hd_ptr to something useful just prior to returning. 98**/ 99 100 /* PARAMETERS */ 101 102 dcl area_ptr ptr; /* (input) allocation area */ 103 dcl db_path char (168); /* (output) path of database associated with submodel */ 104 dcl hd_ptr ptr; /* (output) header record structure pointer */ 105 dcl iocb_ptr ptr; /* (input) iocb pointer */ 106 dcl a_code fixed bin (35); /* (output) error code */ 107 dcl version fixed bin; /* (output) version of submodel */ 108 109 /* AUTOMATIC */ 110 111 dcl code fixed bin (35) init (0); /* internal error code */ 112 dcl local_hd_ptr ptr; /* local copy of hd_ptr */ 113 dcl 01 mrds_dsm_header_copy like mrds_dsm_header; /* storage for a header record */ 114 115 /* BASED */ 116 117 dcl area_buffer area based (area_ptr); /* allocation buffer assumes non-freeing */ 118 119 /* BUILTIN */ 120 dcl addr builtin; 121 dcl null builtin; 122 dcl size builtin; 123 124 /* ENTRIES */ 125 126 dcl mrds_dsm_get_relation_names$number_of_rels entry (ptr, fixed bin (35)) returns (fixed bin); 127 128 1 1 /* BEGIN INCLUDE FILE mrds_dsm_header.incl.pl1 1 2* 1 3*This include file is for internal MRDS use only - it is not to be 1 4*documented in any user manual. 1 5* 1 6*81-06-01 Davids: This is a copy of the mrds_dsm_header_str 1 7*include file, it is to be used by all mrds routines. The 1 8*structure name has been changed from dsm_header_record to 1 9*mrds_dsm_header to avoid conflicts when both this include file 1 10*and mrds_dsm_header_str are included (mrds_dsm_dsmd). 1 11**/ 1 12 1 13 dcl 1 mrds_dsm_header based, /* header structure for a MRDS submodel */ 1 14 2 dsm_generator_version fixed bin init (0), /* version number of submodel created by CMDSM */ 1 15 2 date_time_generated fixed bin (71) init (0), /* convert data to binary form of creation time */ 1 16 2 database_pn char (168) init (""), /* pathname of database this submodel is valid for */ 1 17 2 name char (32) init (""), /* identifying name for this header structure */ 1 18 2 num_of_relations fixed bin (35) init (0), /* number of relations in submodel view of database */ 1 19 2 creator_id char (32) init ("") ; /* the person.project.tag of the submodel creator */ 1 20 1 21 /* END INCLUDE FILE mrds_dsm_header.incl.pl1 */ 129 130 2 1 /* BEGIN INCLUDE FILE mrds_dsm_relation_names.incl.pl1 -- nsd 81/01/12 */ 2 2 2 3 /* 2 4*This include file is for internal mrds use only. It is used to 2 5*return an array of submodel relation names. 2 6* 2 7*HISTORY 2 8* 2 9*81-01-12 Davids: written 2 10* 2 11*81-09-14 Davids: changed relation to char (32) from char (64). 64 2 12*was a proposed maximum but could not be implemented. Several 2 13*modules would not compile when compiled with -prefix stringsize 2 14*becuase they made assignments of the form char (32) = char (64). 2 15**/ 2 16 2 17 dcl 1 mrds_dsm_relation_names based (mrds_dsm_relation_names_ptr), 2 18 2 nrels fixed bin, 2 19 2 relation (mrds_dsm_relation_names_nrels_alloc refer (mrds_dsm_relation_names.nrels)) char (32); 2 20 2 21 dcl mrds_dsm_relation_names_nrels_alloc fixed bin; 2 22 2 23 dcl mrds_dsm_relation_names_ptr ptr; 2 24 2 25 /* END INCLUDE FILE mrds_dsm_relation_names.incl.pl1 */ 2 26 131 132 133 /* 134* main entry point - reads and verifies the header structure, reads 135* all the relations and loads the relation count into the header 136* structure. Why the relation count is not stored in the header 137* structure to begin with i do not know. 138**/ 139 140 hd_ptr = null; 141 allocate mrds_dsm_header in (area_buffer) set (local_hd_ptr); 142 143 call common (local_hd_ptr, size (mrds_dsm_header) * 4); 144 if code = 0 & local_hd_ptr -> mrds_dsm_header.dsm_generator_version < 5 then 145 local_hd_ptr -> mrds_dsm_header.num_of_relations = mrds_dsm_get_relation_names$number_of_rels (iocb_ptr, code); 146 147 if code = 0 148 then hd_ptr = local_hd_ptr; 149 150 a_code = code; 151 152 return; 153 154 version: entry (iocb_ptr, version, a_code); 155 156 /* 157* The main reason for this entry point is so that modules that need 158* to know the submodel version they are dealing with do not have to 159* include the entire header structure. 160**/ 161 162 call common (addr (mrds_dsm_header_copy), size (mrds_dsm_header) * 4); 163 if code = 0 164 then version = mrds_dsm_header_copy.dsm_generator_version; 165 else version = 0; 166 167 a_code = code; 168 169 return; 170 171 db_path: entry (iocb_ptr, db_path, a_code); 172 173 /* 174* This entry returns just the db_path that is stored in the 175* submodel header. routines that need to know just the db_path 176* should not be required to know the entire submodel header 177* structure. 178**/ 179 180 call common (addr (mrds_dsm_header_copy), size (mrds_dsm_header_copy) * 4); 181 if code = 0 182 then db_path = mrds_dsm_header_copy.database_pn; 183 else db_path = ""; 184 185 a_code = code; 186 return; 187 188 common: proc (buffer_ptr, buffer_size); 189 190 /* 191* This internal procedure reads and verifies the header structure 192**/ 193 194 /* PARAMETERS */ 195 196 dcl buffer_ptr ptr; /* (input) pointer to input buffer */ 197 dcl buffer_size fixed bin (21); /* (input) size of buffer */ 198 199 /* AUTOMATIC */ 200 201 dcl record_length fixed bin (21); /* length of record */ 202 203 /* CONSTANTS */ 204 205 dcl BOF fixed bin init (-1) internal static options (constant); 206 /* used to indicate the beginning of the file */ 207 208 /* ENTRIES */ 209 210 dcl iox_$position entry (ptr, fixed bin, fixed bin (21), fixed bin (35)); 211 dcl iox_$read_record entry (ptr, ptr, fixed bin (21), fixed bin (21), fixed bin (35)); 212 213 /* EXTERNAL */ 214 215 dcl mrds_error_$not_dsm fixed bin (35) external static; 216 217 218 219 code = 0; 220 221 call iox_$position (iocb_ptr, BOF, 0, code); 222 if code = 0 223 then do; 224 call iox_$read_record (iocb_ptr, buffer_ptr, buffer_size, record_length, code); 225 if code = 0 226 then do; 227 if buffer_ptr -> mrds_dsm_header.name ^= "data_submodel_header" 228 then code = mrds_error_$not_dsm; 229 end; 230 231 end; 232 233 return; 234 235 end /* common */; 236 237 238 end /* mrds_dsm_read_header */; 239 SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/18/85 0907.0 mrds_dsm_read_header.pl1 >special_ldd>online>mrds.pbf-04/18/85>mrds_dsm_read_header.pl1 129 1 10/14/83 1608.9 mrds_dsm_header.incl.pl1 >ldd>include>mrds_dsm_header.incl.pl1 131 2 10/14/83 1609.0 mrds_dsm_relation_names.incl.pl1 >ldd>include>mrds_dsm_relation_names.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. BOF 000000 constant fixed bin(17,0) initial dcl 205 set ref 221* a_code parameter fixed bin(35,0) dcl 106 set ref 18 150* 154 167* 171 185* addr builtin function dcl 120 ref 162 162 180 180 area_buffer based area(1024) dcl 117 ref 141 area_ptr parameter pointer dcl 102 ref 18 141 buffer_ptr parameter pointer dcl 196 set ref 188 224* 227 buffer_size parameter fixed bin(21,0) dcl 197 set ref 188 224* code 000100 automatic fixed bin(35,0) initial dcl 111 set ref 111* 144 144* 147 150 163 167 181 185 219* 221* 222 224* 225 227* creator_id 67 based char(32) initial level 2 in structure "mrds_dsm_header" packed unaligned dcl 1-13 in procedure "mrds_dsm_read_header" set ref 141* creator_id 67 000104 automatic char(32) initial level 2 in structure "mrds_dsm_header_copy" packed unaligned dcl 113 in procedure "mrds_dsm_read_header" set ref 113* database_pn 4 000104 automatic char(168) initial level 2 in structure "mrds_dsm_header_copy" packed unaligned dcl 113 in procedure "mrds_dsm_read_header" set ref 113* 181 database_pn 4 based char(168) initial level 2 in structure "mrds_dsm_header" packed unaligned dcl 1-13 in procedure "mrds_dsm_read_header" set ref 141* date_time_generated 2 based fixed bin(71,0) initial level 2 in structure "mrds_dsm_header" dcl 1-13 in procedure "mrds_dsm_read_header" set ref 141* date_time_generated 2 000104 automatic fixed bin(71,0) initial level 2 in structure "mrds_dsm_header_copy" dcl 113 in procedure "mrds_dsm_read_header" set ref 113* db_path parameter char(168) unaligned dcl 103 set ref 171 181* 183* dsm_generator_version based fixed bin(17,0) initial level 2 in structure "mrds_dsm_header" dcl 1-13 in procedure "mrds_dsm_read_header" set ref 141* 144 dsm_generator_version 000104 automatic fixed bin(17,0) initial level 2 in structure "mrds_dsm_header_copy" dcl 113 in procedure "mrds_dsm_read_header" set ref 113* 163 hd_ptr parameter pointer dcl 104 set ref 18 140* 147* iocb_ptr parameter pointer dcl 105 set ref 18 144* 154 171 221* 224* iox_$position 000012 constant entry external dcl 210 ref 221 iox_$read_record 000014 constant entry external dcl 211 ref 224 local_hd_ptr 000102 automatic pointer dcl 112 set ref 141* 143* 144 144 147 mrds_dsm_get_relation_names$number_of_rels 000010 constant entry external dcl 126 ref 144 mrds_dsm_header based structure level 1 unaligned dcl 1-13 set ref 141 143 162 mrds_dsm_header_copy 000104 automatic structure level 1 unaligned dcl 113 set ref 162 162 180 180 180 mrds_error_$not_dsm 000016 external static fixed bin(35,0) dcl 215 ref 227 name 56 000104 automatic char(32) initial level 2 in structure "mrds_dsm_header_copy" packed unaligned dcl 113 in procedure "mrds_dsm_read_header" set ref 113* name 56 based char(32) initial level 2 in structure "mrds_dsm_header" packed unaligned dcl 1-13 in procedure "mrds_dsm_read_header" set ref 141* 227 null builtin function dcl 121 ref 140 num_of_relations 66 000104 automatic fixed bin(35,0) initial level 2 in structure "mrds_dsm_header_copy" dcl 113 in procedure "mrds_dsm_read_header" set ref 113* num_of_relations 66 based fixed bin(35,0) initial level 2 in structure "mrds_dsm_header" dcl 1-13 in procedure "mrds_dsm_read_header" set ref 141* 144* record_length 000216 automatic fixed bin(21,0) dcl 201 set ref 224* size builtin function dcl 122 ref 143 162 180 version parameter fixed bin(17,0) dcl 107 set ref 154 163* 165* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. mrds_dsm_relation_names based structure level 1 unaligned dcl 2-17 mrds_dsm_relation_names_nrels_alloc automatic fixed bin(17,0) dcl 2-21 mrds_dsm_relation_names_ptr automatic pointer dcl 2-23 NAMES DECLARED BY EXPLICIT CONTEXT. common 000251 constant entry internal dcl 188 ref 143 162 180 db_path 000211 constant entry external dcl 171 mrds_dsm_read_header 000045 constant entry external dcl 18 version 000151 constant entry external dcl 154 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 454 474 346 464 Length 716 346 20 205 105 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME mrds_dsm_read_header 180 external procedure is an external procedure. common internal procedure shares stack frame of external procedure mrds_dsm_read_header. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME mrds_dsm_read_header 000100 code mrds_dsm_read_header 000102 local_hd_ptr mrds_dsm_read_header 000104 mrds_dsm_header_copy mrds_dsm_read_header 000216 record_length common THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return ext_entry alloc_based THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. iox_$position iox_$read_record mrds_dsm_get_relation_names$number_of_rels THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. mrds_error_$not_dsm LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 111 000020 113 000021 18 000040 140 000060 141 000063 143 000107 144 000113 147 000136 150 000143 152 000144 154 000145 162 000164 163 000172 165 000200 167 000202 169 000204 171 000205 180 000224 181 000232 183 000242 185 000247 186 000250 188 000251 219 000253 221 000254 222 000272 224 000274 225 000314 227 000316 233 000330 ----------------------------------------------------------- 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