Skip to content

FiNeRFortran INI ParseR

A pure Fortran 2003+ OOP library for reading and writing INI configuration files.

Quick start โ€‹

Parse an INI source string and retrieve a multi-value option:

fortran
use finer
use penf, only: R4P, I4P
type(file_ini)                :: fini
character(len=:), allocatable :: source
real(R4P), allocatable        :: array(:)
integer(I4P)                  :: error

source = '[section-1]'//new_line('A')// &
         'option-1 = one'//new_line('A')// &
         'option-2 = 2.'//new_line('A')// &
         '           3.'//new_line('A')// &
         '[section-2]'//new_line('A')// &
         'option-1 = foo'

call fini%load(source=source)
allocate(array(1:fini%count_values(section='section-1', option='option-2')))
call fini%get(section='section-1', option='option-2', val=array, error=error)
if (error == 0) print *, array   ! 2.0  3.0

Authors โ€‹

Contributions are welcome โ€” see the Contributing page.

Copyrights โ€‹

FiNeR is distributed under a multi-licensing system:

Use caseLicense
FOSS projectsGPL v3
Closed source / commercialBSD 2-Clause
Closed source / commercialBSD 3-Clause
Closed source / commercialMIT

Anyone interested in using, developing, or contributing to FiNeR is welcome โ€” pick the license that best fits your needs.