get_toml_int Subroutine

public subroutine get_toml_int(table, key, value, context)

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table
type(toml_key), intent(in) :: key
integer(kind=i32), intent(out) :: value
character(len=*), intent(in) :: context

Calls

proc~~get_toml_int~~CallsGraph proc~get_toml_int get_toml_int get_value get_value proc~get_toml_int->get_value proc~require_toml_success require_toml_success proc~get_toml_int->proc~require_toml_success proc~stop_config_error stop_config_error proc~get_toml_int->proc~stop_config_error proc~require_toml_success->proc~stop_config_error

Called by

proc~~get_toml_int~~CalledByGraph proc~get_toml_int get_toml_int proc~normalize_config_layout normalize_config_layout proc~normalize_config_layout->proc~get_toml_int proc~load_toml_config load_toml_config proc~load_toml_config->proc~normalize_config_layout proc~load_app_config load_app_config proc~load_app_config->proc~load_toml_config proc~handle_early_cli handle_early_cli proc~handle_early_cli->proc~load_app_config proc~load_or_init_run_state load_or_init_run_state proc~load_or_init_run_state->proc~load_app_config program~main main program~main->proc~handle_early_cli program~main->proc~load_or_init_run_state

Source Code

  subroutine get_toml_int(table, key, value, context)
    type(toml_table), intent(inout) :: table
    type(toml_key), intent(in) :: key
    integer(i32), intent(out) :: value
    character(len=*), intent(in) :: context
    integer :: stat
    integer(i64) :: tmp

    call get_value(table, key, tmp, stat=stat)
    call require_toml_success(stat, context)
    if (tmp > int(huge(0_i32), i64) .or. tmp < -int(huge(0_i32), i64) - 1_i64) then
      call stop_config_error(trim(context)//' must fit a 32-bit signed integer.')
    end if
    value = int(tmp, i32)
  end subroutine get_toml_int