check_error_api Function

public function check_error_api(verror) result(status) bind(C, name=namespace//"check_error")

Check error handle status

Arguments

Type IntentOptional Attributes Name
type(c_ptr), value :: verror

Return Value integer(kind=c_int)


Source Code

function check_error_api(verror) result(status) &
      & bind(C, name=namespace//"check_error")
   !DEC$ ATTRIBUTES DLLEXPORT :: check_error_api
   type(c_ptr), value :: verror
   type(vp_error), pointer :: error
   integer(c_int) :: status

   if (debug) print'("[Info]",1x, a)', "check_error"

   if (c_associated(verror)) then
      call c_f_pointer(verror, error)

      if (allocated(error%ptr)) then
         status = 1
      else
         status = 0
      end if
   else
      status = 2
   end if

end function check_error_api