1
2
3
4
5
6
7
8
9
10
11
12
13
14 delete_key:
15 proc (p_journal_control_block_ptr, p_info_ptr, p_code);
16
17
18
19
20
21
22
23
24
25
26
27 dcl p_journal_control_block_ptr
28 ptr;
29 dcl p_info_ptr ptr;
30 dcl p_code fixed bin (35);
31
32
33
34 dcl privileges_string bit (36) aligned;
35
36
37
38
39
40 dcl null builtin;
41
42 dcl cleanup condition;
43
44
45
46 dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35));
47 dcl rcprm_registry_util_$turn_off_privs
48 entry (bit (36) aligned);
49 dcl rcprm_registry_util_$turn_on_privs
50 entry (bit (36) aligned);
51
52
53
54 dcl error_table_$locked_by_this_process
55 fixed bin (35) ext;
56 dcl error_table_$bad_arg fixed bin (35) ext;
57 ^L
58 ak_info_ptr = p_info_ptr;
59 journal_control_block_ptr = p_journal_control_block_ptr;
60 if ^ak_info.input_desc | ^ak_info.input_key then do;
61 p_code = error_table_$bad_arg;
62 return;
63 end;
64 privileges_string = ""b;
65 on cleanup call rcprm_registry_util_$turn_off_privs (privileges_string);
66
67 call rcprm_registry_util_$turn_on_privs (privileges_string);
68
69 call iox_$control (journal_control_block.vfile_iocb_ptr, "delete_key", ak_info_ptr, p_code);
70 if p_code ^= 0 & p_code ^= error_table_$locked_by_this_process then
71 return;
72
73
74 a_key_len = ak_info.key_len;
75 a_rec_len = 0;
76 alloc journal_entry in (journal_area);
77 journal_entry.key_str = ak_info.key;
78 journal_entry.descriptor = ak_info.descrip;
79 journal_entry.inc_ref_count = "0"b;
80 journal_entry.dec_ref_count = "0"b;
81 journal_entry.type = DELETE_KEY;
82 journal_entry.next_ptr = null;
83 journal_entry.prev_ptr = journal_control_block.latest_entry_ptr;
84 if journal_control_block.latest_entry_ptr ^= null then
85 journal_control_block.latest_entry_ptr -> journal_entry.next_ptr = journal_entry_ptr;
86 journal_control_block.latest_entry_ptr = journal_entry_ptr;
87 call rcprm_registry_util_$turn_off_privs (privileges_string);
88 return;
89 ^L
90 %include journal_entry;
91 %include journal_control_block;
92 %include ak_info;
93 end;