Skip to content
Snippets Groups Projects
Commit 0198819a authored by Evgeny Mortikov's avatar Evgeny Mortikov
Browse files

config parser module update

parent fe277867
No related branches found
No related tags found
No related merge requests found
module config_parser
implicit none
public
!< @brief C->Fortran interface
interface
!< process configuration file [filename], status = [0 (ERROR), 1 (OK)]
subroutine c_config_run(filename, status) BIND(C)
use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT
implicit none
character (kind=C_CHAR), intent(in) :: filename(*)
integer (kind=C_INT), intent(out) :: status
end subroutine c_config_run
......@@ -13,7 +15,6 @@ module config_parser
!< check if variable [name] is defined, status = [0 (FALSE), 1 (TRUE)]
subroutine c_config_is_varname(name, status) BIND(C)
use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT
implicit none
character (kind=C_CHAR), intent(in) :: name(*)
integer (kind=C_INT), intent(out) :: status
end subroutine c_config_is_varname
......@@ -21,7 +22,6 @@ module config_parser
!< get (int) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
subroutine c_config_get_int(name, value, status) BIND(C)
use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT
implicit none
character (kind=C_CHAR), intent(in) :: name(*)
integer (kind=C_INT), intent(out) :: value
integer (kind=C_INT), intent(out) :: status
......@@ -30,7 +30,6 @@ module config_parser
!< get (float) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
subroutine c_config_get_float(name, value, status) BIND(C)
use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT, C_FLOAT
implicit none
character (kind=C_CHAR), intent(in) :: name(*)
real (kind=C_FLOAT), intent(out) :: value
integer (kind=C_INT), intent(out) :: status
......@@ -39,7 +38,6 @@ module config_parser
!< get (double) [value] of variable [name], status = [0 (ERROR), 1 (OK)]
subroutine c_config_get_double(name, value, status) BIND(C)
use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT, C_DOUBLE
implicit none
character (kind=C_CHAR), intent(in) :: name(*)
real (kind=C_DOUBLE), intent(out) :: value
integer (kind=C_INT), intent(out) :: status
......@@ -49,7 +47,6 @@ module config_parser
!< [len] = 0 if variable is not defined or not a string
subroutine c_config_get_string_len(name, len) BIND(C)
use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT
implicit none
character (kind=C_CHAR), intent(in) :: name(*)
integer (kind=C_INT), intent(out) :: len
end subroutine c_config_get_string_len
......@@ -59,7 +56,6 @@ module config_parser
!< *: [c_str] output doesn't contain the null terminated character
subroutine c_config_get_string_unsafe(name, c_str, status) BIND(C)
use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT
implicit none
character (kind=C_CHAR), intent(in) :: name(*)
character (kind=C_CHAR), intent(out) :: c_str(*)
integer (kind=C_INT), intent(out) :: status
......@@ -77,7 +73,6 @@ module config_parser
! *: [c_str] output doesn't contain the null terminated character
subroutine c_config_get_string(name, c_str, status)
use, intrinsic :: iso_c_binding, only: C_CHAR, C_INT
implicit none
character (kind=C_CHAR), intent(in) :: name(*)
character (kind=C_CHAR), allocatable, intent(out) :: c_str(:)
integer (kind=C_INT), intent(out) :: status
......@@ -100,4 +95,4 @@ module config_parser
! --------------------------------------------------------------------------------
! --------------------------------------------------------------------------------
end module config_parser
\ No newline at end of file
end module config_parser
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment