Scan files and return indices of changed entries.
changed_idx(1:changed_count) contains the 1-based indices into files
for which the fingerprint differs from fp_prev.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_t), | intent(in), | allocatable | :: | files(:) | ||
| integer(kind=int64), | intent(in) | :: | fp_prev(:) | |||
| integer(kind=int64), | intent(inout) | :: | fp_now(:) | |||
| integer, | intent(inout) | :: | changed_idx(:) | |||
| integer, | intent(out) | :: | changed_count |
subroutine scan_changes(files, fp_prev, fp_now, changed_idx, changed_count) type(string_t), allocatable, intent(in) :: files(:) integer(int64), intent(in) :: fp_prev(:) integer(int64), intent(inout) :: fp_now(:) integer, intent(inout) :: changed_idx(:) integer, intent(out) :: changed_count integer :: i, n changed_count = 0 if (.not. allocated(files)) return n = size(files) if (n == 0) return do i = 1, n fp_now(i) = file_fingerprint(files(i)%s) if (fp_now(i) /= fp_prev(i)) then changed_count = changed_count + 1 changed_idx(changed_count) = i end if end do end subroutine scan_changes