Append a feature name to a string_t array if not already present.
This is used both for plugin feature names and for ignore/include patterns.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_t), | intent(inout), | allocatable | :: | features(:) | ||
| character(len=*), | intent(in) | :: | name |
subroutine push_feature(features, name) type(string_t), allocatable, intent(inout) :: features(:) character(len=*), intent(in) :: name integer :: n, i type(string_t), allocatable :: tmp(:) if (len_trim(name) == 0) return if (.not. allocated(features)) then allocate(features(1)) features(1)%s = trim(name) return end if do i = 1, size(features) if (trim(features(i)%s) == trim(name)) return end do n = size(features) allocate(tmp(n+1)) tmp(1:n) = features tmp(n+1)%s = trim(name) call move_alloc(tmp, features) end subroutine push_feature