is_pic_error_code Function

public pure function is_pic_error_code(code) result(reserved)

True when code falls inside the range PIC reserves for its own error codes (0 .. PIC_ERROR_CODE_MAX). Downstream libraries can assert their own codes are outside it: if (is_pic_error_code(MYLIB_ERROR_SOCKET)) error stop “code clash”

Arguments

Type IntentOptional Attributes Name
integer(kind=default_int), intent(in) :: code

Return Value logical


Source Code

   pure function is_pic_error_code(code) result(reserved)
      !! True when `code` falls inside the range PIC reserves for its own
      !! error codes (0 .. PIC_ERROR_CODE_MAX). Downstream libraries can
      !! assert their own codes are outside it:
      !!   if (is_pic_error_code(MYLIB_ERROR_SOCKET)) error stop "code clash"
      integer(default_int), intent(in) :: code
      logical :: reserved
      reserved = (code >= 0) .and. (code <= PIC_ERROR_CODE_MAX)
   end function is_pic_error_code