COMPILATION LISTING OF SEGMENT vrmu_add_tuple Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 11/21/84 1435.2 mst Wed 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 vrmu_add_tuple: proc (vrm_rel_desc_ptr, iocb_ptr, pk_ptr, tuple_id, int_ptr, tuple_len, outt_ptr, code); 19 20 /* NOTES: 21* 22* This procedure stores a new tuple into the relation indicated by rmri_ptr. 23* The seek_key and write_record operations are used. The 24* tuple_id and a pointer to the stored record are returned to the caller. 25**/ 26 27 /* HISTORY: 28* 29* Initially written by JA Weeldreyer -- June, 1978. 30* 31* 82-09-20 R. Harvey: Changed module name and stripped down for 32* vfile_relmgr_. 33* 34* 83-06-23 R. Harvey: Changed references to mdbm_error_$dup_store to 35* be dm_error_$key_duplication. 36* 37* 83-10-21 Roger Lackey : Removed the mdbm_tuple_id.incl.pl1 and replaced 38* the needed parts as a automactic based structure 39**/ 40 41 tuple_ptr = int_ptr; 42 tuple_hdr_len = 4 * (binary (rel (addr (int_ptr -> tuple.data))) - 43 binary (rel (int_ptr))); 44 45 call iox_$seek_key (iocb_ptr, key, rl_sink, icode); /* search for key */ 46 if icode = 0 then call error (dm_error_$key_duplication); /* if there already */ 47 else if icode ^= error_table_$no_record then call error (icode); /* other error */ 48 49 call iox_$write_record (iocb_ptr, tuple_ptr, tuple_len, icode); /* write the record */ 50 if icode ^= 0 then call error (icode); 51 52 string (rs_info.flags) = "0"b; /* get info on rec. just written */ 53 call iox_$control (iocb_ptr, "record_status", addr (rs_info), icode); 54 if icode ^= 0 then call error (icode); 55 56 outt_ptr = rs_info.record_ptr; /* set output args */ 57 tid_ptr = addr (tuple_id); /* make tuple id */ 58 tuple_id_templet.nstd_desc = "1"b; 59 tuple_id_templet.temp = "0"b; 60 tuple_id_templet.file_id = vrm_rel_desc.file_id; 61 svd_ptr = addr (rs_info.descriptor); 62 tuple_id_templet.comp_no = spec_vf_desc.comp_no; 63 tuple_id_templet.offset = spec_vf_desc.offset; 64 65 code = 0; 66 67 exit: 68 return; 69 70 error: proc (cd); 71 72 /* Internal error procedure */ 73 74 dcl cd fixed bin (35); 75 76 code = cd; 77 go to exit; 78 79 end error; 80 1 1 /* BEGIN INCLUDE vrm_rel_desc.incl.pl1 */ 1 2 1 3 /* 83-05-26 Roger Lackey : Added vrm_attr_info.key_head bit for relation_cursors */ 1 4 1 5 dcl 1 vrm_rel_desc based (vrm_rel_desc_ptr), 1 6 2 record_id bit (12) unal, /* Distinguish us from tuples and collection records */ 1 7 2 version char (8), /* Version of this structure */ 1 8 2 file_id bit (7), /* Value of file id from model */ 1 9 2 rel_id bit (12), /* Relation id */ 1 10 2 switches, 1 11 3 MRDS_compatible bit (1) unal, /* For pre-relation_manager_ MRDS */ 1 12 3 stationary_records 1 13 bit (1) unal, /* On = stationary */ 1 14 3 indexed bit (1) unal, /* This relation has attributes with secondary indices */ 1 15 3 pad bit (33) unal, 1 16 2 var_offset fixed bin (35), /* Position of first varying attr */ 1 17 2 maximum_data_length 1 18 fixed bin (35), /* Maximum size of tuple in characters */ 1 19 2 number_primary_key_attrs 1 20 fixed bin, /* Number of attributes which make up the primary key */ 1 21 2 number_sec_indexes fixed bin, /* Number of attributes which have a secondary index */ 1 22 2 last_var_attr_no fixed bin, /* Attr index of last varying attribute */ 1 23 2 number_var_attrs fixed bin, /* Number of varying attributes */ 1 24 2 number_attrs fixed bin, /* Number of attribute in rel */ 1 25 2 attr (vrd_no_of_attrs /* Description of each attribute */ 1 26 refer (vrm_rel_desc.number_attrs)) aligned like vrm_attr_info; 1 27 1 28 dcl 1 vrm_attr_info based (vrm_attr_info_ptr), 1 29 /* Attribute specific info */ 1 30 2 name char (32), /* Name of the attribute */ 1 31 2 descriptor bit (36) aligned, /* domain descriptor */ 1 32 2 varying bit (1) unal, /* ON = This is a varying string */ 1 33 2 key_head bit (1) unal, /* ON = This attr can be a keyhead */ 1 34 2 primary_key_attr bit (1) unal, /* ON = This is a primary key attribute */ 1 35 2 pad bit (15) unal, /* unused */ 1 36 2 index_collextion_ix fixed bin (17) unal, /* Index into vrm_open_info.index_collection array if key_head is on */ 1 37 2 bit_length fixed bin (35), /* Maximum bit length of tuple */ 1 38 2 bit_offset fixed bin (35); /* Offset in tuple if fixed, index to offset in tuple if varying */ 1 39 1 40 1 41 dcl vrm_rel_desc_ptr pointer; 1 42 dcl vrd_no_of_attrs fixed bin; 1 43 dcl VRM_REL_DESC_RECORD_ID bit (12) unal int static options (constant) init ("100000000000"b); 1 44 dcl VRM_REL_DESC_VERSION_1 char (8) int static options (constant) init (" 1"); 1 45 dcl vrm_attr_info_ptr pointer; 1 46 dcl VRM_REL_DESC_KEY char (256) varying int static options (constant) init ("@relation_description"); 1 47 1 48 /* END INCLUDE vrm_rel_desc.incl.pl1 */ 81 82 2 1 /* BEGIN vrm_tuple.incl.pl1 -- jaw, 7/25/78 */ 2 2 2 3 /* 82-08-27 R. Harvey: taken from mdbm_tuple.incl.pl1 for vfile_relmgr_. 2 4* Modified dimension references to point to entries in vrm_rel_desc. */ 2 5 2 6 2 7 dcl 1 tuple aligned based (tuple_ptr), /* tuple format, all file types */ 2 8 2 rel_id bit (12) unal, /* relation id */ 2 9 2 attr_exists (vrm_rel_desc.number_attrs) bit (1) unal, /* existance flags */ 2 10 2 var_offsets (vrm_rel_desc.number_var_attrs) fixed bin (35) unal, /* offsets for variable attr.; stored as len|value */ 2 11 2 force_even_word (tuple_pad_length) fixed bin (71) aligned, /* pad to even word boundary */ 2 12 2 data char (vrm_rel_desc.maximum_data_length) unal; /* space for data */ 2 13 2 14 2 15 dcl tuple_ptr ptr; 2 16 dcl tuple_length fixed bin (21); /* byte count */ 2 17 2 18 declare tuple_pad_length fixed bin internal static init (0) ; /* minimum array size needed for even word padding */ 2 19 2 20 2 21 2 22 /* END vrm_tuple.incl.pl1 */ 2 23 83 84 85 3 1 /* BEGIN mdbm_rs_info.incl.pl1 -- jaw, 6/15/78 (from mda, 6/15/77) */ 3 2 3 3 dcl 1 rs_info aligned, 3 4 2 version fixed init (2), /* must be set to 1 or 2 (Input) */ 3 5 2 flags aligned, 3 6 3 lock_sw bit (1) unal, /* Input -- if ="1"b try to lock record */ 3 7 3 unlock_sw bit (1) unal, /* Input -- if ="1"b try to unlock record */ 3 8 3 create_sw bit (1) unal, /* Input--if set creat new record */ 3 9 3 locate_sw bit (1) unal, /* Input--if set causes current rec to be 3 10* located outside the index by descrip, or created without key */ 3 11 3 inc_ref_count bit (1) unal, /* Input--bump reference count of record, if stationary */ 3 12 3 dec_ref_count bit (1) unal, /* Input--decrement ref count if this flag set and 3 13* record stationary */ 3 14 3 locate_pos_sw bit (1) unal, /* Input--if set the record_length is taken 3 15* as an input arg. spec. the abs. logical record position 3 16* \ to which both current and next will be set */ 3 17 3 mbz1 bit (29) unal, /* must be set to "0"b, reserved for future use */ 3 18 2 record_length fixed (21), /* length in bytes, Input if create_sw set */ 3 19 2 max_rec_len fixed (21), /* max length of contained record 3 20* Input if create_sw is set--overrides min_block_size */ 3 21 2 record_ptr ptr, /* points to first byte of record--will be word aligned */ 3 22 2 descriptor fixed (35), /* Input if locate_sw set and create_sw="0"b */ 3 23 2 ref_count fixed (34), /* Output--should match number of keys on this record-- 3 24* = -1 if non-stationary record */ 3 25 2 time_last_modified fixed (71), /* Output */ 3 26 2 modifier fixed (35), /* Output--also Input when locking */ 3 27 2 block_ptr ptr unal, /* Output */ 3 28 2 mbz2 (2) fixed init (0, 0); 3 29 3 30 /* END mdbm_rs_info.incl.pl1 */ 3 31 86 87 88 dcl tid_ptr ptr; /* Pointer to tuple_id_templet */ 89 90 dcl 1 tuple_id_templet unal based (tid_ptr), /* tuple id for unblocked files */ 91 2 nstd_desc bit (1) unal, /* to indicate foreign vfile desc */ 92 2 temp bit (1) unal, /* On if for temp relation */ 93 2 file_id bit (7) unal, /* file id no. */ 94 2 comp_no bit (10), /* vfile component number */ 95 2 offset bit (17) unal; /* the double word offset within component */ 96 97 98 dcl (pk_ptr, /* Input: pointer to encoded primary key */ 99 int_ptr, /* Input: pointer to tuple to be stored */ 100 outt_ptr, /* Output: pointer to stored tuple in db. */ 101 svd_ptr /* pointer to special view of vfile desc. */ 102 ) ptr; 103 104 dcl (code, /* Output: status code */ 105 icode) fixed bin (35); /* internal status code */ 106 107 108 dcl tuple_id bit (36) aligned; /* Output: tuple id of stored tuple */ 109 110 dcl (rl_sink, /* sink for record length */ 111 tuple_hdr_len, /* length of tuple header */ 112 tuple_len) fixed bin (21); /* true length of tuple */ 113 114 dcl iocb_ptr ptr; 115 dcl key char (256) var based (pk_ptr); /* encoded primary key */ 116 117 dcl 1 spec_vf_desc aligned based (svd_ptr), /* special view of vf. desc. */ 118 2 pad bit (8) unal, 119 2 comp_no bit (10) unal, 120 2 offset bit (17) unal; /* drops low order bit */ 121 122 dcl (dm_error_$key_duplication, 123 error_table_$no_record) ext fixed bin (35); 124 125 dcl (addr, 126 binary, 127 rel, 128 string 129 ) builtin; 130 131 dcl iox_$seek_key entry (ptr, char (256) var, fixed bin (21), fixed bin (35)); 132 dcl iox_$write_record entry (ptr, ptr, fixed bin (21), fixed bin (35)); 133 dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35)); 134 135 136 end vrmu_add_tuple; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/21/84 0933.9 vrmu_add_tuple.pl1 >special_ldd>online>mrds_install>vrmu_add_tuple.pl1 81 1 10/14/83 1609.1 vrm_rel_desc.incl.pl1 >ldd>include>vrm_rel_desc.incl.pl1 83 2 10/14/83 1609.1 vrm_tuple.incl.pl1 >ldd>include>vrm_tuple.incl.pl1 86 3 10/14/83 1609.0 mdbm_rs_info.incl.pl1 >ldd>include>mdbm_rs_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. addr builtin function dcl 125 ref 42 53 53 57 61 binary builtin function dcl 125 ref 42 42 cd parameter fixed bin(35,0) dcl 74 ref 70 76 code parameter fixed bin(35,0) dcl 104 set ref 18 65* 76* comp_no 0(08) based bit(10) level 2 in structure "spec_vf_desc" packed unaligned dcl 117 in procedure "vrmu_add_tuple" ref 62 comp_no 0(09) based bit(10) level 2 in structure "tuple_id_templet" packed unaligned dcl 90 in procedure "vrmu_add_tuple" set ref 62* data based char level 2 packed unaligned dcl 2-7 set ref 42 descriptor 6 000102 automatic fixed bin(35,0) level 2 dcl 3-3 set ref 61 dm_error_$key_duplication 000010 external static fixed bin(35,0) dcl 122 set ref 46* error_table_$no_record 000012 external static fixed bin(35,0) dcl 122 ref 47 file_id 0(02) based bit(7) level 2 in structure "tuple_id_templet" packed unaligned dcl 90 in procedure "vrmu_add_tuple" set ref 60* file_id 2(18) based bit(7) level 2 in structure "vrm_rel_desc" packed unaligned dcl 1-5 in procedure "vrmu_add_tuple" ref 60 flags 1 000102 automatic structure level 2 dcl 3-3 set ref 52* icode 000124 automatic fixed bin(35,0) dcl 104 set ref 45* 46 47 47* 49* 50 50* 53* 54 54* int_ptr parameter pointer dcl 98 ref 18 41 42 42 iocb_ptr parameter pointer dcl 114 set ref 18 45* 49* 53* iox_$control 000020 constant entry external dcl 133 ref 53 iox_$seek_key 000014 constant entry external dcl 131 ref 45 iox_$write_record 000016 constant entry external dcl 132 ref 49 key based varying char(256) dcl 115 set ref 45* maximum_data_length 6 based fixed bin(35,0) level 2 dcl 1-5 ref 42 mbz2 14 000102 automatic fixed bin(17,0) initial array level 2 dcl 3-3 set ref 3-3* 3-3* nstd_desc based bit(1) level 2 packed unaligned dcl 90 set ref 58* number_attrs 13 based fixed bin(17,0) level 2 dcl 1-5 ref 42 number_var_attrs 12 based fixed bin(17,0) level 2 dcl 1-5 ref 42 offset 0(19) based bit(17) level 2 in structure "tuple_id_templet" packed unaligned dcl 90 in procedure "vrmu_add_tuple" set ref 63* offset 0(18) based bit(17) level 2 in structure "spec_vf_desc" packed unaligned dcl 117 in procedure "vrmu_add_tuple" ref 63 outt_ptr parameter pointer dcl 98 set ref 18 56* pk_ptr parameter pointer dcl 98 ref 18 45 record_ptr 4 000102 automatic pointer level 2 dcl 3-3 set ref 56 rel builtin function dcl 125 ref 42 42 rl_sink 000125 automatic fixed bin(21,0) dcl 110 set ref 45* rs_info 000102 automatic structure level 1 dcl 3-3 set ref 53 53 spec_vf_desc based structure level 1 dcl 117 string builtin function dcl 125 set ref 52* svd_ptr 000122 automatic pointer dcl 98 set ref 61* 62 63 temp 0(01) based bit(1) level 2 packed unaligned dcl 90 set ref 59* tid_ptr 000120 automatic pointer dcl 88 set ref 57* 58 59 60 62 63 tuple based structure level 1 dcl 2-7 tuple_hdr_len 000126 automatic fixed bin(21,0) dcl 110 set ref 42* tuple_id parameter bit(36) dcl 108 set ref 18 57 tuple_id_templet based structure level 1 packed unaligned dcl 90 tuple_len parameter fixed bin(21,0) dcl 110 set ref 18 49* tuple_pad_length constant fixed bin(17,0) initial dcl 2-18 ref 42 tuple_ptr 000100 automatic pointer dcl 2-15 set ref 41* 49* version 000102 automatic fixed bin(17,0) initial level 2 dcl 3-3 set ref 3-3* vrm_attr_info based structure level 1 unaligned dcl 1-28 vrm_rel_desc based structure level 1 unaligned dcl 1-5 vrm_rel_desc_ptr parameter pointer dcl 1-41 ref 18 42 42 42 60 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. VRM_REL_DESC_KEY internal static varying char(256) initial dcl 1-46 VRM_REL_DESC_RECORD_ID internal static bit(12) initial unaligned dcl 1-43 VRM_REL_DESC_VERSION_1 internal static char(8) initial unaligned dcl 1-44 tuple_length automatic fixed bin(21,0) dcl 2-16 vrd_no_of_attrs automatic fixed bin(17,0) dcl 1-42 vrm_attr_info_ptr automatic pointer dcl 1-45 NAMES DECLARED BY EXPLICIT CONTEXT. error 000251 constant entry internal dcl 70 ref 46 47 50 54 exit 000250 constant label dcl 67 ref 77 vrmu_add_tuple 000020 constant entry external dcl 18 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 362 404 264 372 Length 630 264 22 207 75 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME vrmu_add_tuple 128 external procedure is an external procedure. error internal procedure shares stack frame of external procedure vrmu_add_tuple. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME vrmu_add_tuple 000100 tuple_ptr vrmu_add_tuple 000102 rs_info vrmu_add_tuple 000120 tid_ptr vrmu_add_tuple 000122 svd_ptr vrmu_add_tuple 000124 icode vrmu_add_tuple 000125 rl_sink vrmu_add_tuple 000126 tuple_hdr_len vrmu_add_tuple THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return mpfx2 ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. iox_$control iox_$seek_key iox_$write_record THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_error_$key_duplication error_table_$no_record LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 18 000011 3 3 000025 41 000036 42 000042 45 000075 46 000114 47 000126 49 000133 50 000151 52 000155 53 000156 54 000213 56 000217 57 000222 58 000224 59 000227 60 000232 61 000237 62 000241 63 000244 65 000247 67 000250 70 000251 76 000253 77 000256 ----------------------------------------------------------- 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