1
2
3
4
5
6
7
8
9
10
11
12
13
14 add_key:
15 proc (p_journal_control_block_ptr, p_info_ptr, p_code);
16
17
18
19
20
21
22
23
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
32
33 dcl privileges_string bit (36) aligned;
34
35
36
37
38
39 dcl null builtin;
40
41 dcl cleanup condition;
42
43
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
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 ^L
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 ^L
89 %include journal_entry;
90 %include journal_control_block;
91 %include ak_info;
92
93 end add_key;