1
2
3
4
5
6
7
8
9
10
11
12
13
14 commit:
15 proc (p_journal_control_block_ptr, p_code);
16
17
18
19
20
21
22
23
24
25 dcl p_journal_control_block_ptr
26 ptr;
27 dcl p_code fixed bin (35);
28
29
30
31 dcl privileges_string bit (36) aligned;
32 dcl scratch_area_ptr ptr;
33
34
35
36 dcl scratch_area area (4096) based (scratch_area_ptr);
37
38
39
40
41 dcl null builtin;
42
43 dcl cleanup condition;
44
45
46
47 dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35));
48 dcl iox_$delete_record entry (ptr, fixed bin (35));
49 dcl get_system_free_area_ entry returns (ptr);
50 dcl rcprm_registry_util_$turn_off_privs
51 entry (bit (36) aligned);
52 dcl rcprm_registry_util_$turn_on_privs
53 entry (bit (36) aligned);
54
55
56
57 dcl error_table_$locked_by_this_process
58 fixed bin (35) ext;
59 ^L
60 journal_control_block_ptr = p_journal_control_block_ptr;
61 scratch_area_ptr = get_system_free_area_ ();
62
63 if journal_control_block.latest_entry_ptr = null then do;
64 p_code = 0;
65 return;
66 end;
67
68 do journal_entry_ptr = journal_control_block.latest_entry_ptr repeat (journal_entry.prev_ptr)
69 while (journal_entry.prev_ptr ^= null);
70 end;
71
72 rs_info_ptr = null ();
73 privileges_string = ""b;
74 on cleanup call clean_up;
75
76 call rcprm_registry_util_$turn_on_privs (privileges_string);
77
78 do while (journal_entry_ptr ^= null);
79
80 goto ENTRY_TYPE (journal_entry.type);
81
82 ENTRY_TYPE (1):
83 ENTRY_TYPE (7):
84 ENTRY_TYPE (8):
85 alloc rs_info in (scratch_area);
86 rs_info.version = rs_info_version_2;
87 rs_info.unlock_sw = "1"b;
88 rs_info.lock_sw = "0"b;
89 rs_info.locate_sw = "1"b;
90 rs_info.descriptor = journal_entry.descriptor;
91 call iox_$control (journal_control_block.vfile_iocb_ptr, "record_status", rs_info_ptr, p_code);
92 if p_code ^= 0 & p_code ^= error_table_$locked_by_this_process then do;
93 call clean_up;
94 return;
95 end;
96 free rs_info;
97
98 goto NEXT;
99
100 ENTRY_TYPE (2):
101 goto NEXT;
102
103 ENTRY_TYPE (3):
104 alloc rs_info in (scratch_area);
105 rs_info.version = rs_info_version_2;
106 rs_info.locate_sw = "1"b;
107 rs_info.descriptor = journal_entry.descriptor;
108
109 call iox_$control (journal_control_block.vfile_iocb_ptr, "record_status", rs_info_ptr, p_code);
110 if p_code ^= 0 & p_code ^= error_table_$locked_by_this_process then do;
111 call clean_up;
112 return;
113 end;
114
115 free rs_info;
116
117 call iox_$delete_record (journal_control_block.vfile_iocb_ptr, p_code);
118 if p_code ^= 0 & p_code ^= error_table_$locked_by_this_process then do;
119 call clean_up;
120 return;
121 end;
122
123 goto NEXT;
124
125
126 ENTRY_TYPE (4):
127 goto NEXT;
128
129
130 ENTRY_TYPE (5):
131 goto NEXT;
132
133
134 ENTRY_TYPE (6):
135 goto NEXT;
136
137 NEXT:
138 journal_entry_ptr = journal_entry.next_ptr;
139 if journal_entry_ptr ^= null then
140 journal_entry.prev_ptr = null;
141 end;
142 call clean_up;
143 return;
144
145 clean_up:
146 proc;
147
148 if rs_info_ptr ^= null () then
149 free rs_info;
150 call rcprm_registry_util_$turn_off_privs (privileges_string);
151
152 end clean_up;
153 ^L
154 %include journal_entry;
155 %include journal_control_block;
156 %include rs_info;
157 end;