fdoc

subroutineload_source

subroutine load_source(s, path, raw, text, stat, errmsg)

Read source file path, preprocessing it if its extension calls for that. Unless that runs an external command, this can be called from parallel code.

Arguments

NameTypeIntentAttributesDescription
stype(settings_t)in

the settings

pathcharacter(len=*)in

the file

rawcharacter(len=:)outallocatable

the file as it is

textcharacter(len=:)outallocatable

the text to parse

statintegerout

nonzero on failure

errmsgcharacter(len=:)outallocatable

what is wrong

Calls

Source

Show the code
subroutine load_source(s, path, raw, text, stat, errmsg)
    type(settings_t), intent(in) :: s                   !! the settings
    character(len=*), intent(in) :: path                !! the file
    character(len=:), allocatable, intent(out) :: raw   !! the file as it is
    character(len=:), allocatable, intent(out) :: text  !! the text to parse
    integer, intent(out) :: stat                        !! nonzero on failure
    character(len=:), allocatable, intent(out) :: errmsg  !! what is wrong

    call read_whole_file(path, raw, stat, errmsg)
    if (stat /= 0) return
    text = raw
    if (needs_fypp(s, path)) then
        call fypp_source(s, path, text)
    else if (s%preprocess .and. contains_string(s%fpp_extensions, extension_of(path))) then
        call preprocess(s, path, text)
    end if
end subroutine load_source

Graphs

Calls

Called by