error_ring_get Function

public pure function error_ring_get(i) result(msg)

Message at ring-relative index i (0 = most recent, 1 = next-most-recent, …). Empty string if i is out of [0, error_ring_count()).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: i

Return Value character(len=ERROR_RING_MSG_LEN)


Called by

proc~~error_ring_get~~CalledByGraph proc~error_ring_get error_ring_get proc~rdb_ocean_last_error rdb_ocean_last_error proc~rdb_ocean_last_error->proc~error_ring_get

Variables

Type Visibility Attributes Name Initial
integer, private :: slot

Source Code

   pure function error_ring_get(i) result(msg)
      !! Message at ring-relative index `i` (0 = most recent, 1 =
      !! next-most-recent, ...). Empty string if `i` is out of
      !! `[0, error_ring_count())`.
      integer, intent(in) :: i
      character(len=ERROR_RING_MSG_LEN) :: msg

      integer :: slot

      if (i < 0 .or. i >= ring_count) then
         msg = ""
         return
      end if
      slot = ring_head - i
      if (slot < 1) slot = slot + ERROR_RING_SLOTS
      msg = ring(slot)
   end function error_ring_get