COMPILATION LISTING OF SEGMENT add_key Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 11/11/89 0941.1 mst Sat Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 /* format: style4,delnl,insnl,indattr,ifthen,dclind10 */ 14 add_key: 15 proc (p_journal_control_block_ptr, p_info_ptr, p_code); 16 17 /* After doing the specified add_key operation on the vfile, an entry is made 18* in the journal recording the key and descriptor. Only the input_desc and input_key case is allowed. 19* 20* Written by Lindsey Spratt 08/06/79 21* Modified by Chris Jones 02/15/85 for privileges and clean up. 22**/ 23 /* Parameter */ 24 25 26 dcl p_journal_control_block_ptr 27 ptr; 28 dcl p_info_ptr ptr; 29 dcl p_code fixed bin (35); 30 31 /* Automatic */ 32 33 dcl privileges_string bit (36) aligned; 34 35 /* Based */ 36 /* Controlled */ 37 /* Builtin */ 38 39 dcl null builtin; 40 41 dcl cleanup condition; 42 43 /* Entry */ 44 45 dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35)); 46 dcl rcprm_registry_util_$turn_off_privs 47 entry (bit (36) aligned); 48 dcl rcprm_registry_util_$turn_on_privs 49 entry (bit (36) aligned); 50 51 /* External */ 52 53 dcl error_table_$locked_by_this_process 54 fixed bin (35) ext; 55 dcl error_table_$bad_arg fixed bin (35) ext; 56 57 ak_info_ptr = p_info_ptr; 58 journal_control_block_ptr = p_journal_control_block_ptr; 59 if ^ak_info.input_desc & ^ak_info.input_key then do; 60 p_code = error_table_$bad_arg; 61 return; 62 end; 63 privileges_string = ""b; 64 on cleanup call rcprm_registry_util_$turn_off_privs (privileges_string); 65 66 call rcprm_registry_util_$turn_on_privs (privileges_string); 67 call iox_$control (journal_control_block.vfile_iocb_ptr, "add_key", ak_info_ptr, p_code); 68 if p_code ^= 0 & p_code ^= error_table_$locked_by_this_process then do; 69 call rcprm_registry_util_$turn_off_privs (privileges_string); 70 return; 71 end; 72 73 a_key_len = ak_info.key_len; 74 a_rec_len = 0; 75 alloc journal_entry in (journal_area); 76 journal_entry.key_str = ak_info.key; 77 journal_entry.descriptor = ak_info.descrip; 78 journal_entry.inc_ref_count = "0"b; 79 journal_entry.dec_ref_count = "0"b; 80 journal_entry.type = ADD_KEY; 81 journal_entry.next_ptr = null; 82 if journal_control_block.latest_entry_ptr ^= null then 83 journal_control_block.latest_entry_ptr -> journal_entry.next_ptr = journal_entry_ptr; 84 journal_entry.prev_ptr = journal_control_block.latest_entry_ptr; 85 journal_control_block.latest_entry_ptr = journal_entry_ptr; 86 call rcprm_registry_util_$turn_off_privs (privileges_string); 87 return; 88 1 1 /* BEGIN INCLUDE FILE journal_entry.incl.pl1 */ 1 2 1 3 dcl journal_entry_ptr ptr; 1 4 dcl a_rec_len fixed bin (21); 1 5 dcl a_key_len fixed bin; 1 6 dcl 1 journal_entry based (journal_entry_ptr) aligned, 1 7 2 head, 1 8 3 prev_ptr ptr, 1 9 3 next_ptr ptr, 1 10 3 type fixed bin, 1 11 2 descriptor fixed bin (35), 1 12 2 inc_ref_count bit (1) init ("0"b), 1 13 2 dec_ref_count bit (1) init ("0"b), 1 14 2 key_len fixed bin , 1 15 2 rec_len fixed bin (21) , 1 16 2 key_str char (a_key_len refer (journal_entry.key_len)), 1 17 2 rec_str char (a_rec_len refer (journal_entry.rec_len)); 1 18 1 19 dcl RS_LOCK fixed bin init(1) options(constant) internal static; 1 20 dcl WRITE_RECORD fixed bin init(2) options(constant) internal static; 1 21 dcl DELETE_RECORD fixed bin init(3) options(constant) internal static; 1 22 dcl ADD_KEY fixed bin init(4) options(constant) internal static; 1 23 dcl DELETE_KEY fixed bin init(5) options(constant) internal static; 1 24 dcl RS_COUNT fixed bin init(6) options(constant) internal static; 1 25 dcl RS_LOCK_COUNT fixed bin init(7) options(constant) internal static; 1 26 dcl RS_LOCK_CREATE fixed bin init(8) options(constant) internal static; 1 27 1 28 /* END INCLUDE FILE journal_entry.incl.pl1 */ 89 2 1 /* BEGIN INCLUDE FILE journal_control_block.incl.pl1 */ 2 2 2 3 dcl sys_info$max_seg_size fixed bin (24) ext; 2 4 2 5 dcl journal_control_block_ptr 2 6 ptr; 2 7 dcl 1 journal_control_block 2 8 aligned based (journal_control_block_ptr), 2 9 2 attach char (128) var, 2 10 2 open_desc char (128) var, 2 11 2 vfile_iocb_ptr ptr, 2 12 2 latest_entry_ptr ptr, 2 13 2 journal_area_ptr ptr; 2 14 2 15 dcl journal_area area (sys_info$max_seg_size) based (journal_control_block.journal_area_ptr) aligned; 2 16 2 17 2 18 /* END INCLUDE FILE journal_control_block.incl.pl1 */ 90 3 1 /* ak_info -- include file for info structures used by the following vfile_ 3 2* control orders: "add_key", "delete_key", "get_key", and "reassign_key". 3 3* Created by M. Asherman 3/23/76 3 4* Modified 5/13/77 to add separate gk_info structure */ 3 5 3 6 dcl 1 ak_info based (ak_info_ptr), 3 7 2 header like ak_header, 3 8 2 key char (ak_key_len refer (ak_info.header.key_len)); 3 9 3 10 dcl 1 ak_header based (ak_info_ptr), 3 11 2 flags aligned, 3 12 3 input_key bit (1) unal, /* set if key is input arg */ 3 13 3 input_desc bit (1) unal, /* set if descriptor is an input arg */ 3 14 3 mbz bit (34) unal, /* not used for the present */ 3 15 2 descrip fixed (35), /* record designator */ 3 16 2 key_len fixed; 3 17 3 18 dcl ak_info_ptr ptr; 3 19 dcl ak_key_len fixed; 3 20 3 21 3 22 dcl 1 rk_info based (rk_info_ptr), 3 23 2 header like rk_header, 3 24 2 key char (rk_key_len refer (rk_info.header.key_len)); 3 25 3 26 dcl 1 rk_header based (rk_info_ptr), 3 27 2 flags aligned, 3 28 3 input_key bit (1) unal, /* same as above */ 3 29 3 input_old_desc bit (1) unal, /* set if specified entry has initial descrip 3 30* given by old_descrip */ 3 31 3 input_new_desc bit (1) unal, /* set if new val for descrip is input in this struc */ 3 32 3 mbz bit (33) unal, 3 33 2 old_descrip fixed (35), /* used if first flag is set */ 3 34 2 new_descrip fixed (35), /* used only if second flag is set */ 3 35 2 key_len fixed; 3 36 3 37 dcl rk_info_ptr ptr; 3 38 dcl rk_key_len fixed; 3 39 3 40 3 41 dcl 1 gk_info based (gk_info_ptr), /* structure for get_key order */ 3 42 2 header like gk_header, 3 43 2 key char (gk_key_len refer (gk_info.header.key_len)); 3 44 /* may be Input as well as Output */ 3 45 3 46 dcl 1 gk_header based (gk_info_ptr), 3 47 2 flags aligned, 3 48 3 input_key bit (1) unal, /* if set, use key in this structure */ 3 49 3 input_desc bit (1) unal, /* if set, descriptor given in this structure */ 3 50 3 desc_code fixed (2) unal, /* 0=any, 1=current -- applies when input_desc="0"b */ 3 51 3 position_specification 3 52 unal, 3 53 4 current bit (1) unal, /* otherwise next */ 3 54 4 rel_type fixed (2) unal, /* as in seek_head, if input_key = "1"b */ 3 55 4 head_size fixed bin (9) unsigned unaligned, 3 56 /* size of head for initial seek */ 3 57 3 reset_pos bit (1) unal, /* if set, final position unchanged by this operation */ 3 58 3 pad bit (8) unal, 3 59 3 version fixed (8) unal, 3 60 2 descrip fixed (35), /* Output, except when input_desc="1"b */ 3 61 2 key_len fixed; /* Input when input_key="1"b, also Output in all cases */ 3 62 3 63 dcl gk_info_ptr ptr; 3 64 dcl gk_key_len fixed; 3 65 3 66 dcl gk_info_version_0 internal static fixed options (constant) init (0); 3 67 3 68 /* end ak_info.incl.pl1 */ 91 92 93 end add_key; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0805.5 add_key.pl1 >spec>install>1111>add_key.pl1 89 1 02/11/80 1426.1 journal_entry.incl.pl1 >ldd>include>journal_entry.incl.pl1 90 2 02/11/80 1426.1 journal_control_block.incl.pl1 >ldd>include>journal_control_block.incl.pl1 91 3 07/19/79 1547.0 ak_info.incl.pl1 >ldd>include>ak_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. ADD_KEY constant fixed bin(17,0) initial dcl 1-22 ref 80 a_key_len 000113 automatic fixed bin(17,0) dcl 1-5 set ref 73* 75 75 a_rec_len 000112 automatic fixed bin(21,0) dcl 1-4 set ref 74* 75 75 ak_header based structure level 1 unaligned dcl 3-10 ak_info based structure level 1 unaligned dcl 3-6 ak_info_ptr 000116 automatic pointer dcl 3-18 set ref 57* 59 59 67* 73 76 77 cleanup 000102 stack reference condition dcl 41 ref 64 dec_ref_count 7 based bit(1) initial level 2 dcl 1-6 set ref 75* 79* descrip 1 based fixed bin(35,0) level 3 dcl 3-6 ref 77 descriptor 5 based fixed bin(35,0) level 2 dcl 1-6 set ref 77* error_table_$bad_arg 000020 external static fixed bin(35,0) dcl 55 ref 60 error_table_$locked_by_this_process 000016 external static fixed bin(35,0) dcl 53 ref 68 flags based structure level 3 dcl 3-6 gk_header based structure level 1 unaligned dcl 3-46 head based structure level 2 dcl 1-6 header based structure level 2 unaligned dcl 3-6 inc_ref_count 6 based bit(1) initial level 2 dcl 1-6 set ref 75* 78* input_desc 0(01) based bit(1) level 4 packed packed unaligned dcl 3-6 ref 59 input_key based bit(1) level 4 packed packed unaligned dcl 3-6 ref 59 iox_$control 000010 constant entry external dcl 45 ref 67 journal_area based area dcl 2-15 ref 75 journal_area_ptr 106 based pointer level 2 dcl 2-7 ref 75 journal_control_block based structure level 1 dcl 2-7 journal_control_block_ptr 000114 automatic pointer dcl 2-5 set ref 58* 67 75 82 82 84 85 journal_entry based structure level 1 dcl 1-6 set ref 75 journal_entry_ptr 000110 automatic pointer dcl 1-3 set ref 75* 76 77 78 79 80 81 82 84 85 key 3 based char level 2 packed packed unaligned dcl 3-6 ref 76 key_len 10 based fixed bin(17,0) level 2 in structure "journal_entry" dcl 1-6 in procedure "add_key" set ref 75* 76 key_len 2 based fixed bin(17,0) level 3 in structure "ak_info" dcl 3-6 in procedure "add_key" ref 73 76 key_str 12 based char level 2 dcl 1-6 set ref 76* latest_entry_ptr 104 based pointer level 2 dcl 2-7 set ref 82 82 84 85* next_ptr 2 based pointer level 3 dcl 1-6 set ref 81* 82* null builtin function dcl 39 ref 81 82 p_code parameter fixed bin(35,0) dcl 29 set ref 14 60* 67* 68 68 p_info_ptr parameter pointer dcl 28 ref 14 57 p_journal_control_block_ptr parameter pointer dcl 26 ref 14 58 prev_ptr based pointer level 3 dcl 1-6 set ref 84* privileges_string 000100 automatic bit(36) dcl 33 set ref 63* 64* 66* 69* 86* rcprm_registry_util_$turn_off_privs 000012 constant entry external dcl 46 ref 64 69 86 rcprm_registry_util_$turn_on_privs 000014 constant entry external dcl 48 ref 66 rec_len 11 based fixed bin(21,0) level 2 dcl 1-6 set ref 75* rk_header based structure level 1 unaligned dcl 3-26 type 4 based fixed bin(17,0) level 3 dcl 1-6 set ref 80* vfile_iocb_ptr 102 based pointer level 2 dcl 2-7 set ref 67* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. DELETE_KEY internal static fixed bin(17,0) initial dcl 1-23 DELETE_RECORD internal static fixed bin(17,0) initial dcl 1-21 RS_COUNT internal static fixed bin(17,0) initial dcl 1-24 RS_LOCK internal static fixed bin(17,0) initial dcl 1-19 RS_LOCK_COUNT internal static fixed bin(17,0) initial dcl 1-25 RS_LOCK_CREATE internal static fixed bin(17,0) initial dcl 1-26 WRITE_RECORD internal static fixed bin(17,0) initial dcl 1-20 ak_key_len automatic fixed bin(17,0) dcl 3-19 gk_info based structure level 1 unaligned dcl 3-41 gk_info_ptr automatic pointer dcl 3-63 gk_info_version_0 internal static fixed bin(17,0) initial dcl 3-66 gk_key_len automatic fixed bin(17,0) dcl 3-64 rk_info based structure level 1 unaligned dcl 3-22 rk_info_ptr automatic pointer dcl 3-37 rk_key_len automatic fixed bin(17,0) dcl 3-38 sys_info$max_seg_size external static fixed bin(24,0) dcl 2-3 NAME DECLARED BY EXPLICIT CONTEXT. add_key 000016 constant entry external dcl 14 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 336 360 230 346 Length 600 230 22 204 106 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME add_key 105 external procedure is an external procedure. on unit on line 64 68 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME add_key 000100 privileges_string add_key 000110 journal_entry_ptr add_key 000112 a_rec_len add_key 000113 a_key_len add_key 000114 journal_control_block_ptr add_key 000116 ak_info_ptr add_key THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac enable_op ext_entry int_entry op_alloc_ THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. iox_$control rcprm_registry_util_$turn_off_privs rcprm_registry_util_$turn_on_privs THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_arg error_table_$locked_by_this_process LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 14 000012 57 000023 58 000027 59 000032 60 000035 61 000037 63 000040 64 000041 66 000065 67 000074 68 000124 69 000132 70 000140 73 000141 74 000144 75 000145 76 000171 77 000177 78 000201 79 000202 80 000203 81 000205 82 000207 84 000215 85 000217 86 000220 87 000227 ----------------------------------------------------------- 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