watch_config Module

Project configuration and defaults.

Reads watcher configuration from: - Built-in defaults (set_watch_defaults) - fpm.toml under [extra.fpm-watch] (apply_watch_from_manifest)

Also provides helper routines used by the supervisor (watch_restart) for auto-restart defaults (delay, max restarts, self path).


Uses

    • fpm_filesystem
    • fpm_strings
    • tomlf
    • fpm_toml
    • watch_types
    • fpm_error
  • module~~watch_config~~UsesGraph module~watch_config watch_config fpm_error fpm_error module~watch_config->fpm_error fpm_filesystem fpm_filesystem module~watch_config->fpm_filesystem fpm_strings fpm_strings module~watch_config->fpm_strings fpm_toml fpm_toml module~watch_config->fpm_toml module~watch_types watch_types module~watch_config->module~watch_types tomlf tomlf module~watch_config->tomlf module~watch_types->fpm_strings fpm_command_line fpm_command_line module~watch_types->fpm_command_line iso_fortran_env iso_fortran_env module~watch_types->iso_fortran_env

Used by

  • module~~watch_config~~UsedByGraph module~watch_config watch_config module~watch_cli watch_cli module~watch_cli->module~watch_config module~watch_restart watch_restart module~watch_restart->module~watch_config

Subroutines

public subroutine apply_watch_from_manifest(w)

Apply configuration overrides from fpm.toml [extra.fpm-watch].

Read more…

Arguments

Type IntentOptional Attributes Name
type(watch_opts_t), intent(inout) :: w

public subroutine get_restart_defaults(auto_restart, restart_delay, restart_max, self_exe)

Read supervisor defaults from the manifest (when present).

Read more…

Arguments

Type IntentOptional Attributes Name
logical, intent(out) :: auto_restart
real, intent(out) :: restart_delay
integer, intent(out) :: restart_max
character(len=:), intent(out), allocatable :: self_exe

public subroutine normalize_watch_opts(w)

Normalize watcher options and clamp to safe bounds.

Read more…

Arguments

Type IntentOptional Attributes Name
type(watch_opts_t), intent(inout) :: w

public subroutine push_feature(features, name)

Append a feature name to a string_t array if not already present.

Read more…

Arguments

Type IntentOptional Attributes Name
type(string_t), intent(inout), allocatable :: features(:)
character(len=*), intent(in) :: name

public subroutine set_watch_defaults(w)

Apply built-in defaults to watcher options.

Read more…

Arguments

Type IntentOptional Attributes Name
type(watch_opts_t), intent(inout) :: w

private subroutine load_watch_table(root, wt, ok)

Locate and return the [extra.fpm-watch] table from fpm.toml.

Read more…

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(out), allocatable :: root
type(toml_table), intent(out), pointer :: wt
logical, intent(out) :: ok

private subroutine toml_get_int(table, key, v)

Read a TOML integer value if present.

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table
character(len=*), intent(in) :: key
integer, intent(inout) :: v

private subroutine toml_get_list_strings(table, key, list)

Read a TOML string list into an allocatable string_t array.

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table
character(len=*), intent(in) :: key
type(string_t), intent(inout), allocatable :: list(:)

private subroutine toml_get_logical(table, key, v)

Read a TOML logical value if present.

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table
character(len=*), intent(in) :: key
logical, intent(inout) :: v

private subroutine toml_get_real(table, key, v)

Read a TOML real value if present.

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table
character(len=*), intent(in) :: key
real, intent(inout) :: v

private subroutine toml_get_string(table, key, v)

Read a TOML string value if present.

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table
character(len=*), intent(in) :: key
character(len=:), intent(inout), allocatable :: v