subroutinecheck_settings
subroutine check_settings(s, stat, errmsg)
Validate the project file's settings and derive what depends on them, before the command line is applied.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| s | type(settings_t) | inout | the settings | |
| stat | integer | out | nonzero on failure | |
| errmsg | character(len=:) | out | allocatable | what is wrong |
Calls
Source
Show the code
subroutine check_settings(s, stat, errmsg)
type(settings_t), intent(inout) :: s !! the settings
integer, intent(out) :: stat !! nonzero on failure
character(len=:), allocatable, intent(out) :: errmsg !! what is wrong
type(string_t), allocatable :: marks(:)
integer :: k, j
stat = 0
s%relative = s%project_url == ''
do k = 1, size(s%fixed_extensions)
if (contains_string(s%extensions, s%fixed_extensions(k)%s)) then
stat = 1
errmsg = "Fixed-form extension '"//s%fixed_extensions(k)%s//"' also appears in the free-form extension list"
return
end if
end do
do k = 1, size(s%extra_mods)
do j = 1, size(s%external)
if (s%extra_mods(k)%key == s%external(j)%key) then
stat = 1
errmsg = "extra-mod '"//s%extra_mods(k)%key//"' also appears in external mods"
return
end if
end do
end do
do k = 1, size(s%display)
s%display(k)%s = lowercase(s%display(k)%s)
end do
s%extensions = [s%extensions, s%fpp_extensions]
call sort_strings(s%extensions)
call push(s%exclude_dir, s%output_dir)
call add_intrinsic_modules(s)
marks = [string_t(s%docmark), string_t(s%predocmark), string_t(s%docmark_alt), string_t(s%predocmark_alt)]
do k = 1, size(marks)
do j = k + 1, size(marks)
if (marks(k)%s == marks(j)%s .and. len(marks(k)%s) > 0) then
stat = 1
errmsg = "Doc comment markers are the same: '"//marks(k)%s//"'"
return
end if
end do
end do
end subroutine check_settings