set_continuation_byte Function

private pure function set_continuation_byte(byte) result(res)

This function take one byte, set the first two bits to 10, and returns one byte of the continuation part.

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: byte

Return Value integer(kind=int8)


Source Code

   pure function set_continuation_byte(byte) result(res)
      use, intrinsic :: iso_fortran_env, only: int8
      implicit none
      integer(int8), intent(in) :: byte
      integer(int8) :: res

      res = ibset(byte, 7) ! 1xxxxxxx
      res = ibclr(res, 6)  ! 10xxxxxx
   end function set_continuation_byte