subroutineapply_toml_string
subroutine apply_toml_string(text, s, stat, errmsg)
Apply --config options: TOML with ; between lines.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| text | character(len=*) | in | the options | |
| s | type(settings_t) | inout | the settings | |
| stat | integer | out | nonzero on failure | |
| errmsg | character(len=:) | out | allocatable | 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