! Module  : cmsg_m
! Purpose : C public interface for MSG modules
!
! Copyright 2021-2022 Rich Townsend & The MSG Team
!
! This file is part of MSG. MSG is free software: you can redistribute
! it and/or modify it under the terms of the GNU General Public
! License as published by the Free Software Foundation, version 3.
!
! MSG is distributed in the hope that it will be useful, but WITHOUT
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
! License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program.  If not, see <http://www.gnu.org/licenses/>.

#:include 'forum.inc'

module cmsg_m

   ! Uses

   use forum_m, only: f_c_string

   use msg_m, only: get_version
   use stat_m

   use cmsg_spec_m
   use cmsg_phot_m

   use ISO_C_BINDING

   ! No implicit typing

   implicit none

   ! Access specifiers

   public

contains

   subroutine get_msg_version(version) bind(C)

      character(C_CHAR) :: version(*)

      character(:), allocatable :: f_version

      ! Get the library version

      call get_version(f_version)

      call f_c_string(f_version, version)

      ! Finish

      return

   end subroutine get_msg_version

end module cmsg_m
