match_os_type Subroutine

public subroutine match_os_type(os_name, os_type)

Match os_type enum to a lowercase string with name of OS

Arguments

Type IntentOptional Attributes Name
character(len=:), intent(in), allocatable :: os_name

Name of operating system

integer, intent(out) :: os_type

Enum representing type of OS


Source Code

      subroutine match_os_type(os_name, os_type)

        !> Name of operating system
        character(len=:), allocatable, intent(in) :: os_name

        !> Enum representing type of OS
        integer, intent(out) :: os_type

        select case (os_name)
          case ("linux");   os_type = OS_LINUX
          case ("macos");   os_type = OS_MACOS
          case ("windows"); os_type = OS_WINDOWS
          case ("cygwin");  os_type = OS_CYGWIN
          case ("solaris"); os_type = OS_SOLARIS
          case ("freebsd"); os_type = OS_FREEBSD
          case ("openbsd"); os_type = OS_OPENBSD
          case ("all");     os_type = OS_ALL
          case default;     os_type = OS_UNKNOWN
        end select

      end subroutine match_os_type