is_in_dep_dirs Function

private pure function is_in_dep_dirs(p, dep_dirs) result(ok)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: p
type(string_t), intent(in), allocatable :: dep_dirs(:)

Return Value logical


Calls

proc~~is_in_dep_dirs~~CallsGraph proc~is_in_dep_dirs is_in_dep_dirs proc~normalize_path normalize_path proc~is_in_dep_dirs->proc~normalize_path proc~starts_with starts_with proc~is_in_dep_dirs->proc~starts_with

Called by

proc~~is_in_dep_dirs~~CalledByGraph proc~is_in_dep_dirs is_in_dep_dirs proc~vec_push_unique vec_push_unique proc~vec_push_unique->proc~is_in_dep_dirs proc~gather_files_with_mask gather_files_with_mask proc~gather_files_with_mask->proc~vec_push_unique proc~push_file_with_mask push_file_with_mask proc~push_file_with_mask->proc~vec_push_unique proc~compute_watch_files_from_settings compute_watch_files_from_settings proc~compute_watch_files_from_settings->proc~gather_files_with_mask proc~compute_watch_files_from_settings->proc~push_file_with_mask proc~rebuild_watch_list rebuild_watch_list proc~rebuild_watch_list->proc~compute_watch_files_from_settings proc~handle_manifest_change handle_manifest_change proc~handle_manifest_change->proc~rebuild_watch_list proc~watcher_init watcher_t%watcher_init proc~watcher_init->proc~rebuild_watch_list proc~watcher_run watcher_t%watcher_run proc~watcher_run->proc~rebuild_watch_list proc~watcher_run->proc~handle_manifest_change

Source Code

   pure logical function is_in_dep_dirs(p, dep_dirs) result(ok)
      character(len=*), intent(in) :: p
      type(string_t), allocatable, intent(in) :: dep_dirs(:)
      integer :: j
      character(len=:), allocatable :: d
      ok = .false.
      if (.not. allocated(dep_dirs)) return
      if (size(dep_dirs) == 0) return

      do j = 1, size(dep_dirs)
         if (len_trim(dep_dirs(j)%s) == 0) cycle
         d = normalize_path(trim(dep_dirs(j)%s))
         if (len_trim(d) == 0) cycle
         if (p == d) then
            ok = .true.
            return
         end if
         if (starts_with(p, d // "/")) then
            ok = .true.
            return
         end if
      end do
   end function is_in_dep_dirs