Skip to content
Snippets Groups Projects
Commit 798e0145 authored by Jan Frederik Engels's avatar Jan Frederik Engels :new_moon: Committed by Luis Kornblueh
Browse files

Fix t_event_is_active

parent 6f51f9d6
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,8 @@
MODULE mtime_hl
USE, INTRINSIC :: iso_c_binding, ONLY: c_int32_t, c_int64_t, c_double, &
& c_null_char, c_ptr, c_loc, c_f_pointer
& c_null_char, c_ptr, c_loc, c_f_pointer, &
& c_null_ptr
USE mtime_c_bindings
USE mtime_constants
use mtime_error_handling
......
......@@ -110,16 +110,30 @@
FUNCTION t_event_is_active(this, my_datetime, plus_slack, minus_slack) result(ret)
CLASS(t_event) :: this
CLASS(t_event), TARGET :: this
TYPE(t_datetime) :: my_datetime
TYPE(t_timedelta), OPTIONAL :: plus_slack
TYPE(t_timedelta), OPTIONAL :: minus_slack
TYPE(t_event), POINTER :: tmp_ev
TYPE(c_ptr) :: tmp_dt, tmp_plus, tmp_minus
logical(c_bool) :: ret
!FIXME
STOP
!ret = isCurrentEventActive(this, my_datetime%dt, plus_slack%td, minus_slack%td)
tmp_ev => this
tmp_dt = my_datetime%get_c_pointer()
if (present(plus_slack)) then
tmp_plus = plus_slack%get_c_pointer()
else
tmp_plus = c_null_ptr
endif
if (present(minus_slack)) then
tmp_minus = minus_slack%get_c_pointer()
else
tmp_minus = c_null_ptr
endif
ret = my_isCurrentEventActive(c_loc(tmp_ev), tmp_dt, &
& tmp_plus, tmp_minus)
END FUNCTION t_event_is_active
! ================================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment