COMPILATION LISTING OF SEGMENT vrm_get_population Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 11/21/84 1432.6 mst Wed Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 get_population: proc (I_rel_cursor_ptr, O_number_of_tuples, O_code); 7 8 9 /* BEGIN_DESCRIPTION 10* 11* This routine will return the number of tuples in the specified relation 12* by asking vfile_ for its count. This is very fast and very accurate. 13* 14* END_DESCRIPTION 15**/ 16 17 /* HISTORY 18* 19* 19 September 1983 R. Harvey: Initially written 20* 21**/ 22 23 /* get_population: proc (I_rel_cursor_ptr, O_number_of_tuples, O_code); */ 24 25 26 /* Parameters */ 27 28 dcl I_rel_cursor_ptr ptr; 29 dcl O_number_of_tuples fixed bin (35); 30 dcl O_code fixed bin (35); 31 32 33 O_number_of_tuples = 0; /* init */ 34 O_code = 0; 35 36 vrm_cursor_ptr = I_rel_cursor_ptr; 37 vrm_open_info_ptr = vrm_cursor.open_info_ptr; 38 iocb_ptr = vrm_cursor.iocb_ptr; 39 40 vrm_rel_desc_ptr = vrm_open_info.relation_model_ptr; 41 42 vfsi.info_version = vfs_version_1; 43 call iox_$control (iocb_ptr, "file_status", addr (vfsi), code); 44 if code ^= 0 45 then call error (code); 46 47 /* Now we have a count of what vfile_ thinks is there. We need to adjust this to conform to reality */ 48 49 if vrm_rel_desc.switches.MRDS_compatible 50 then O_number_of_tuples = vfsi.non_null_recs - 1; /* because there is really a null record */ 51 else O_number_of_tuples = vfsi.non_null_recs - 1 - vrm_open_info.number_of_index_collections; 52 53 54 Exit: return; 55 56 57 58 error: proc (ecode); 59 60 dcl ecode fixed bin (35) parameter; 61 62 O_code = ecode; 63 go to Exit; 64 65 end error; 66 1 1 /* BEGIN INCLUDE vrm_open_info.incl.pl1 */ 1 2 1 3 /* R. Harvey 82-11-02 1 4* 82-09-82 Roger Lackey: added iocb_list_ptr */ 1 5 1 6 dcl 1 vrm_open_info aligned based (vrm_open_info_ptr), /* Vfile relation description */ 1 7 2 version char (8), /* Version number of this structure */ 1 8 2 opening_id bit (36) aligned, /* Opening id associated with this desc */ 1 9 2 file_uid bit (36) aligned, /* Unique id of msf dir */ 1 10 2 number_of_openings fixed bin, /* Number of separate calls to vrm$open */ 1 11 2 switches, 1 12 3 shared bit (1) unal, /* Open relation in shared mode */ 1 13 3 pad bit (35) unal init ("0"b), /* Unused must be zero */ 1 14 2 database_dir_path char (168) varying, /* Absolute path of database */ 1 15 2 relation_name char (30) varying, /* Name of relation */ 1 16 2 relation_model_ptr pointer, /* Pointer to the relation_model in the relation itself or a temp seg */ 1 17 2 com_ptr pointer, /* Temp seg for cursors and scratch space */ 1 18 2 iocb_list_ptr pointer, /* Pointer to first vrm_iocb_list_block */ 1 19 2 primary_key_info_ptr pointer, /* Special case collection info ptr */ 1 20 2 number_of_index_collections fixed bin, /* Count of index collections (include primary key) */ 1 21 2 index_collection (voi_no_of_index_collections 1 22 refer (vrm_open_info.number_of_index_collections)), 1 23 3 id bit (36), 1 24 3 info_ptr ptr unal; /* Points to more detailed info */ 1 25 1 26 1 27 dcl VRM_OPEN_INFO_VERSION_1 char (8) int static options (constant) init (" 1"); 1 28 dcl vrm_open_info_ptr ptr; 1 29 dcl voi_no_of_index_collections fixed bin; 1 30 1 31 /* END INCLUDE vrm_open_info.incl.pl1 */ 67 68 2 1 /* BEGIN INCLUDE vrm_rel_desc.incl.pl1 */ 2 2 2 3 /* 83-05-26 Roger Lackey : Added vrm_attr_info.key_head bit for relation_cursors */ 2 4 2 5 dcl 1 vrm_rel_desc based (vrm_rel_desc_ptr), 2 6 2 record_id bit (12) unal, /* Distinguish us from tuples and collection records */ 2 7 2 version char (8), /* Version of this structure */ 2 8 2 file_id bit (7), /* Value of file id from model */ 2 9 2 rel_id bit (12), /* Relation id */ 2 10 2 switches, 2 11 3 MRDS_compatible bit (1) unal, /* For pre-relation_manager_ MRDS */ 2 12 3 stationary_records 2 13 bit (1) unal, /* On = stationary */ 2 14 3 indexed bit (1) unal, /* This relation has attributes with secondary indices */ 2 15 3 pad bit (33) unal, 2 16 2 var_offset fixed bin (35), /* Position of first varying attr */ 2 17 2 maximum_data_length 2 18 fixed bin (35), /* Maximum size of tuple in characters */ 2 19 2 number_primary_key_attrs 2 20 fixed bin, /* Number of attributes which make up the primary key */ 2 21 2 number_sec_indexes fixed bin, /* Number of attributes which have a secondary index */ 2 22 2 last_var_attr_no fixed bin, /* Attr index of last varying attribute */ 2 23 2 number_var_attrs fixed bin, /* Number of varying attributes */ 2 24 2 number_attrs fixed bin, /* Number of attribute in rel */ 2 25 2 attr (vrd_no_of_attrs /* Description of each attribute */ 2 26 refer (vrm_rel_desc.number_attrs)) aligned like vrm_attr_info; 2 27 2 28 dcl 1 vrm_attr_info based (vrm_attr_info_ptr), 2 29 /* Attribute specific info */ 2 30 2 name char (32), /* Name of the attribute */ 2 31 2 descriptor bit (36) aligned, /* domain descriptor */ 2 32 2 varying bit (1) unal, /* ON = This is a varying string */ 2 33 2 key_head bit (1) unal, /* ON = This attr can be a keyhead */ 2 34 2 primary_key_attr bit (1) unal, /* ON = This is a primary key attribute */ 2 35 2 pad bit (15) unal, /* unused */ 2 36 2 index_collextion_ix fixed bin (17) unal, /* Index into vrm_open_info.index_collection array if key_head is on */ 2 37 2 bit_length fixed bin (35), /* Maximum bit length of tuple */ 2 38 2 bit_offset fixed bin (35); /* Offset in tuple if fixed, index to offset in tuple if varying */ 2 39 2 40 2 41 dcl vrm_rel_desc_ptr pointer; 2 42 dcl vrd_no_of_attrs fixed bin; 2 43 dcl VRM_REL_DESC_RECORD_ID bit (12) unal int static options (constant) init ("100000000000"b); 2 44 dcl VRM_REL_DESC_VERSION_1 char (8) int static options (constant) init (" 1"); 2 45 dcl vrm_attr_info_ptr pointer; 2 46 dcl VRM_REL_DESC_KEY char (256) varying int static options (constant) init ("@relation_description"); 2 47 2 48 /* END INCLUDE vrm_rel_desc.incl.pl1 */ 69 70 3 1 /* BEGIN INCLUDE vrm_cursor.incl.pl1 */ 3 2 3 3 /* 83-05-26 Roger Lackey : Modifyed for relation cursors */ 3 4 3 5 dcl vrm_cursor_ptr pointer; /* Pointer to this structure */ 3 6 3 7 dcl 1 vrm_cursor aligned based (vrm_cursor_ptr), /* vfile relation manager cursor */ 3 8 2 opening_id bit (36) aligned, /* ID of opening associated with this cursor */ 3 9 2 debug_sw unal, /* Undefined MBZ */ 3 10 3 trace_open bit (1) unal, /* Show opening of iocb cursor creation time */ 3 11 3 pad bit (35) unal, 3 12 2 switches, 3 13 3 shared bit (1) unal, /* Other processes can use this relation */ 3 14 3 meter_sw bit (1) unal, /* On = Keep meters for this cursor */ 3 15 3 pad bit (7) unal, /* Unsed */ 3 16 2 opening_mode fixed bin, /* Opening mode for this cursor (8 = KSQR 10 = KSQU) */ 3 17 2 open_info_ptr pointer, /* Pointer to parent opening info structure */ 3 18 2 vrm_relation_desc_ptr pointer, /* Pointer to parent rel desc */ 3 19 2 iocb_ptr pointer, /* Pointer to attach iocb */ 3 20 2 secondary_iocb_ptr ptr, /* Second iocb_ptr used by vrmu_search */ 3 21 2 search_list_ptr ptr, /* Pointer to search_list */ 3 22 2 search_keys_ptr ptr, /* Pointer to search_keys array */ 3 23 2 meter_ptr pointer, /* Pointer metering str if metering is on or null */ 3 24 2 vrm_iocb_list_block_ptr pointer, /* Pointer to vrm_iocb_list_block that contains this cursors iocb */ 3 25 2 vrm_iocb_list_block_iocbs_ix fixed bin; /* Index into list_block.iocbs for location of iocb */ 3 26 3 27 3 28 /* END INCLUDE vrm_cursor.incl.pl1 */ 71 72 4 1 dcl 1 uns_info based (addr (info)), /* info structure for unstructured files */ 4 2 2 info_version fixed, /* (Input) must =1--only one version 4 3* currently supported */ 4 4 2 type fixed, /* =1 */ 4 5 2 end_pos fixed (34), /* length (bytes) not including header */ 4 6 2 flags aligned, 4 7 3 pad1 bit (2) unal, /* used for lock_status in other files */ 4 8 3 header_present bit (1) unal, /* on if file code is set */ 4 9 3 pad2 bit (33) unal, 4 10 2 header_id fixed (35); /* meaning is user defined */ 4 11 dcl 1 seq_info based (addr (info)), /* info structure for sequential files */ 4 12 2 info_version fixed, 4 13 2 type fixed, /* =2 */ 4 14 2 end_pos fixed (34), /* record count */ 4 15 2 flags aligned, 4 16 3 lock_status bit (2) unal, /* 0,1,2, or 3 to indicate not locked, 4 17* locked by (other,this,dead) process */ 4 18 3 pad bit (34) unal, 4 19 2 version fixed, /* end_pos valid only in latest version */ 4 20 2 action fixed; /* indicates if adjustment or rollback is needed */ 4 21 dcl 1 blk_info based (addr (info)), /* info structure for blocked files */ 4 22 2 info_version fixed, 4 23 2 type fixed, /* =3 */ 4 24 2 end_pos fixed (34), /* record count */ 4 25 2 flags aligned, 4 26 3 lock_status bit (2) unal, /* same as seq_info.= */ 4 27 3 pad bit (34) unal, 4 28 2 version fixed, /* only one currently supported */ 4 29 2 action fixed, /* non-zero if truncation in progress, else =0 */ 4 30 2 max_rec_len fixed (21), /* bytes--determines characteristiWc block size */ 4 31 2 pad fixed, /* not used at this time */ 4 32 2 time_last_modified fixed (71); /* time stamp for synchronization */ 4 33 dcl 1 indx_info based (addr (info)), /* info structure for indexed files */ 4 34 2 info_version fixed, 4 35 2 type fixed, /* =4 */ 4 36 2 records fixed (34), /* record count */ 4 37 2 flags aligned, 4 38 3 lock_status bit (2) unal, /* same as seq_info.= */ 4 39 3 pad bit (34) unal, 4 40 2 version_info aligned, 4 41 3 file_version fixed (17) unal, /* headers differ */ 4 42 3 program_version fixed (17) unal, /* may indicate bugs */ 4 43 2 action fixed, /* non-zero code indicates update in progress */ 4 44 2 non_null_recs fixed (34), /* count of allocated recs */ 4 45 2 record_bytes fixed (34), /* total record length */ 4 46 2 free_blocks fixed, /* available record blocks */ 4 47 2 index_height fixed, /* height of index tree (0 if empty) */ 4 48 2 nodes fixed, /* nodes being used in the index */ 4 49 2 key_bytes fixed (34), /* total length of keys */ 4 50 2 change_count fixed (35), /* bumped on each file modification */ 4 51 2 num_keys fixed (34), /* number of index entries */ 4 52 2 dup_keys fixed (34), /* 0 if all keys are distinct, else 1 for each dup */ 4 53 2 dup_key_bytes fixed (34), /* total bytes of duplicate keys */ 4 54 2 word (1) fixed; /* reserved for future use */ 4 55 dcl 1 vbl_info based (addr (info)), /* info structure for variable files */ 4 56 2 info_version fixed, 4 57 2 type fixed, /* =5 */ 4 58 2 end_pos fixed (34), /* logical end of file--not necessarily allocation count */ 4 59 2 flags aligned, 4 60 3 lock_status bit (2) unal, /* same as seq_info.= */ 4 61 3 pad bit (34) unal, 4 62 2 version fixed, /* only one currently supported */ 4 63 2 action fixed, /* same as in indexed files */ 4 64 2 first_nz fixed (34), /* position (numeric key) for first allocated record */ 4 65 2 last_nz fixed (34), /* last allocated record position */ 4 66 2 change_count fixed (35); /* used for synchronization */ 4 67 dcl vfs_version_1 static internal fixed init (1); 4 68 /* should be used in 4 69* assignments to info_version */ 73 74 75 /* Automatic */ 76 77 dcl code fixed bin (35); 78 dcl info fixed bin; /* dummy variable to keep compiler happy */ 79 dcl iocb_ptr ptr; 80 dcl 1 vfsi like indx_info; 81 82 83 /* Builtin */ 84 85 dcl addr builtin; 86 87 88 /* External entry */ 89 90 dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35)); 91 92 93 94 95 end get_population; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/21/84 0933.8 vrm_get_population.pl1 >special_ldd>online>mrds_install>vrm_get_population.pl1 67 1 10/14/83 1609.1 vrm_open_info.incl.pl1 >ldd>include>vrm_open_info.incl.pl1 69 2 10/14/83 1609.1 vrm_rel_desc.incl.pl1 >ldd>include>vrm_rel_desc.incl.pl1 71 3 10/14/83 1609.1 vrm_cursor.incl.pl1 >ldd>include>vrm_cursor.incl.pl1 73 4 07/19/79 1547.0 vfs_info.incl.pl1 >ldd>include>vfs_info.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. I_rel_cursor_ptr parameter pointer dcl 28 ref 6 36 MRDS_compatible 3(01) based bit(1) level 3 packed unaligned dcl 2-5 ref 49 O_code parameter fixed bin(35,0) dcl 30 set ref 6 34* 62* O_number_of_tuples parameter fixed bin(35,0) dcl 29 set ref 6 33* 49* 51* addr builtin function dcl 85 ref 43 43 code 000106 automatic fixed bin(35,0) dcl 77 set ref 43* 44 44* ecode parameter fixed bin(35,0) dcl 60 ref 58 62 indx_info based structure level 1 unaligned dcl 4-33 info_version 000112 automatic fixed bin(17,0) level 2 dcl 80 set ref 42* iocb_ptr 10 based pointer level 2 in structure "vrm_cursor" dcl 3-7 in procedure "get_population" ref 38 iocb_ptr 000110 automatic pointer dcl 79 in procedure "get_population" set ref 38* 43* iox_$control 000010 constant entry external dcl 90 ref 43 non_null_recs 6 000112 automatic fixed bin(34,0) level 2 dcl 80 set ref 49 51 number_of_index_collections 102 based fixed bin(17,0) level 2 dcl 1-6 ref 51 open_info_ptr 4 based pointer level 2 dcl 3-7 ref 37 relation_model_ptr 72 based pointer level 2 dcl 1-6 ref 40 switches 3(01) based structure level 2 packed unaligned dcl 2-5 vfs_version_1 constant fixed bin(17,0) initial dcl 4-67 ref 42 vfsi 000112 automatic structure level 1 unaligned dcl 80 set ref 43 43 vrm_attr_info based structure level 1 unaligned dcl 2-28 vrm_cursor based structure level 1 dcl 3-7 vrm_cursor_ptr 000104 automatic pointer dcl 3-5 set ref 36* 37 38 vrm_open_info based structure level 1 dcl 1-6 vrm_open_info_ptr 000100 automatic pointer dcl 1-28 set ref 37* 40 51 vrm_rel_desc based structure level 1 unaligned dcl 2-5 vrm_rel_desc_ptr 000102 automatic pointer dcl 2-41 set ref 40* 49 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. VRM_OPEN_INFO_VERSION_1 internal static char(8) initial unaligned dcl 1-27 VRM_REL_DESC_KEY internal static varying char(256) initial dcl 2-46 VRM_REL_DESC_RECORD_ID internal static bit(12) initial unaligned dcl 2-43 VRM_REL_DESC_VERSION_1 internal static char(8) initial unaligned dcl 2-44 blk_info based structure level 1 unaligned dcl 4-21 info automatic fixed bin(17,0) dcl 78 seq_info based structure level 1 unaligned dcl 4-11 uns_info based structure level 1 unaligned dcl 4-1 vbl_info based structure level 1 unaligned dcl 4-55 voi_no_of_index_collections automatic fixed bin(17,0) dcl 1-29 vrd_no_of_attrs automatic fixed bin(17,0) dcl 2-42 vrm_attr_info_ptr automatic pointer dcl 2-45 NAMES DECLARED BY EXPLICIT CONTEXT. Exit 000117 constant label dcl 54 ref 63 error 000120 constant entry internal dcl 58 ref 44 get_population 000012 constant entry external dcl 6 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 174 206 132 204 Length 440 132 12 216 41 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME get_population 122 external procedure is an external procedure. error internal procedure shares stack frame of external procedure get_population. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME get_population 000100 vrm_open_info_ptr get_population 000102 vrm_rel_desc_ptr get_population 000104 vrm_cursor_ptr get_population 000106 code get_population 000110 iocb_ptr get_population 000112 vfsi get_population THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. iox_$control NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 6 000006 33 000017 34 000021 36 000022 37 000025 38 000027 40 000031 42 000033 43 000035 44 000067 49 000073 51 000104 54 000117 58 000120 62 000122 63 000125 ----------------------------------------------------------- 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