mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Have openmc_statepoint_write accept a const char* instead of const char**
This commit is contained in:
parent
db5f9ca59e
commit
1fe775574e
3 changed files with 6 additions and 4 deletions
|
|
@ -465,13 +465,15 @@ Functions
|
|||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_statepoint_write(const char filename[])
|
||||
.. c:function:: int openmc_statepoint_write(const char filename[], const bool* write_source)
|
||||
|
||||
Write a statepoint file
|
||||
|
||||
:param filename: Name of file to create. If a null pointer is passed, a
|
||||
filename is assigned automatically.
|
||||
:type filename: const char[]
|
||||
:param write_source: Whether to include the source bank
|
||||
:type write_source: const bool*
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ _dll.openmc_simulation_init.restype = c_int
|
|||
_dll.openmc_simulation_init.errcheck = _error_handler
|
||||
_dll.openmc_simulation_finalize.restype = c_int
|
||||
_dll.openmc_simulation_finalize.errcheck = _error_handler
|
||||
_dll.openmc_statepoint_write.argtypes = [POINTER(c_char_p), POINTER(c_bool)]
|
||||
_dll.openmc_statepoint_write.argtypes = [c_char_p, POINTER(c_bool)]
|
||||
_dll.openmc_statepoint_write.restype = c_int
|
||||
_dll.openmc_statepoint_write.errcheck = _error_handler
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ contains
|
|||
!===============================================================================
|
||||
|
||||
function openmc_statepoint_write(filename, write_source) result(err) bind(C)
|
||||
type(C_PTR), intent(in), optional :: filename
|
||||
type(C_PTR), value :: filename
|
||||
logical(C_BOOL), intent(in), optional :: write_source
|
||||
integer(C_INT) :: err
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ contains
|
|||
err = 0
|
||||
|
||||
! Set the filename
|
||||
if (present(filename)) then
|
||||
if (c_associated(filename)) then
|
||||
call c_f_pointer(filename, string, [MAX_FILE_LEN])
|
||||
filename_ = to_f_string(string)
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue