fdoc

subroutineinherit_displayprivate

subroutine inherit_display(list, id, s)

Copy the display settings that apply to id from its parent, and apply its own metadata.

Arguments

NameTypeIntentAttributesDescription
listtype(entity_list_t)inout

the entities

idintegerin

the entity

stype(settings_t)in

the settings

Calls

Source

Show the code
subroutine inherit_display(list, id, s)
    type(entity_list_t), intent(inout) :: list  !! the entities
    integer, intent(in) :: id                   !! the entity
    type(settings_t), intent(in) :: s           !! the settings
    type(string_t), allocatable :: wanted(:)
    logical :: flag, ok
    integer :: k, j

    associate (e => list%box(id)%e)
        if (e%parent > 0) then
            e%display = list%box(e%parent)%e%display
            e%internals = list%box(e%parent)%e%internals
        else
            e%display = s%display
            e%internals = s%proc_internals
        end if
        do k = 1, size(e%meta)
            if (e%meta(k)%key == 'proc_internals') then
                call parse_bool(e%meta(k)%values(1)%s, flag, ok)
                if (ok) e%internals = flag
            else if (e%meta(k)%key == 'display') then
                allocate (wanted(size(e%meta(k)%values)))
                do j = 1, size(wanted)
                    wanted(j)%s = lowercase(e%meta(k)%values(j)%s)
                end do
                if (contains_string(wanted, 'none') .and. e%kind /= E_FILE) then
                    e%display = [string_t ::]
                else if (contains_string(wanted, 'public') .or. contains_string(wanted, 'private') .or. &
                         contains_string(wanted, 'protected')) then
                    call move_alloc(wanted, e%display)
                end if
                if (allocated(wanted)) deallocate (wanted)
            end if
        end do
    end associate
end subroutine inherit_display

Graphs

Calls

Called by