read_package_file Subroutine

public subroutine read_package_file(table, manifest, error)

Process the configuration file to a TOML data structure

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(out), allocatable :: table

TOML data structure

character(len=*), intent(in) :: manifest

Name of the package configuration file

type(error_t), intent(out), allocatable :: error

Error status of the operation


Source Code

    subroutine read_package_file(table, manifest, error)

        !> TOML data structure
        type(toml_table), allocatable, intent(out) :: table

        !> Name of the package configuration file
        character(len=*), intent(in) :: manifest

        !> Error status of the operation
        type(error_t), allocatable, intent(out) :: error

        logical :: exist

        inquire (file=manifest, exist=exist)

        if (.not. exist) then
            call file_not_found_error(error, manifest)
            return
        end if

        call load_table_from_file(table, manifest, error)

    end subroutine read_package_file