Skip to content

Commit 23b663f

Browse files
create procedure to run callbacks
1 parent ad07651 commit 23b663f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/caffeine/program_termination_s.f90

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,18 @@ subroutine prif_error_stop_integer(quiet, stop_code)
126126
call unimplemented("prif_fail_image")
127127
end procedure
128128

129+
subroutine run_callbacks(is_error_stop, quiet, stop_code_int, stop_code_char)
130+
logical(c_bool), intent(in) :: is_error_stop, quiet
131+
integer(c_int), intent(in), optional :: stop_code_int
132+
character(len=*), intent(in), optional :: stop_code_char
133+
134+
type(callback_entry), pointer :: next_entry
135+
136+
next_entry => callback_list
137+
do while (associated(next_entry))
138+
call next_entry%callback(is_error_stop, quiet, stop_code_int, stop_code_char)
139+
next_entry => next_entry%next
140+
end do
141+
end subroutine
142+
129143
end submodule program_termination_s

0 commit comments

Comments
 (0)