! This file was automatically generated by SWIG (http://www.swig.org).
! Version 4.0.0
!
! Do not make changes to this file unless you know what you are doing--modify
! the SWIG interface file instead.

! ---------------------------------------------------------------
! Programmer(s): Auto-generated by swig.
! ---------------------------------------------------------------
! SUNDIALS Copyright Start
! Copyright (c) 2002-2022, Lawrence Livermore National Security
! and Southern Methodist University.
! All rights reserved.
!
! See the top-level LICENSE and NOTICE files for details.
!
! SPDX-License-Identifier: BSD-3-Clause
! SUNDIALS Copyright End
! ---------------------------------------------------------------

module fsundials_profiler_mod
 use, intrinsic :: ISO_C_BINDING
 implicit none
 private

 ! DECLARATION CONSTRUCTS
 public :: FSUNProfiler_Free
 type, bind(C) :: SwigArrayWrapper
  type(C_PTR), public :: data = C_NULL_PTR
  integer(C_SIZE_T), public :: size = 0
 end type
 public :: FSUNProfiler_Begin
 public :: FSUNProfiler_End
 public :: FSUNProfiler_Print
 public :: FSUNProfiler_Reset

  public :: FSUNProfiler_Create


! WRAPPER DECLARATIONS
interface
function swigc_FSUNProfiler_Free(farg1) &
bind(C, name="_wrap_FSUNProfiler_Free") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT) :: fresult
end function

function swigc_FSUNProfiler_Begin(farg1, farg2) &
bind(C, name="_wrap_FSUNProfiler_Begin") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigarraywrapper
type(C_PTR), value :: farg1
type(SwigArrayWrapper) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FSUNProfiler_End(farg1, farg2) &
bind(C, name="_wrap_FSUNProfiler_End") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigarraywrapper
type(C_PTR), value :: farg1
type(SwigArrayWrapper) :: farg2
integer(C_INT) :: fresult
end function

function swigc_FSUNProfiler_Print(farg1, farg2) &
bind(C, name="_wrap_FSUNProfiler_Print") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
type(C_PTR), value :: farg2
integer(C_INT) :: fresult
end function

function swigc_FSUNProfiler_Reset(farg1) &
bind(C, name="_wrap_FSUNProfiler_Reset") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
type(C_PTR), value :: farg1
integer(C_INT) :: fresult
end function


function swigc_FSUNProfiler_Create(farg1, farg2, farg3) &
bind(C, name="_wrap_FSUNProfiler_Create") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigarraywrapper
type(C_PTR), value :: farg1
type(SwigArrayWrapper) :: farg2
type(C_PTR), value :: farg3
integer(C_INT) :: fresult
end function

end interface


contains
 ! MODULE SUBPROGRAMS
function FSUNProfiler_Free(p) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR), target, intent(inout) :: p
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 

farg1 = c_loc(p)
fresult = swigc_FSUNProfiler_Free(farg1)
swig_result = fresult
end function


subroutine SWIG_string_to_chararray(string, chars, wrap)
  use, intrinsic :: ISO_C_BINDING
  character(kind=C_CHAR, len=*), intent(IN) :: string
  character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars
  type(SwigArrayWrapper), intent(OUT) :: wrap
  integer :: i

  allocate(character(kind=C_CHAR) :: chars(len(string) + 1))
  do i=1,len(string)
    chars(i) = string(i:i)
  end do
  i = len(string) + 1
  chars(i) = C_NULL_CHAR ! C string compatibility
  wrap%data = c_loc(chars)
  wrap%size = len(string)
end subroutine

function FSUNProfiler_Begin(p, name) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: p
character(kind=C_CHAR, len=*), target :: name
character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(SwigArrayWrapper) :: farg2 

farg1 = p
call SWIG_string_to_chararray(name, farg2_chars, farg2)
fresult = swigc_FSUNProfiler_Begin(farg1, farg2)
swig_result = fresult
end function

function FSUNProfiler_End(p, name) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: p
character(kind=C_CHAR, len=*), target :: name
character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(SwigArrayWrapper) :: farg2 

farg1 = p
call SWIG_string_to_chararray(name, farg2_chars, farg2)
fresult = swigc_FSUNProfiler_End(farg1, farg2)
swig_result = fresult
end function

function FSUNProfiler_Print(p, fp) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: p
type(C_PTR) :: fp
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 
type(C_PTR) :: farg2 

farg1 = p
farg2 = fp
fresult = swigc_FSUNProfiler_Print(farg1, farg2)
swig_result = fresult
end function

function FSUNProfiler_Reset(p) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: p
integer(C_INT) :: fresult 
type(C_PTR) :: farg1 

farg1 = p
fresult = swigc_FSUNProfiler_Reset(farg1)
swig_result = fresult
end function


function FSUNProfiler_Create(comm, title, p) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
type(C_PTR) :: comm
character(kind=C_CHAR, len=*), target :: title
character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars
type(C_PTR), target, intent(inout) :: p
integer(C_INT) :: fresult
type(C_PTR) :: farg1
type(SwigArrayWrapper) :: farg2
type(C_PTR) :: farg3

farg1 = comm
call SWIG_string_to_chararray(title, farg2_chars, farg2)
farg3 = c_loc(p)
fresult = swigc_FSUNProfiler_Create(farg1, farg2, farg3)
swig_result = fresult
end function


end module
