fdoc

subroutineapply_toml_string

subroutine apply_toml_string(text, s, stat, errmsg)

Apply --config options: TOML with ; between lines.

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the options

stype(settings_t)inout

the settings

statintegerout

nonzero on failure

errmsgcharacter(len=:)outallocatable

what is wrong

Calls

Source

Show the code
subroutine apply_toml_string(text, s, stat, errmsg)
    character(len=*), intent(in) :: text                !! the options
    type(settings_t), intent(inout) :: s                !! the settings
    integer, intent(out) :: stat                        !! nonzero on failure
    character(len=:), allocatable, intent(out) :: errmsg  !! what is wrong
    type(toml_table), allocatable :: top
    type(toml_error), allocatable :: error

    call toml_loads(top, join(split_on(text, ';'), achar(10)), error=error)
    if (allocated(error)) then
        stat = 1
        errmsg = '--config: '//error%message
        return
    end if
    call apply_table(top, s, stat, errmsg)
end subroutine apply_toml_string

Graphs

Calls

Called by