Locate and return the [extra.fpm-watch] table from fpm.toml.
Returns ok=.false. when:
- fpm.toml is missing,
- the TOML cannot be read,
- the extra table is absent,
- the fpm-watch table is absent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(toml_table), | intent(out), | allocatable | :: | root | ||
| type(toml_table), | intent(out), | pointer | :: | wt | ||
| logical, | intent(out) | :: | ok |
subroutine load_watch_table(root, wt, ok) type(toml_table), allocatable, intent(out) :: root type(toml_table), pointer, intent(out) :: wt logical, intent(out) :: ok type(toml_table), pointer :: extra type(error_t), allocatable :: err integer :: stat ok = .false. wt => null() extra => null() if (.not. exists("fpm.toml")) return call read_package_file(root, "fpm.toml", err) if (allocated(err)) return call get_value(root, "extra", extra, requested=.false., stat=stat) if (stat /= toml_stat%success) return if (.not. associated(extra)) return call get_value(extra, "fpm-watch", wt, requested=.false., stat=stat) if (stat /= toml_stat%success) return if (.not. associated(wt)) return ok = .true. end subroutine load_watch_table