PluginGuestReceiveF Function

private function PluginGuestReceiveF()

Arguments

None

Return Value character(len=:), ALLOCATABLE


Contents

Source Code


Source Code

    FUNCTION PluginGuestReceiveF()
        CHARACTER(:), ALLOCATABLE :: PluginGuestReceiveF
        integer :: length
        character(kind=c_char, len=1), allocatable, dimension(:) :: cstring
        integer(kind=c_size_t) :: clen

        clen = int(PATHLEN, kind=c_size_t)
        allocate(cstring(PATHLEN + 1))
        call PluginGuestReceive(cstring, clen)
        DO length = 1, PATHLEN
            IF (cstring(length) == c_null_char) EXIT
        END DO
        length = length - 1
        allocate(CHARACTER(len=length) :: PluginGuestReceiveF)
        DO length = 1, LEN(PluginGuestReceiveF)
            PluginGuestReceiveF(length:length) = cstring(length)
        END DO
    END FUNCTION PluginGuestReceiveF