diff --git a/CHANGELOG.md b/CHANGELOG.md index 97d706cc7..fa3eff810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] - + +## v0.12.2 - 2020-08-04 +### Added +- Added std::string scalar arguments. + +### Fixed +- Mangle names of Fortran helper functions with *C_prefix*. This + fixes a conflict when two Shroud generated wrappers are used in the + same subprogram. Ideally these helpers would be `PRIVATE`, but + gfortran does not allow `PRIVATE` and `BIND(C)` together. +- Mangle names of Fortran derived types for capsules with *C_prefix* to avoid + name conflicts. +- Correctly count Python arguments when there are default arguments. + Do not include *intent(out)* arguments. + ## v0.12.0 - 2020-06-29 ### Added - Option `C_force_wrapper` to create a C wrapper. @@ -23,7 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. are a lot of classes which may create lots of duplicate helpers. - Parse array syntax for variables and struct members. - Change Python setter and getter functions to be driven by py_statements. -- Parse `(void)` C prototype to indicate no parameters. +- Parse `(void)` C prototype to indicate no parameters. ### Changed - *intent(in)* pointer arguments now use the *rank* attribute instead of diff --git a/Makefile b/Makefile index 358a1d138..0e82cf6b5 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ include $(top)/regression/run/Makefile virtualenv : $(venv.dir) $(venv.dir) : $(PYTHON) -m venv --system-site-packages $(venv.dir) + $(python.dir)/pip install --upgrade pip virtualenv2 : $(venv) --system-site-packages $(venv.dir) @@ -111,10 +112,33 @@ pypi: .PHONY : install-twine sdist testpypi pypi +######################################################################## +# Creating pex executable +# This puts all of shroud into a single file. +# https://github.com/pantsbuild/pex + +install-pex : + $(python.dir)/pip install pex + +# Use version in output file name. +pex-file : vernum = $(shell grep __version__ shroud/metadata.py | awk -F '"' '{print $$2}') +pex-file : dist-pex/.. + $(python.dir)/pex . -r requirements.txt --python-shebang="/usr/bin/env python3" \ + -e shroud.main:main -o dist-pex/shroud-$(vernum).pex + cd dist-pex && ln --force --symbolic shroud-$(vernum).pex shroud.pex + +# Test pex created executable +do-test-pex : + @export TEST_OUTPUT_DIR=$(top)/$(tempdir)/regression; \ + export TEST_INPUT_DIR=$(top)/regression; \ + export EXECUTABLE_DIR=$(top)/dist-pex/shroud.pex; \ + $(PYTHON) regression/do-test.py $(do-test-args) + ######################################################################## # Creating shiv executable # This puts all of shroud into a single file. # https://github.com/linkedin/shiv +# Note: Python 3.6+ install-shiv : $(python.dir)/pip install shiv @@ -124,7 +148,7 @@ shiv-file : vernum = $(shell grep __version__ shroud/metadata.py | awk -F '"' '{ shiv-file : dist-shiv/.. $(python.dir)/shiv --python '/usr/bin/env python3' -c shroud \ -o dist-shiv/shroud-$(vernum).pyz . - cd dist-shiv && ln -s shroud-$(vernum).pyz shroud.pyz + cd dist-shiv && ln --force --symbolic shroud-$(vernum).pyz shroud.pyz # Test shiv created executable do-test-shiv : diff --git a/README.md b/README.md index b1d9b1319..90a31ecd1 100644 --- a/README.md +++ b/README.md @@ -98,9 +98,10 @@ In addition, a file created by is available from the github release. Shroud and PyYAML are bundled into a single executable which uses the Python3 on your path. +Shiv requires Python 3.6+. ``` -wget https://github.com/LLNL/shroud/archive/shroud-0.12.1.pyz +wget https://github.com/LLNL/shroud/archive/shroud-0.12.2.pyz ``` diff --git a/docs/conf.py b/docs/conf.py index 8419bea54..334a2d1e2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,7 @@ # The short X.Y version. version = '0.12' # The full version, including alpha/beta/rc tags. -release = '0.12.1' +release = '0.12.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/cstatements.rst b/docs/cstatements.rst index 4bf371cb7..774c42492 100644 --- a/docs/cstatements.rst +++ b/docs/cstatements.rst @@ -48,7 +48,7 @@ arg arg_decl The explicit declarations will be provided in the fields - c_arg_decl and f_arg_decl. + *c_arg_decl* and *f_arg_decl*. capsule @@ -181,6 +181,8 @@ f_arg_decl ^^^^^^^^^^ A list of declarations in the Fortran interface when buf_arg includes "arg_decl". +The variable to be declared is *c_var*. +*f_module* can be used to add ``USE`` statements. .. c_var diff --git a/docs/fstatements.rst b/docs/fstatements.rst index 32ac41330..947febd6f 100644 --- a/docs/fstatements.rst +++ b/docs/fstatements.rst @@ -67,6 +67,8 @@ If true, the Fortran wrapper will always be created. This is used when an assignment is needed to do a type coercion; for example, with logical types. +.. XXX tends to call bufferify version + arg_name ^^^^^^^^ @@ -93,6 +95,12 @@ Added before splicer. arg_c_call ^^^^^^^^^^ +List of arguments to pass to C wrapper. +This can include an expression or additional arguments if required. + +.. code-block:: text + + arg_c_call=["C_LOC({f_var})"], declare ^^^^^^^ @@ -113,6 +121,18 @@ call Code used to call the function. Defaults to ``{F_result} = {F_C_call}({F_arg_c_call})`` + +For example, to assign to an intermediate variable: + +.. code-block:: text + + declare=[ + "type(C_PTR) :: {F_pointer}", + ], + call=[ + "{F_pointer} = {F_C_call}({F_arg_c_call})", + ], + post_call ^^^^^^^^^ diff --git a/docs/python.rst b/docs/python.rst index 68b9cf2f8..08b58e342 100644 --- a/docs/python.rst +++ b/docs/python.rst @@ -111,6 +111,53 @@ PY_from_object PyArg_Parse - ``status = converter(object, address)``. Defaults to *None*. +py_ctype +^^^^^^^^ + +The type returned by *PY_get* function. +Defaults to ``None`` which implies it is the same as the typemap. +i.e. ``PyInt_AsLong`` returns a ``long``. + +Defined for complex types because ``PyComplex_AsCComplex`` returns +type ``Py_complex``. +See also *pytype_to_pyctor* and *pytype_to_cxx*. + +pytype_to_pyctor +^^^^^^^^^^^^^^^^ + +Expression to use with *PY_ctor*. +Defaults to ``None`` which indicates no additional processing of the argument +is required. +Only needs to be defined when *py_ctype* is defined. + +With complex types, it is used to extract the real and imaginary parts from +``Py_complex`` (defined with *py_ctype*) +with ``creal({ctor_expr}), cimag({ctor_expr})``. +*ctor_expr* is the expression used with *Py_ctor*. + +pytype_to_cxx +^^^^^^^^^^^^^ + +Expression to convert *py_ctype* into a C++ value. +Only needs to be defined when *py_ctype* is defined. + +Used with complex to convert ``Py_complex`` (defined with *py_ctype*) +to C using ``{work_var}.real + {work_var}.imag * I`` +or C++ with ``std::complex(\tcvalue.real, cvalue.imag)``. + +cxx_to_pytype +^^^^^^^^^^^^^ + +Statements to convert *cxx_var* to *py_ctype*/ +Only needs to be defined when *py_ctype* is defined. + +.. code-block:: yaml + + cxx_to_pytype: | + {ctype_var}.real = creal({cxx_var}); + {ctype_var}.imag = cimag({cxx_var}); + + PYN_descr ^^^^^^^^^ @@ -269,6 +316,7 @@ Assign a blank list will not add any declarations. This is used when only an output ``std::string`` or ``std::vector`` is created after parsing arguments. +This variables is used with ``PyArg_ParseTupleAndKeywords``. The argument will be non-const to allow it to be assigned later. diff --git a/docs/reference.rst b/docs/reference.rst index 277f349a4..9b0b3c7b7 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -54,6 +54,12 @@ write-helpers BASE Write files which contain the available helper functions into the files BASE.c and BASE.f. +write-version + Write Shroud version into generated files. + ``--nowrite-version`` will not write the version and is used + by the testsuite to avoid changing every reference file when + the version changes. + yaml-types FILE Write a YAML file with the default types. @@ -452,11 +458,21 @@ F_abstract_interface_subprogram_template Defaults to ``arg{index}`` where *index* is the 0-based argument index. see :ref:`DeclAnchor_Function_Pointers`. +F_array_type_template + ``{C_prefix}SHROUD_array`` + +F_capsule_data_type_template + ``{C_prefix}SHROUD_capsule_data`` + F_capsule_data_type_class_template Name of the derived type which is the ``BIND(C)`` equivalent of the struct used to implement a shadow class. Each class must have a unique name. - Defaults to ``SHROUD_{F_name_scope}capsule``. + Defaults to ``{C_prefix}SHROUD_{F_name_scope}capsule``. + +F_capsule_type_template + ``{C_prefix}SHROUD_capsule`` + F_enum_member_template Name of enumeration member in Fortran wrapper. @@ -711,7 +727,8 @@ CXX_this F_array_type Name of derived type used to store information about an array such as its address and size. - Defaults to *SHROUD_array*. + Default value from option *F_array_type_template* which + defaults to *{C_prefix}SHROUD_array*. F_C_prefix Prefix added to name of generated Fortran interface for C routines. @@ -719,7 +736,12 @@ F_C_prefix F_capsule_data_type Name of derived type used to share memory information with C or C++. - Defaults to *SHROUD_capsule_data*. + Member of *F_array_type*. + Default value from option *F_capsule_data_type_template* which + defaults to *{C_prefix}SHROUD_capsule_data*. + + Each class has a similar derived type, but with a different name + to enforce type safety. F_capsule_delete_function Name of type-bound function of *F_capsule_type* which will @@ -733,7 +755,8 @@ F_capsule_final_function F_capsule_type Name of derived type used to release memory allocated by C or C++. - Defaults to *SHROUD_capsule*. + Default value from option *F_capsule_type_template* which + defaults to *{C_prefix}SHROUD_capsule*. Contains a *F_capsule_data_type*. F_derived_member diff --git a/docs/typemaps.rst b/docs/typemaps.rst index 6025ea9a4..20dc9f8d4 100644 --- a/docs/typemaps.rst +++ b/docs/typemaps.rst @@ -66,6 +66,11 @@ And template arguments are converted to underscores with the trailing ``>`` being replaced i.e. ``std::vector`` becomes ``std_vector_int``. +Complex types set this explicitly since C and C++ have much different +type names. The *flat_name* is always ``double_complex`` while +*c_type* is ``double complex`` and *cxx_type* is ``complex``. + + One use of this name is as the **function_suffix** for templated functions. idtor diff --git a/regression/do-test.py b/regression/do-test.py index 53b2a8c9f..cc1e010f7 100644 --- a/regression/do-test.py +++ b/regression/do-test.py @@ -187,6 +187,8 @@ def do_test(self): # Avoid printing things which may vary (path, date, time). "--option", "debug_testsuite=true", + # Avoid printing version number in reference files + "--nowrite-version", ] # test specific flags @@ -320,6 +322,7 @@ def __init__(self, name, yaml=None, cmdline=None): cmdline=[ "--write-helpers", "helpers", "--yaml-types", "def_types.yaml", + "--write-version", # Test writing vesion ]), TestDesc("tutorial"), TestDesc("debugfalse", yaml="tutorial", @@ -477,6 +480,7 @@ def __init__(self, name, yaml=None, cmdline=None): TestDesc("namespace"), TestDesc("namespacedoc"), TestDesc("strings"), + TestDesc("ccomplex"), TestDesc("clibrary"), TestDesc("cxxlibrary"), TestDesc("interface"), diff --git a/regression/input/ccomplex.yaml b/regression/input/ccomplex.yaml new file mode 100644 index 000000000..56425ae73 --- /dev/null +++ b/regression/input/ccomplex.yaml @@ -0,0 +1,61 @@ +copyright: +- Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +- other Shroud Project Developers. +- See the top-level COPYRIGHT file for details. +- +- "SPDX-License-Identifier: (BSD-3-Clause)" +- + +# Wrap complex in a C library +# Many of the same function as Tutorial, but for C. + +# Several tests have a 'char *outbuf+intent(out)' argument +# which will force a C bufferify wrapper to be created. +# The size of this buffer is controlled by lenoutbuf. +# This feature is helpful for the C tests since a C wrapper is not required +# for each function since we do not need to deal with name mangling +# like in C++. + +library: ccomplex +cxx_header: ccomplex.h + +language: c + +options: + debug: True + wrap_python: True + wrap_lua: False + literalinclude2: True + +declarations: + +###################################################################### +- decl: void acceptFloatComplexInoutPtr(float complex *arg1) + options: + wrap_python: False +- decl: void acceptDoubleComplexInoutPtr(double complex *arg1) +- decl: void acceptDoubleComplexOutPtr(double complex *arg1 +intent(out)) + +- decl: void acceptDoubleComplexInoutPtrFlag(double complex *arg1, int *flag +intent(out)) + options: + wrap_c: False + wrap_fortran: False + doxygen: + description: | + Return two values so Py_BuildValue is used. + +- decl: void acceptDoubleComplexOutPtrFlag( + double complex *arg1 +intent(out), + int *flag +intent(out)) + doxygen: + description: | + Return two values so Py_BuildValue is used. + Creates a Py_complex for intent(out) + +###################################################################### + +#- decl: void acceptDoubleComplexInoutArrayList( +# double complex *arg1 +rank(1), +# int narg +implied(size(arg1))) +# options: +# PY_array_arg: list diff --git a/regression/input/cxxlibrary.yaml b/regression/input/cxxlibrary.yaml index ac23d4359..99017a2d6 100644 --- a/regression/input/cxxlibrary.yaml +++ b/regression/input/cxxlibrary.yaml @@ -66,3 +66,8 @@ declarations: ################################################## - decl: bool defaultPtrIsNULL(double* data +intent(IN)+rank(1) = nullptr ) + +- decl: void defaultArgsInOut(int in1, + int *out1+intent(out), + int *out2+intent(out), + bool flag = false) diff --git a/regression/input/strings.yaml b/regression/input/strings.yaml index 318e487be..6fb7d9379 100644 --- a/regression/input/strings.yaml +++ b/regression/input/strings.yaml @@ -248,9 +248,9 @@ declarations: Test return tuple with two arguments. Must rename argument to nlen to avoid conflict with intrinsic len. -#- decl: void acceptStringInstance(std::string arg1) -# doxygen: -# brief: Accept a string instance +- decl: int acceptStringInstance(std::string arg1) + doxygen: + brief: Accept a string instance - decl: void returnStrings(std::string & arg1 +intent(out), std::string & arg2 +intent(out)) diff --git a/regression/input/struct.yaml b/regression/input/struct.yaml index 73568ca51..1a8ff3f21 100644 --- a/regression/input/struct.yaml +++ b/regression/input/struct.yaml @@ -62,7 +62,6 @@ declarations: ###################################################################### - decl: Cstruct1 returnStructByValue(int i, double d); -- decl: const Cstruct1 returnConstStructByValue(int i, double d); - decl: Cstruct1 *returnStructPtr1(int i, double d) doxygen: diff --git a/regression/reference/arrayclass/arrayclass.json b/regression/reference/arrayclass/arrayclass.json index 7a4662656..538e503d7 100644 --- a/regression/reference/arrayclass/arrayclass.json +++ b/regression/reference/arrayclass/arrayclass.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapArrayWrapper.cpp", "C_name_scope": "ArrayWrapper_", "C_type_name": "ARR_ArrayWrapper", - "F_capsule_data_type": "SHROUD_arraywrapper_capsule", + "F_capsule_data_type": "ARR_SHROUD_arraywrapper_capsule", "F_derived_name": "arraywrapper", "F_name_scope": "arraywrapper_", "PY_PyObject": "PY_ArrayWrapper", @@ -481,6 +481,7 @@ "f_assumed_shape": "(:)", "f_type": "real(C_DOUBLE)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "stmt0": "f_native_*_result_pointer", @@ -630,6 +631,7 @@ "cxx_rv_decl": "double * SHC_rv", "function_name": "getArray", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "get_array" }, "options": { @@ -666,6 +668,7 @@ "f_assumed_shape": "(:)", "f_type": "real(C_DOUBLE)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "stmt0": "f_native_*_result_pointer", @@ -817,6 +820,7 @@ "cxx_rv_decl": "double * SHC_rv", "function_name": "getArrayConst", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "get_array_const" }, "options": { @@ -853,6 +857,7 @@ "f_assumed_shape": "(:)", "f_type": "real(C_DOUBLE)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "stmt0": "f_native_*_result_pointer", @@ -1004,6 +1009,7 @@ "cxx_rv_decl": "const double * SHC_rv", "function_name": "getArrayC", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "get_array_c" }, "options": { @@ -1040,6 +1046,7 @@ "f_assumed_shape": "(:)", "f_type": "real(C_DOUBLE)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "stmt0": "f_native_*_result_pointer", @@ -1193,6 +1200,7 @@ "cxx_rv_decl": "const double * SHC_rv", "function_name": "getArrayConstC", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "get_array_const_c" }, "options": { @@ -1409,6 +1417,7 @@ "f_intent": "OUT", "f_type": "real(C_DOUBLE)", "f_var": "array", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "stmt0": "f_native_**_out_pointer", @@ -1743,6 +1752,7 @@ "f_intent": "OUT", "f_type": "real(C_DOUBLE)", "f_var": "array", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "stmt0": "f_native_*&_out_pointer", @@ -2078,6 +2088,7 @@ "f_intent": "OUT", "f_type": "real(C_DOUBLE)", "f_var": "array", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "stmt0": "f_native_**_out_pointer", @@ -2414,6 +2425,7 @@ "f_intent": "OUT", "f_type": "real(C_DOUBLE)", "f_var": "array", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "stmt0": "f_native_*&_out_pointer", diff --git a/regression/reference/arrayclass/arrayclass_types.yaml b/regression/reference/arrayclass/arrayclass_types.yaml index b0a844a7b..f869fa8df 100644 --- a/regression/reference/arrayclass/arrayclass_types.yaml +++ b/regression/reference/arrayclass/arrayclass_types.yaml @@ -1,5 +1,5 @@ # arrayclass_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -16,5 +16,5 @@ typemap: c_type: ARR_ArrayWrapper f_module_name: arrayclass_mod f_derived_type: arraywrapper - f_capsule_data_type: SHROUD_arraywrapper_capsule + f_capsule_data_type: ARR_SHROUD_arraywrapper_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/arrayclass/pyArrayWrappertype.cpp b/regression/reference/arrayclass/pyArrayWrappertype.cpp index f82cae1f1..3bce0ec18 100644 --- a/regression/reference/arrayclass/pyArrayWrappertype.cpp +++ b/regression/reference/arrayclass/pyArrayWrappertype.cpp @@ -1,5 +1,5 @@ // pyArrayWrappertype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/pyarrayclassmodule.cpp b/regression/reference/arrayclass/pyarrayclassmodule.cpp index dea715230..2988b60ed 100644 --- a/regression/reference/arrayclass/pyarrayclassmodule.cpp +++ b/regression/reference/arrayclass/pyarrayclassmodule.cpp @@ -1,5 +1,5 @@ // pyarrayclassmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/pyarrayclassmodule.hpp b/regression/reference/arrayclass/pyarrayclassmodule.hpp index d6ff46122..574aba3b6 100644 --- a/regression/reference/arrayclass/pyarrayclassmodule.hpp +++ b/regression/reference/arrayclass/pyarrayclassmodule.hpp @@ -1,5 +1,5 @@ // pyarrayclassmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/pyarrayclassutil.cpp b/regression/reference/arrayclass/pyarrayclassutil.cpp index c9678fa30..4b15fb528 100644 --- a/regression/reference/arrayclass/pyarrayclassutil.cpp +++ b/regression/reference/arrayclass/pyarrayclassutil.cpp @@ -1,5 +1,5 @@ // pyarrayclassutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/setup.py b/regression/reference/arrayclass/setup.py index d992816b7..c3281f3c4 100644 --- a/regression/reference/arrayclass/setup.py +++ b/regression/reference/arrayclass/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/typesarrayclass.h b/regression/reference/arrayclass/typesarrayclass.h index fe5cc6e15..f368eabd6 100644 --- a/regression/reference/arrayclass/typesarrayclass.h +++ b/regression/reference/arrayclass/typesarrayclass.h @@ -1,5 +1,5 @@ // typesarrayclass.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/wrapArrayWrapper.cpp b/regression/reference/arrayclass/wrapArrayWrapper.cpp index 3fcc37865..7b6a7f3c4 100644 --- a/regression/reference/arrayclass/wrapArrayWrapper.cpp +++ b/regression/reference/arrayclass/wrapArrayWrapper.cpp @@ -1,5 +1,5 @@ // wrapArrayWrapper.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/wrapArrayWrapper.h b/regression/reference/arrayclass/wrapArrayWrapper.h index d1f627d63..612fadac3 100644 --- a/regression/reference/arrayclass/wrapArrayWrapper.h +++ b/regression/reference/arrayclass/wrapArrayWrapper.h @@ -1,5 +1,5 @@ // wrapArrayWrapper.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/wraparrayclass.cpp b/regression/reference/arrayclass/wraparrayclass.cpp index 4c1169c72..c37bfb601 100644 --- a/regression/reference/arrayclass/wraparrayclass.cpp +++ b/regression/reference/arrayclass/wraparrayclass.cpp @@ -1,5 +1,5 @@ // wraparrayclass.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/arrayclass/wrapfarrayclass.f b/regression/reference/arrayclass/wrapfarrayclass.f index 93a57d019..a6875ae5e 100644 --- a/regression/reference/arrayclass/wrapfarrayclass.f +++ b/regression/reference/arrayclass/wrapfarrayclass.f @@ -1,5 +1,5 @@ ! wrapfarrayclass.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,15 +22,15 @@ module arrayclass_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: ARR_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type ARR_SHROUD_capsule_data ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: ARR_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(ARR_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -42,15 +42,15 @@ module arrayclass_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type ARR_SHROUD_array - type, bind(C) :: SHROUD_arraywrapper_capsule + type, bind(C) :: ARR_SHROUD_arraywrapper_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_arraywrapper_capsule + end type ARR_SHROUD_arraywrapper_capsule type arraywrapper - type(SHROUD_arraywrapper_capsule) :: cxxmem + type(ARR_SHROUD_arraywrapper_capsule) :: cxxmem ! splicer begin class.ArrayWrapper.component_part ! splicer end class.ArrayWrapper.component_part contains @@ -94,9 +94,9 @@ function c_arraywrapper_ctor(SHT_crv) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_ctor") use iso_c_binding, only : C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(OUT) :: SHT_crv + type(ARR_SHROUD_arraywrapper_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_arraywrapper_ctor @@ -111,9 +111,9 @@ end function c_arraywrapper_ctor subroutine c_arraywrapper_set_size(self, size) & bind(C, name="ARR_ArrayWrapper_set_size") use iso_c_binding, only : C_INT - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: size end subroutine c_arraywrapper_set_size @@ -125,9 +125,9 @@ pure function c_arraywrapper_get_size(self) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_size") use iso_c_binding, only : C_INT - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_arraywrapper_get_size @@ -142,9 +142,9 @@ end function c_arraywrapper_get_size subroutine c_arraywrapper_fill_size(self, size) & bind(C, name="ARR_ArrayWrapper_fill_size") use iso_c_binding, only : C_INT - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self integer(C_INT), intent(OUT) :: size end subroutine c_arraywrapper_fill_size @@ -154,9 +154,9 @@ end subroutine c_arraywrapper_fill_size ! Match: c_default subroutine c_arraywrapper_allocate(self) & bind(C, name="ARR_ArrayWrapper_allocate") - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self end subroutine c_arraywrapper_allocate ! ---------------------------------------- @@ -167,9 +167,9 @@ function c_arraywrapper_get_array(self) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_array") use iso_c_binding, only : C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_arraywrapper_get_array @@ -180,10 +180,10 @@ function c_arraywrapper_get_array_bufferify(self, DSHC_rv) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_array_bufferify") use iso_c_binding, only : C_PTR - import :: SHROUD_array, SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_array, ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_array), intent(INOUT) :: DSHC_rv type(C_PTR) SHT_rv end function c_arraywrapper_get_array_bufferify @@ -195,9 +195,9 @@ pure function c_arraywrapper_get_array_const(self) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_array_const") use iso_c_binding, only : C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_arraywrapper_get_array_const @@ -208,10 +208,10 @@ function c_arraywrapper_get_array_const_bufferify(self, DSHC_rv) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_array_const_bufferify") use iso_c_binding, only : C_PTR - import :: SHROUD_array, SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_array, ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_array), intent(INOUT) :: DSHC_rv type(C_PTR) SHT_rv end function c_arraywrapper_get_array_const_bufferify @@ -223,9 +223,9 @@ function c_arraywrapper_get_array_c(self) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_array_c") use iso_c_binding, only : C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_arraywrapper_get_array_c @@ -236,10 +236,10 @@ function c_arraywrapper_get_array_c_bufferify(self, DSHC_rv) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_array_c_bufferify") use iso_c_binding, only : C_PTR - import :: SHROUD_array, SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_array, ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_array), intent(INOUT) :: DSHC_rv type(C_PTR) SHT_rv end function c_arraywrapper_get_array_c_bufferify @@ -251,9 +251,9 @@ pure function c_arraywrapper_get_array_const_c(self) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_array_const_c") use iso_c_binding, only : C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_arraywrapper_get_array_const_c @@ -265,10 +265,10 @@ function c_arraywrapper_get_array_const_c_bufferify(self, & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_get_array_const_c_bufferify") use iso_c_binding, only : C_PTR - import :: SHROUD_array, SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_array, ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_array), intent(INOUT) :: DSHC_rv type(C_PTR) SHT_rv end function c_arraywrapper_get_array_const_c_bufferify @@ -287,9 +287,9 @@ end function c_arraywrapper_get_array_const_c_bufferify subroutine c_arraywrapper_fetch_array_ptr(self, array, isize) & bind(C, name="ARR_ArrayWrapper_fetch_array_ptr") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR), intent(OUT) :: array integer(C_INT), intent(INOUT) :: isize end subroutine c_arraywrapper_fetch_array_ptr @@ -310,10 +310,10 @@ subroutine c_arraywrapper_fetch_array_ptr_bufferify(self, & Darray, isize) & bind(C, name="ARR_ArrayWrapper_fetch_array_ptr_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array, SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_array, ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self - type(SHROUD_array), intent(INOUT) :: Darray + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_array), intent(INOUT) :: Darray integer(C_INT), intent(INOUT) :: isize end subroutine c_arraywrapper_fetch_array_ptr_bufferify @@ -332,9 +332,9 @@ end subroutine c_arraywrapper_fetch_array_ptr_bufferify subroutine c_arraywrapper_fetch_array_ref(self, array, isize) & bind(C, name="ARR_ArrayWrapper_fetch_array_ref") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR), intent(OUT) :: array integer(C_INT), intent(INOUT) :: isize end subroutine c_arraywrapper_fetch_array_ref @@ -355,10 +355,10 @@ subroutine c_arraywrapper_fetch_array_ref_bufferify(self, & Darray, isize) & bind(C, name="ARR_ArrayWrapper_fetch_array_ref_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array, SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_array, ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self - type(SHROUD_array), intent(INOUT) :: Darray + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_array), intent(INOUT) :: Darray integer(C_INT), intent(INOUT) :: isize end subroutine c_arraywrapper_fetch_array_ref_bufferify @@ -378,9 +378,9 @@ subroutine c_arraywrapper_fetch_array_ptr_const(self, array, & isize) & bind(C, name="ARR_ArrayWrapper_fetch_array_ptr_const") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR), intent(OUT) :: array integer(C_INT), intent(INOUT) :: isize end subroutine c_arraywrapper_fetch_array_ptr_const @@ -401,10 +401,10 @@ subroutine c_arraywrapper_fetch_array_ptr_const_bufferify(self, & Darray, isize) & bind(C, name="ARR_ArrayWrapper_fetch_array_ptr_const_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array, SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_array, ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self - type(SHROUD_array), intent(INOUT) :: Darray + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_array), intent(INOUT) :: Darray integer(C_INT), intent(INOUT) :: isize end subroutine c_arraywrapper_fetch_array_ptr_const_bufferify @@ -424,9 +424,9 @@ subroutine c_arraywrapper_fetch_array_ref_const(self, array, & isize) & bind(C, name="ARR_ArrayWrapper_fetch_array_ref_const") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR), intent(OUT) :: array integer(C_INT), intent(INOUT) :: isize end subroutine c_arraywrapper_fetch_array_ref_const @@ -447,10 +447,10 @@ subroutine c_arraywrapper_fetch_array_ref_const_bufferify(self, & Darray, isize) & bind(C, name="ARR_ArrayWrapper_fetch_array_ref_const_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array, SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_array, ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self - type(SHROUD_array), intent(INOUT) :: Darray + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_array), intent(INOUT) :: Darray integer(C_INT), intent(INOUT) :: isize end subroutine c_arraywrapper_fetch_array_ref_const_bufferify @@ -465,9 +465,9 @@ end subroutine c_arraywrapper_fetch_array_ref_const_bufferify subroutine c_arraywrapper_fetch_void_ptr(self, array) & bind(C, name="ARR_ArrayWrapper_fetch_void_ptr") use iso_c_binding, only : C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR), intent(OUT) :: array end subroutine c_arraywrapper_fetch_void_ptr @@ -482,9 +482,9 @@ end subroutine c_arraywrapper_fetch_void_ptr subroutine c_arraywrapper_fetch_void_ref(self, array) & bind(C, name="ARR_ArrayWrapper_fetch_void_ref") use iso_c_binding, only : C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR), intent(OUT) :: array end subroutine c_arraywrapper_fetch_void_ref @@ -500,9 +500,9 @@ function c_arraywrapper_check_ptr(self, array) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_check_ptr") use iso_c_binding, only : C_BOOL, C_PTR - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self type(C_PTR), value, intent(IN) :: array logical(C_BOOL) :: SHT_rv end function c_arraywrapper_check_ptr @@ -515,9 +515,9 @@ function c_arraywrapper_sum_array(self) & result(SHT_rv) & bind(C, name="ARR_ArrayWrapper_sum_array") use iso_c_binding, only : C_DOUBLE - import :: SHROUD_arraywrapper_capsule + import :: ARR_SHROUD_arraywrapper_capsule implicit none - type(SHROUD_arraywrapper_capsule), intent(IN) :: self + type(ARR_SHROUD_arraywrapper_capsule), intent(IN) :: self real(C_DOUBLE) :: SHT_rv end function c_arraywrapper_sum_array @@ -635,7 +635,7 @@ function arraywrapper_get_array(obj) & result(SHT_rv) use iso_c_binding, only : C_DOUBLE, C_PTR, c_f_pointer class(arraywrapper) :: obj - type(SHROUD_array) :: DSHC_rv + type(ARR_SHROUD_array) :: DSHC_rv real(C_DOUBLE), pointer :: SHT_rv(:) ! splicer begin class.ArrayWrapper.method.get_array type(C_PTR) :: SHT_ptr @@ -656,7 +656,7 @@ function arraywrapper_get_array_const(obj) & result(SHT_rv) use iso_c_binding, only : C_DOUBLE, C_PTR, c_f_pointer class(arraywrapper) :: obj - type(SHROUD_array) :: DSHC_rv + type(ARR_SHROUD_array) :: DSHC_rv real(C_DOUBLE), pointer :: SHT_rv(:) ! splicer begin class.ArrayWrapper.method.get_array_const type(C_PTR) :: SHT_ptr @@ -677,7 +677,7 @@ function arraywrapper_get_array_c(obj) & result(SHT_rv) use iso_c_binding, only : C_DOUBLE, C_PTR, c_f_pointer class(arraywrapper) :: obj - type(SHROUD_array) :: DSHC_rv + type(ARR_SHROUD_array) :: DSHC_rv real(C_DOUBLE), pointer :: SHT_rv(:) ! splicer begin class.ArrayWrapper.method.get_array_c type(C_PTR) :: SHT_ptr @@ -698,7 +698,7 @@ function arraywrapper_get_array_const_c(obj) & result(SHT_rv) use iso_c_binding, only : C_DOUBLE, C_PTR, c_f_pointer class(arraywrapper) :: obj - type(SHROUD_array) :: DSHC_rv + type(ARR_SHROUD_array) :: DSHC_rv real(C_DOUBLE), pointer :: SHT_rv(:) ! splicer begin class.ArrayWrapper.method.get_array_const_c type(C_PTR) :: SHT_ptr @@ -732,7 +732,7 @@ subroutine arraywrapper_fetch_array_ptr(obj, array) use iso_c_binding, only : C_DOUBLE, C_INT, c_f_pointer class(arraywrapper) :: obj real(C_DOUBLE), intent(OUT), pointer :: array(:) - type(SHROUD_array) :: Darray + type(ARR_SHROUD_array) :: Darray integer(C_INT) :: isize ! splicer begin class.ArrayWrapper.method.fetch_array_ptr call c_arraywrapper_fetch_array_ptr_bufferify(obj%cxxmem, & @@ -765,7 +765,7 @@ subroutine arraywrapper_fetch_array_ref(obj, array) use iso_c_binding, only : C_DOUBLE, C_INT, c_f_pointer class(arraywrapper) :: obj real(C_DOUBLE), intent(OUT), pointer :: array(:) - type(SHROUD_array) :: Darray + type(ARR_SHROUD_array) :: Darray integer(C_INT) :: isize ! splicer begin class.ArrayWrapper.method.fetch_array_ref call c_arraywrapper_fetch_array_ref_bufferify(obj%cxxmem, & @@ -798,7 +798,7 @@ subroutine arraywrapper_fetch_array_ptr_const(obj, array) use iso_c_binding, only : C_DOUBLE, C_INT, c_f_pointer class(arraywrapper) :: obj real(C_DOUBLE), intent(OUT), pointer :: array(:) - type(SHROUD_array) :: Darray + type(ARR_SHROUD_array) :: Darray integer(C_INT) :: isize ! splicer begin class.ArrayWrapper.method.fetch_array_ptr_const call c_arraywrapper_fetch_array_ptr_const_bufferify(obj%cxxmem, & @@ -831,7 +831,7 @@ subroutine arraywrapper_fetch_array_ref_const(obj, array) use iso_c_binding, only : C_DOUBLE, C_INT, c_f_pointer class(arraywrapper) :: obj real(C_DOUBLE), intent(OUT), pointer :: array(:) - type(SHROUD_array) :: Darray + type(ARR_SHROUD_array) :: Darray integer(C_INT) :: isize ! splicer begin class.ArrayWrapper.method.fetch_array_ref_const call c_arraywrapper_fetch_array_ref_const_bufferify(obj%cxxmem, & diff --git a/regression/reference/ccomplex/ccomplex.json b/regression/reference/ccomplex/ccomplex.json new file mode 100644 index 000000000..4d069316e --- /dev/null +++ b/regression/reference/ccomplex/ccomplex.json @@ -0,0 +1,624 @@ +{ + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", + "library": { + "copyright": [ + "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", + "other Shroud Project Developers.", + "See the top-level COPYRIGHT file for details.", + "", + "SPDX-License-Identifier: (BSD-3-Clause)", + "" + ], + "cxx_header": [ + "ccomplex.h" + ], + "functions": [ + { + "_fmtargs": { + "arg1": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "arg1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "arg1", + "cxx_type": "std::complex", + "cxx_var": "arg1", + "idtor": "0", + "sh_type": "SH_TYPE_FLOAT_COMPLEX", + "stmt0": "c_native_*_inout", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_arg1", + "c_var": "arg1", + "f_intent": "INOUT", + "f_type": "complex(C_FLOAT_COMPLEX)", + "f_var": "arg1", + "sh_type": "SH_TYPE_FLOAT_COMPLEX", + "stmt0": "f_native_*_inout", + "stmt1": "f_default", + "stmtc0": "c_native_*_inout", + "stmtc1": "c_default" + } + } + }, + "ast": { + "declarator": { + "name": "acceptFloatComplexInoutPtr", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "inout" + }, + "declarator": { + "name": "arg1", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "float", + "complex" + ], + "typemap_name": "float_complex" + } + ], + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void acceptFloatComplexInoutPtr(float complex *arg1)", + "declgen": "void acceptFloatComplexInoutPtr(float complex * arg1 +intent(inout))", + "fmtdict": { + "C_call_list": "arg1", + "C_name": "acceptFloatComplexInoutPtr", + "C_prototype": "float complex * arg1", + "C_return_type": "void", + "F_C_call": "c_accept_float_complex_inout_ptr", + "F_C_name": "accept_float_complex_inout_ptr", + "F_arg_c_call": "arg1", + "F_arguments": "arg1", + "F_name_function": "accept_float_complex_inout_ptr", + "F_name_generic": "accept_float_complex_inout_ptr", + "F_name_impl": "accept_float_complex_inout_ptr", + "F_subprogram": "subroutine", + "function_name": "acceptFloatComplexInoutPtr", + "stmt0": "f_subroutine", + "stmt1": "f_default", + "stmtc0": "c", + "stmtc1": "c_default", + "underscore_name": "accept_float_complex_inout_ptr" + }, + "options": { + "wrap_python": false + } + }, + { + "_fmtargs": { + "arg1": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "arg1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "arg1", + "cxx_type": "std::complex", + "cxx_var": "arg1", + "idtor": "0", + "sh_type": "SH_TYPE_DOUBLE_COMPLEX", + "stmt0": "c_native_*_inout", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_arg1", + "c_var": "arg1", + "f_intent": "INOUT", + "f_type": "complex(C_DOUBLE_COMPLEX)", + "f_var": "arg1", + "sh_type": "SH_TYPE_DOUBLE_COMPLEX", + "stmt0": "f_native_*_inout", + "stmt1": "f_default", + "stmtc0": "c_native_*_inout", + "stmtc1": "c_default" + }, + "fmtpy": { + "array_size": "1", + "c_const": "", + "c_deref": "*", + "c_type": "double complex", + "c_var": "arg1", + "ctor_expr": "creal(arg1), cimag(arg1)", + "ctype_expr": "SHCPY_arg1.real + SHCPY_arg1.imag * I", + "ctype_var": "SHCPY_arg1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "arg1", + "cxx_type": "std::complex", + "cxx_var": "arg1", + "data_var": "SHData_arg1", + "numpy_type": "NPY_DOUBLE", + "py_ctype": "Py_complex", + "py_var": "SHPy_arg1", + "size_var": "SHSize_arg1", + "stmt0": "py_native_*_inout", + "stmt1": "py_native_*_inout", + "value_var": "SHValue_arg1" + } + } + }, + "ast": { + "declarator": { + "name": "acceptDoubleComplexInoutPtr", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "inout" + }, + "declarator": { + "name": "arg1", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "double", + "complex" + ], + "typemap_name": "double_complex" + } + ], + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void acceptDoubleComplexInoutPtr(double complex *arg1)", + "declgen": "void acceptDoubleComplexInoutPtr(double complex * arg1 +intent(inout))", + "fmtdict": { + "C_call_list": "arg1", + "C_name": "acceptDoubleComplexInoutPtr", + "C_prototype": "double complex * arg1", + "C_return_type": "void", + "F_C_call": "c_accept_double_complex_inout_ptr", + "F_C_name": "accept_double_complex_inout_ptr", + "F_arg_c_call": "arg1", + "F_arguments": "arg1", + "F_name_function": "accept_double_complex_inout_ptr", + "F_name_generic": "accept_double_complex_inout_ptr", + "F_name_impl": "accept_double_complex_inout_ptr", + "F_subprogram": "subroutine", + "PY_name_impl": "PY_acceptDoubleComplexInoutPtr", + "function_name": "acceptDoubleComplexInoutPtr", + "stmt0": "f_subroutine", + "stmt1": "f_default", + "stmtc0": "c", + "stmtc1": "c_default", + "underscore_name": "accept_double_complex_inout_ptr" + }, + "options": {} + }, + { + "_fmtargs": { + "arg1": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "arg1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "arg1", + "cxx_type": "std::complex", + "cxx_var": "arg1", + "idtor": "0", + "sh_type": "SH_TYPE_DOUBLE_COMPLEX", + "stmt0": "c_native_*_out", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_arg1", + "c_var": "arg1", + "f_intent": "OUT", + "f_type": "complex(C_DOUBLE_COMPLEX)", + "f_var": "arg1", + "sh_type": "SH_TYPE_DOUBLE_COMPLEX", + "stmt0": "f_native_*_out", + "stmt1": "f_default", + "stmtc0": "c_native_*_out", + "stmtc1": "c_default" + }, + "fmtpy": { + "array_size": "1", + "c_const": "", + "c_deref": "*", + "c_type": "double complex", + "c_var": "arg1", + "ctor_expr": "creal(arg1), cimag(arg1)", + "ctype_var": "SHCPY_arg1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "arg1", + "cxx_type": "std::complex", + "cxx_var": "arg1", + "data_var": "SHData_arg1", + "numpy_type": "NPY_DOUBLE", + "py_ctype": "Py_complex", + "py_var": "SHPy_arg1", + "size_var": "SHSize_arg1", + "stmt0": "py_native_*_out", + "stmt1": "py_native_*_out", + "value_var": "SHValue_arg1" + } + } + }, + "ast": { + "declarator": { + "name": "acceptDoubleComplexOutPtr", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "out" + }, + "declarator": { + "name": "arg1", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "double", + "complex" + ], + "typemap_name": "double_complex" + } + ], + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void acceptDoubleComplexOutPtr(double complex *arg1 +intent(out))", + "declgen": "void acceptDoubleComplexOutPtr(double complex * arg1 +intent(out))", + "fmtdict": { + "C_call_list": "arg1", + "C_name": "acceptDoubleComplexOutPtr", + "C_prototype": "double complex * arg1", + "C_return_type": "void", + "F_C_call": "c_accept_double_complex_out_ptr", + "F_C_name": "accept_double_complex_out_ptr", + "F_arg_c_call": "arg1", + "F_arguments": "arg1", + "F_name_function": "accept_double_complex_out_ptr", + "F_name_generic": "accept_double_complex_out_ptr", + "F_name_impl": "accept_double_complex_out_ptr", + "F_subprogram": "subroutine", + "PY_name_impl": "PY_acceptDoubleComplexOutPtr", + "function_name": "acceptDoubleComplexOutPtr", + "stmt0": "f_subroutine", + "stmt1": "f_default", + "stmtc0": "c", + "stmtc1": "c_default", + "underscore_name": "accept_double_complex_out_ptr" + }, + "options": {} + }, + { + "_fmtargs": { + "arg1": { + "fmtpy": { + "array_size": "1", + "c_const": "", + "c_deref": "*", + "c_type": "double complex", + "c_var": "arg1", + "ctor_expr": "creal(arg1), cimag(arg1)", + "ctype_expr": "SHCPY_arg1.real + SHCPY_arg1.imag * I", + "ctype_var": "SHCPY_arg1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "arg1", + "cxx_type": "std::complex", + "cxx_var": "arg1", + "data_var": "SHData_arg1", + "numpy_type": "NPY_DOUBLE", + "py_ctype": "Py_complex", + "py_var": "SHPy_arg1", + "size_var": "SHSize_arg1", + "stmt0": "py_native_*_inout", + "stmt1": "py_native_*_inout", + "value_var": "SHValue_arg1" + } + }, + "flag": { + "fmtpy": { + "array_size": "1", + "c_const": "", + "c_deref": "*", + "c_type": "int", + "c_var": "flag", + "ctor_expr": "flag", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "flag", + "cxx_type": "int", + "cxx_var": "flag", + "data_var": "SHData_flag", + "numpy_type": "NPY_INT", + "py_var": "SHPy_flag", + "size_var": "SHSize_flag", + "stmt0": "py_native_*_out", + "stmt1": "py_native_*_out", + "value_var": "SHValue_flag" + } + } + }, + "ast": { + "declarator": { + "name": "acceptDoubleComplexInoutPtrFlag", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "inout" + }, + "declarator": { + "name": "arg1", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "double", + "complex" + ], + "typemap_name": "double_complex" + }, + { + "attrs": { + "intent": "out" + }, + "declarator": { + "name": "flag", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "int" + ], + "typemap_name": "int" + } + ], + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void acceptDoubleComplexInoutPtrFlag(double complex *arg1, int *flag +intent(out))", + "declgen": "void acceptDoubleComplexInoutPtrFlag(double complex * arg1 +intent(inout), int * flag +intent(out))", + "doxygen": { + "description": "Return two values so Py_BuildValue is used.\n" + }, + "fmtdict": { + "PY_name_impl": "PY_acceptDoubleComplexInoutPtrFlag", + "function_name": "acceptDoubleComplexInoutPtrFlag", + "underscore_name": "accept_double_complex_inout_ptr_flag" + }, + "options": { + "wrap_c": false, + "wrap_fortran": false + } + }, + { + "_fmtargs": { + "arg1": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "arg1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "arg1", + "cxx_type": "std::complex", + "cxx_var": "arg1", + "idtor": "0", + "sh_type": "SH_TYPE_DOUBLE_COMPLEX", + "stmt0": "c_native_*_out", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_arg1", + "c_var": "arg1", + "f_intent": "OUT", + "f_type": "complex(C_DOUBLE_COMPLEX)", + "f_var": "arg1", + "sh_type": "SH_TYPE_DOUBLE_COMPLEX", + "stmt0": "f_native_*_out", + "stmt1": "f_default", + "stmtc0": "c_native_*_out", + "stmtc1": "c_default" + }, + "fmtpy": { + "array_size": "1", + "c_const": "", + "c_deref": "*", + "c_type": "double complex", + "c_var": "arg1", + "ctor_expr": "creal(arg1), cimag(arg1)", + "ctype_var": "SHCPY_arg1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "arg1", + "cxx_type": "std::complex", + "cxx_var": "arg1", + "data_var": "SHData_arg1", + "numpy_type": "NPY_DOUBLE", + "py_ctype": "Py_complex", + "py_var": "SHPy_arg1", + "size_var": "SHSize_arg1", + "stmt0": "py_native_*_out", + "stmt1": "py_native_*_out", + "value_var": "SHValue_arg1" + } + }, + "flag": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "flag", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "flag", + "cxx_type": "int", + "cxx_var": "flag", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_*_out", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_flag", + "c_var": "flag", + "f_intent": "OUT", + "f_type": "integer(C_INT)", + "f_var": "flag", + "sh_type": "SH_TYPE_INT", + "stmt0": "f_native_*_out", + "stmt1": "f_default", + "stmtc0": "c_native_*_out", + "stmtc1": "c_default" + }, + "fmtpy": { + "array_size": "1", + "c_const": "", + "c_deref": "*", + "c_type": "int", + "c_var": "flag", + "ctor_expr": "flag", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "flag", + "cxx_type": "int", + "cxx_var": "flag", + "data_var": "SHData_flag", + "numpy_type": "NPY_INT", + "py_var": "SHPy_flag", + "size_var": "SHSize_flag", + "stmt0": "py_native_*_out", + "stmt1": "py_native_*_out", + "value_var": "SHValue_flag" + } + } + }, + "ast": { + "declarator": { + "name": "acceptDoubleComplexOutPtrFlag", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "out" + }, + "declarator": { + "name": "arg1", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "double", + "complex" + ], + "typemap_name": "double_complex" + }, + { + "attrs": { + "intent": "out" + }, + "declarator": { + "name": "flag", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "int" + ], + "typemap_name": "int" + } + ], + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void acceptDoubleComplexOutPtrFlag( double complex *arg1 +intent(out), int *flag +intent(out))", + "declgen": "void acceptDoubleComplexOutPtrFlag(double complex * arg1 +intent(out), int * flag +intent(out))", + "doxygen": { + "description": "Return two values so Py_BuildValue is used.\nCreates a Py_complex for intent(out)\n" + }, + "fmtdict": { + "C_call_list": "arg1,\t flag", + "C_name": "acceptDoubleComplexOutPtrFlag", + "C_prototype": "double complex * arg1,\t int * flag", + "C_return_type": "void", + "F_C_call": "c_accept_double_complex_out_ptr_flag", + "F_C_name": "accept_double_complex_out_ptr_flag", + "F_arg_c_call": "arg1,\t flag", + "F_arguments": "arg1,\t flag", + "F_name_function": "accept_double_complex_out_ptr_flag", + "F_name_generic": "accept_double_complex_out_ptr_flag", + "F_name_impl": "accept_double_complex_out_ptr_flag", + "F_subprogram": "subroutine", + "PY_name_impl": "PY_acceptDoubleComplexOutPtrFlag", + "function_name": "acceptDoubleComplexOutPtrFlag", + "stmt0": "f_subroutine", + "stmt1": "f_default", + "stmtc0": "c", + "stmtc1": "c_default", + "underscore_name": "accept_double_complex_out_ptr_flag" + }, + "options": {} + } + ], + "language": "c", + "scope_file": [ + "ccomplex" + ] + } +} \ No newline at end of file diff --git a/regression/reference/ccomplex/ccomplex.log b/regression/reference/ccomplex/ccomplex.log new file mode 100644 index 000000000..9ed6ace2c --- /dev/null +++ b/regression/reference/ccomplex/ccomplex.log @@ -0,0 +1,19 @@ +Read yaml ccomplex.yaml +C function void acceptFloatComplexInoutPtr(float complex * arg1 +intent(inout)) +C function void acceptDoubleComplexInoutPtr(double complex * arg1 +intent(inout)) +C function void acceptDoubleComplexOutPtr(double complex * arg1 +intent(out)) +C function void acceptDoubleComplexOutPtrFlag(double complex * arg1 +intent(out), int * flag +intent(out)) +Close wrapccomplex.c +Close typesccomplex.h +C-interface, Fortran function void acceptFloatComplexInoutPtr(float complex * arg1 +intent(inout)) +C-interface, Fortran function void acceptDoubleComplexInoutPtr(double complex * arg1 +intent(inout)) +C-interface, Fortran function void acceptDoubleComplexOutPtr(double complex * arg1 +intent(out)) +C-interface, Fortran function void acceptDoubleComplexOutPtrFlag(double complex * arg1 +intent(out), int * flag +intent(out)) +Close wrapfccomplex.f +Python function void acceptDoubleComplexInoutPtr(double complex * arg1 +intent(inout)) +Python function void acceptDoubleComplexOutPtr(double complex * arg1 +intent(out)) +Python function void acceptDoubleComplexInoutPtrFlag(double complex * arg1 +intent(inout), int * flag +intent(out)) +Python function void acceptDoubleComplexOutPtrFlag(double complex * arg1 +intent(out), int * flag +intent(out)) +Close pyccomplexmodule.c +Close pyccomplexmodule.h +Close setup.py diff --git a/regression/reference/ccomplex/output b/regression/reference/ccomplex/output new file mode 100644 index 000000000..68a3ba0d8 --- /dev/null +++ b/regression/reference/ccomplex/output @@ -0,0 +1,6 @@ +Wrote wrapccomplex.c +Wrote typesccomplex.h +Wrote wrapfccomplex.f +Wrote pyccomplexmodule.c +Wrote pyccomplexmodule.h +Wrote setup.py diff --git a/regression/reference/ccomplex/pyccomplexmodule.c b/regression/reference/ccomplex/pyccomplexmodule.c new file mode 100644 index 000000000..2d0ade871 --- /dev/null +++ b/regression/reference/ccomplex/pyccomplexmodule.c @@ -0,0 +1,296 @@ +// pyccomplexmodule.c +// This file is generated by Shroud nowrite-version. Do not edit. +// Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +// other Shroud Project Developers. +// See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) +// +#include "pyccomplexmodule.h" + +// splicer begin include +// splicer end include + +#ifdef __cplusplus +#define SHROUD_UNUSED(param) +#else +#define SHROUD_UNUSED(param) param +#endif + +#if PY_MAJOR_VERSION >= 3 +#define PyInt_AsLong PyLong_AsLong +#define PyInt_FromLong PyLong_FromLong +#define PyInt_FromSize_t PyLong_FromSize_t +#define PyString_FromString PyUnicode_FromString +#define PyString_FromStringAndSize PyUnicode_FromStringAndSize +#endif + +// splicer begin C_definition +// splicer end C_definition +PyObject *PY_error_obj; +// splicer begin additional_functions +// splicer end additional_functions + +// ---------------------------------------- +// Function: void acceptDoubleComplexInoutPtr +// Exact: py_default +// ---------------------------------------- +// Argument: double complex * arg1 +intent(inout) +// Exact: py_native_*_inout +static char PY_acceptDoubleComplexInoutPtr__doc__[] = +"documentation" +; + +static PyObject * +PY_acceptDoubleComplexInoutPtr( + PyObject *SHROUD_UNUSED(self), + PyObject *args, + PyObject *kwds) +{ +// splicer begin function.accept_double_complex_inout_ptr + double complex arg1; + Py_complex SHCPY_arg1; + char *SHT_kwlist[] = { + "arg1", + NULL }; + PyObject * SHPy_arg1 = NULL; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, + "D:acceptDoubleComplexInoutPtr", SHT_kwlist, &SHCPY_arg1)) + return NULL; + + // post_parse + arg1 = SHCPY_arg1.real + SHCPY_arg1.imag * I; + + acceptDoubleComplexInoutPtr(&arg1); + + // post_call + SHPy_arg1 = PyComplex_FromDoubles(creal(arg1), cimag(arg1)); + + return (PyObject *) SHPy_arg1; +// splicer end function.accept_double_complex_inout_ptr +} + +// ---------------------------------------- +// Function: void acceptDoubleComplexOutPtr +// Exact: py_default +// ---------------------------------------- +// Argument: double complex * arg1 +intent(out) +// Exact: py_native_*_out +static char PY_acceptDoubleComplexOutPtr__doc__[] = +"documentation" +; + +static PyObject * +PY_acceptDoubleComplexOutPtr( + PyObject *SHROUD_UNUSED(self), + PyObject *SHROUD_UNUSED(args), + PyObject *SHROUD_UNUSED(kwds)) +{ +// splicer begin function.accept_double_complex_out_ptr + double complex arg1; + PyObject * SHPy_arg1 = NULL; + + acceptDoubleComplexOutPtr(&arg1); + + // post_call + SHPy_arg1 = PyComplex_FromDoubles(creal(arg1), cimag(arg1)); + + return (PyObject *) SHPy_arg1; +// splicer end function.accept_double_complex_out_ptr +} + +// ---------------------------------------- +// Function: void acceptDoubleComplexInoutPtrFlag +// Exact: py_default +// ---------------------------------------- +// Argument: double complex * arg1 +intent(inout) +// Exact: py_native_*_inout +// ---------------------------------------- +// Argument: int * flag +intent(out) +// Exact: py_native_*_out +static char PY_acceptDoubleComplexInoutPtrFlag__doc__[] = +"documentation" +; + +/** + * Return two values so Py_BuildValue is used. + */ +static PyObject * +PY_acceptDoubleComplexInoutPtrFlag( + PyObject *SHROUD_UNUSED(self), + PyObject *args, + PyObject *kwds) +{ +// splicer begin function.accept_double_complex_inout_ptr_flag + double complex arg1; + Py_complex SHCPY_arg1; + int flag; + char *SHT_kwlist[] = { + "arg1", + NULL }; + PyObject *SHTPy_rv = NULL; // return value object + + if (!PyArg_ParseTupleAndKeywords(args, kwds, + "D:acceptDoubleComplexInoutPtrFlag", SHT_kwlist, &SHCPY_arg1)) + return NULL; + + // post_parse + arg1 = SHCPY_arg1.real + SHCPY_arg1.imag * I; + + acceptDoubleComplexInoutPtrFlag(&arg1, &flag); + + // post_call + SHCPY_arg1.real = creal(arg1); + SHCPY_arg1.imag = cimag(arg1); + SHTPy_rv = Py_BuildValue("Di", &SHCPY_arg1, flag); + + return SHTPy_rv; +// splicer end function.accept_double_complex_inout_ptr_flag +} + +// ---------------------------------------- +// Function: void acceptDoubleComplexOutPtrFlag +// Exact: py_default +// ---------------------------------------- +// Argument: double complex * arg1 +intent(out) +// Exact: py_native_*_out +// ---------------------------------------- +// Argument: int * flag +intent(out) +// Exact: py_native_*_out +static char PY_acceptDoubleComplexOutPtrFlag__doc__[] = +"documentation" +; + +/** + * Return two values so Py_BuildValue is used. + * Creates a Py_complex for intent(out) + */ +static PyObject * +PY_acceptDoubleComplexOutPtrFlag( + PyObject *SHROUD_UNUSED(self), + PyObject *SHROUD_UNUSED(args), + PyObject *SHROUD_UNUSED(kwds)) +{ +// splicer begin function.accept_double_complex_out_ptr_flag + double complex arg1; + int flag; + Py_complex SHCPY_arg1; + PyObject *SHTPy_rv = NULL; // return value object + + acceptDoubleComplexOutPtrFlag(&arg1, &flag); + + // post_call + SHCPY_arg1.real = creal(arg1); + SHCPY_arg1.imag = cimag(arg1); + SHTPy_rv = Py_BuildValue("Di", &SHCPY_arg1, flag); + + return SHTPy_rv; +// splicer end function.accept_double_complex_out_ptr_flag +} +static PyMethodDef PY_methods[] = { +{"acceptDoubleComplexInoutPtr", + (PyCFunction)PY_acceptDoubleComplexInoutPtr, + METH_VARARGS|METH_KEYWORDS, PY_acceptDoubleComplexInoutPtr__doc__}, +{"acceptDoubleComplexOutPtr", (PyCFunction)PY_acceptDoubleComplexOutPtr, + METH_NOARGS, PY_acceptDoubleComplexOutPtr__doc__}, +{"acceptDoubleComplexInoutPtrFlag", + (PyCFunction)PY_acceptDoubleComplexInoutPtrFlag, + METH_VARARGS|METH_KEYWORDS, + PY_acceptDoubleComplexInoutPtrFlag__doc__}, +{"acceptDoubleComplexOutPtrFlag", + (PyCFunction)PY_acceptDoubleComplexOutPtrFlag, METH_NOARGS, + PY_acceptDoubleComplexOutPtrFlag__doc__}, +{NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */ +}; + +/* + * initccomplex - Initialization function for the module + * *must* be called initccomplex + */ +static char PY__doc__[] = +"library documentation" +; + +struct module_state { + PyObject *error; +}; + +#if PY_MAJOR_VERSION >= 3 +#define GETSTATE(m) ((struct module_state*)PyModule_GetState(m)) +#else +#define GETSTATE(m) (&_state) +static struct module_state _state; +#endif + +#if PY_MAJOR_VERSION >= 3 +static int ccomplex_traverse(PyObject *m, visitproc visit, void *arg) { + Py_VISIT(GETSTATE(m)->error); + return 0; +} + +static int ccomplex_clear(PyObject *m) { + Py_CLEAR(GETSTATE(m)->error); + return 0; +} + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "ccomplex", /* m_name */ + PY__doc__, /* m_doc */ + sizeof(struct module_state), /* m_size */ + PY_methods, /* m_methods */ + NULL, /* m_reload */ + ccomplex_traverse, /* m_traverse */ + ccomplex_clear, /* m_clear */ + NULL /* m_free */ +}; + +#define RETVAL m +#define INITERROR return NULL +#else +#define RETVAL +#define INITERROR return +#endif + +PyMODINIT_FUNC +#if PY_MAJOR_VERSION >= 3 +PyInit_ccomplex(void) +#else +initccomplex(void) +#endif +{ + PyObject *m = NULL; + const char * error_name = "ccomplex.Error"; + + // splicer begin C_init_locals + // splicer end C_init_locals + + + /* Create the module and add the functions */ +#if PY_MAJOR_VERSION >= 3 + m = PyModule_Create(&moduledef); +#else + m = Py_InitModule4("ccomplex", PY_methods, + PY__doc__, + (PyObject*)NULL,PYTHON_API_VERSION); +#endif + if (m == NULL) + return RETVAL; + struct module_state *st = GETSTATE(m); + + PY_error_obj = PyErr_NewException((char *) error_name, NULL, NULL); + if (PY_error_obj == NULL) + return RETVAL; + st->error = PY_error_obj; + PyModule_AddObject(m, "Error", st->error); + + // splicer begin C_init_body + // splicer end C_init_body + + /* Check for errors */ + if (PyErr_Occurred()) + Py_FatalError("can't initialize module ccomplex"); + return RETVAL; +} + diff --git a/regression/reference/ccomplex/pyccomplexmodule.h b/regression/reference/ccomplex/pyccomplexmodule.h new file mode 100644 index 000000000..882f33e3b --- /dev/null +++ b/regression/reference/ccomplex/pyccomplexmodule.h @@ -0,0 +1,27 @@ +// pyccomplexmodule.h +// This file is generated by Shroud nowrite-version. Do not edit. +// Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +// other Shroud Project Developers. +// See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) +// +#ifndef PYCCOMPLEXMODULE_H +#define PYCCOMPLEXMODULE_H +#include +#include "ccomplex.h" +// splicer begin header.include +// splicer end header.include + +// splicer begin header.C_declaration +// splicer end header.C_declaration + +extern PyObject *PY_error_obj; + +#if PY_MAJOR_VERSION >= 3 +PyMODINIT_FUNC PyInit_ccomplex(void); +#else +PyMODINIT_FUNC initccomplex(void); +#endif + +#endif /* PYCCOMPLEXMODULE_H */ diff --git a/regression/reference/ccomplex/setup.py b/regression/reference/ccomplex/setup.py new file mode 100644 index 000000000..bcfe2d121 --- /dev/null +++ b/regression/reference/ccomplex/setup.py @@ -0,0 +1,27 @@ +# setup.py +# This file is generated by Shroud nowrite-version. Do not edit. +# Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +# other Shroud Project Developers. +# See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (BSD-3-Clause) +# +from setuptools import setup, Extension + +module = Extension( + 'ccomplex', + sources=[ + 'pyccomplexmodule.c' + ], + language='c', + include_dirs = None, +# libraries = ['tcl83'], +# library_dirs = ['/usr/local/lib'], +# extra_compile_args = [ '-O0', '-g' ], +# extra_link_args = +) + +setup( + name='ccomplex', + ext_modules = [module], +) diff --git a/regression/reference/ccomplex/typesccomplex.h b/regression/reference/ccomplex/typesccomplex.h new file mode 100644 index 000000000..3a7cbee05 --- /dev/null +++ b/regression/reference/ccomplex/typesccomplex.h @@ -0,0 +1,23 @@ +// typesccomplex.h +// This file is generated by Shroud nowrite-version. Do not edit. +// Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +// other Shroud Project Developers. +// See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) +// +// For C users and C implementation + +#ifndef TYPESCCOMPLEX_H +#define TYPESCCOMPLEX_H + +// helper capsule_data_helper +struct s_CCO_SHROUD_capsule_data { + void *addr; /* address of C++ memory */ + int idtor; /* index of destructor */ +}; +typedef struct s_CCO_SHROUD_capsule_data CCO_SHROUD_capsule_data; + +void CCO_SHROUD_memory_destructor(CCO_SHROUD_capsule_data *cap); + +#endif // TYPESCCOMPLEX_H diff --git a/regression/reference/ccomplex/wrapccomplex.c b/regression/reference/ccomplex/wrapccomplex.c new file mode 100644 index 000000000..96bf9954f --- /dev/null +++ b/regression/reference/ccomplex/wrapccomplex.c @@ -0,0 +1,23 @@ +// wrapccomplex.c +// This file is generated by Shroud nowrite-version. Do not edit. +// Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +// other Shroud Project Developers. +// See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) +// +#include +#include "ccomplex.h" +#include "typesccomplex.h" + +// splicer begin C_definitions +// splicer end C_definitions + +// start release allocated memory +// Release library allocated memory. +void CCO_SHROUD_memory_destructor(CCO_SHROUD_capsule_data *cap) +{ + cap->addr = NULL; + cap->idtor = 0; // avoid deleting again +} +// end release allocated memory diff --git a/regression/reference/ccomplex/wrapfccomplex.f b/regression/reference/ccomplex/wrapfccomplex.f new file mode 100644 index 000000000..927ff5f80 --- /dev/null +++ b/regression/reference/ccomplex/wrapfccomplex.f @@ -0,0 +1,106 @@ +! wrapfccomplex.f +! This file is generated by Shroud nowrite-version. Do not edit. +! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +! other Shroud Project Developers. +! See the top-level COPYRIGHT file for details. +! +! SPDX-License-Identifier: (BSD-3-Clause) +! +!> +!! \file wrapfccomplex.f +!! \brief Shroud generated wrapper for ccomplex library +!< +! splicer begin file_top +! splicer end file_top +module ccomplex_mod + ! splicer begin module_use + ! splicer end module_use + implicit none + + ! splicer begin module_top + ! splicer end module_top + + ! ---------------------------------------- + ! Function: void acceptFloatComplexInoutPtr + ! Requested: c_void_scalar_result + ! Match: c_default + ! ---------------------------------------- + ! Argument: float complex * arg1 +intent(inout) + ! Requested: c_native_*_inout + ! Match: c_default + interface + subroutine accept_float_complex_inout_ptr(arg1) & + bind(C, name="acceptFloatComplexInoutPtr") + use iso_c_binding, only : C_FLOAT_COMPLEX + implicit none + complex(C_FLOAT_COMPLEX), intent(INOUT) :: arg1 + end subroutine accept_float_complex_inout_ptr + end interface + + ! ---------------------------------------- + ! Function: void acceptDoubleComplexInoutPtr + ! Requested: c_void_scalar_result + ! Match: c_default + ! ---------------------------------------- + ! Argument: double complex * arg1 +intent(inout) + ! Requested: c_native_*_inout + ! Match: c_default + interface + subroutine accept_double_complex_inout_ptr(arg1) & + bind(C, name="acceptDoubleComplexInoutPtr") + use iso_c_binding, only : C_DOUBLE_COMPLEX + implicit none + complex(C_DOUBLE_COMPLEX), intent(INOUT) :: arg1 + end subroutine accept_double_complex_inout_ptr + end interface + + ! ---------------------------------------- + ! Function: void acceptDoubleComplexOutPtr + ! Requested: c_void_scalar_result + ! Match: c_default + ! ---------------------------------------- + ! Argument: double complex * arg1 +intent(out) + ! Requested: c_native_*_out + ! Match: c_default + interface + subroutine accept_double_complex_out_ptr(arg1) & + bind(C, name="acceptDoubleComplexOutPtr") + use iso_c_binding, only : C_DOUBLE_COMPLEX + implicit none + complex(C_DOUBLE_COMPLEX), intent(OUT) :: arg1 + end subroutine accept_double_complex_out_ptr + end interface + + ! ---------------------------------------- + ! Function: void acceptDoubleComplexOutPtrFlag + ! Requested: c_void_scalar_result + ! Match: c_default + ! ---------------------------------------- + ! Argument: double complex * arg1 +intent(out) + ! Requested: c_native_*_out + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * flag +intent(out) + ! Requested: c_native_*_out + ! Match: c_default + interface + subroutine accept_double_complex_out_ptr_flag(arg1, flag) & + bind(C, name="acceptDoubleComplexOutPtrFlag") + use iso_c_binding, only : C_DOUBLE_COMPLEX, C_INT + implicit none + complex(C_DOUBLE_COMPLEX), intent(OUT) :: arg1 + integer(C_INT), intent(OUT) :: flag + end subroutine accept_double_complex_out_ptr_flag + end interface + + interface + ! splicer begin additional_interfaces + ! splicer end additional_interfaces + end interface + +contains + + ! splicer begin additional_functions + ! splicer end additional_functions + +end module ccomplex_mod diff --git a/regression/reference/cdesc/cdesc.json b/regression/reference/cdesc/cdesc.json index 81b46cbff..1c10d4a42 100644 --- a/regression/reference/cdesc/cdesc.json +++ b/regression/reference/cdesc/cdesc.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -41,6 +41,7 @@ "f_intent": "IN", "f_type": "integer(C_INT)", "f_var": "arg", + "hnamefunc0": "ShroudTypeDefines", "rank": "2", "sh_type": "SH_TYPE_INT", "size": "size(arg)", @@ -603,6 +604,7 @@ "f_intent": "OUT", "f_type": "real(C_DOUBLE)", "f_var": "value", + "hnamefunc0": "ShroudTypeDefines", "rank": "0", "sh_type": "SH_TYPE_DOUBLE", "size": "1", diff --git a/regression/reference/cdesc/typescdesc.h b/regression/reference/cdesc/typescdesc.h index 8d49ff173..64c2104e3 100644 --- a/regression/reference/cdesc/typescdesc.h +++ b/regression/reference/cdesc/typescdesc.h @@ -1,5 +1,5 @@ // typescdesc.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cdesc/wrapcdesc.cpp b/regression/reference/cdesc/wrapcdesc.cpp index a5a8c5fc4..42fb0c79c 100644 --- a/regression/reference/cdesc/wrapcdesc.cpp +++ b/regression/reference/cdesc/wrapcdesc.cpp @@ -1,5 +1,5 @@ // wrapcdesc.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cdesc/wrapcdesc.h b/regression/reference/cdesc/wrapcdesc.h index 111635f84..e143ea5f1 100644 --- a/regression/reference/cdesc/wrapcdesc.h +++ b/regression/reference/cdesc/wrapcdesc.h @@ -1,5 +1,5 @@ // wrapcdesc.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cdesc/wrapfcdesc.f b/regression/reference/cdesc/wrapfcdesc.f index fff1e1f8b..779f7ceac 100644 --- a/regression/reference/cdesc/wrapfcdesc.f +++ b/regression/reference/cdesc/wrapfcdesc.f @@ -1,5 +1,5 @@ ! wrapfcdesc.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -55,15 +55,15 @@ module cdesc_mod SH_TYPE_OTHER = 32 ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: CDE_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type CDE_SHROUD_capsule_data ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: CDE_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(CDE_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -75,7 +75,7 @@ module cdesc_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type CDE_SHROUD_array interface @@ -89,9 +89,9 @@ module cdesc_mod ! Match: c_native_*_cdesc subroutine c_rank2_in(Darg) & bind(C, name="CDE_rank2_in") - import :: SHROUD_array + import :: CDE_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Darg + type(CDE_SHROUD_array), intent(INOUT) :: Darg end subroutine c_rank2_in ! ---------------------------------------- @@ -109,10 +109,10 @@ end subroutine c_rank2_in subroutine c_get_scalar1(name, Dvalue) & bind(C, name="CDE_get_scalar1") use iso_c_binding, only : C_CHAR - import :: SHROUD_array + import :: CDE_SHROUD_array implicit none character(kind=C_CHAR), intent(IN) :: name(*) - type(SHROUD_array), intent(INOUT) :: Dvalue + type(CDE_SHROUD_array), intent(INOUT) :: Dvalue end subroutine c_get_scalar1 ! ---------------------------------------- @@ -130,11 +130,11 @@ end subroutine c_get_scalar1 subroutine c_get_scalar1_bufferify(name, Lname, Dvalue) & bind(C, name="CDE_get_scalar1_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SHROUD_array + import :: CDE_SHROUD_array implicit none character(kind=C_CHAR), intent(IN) :: name(*) integer(C_INT), value, intent(IN) :: Lname - type(SHROUD_array), intent(INOUT) :: Dvalue + type(CDE_SHROUD_array), intent(INOUT) :: Dvalue end subroutine c_get_scalar1_bufferify ! ---------------------------------------- @@ -192,7 +192,7 @@ end function c_get_data_double subroutine rank2_in(arg) use iso_c_binding, only : C_INT, C_LOC integer(C_INT), intent(IN), target :: arg(:,:) - type(SHROUD_array) :: Darg + type(CDE_SHROUD_array) :: Darg ! splicer begin function.rank2_in Darg%base_addr = C_LOC(arg) Darg%type = SH_TYPE_INT @@ -238,7 +238,7 @@ subroutine get_scalar1_0(name, value) use iso_c_binding, only : C_INT, C_LOC character(len=*), intent(IN) :: name integer(C_INT), intent(OUT), target :: value - type(SHROUD_array) :: Dvalue + type(CDE_SHROUD_array) :: Dvalue ! splicer begin function.get_scalar1_0 Dvalue%base_addr = C_LOC(value) Dvalue%type = SH_TYPE_INT @@ -285,7 +285,7 @@ subroutine get_scalar1_1(name, value) use iso_c_binding, only : C_DOUBLE, C_INT, C_LOC character(len=*), intent(IN) :: name real(C_DOUBLE), intent(OUT), target :: value - type(SHROUD_array) :: Dvalue + type(CDE_SHROUD_array) :: Dvalue ! splicer begin function.get_scalar1_1 Dvalue%base_addr = C_LOC(value) Dvalue%type = SH_TYPE_DOUBLE diff --git a/regression/reference/classes/classes.json b/regression/reference/classes/classes.json index 07cd89979..d4ecae488 100644 --- a/regression/reference/classes/classes.json +++ b/regression/reference/classes/classes.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -84,7 +84,7 @@ "C_impl_filename": "wrapClass1.cpp", "C_name_scope": "Class1_", "C_type_name": "CLA_Class1", - "F_capsule_data_type": "SHROUD_class1_capsule", + "F_capsule_data_type": "CLA_SHROUD_class1_capsule", "F_derived_name": "class1", "F_name_scope": "class1_", "PY_PyObject": "PY_Class1", @@ -515,7 +515,7 @@ "cxx_var": "obj2", "data_var": "SHData_obj2", "numpy_type": null, - "py_type": "PY_Class1", + "py_object": "PY_Class1", "py_var": "SHPy_obj2", "size_var": "SHSize_obj2", "stmt0": "py_shadow_&_in", @@ -1104,7 +1104,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -1202,9 +1202,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "CLA_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -1754,7 +1755,7 @@ "C_impl_filename": "wrapClass2.cpp", "C_name_scope": "Class2_", "C_type_name": "CLA_Class2", - "F_capsule_data_type": "SHROUD_class2_capsule", + "F_capsule_data_type": "CLA_SHROUD_class2_capsule", "F_derived_name": "class2", "F_name_scope": "class2_", "PY_PyObject": "PY_Class2", @@ -1795,7 +1796,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -1893,9 +1894,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "CLA_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -1990,7 +1992,7 @@ "C_impl_filename": "wrapSingleton.cpp", "C_name_scope": "Singleton_", "C_type_name": "CLA_Singleton", - "F_capsule_data_type": "SHROUD_singleton_capsule", + "F_capsule_data_type": "CLA_SHROUD_singleton_capsule", "F_derived_name": "singleton", "F_name_scope": "singleton_", "PY_PyObject": "PY_Singleton", @@ -2320,7 +2322,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Class1", + "py_object": "PY_Class1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_shadow_scalar_in", @@ -2433,7 +2435,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Class1", + "py_object": "PY_Class1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_shadow_*_in", diff --git a/regression/reference/classes/classes_types.yaml b/regression/reference/classes/classes_types.yaml index 664e5b3dd..dcb0cb054 100644 --- a/regression/reference/classes/classes_types.yaml +++ b/regression/reference/classes/classes_types.yaml @@ -1,5 +1,5 @@ # classes_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -18,7 +18,7 @@ typemap: c_type: CLA_Class1 f_module_name: classes_mod f_derived_type: class1 - f_capsule_data_type: SHROUD_class1_capsule + f_capsule_data_type: CLA_SHROUD_class1_capsule f_to_c: "{f_var}%cxxmem" - type: Class2 fields: @@ -28,7 +28,7 @@ typemap: c_type: CLA_Class2 f_module_name: classes_mod f_derived_type: class2 - f_capsule_data_type: SHROUD_class2_capsule + f_capsule_data_type: CLA_SHROUD_class2_capsule f_to_c: "{f_var}%cxxmem" - type: Singleton fields: @@ -38,5 +38,5 @@ typemap: c_type: CLA_Singleton f_module_name: classes_mod f_derived_type: singleton - f_capsule_data_type: SHROUD_singleton_capsule + f_capsule_data_type: CLA_SHROUD_singleton_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/classes/pyClass1type.cpp b/regression/reference/classes/pyClass1type.cpp index 627c6865c..006c370b4 100644 --- a/regression/reference/classes/pyClass1type.cpp +++ b/regression/reference/classes/pyClass1type.cpp @@ -1,5 +1,5 @@ // pyClass1type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/pyClass2type.cpp b/regression/reference/classes/pyClass2type.cpp index 4a1baa911..58d07fbef 100644 --- a/regression/reference/classes/pyClass2type.cpp +++ b/regression/reference/classes/pyClass2type.cpp @@ -1,5 +1,5 @@ // pyClass2type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/pySingletontype.cpp b/regression/reference/classes/pySingletontype.cpp index 710e55a21..19256a32e 100644 --- a/regression/reference/classes/pySingletontype.cpp +++ b/regression/reference/classes/pySingletontype.cpp @@ -1,5 +1,5 @@ // pySingletontype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/pyclassesmodule.cpp b/regression/reference/classes/pyclassesmodule.cpp index 3f5e70024..c7bec709c 100644 --- a/regression/reference/classes/pyclassesmodule.cpp +++ b/regression/reference/classes/pyclassesmodule.cpp @@ -1,5 +1,5 @@ // pyclassesmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/pyclassesmodule.hpp b/regression/reference/classes/pyclassesmodule.hpp index 8547b2edd..90a5428f6 100644 --- a/regression/reference/classes/pyclassesmodule.hpp +++ b/regression/reference/classes/pyclassesmodule.hpp @@ -1,5 +1,5 @@ // pyclassesmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/pyclassesutil.cpp b/regression/reference/classes/pyclassesutil.cpp index 117dd7265..ff6a9a3e3 100644 --- a/regression/reference/classes/pyclassesutil.cpp +++ b/regression/reference/classes/pyclassesutil.cpp @@ -1,5 +1,5 @@ // pyclassesutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/setup.py b/regression/reference/classes/setup.py index d6beefb76..8869b7020 100644 --- a/regression/reference/classes/setup.py +++ b/regression/reference/classes/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/typesclasses.h b/regression/reference/classes/typesclasses.h index 3533834a1..22dfefa64 100644 --- a/regression/reference/classes/typesclasses.h +++ b/regression/reference/classes/typesclasses.h @@ -1,5 +1,5 @@ // typesclasses.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/utilclasses.cpp b/regression/reference/classes/utilclasses.cpp index 39403a672..c285b0ba7 100644 --- a/regression/reference/classes/utilclasses.cpp +++ b/regression/reference/classes/utilclasses.cpp @@ -1,5 +1,5 @@ // utilclasses.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapClass1.cpp b/regression/reference/classes/wrapClass1.cpp index 39d551662..9bc838f88 100644 --- a/regression/reference/classes/wrapClass1.cpp +++ b/regression/reference/classes/wrapClass1.cpp @@ -1,5 +1,5 @@ // wrapClass1.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapClass1.h b/regression/reference/classes/wrapClass1.h index e37f9c38a..241d06345 100644 --- a/regression/reference/classes/wrapClass1.h +++ b/regression/reference/classes/wrapClass1.h @@ -1,5 +1,5 @@ // wrapClass1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapClass2.cpp b/regression/reference/classes/wrapClass2.cpp index 67d48069a..3bdd55b7b 100644 --- a/regression/reference/classes/wrapClass2.cpp +++ b/regression/reference/classes/wrapClass2.cpp @@ -1,5 +1,5 @@ // wrapClass2.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapClass2.h b/regression/reference/classes/wrapClass2.h index cbf66596e..4211365e6 100644 --- a/regression/reference/classes/wrapClass2.h +++ b/regression/reference/classes/wrapClass2.h @@ -1,5 +1,5 @@ // wrapClass2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapSingleton.cpp b/regression/reference/classes/wrapSingleton.cpp index 9525d5a17..c339925fe 100644 --- a/regression/reference/classes/wrapSingleton.cpp +++ b/regression/reference/classes/wrapSingleton.cpp @@ -1,5 +1,5 @@ // wrapSingleton.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapSingleton.h b/regression/reference/classes/wrapSingleton.h index 3643ccabf..ade9473ac 100644 --- a/regression/reference/classes/wrapSingleton.h +++ b/regression/reference/classes/wrapSingleton.h @@ -1,5 +1,5 @@ // wrapSingleton.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapclasses.cpp b/regression/reference/classes/wrapclasses.cpp index ace67535a..00c014dea 100644 --- a/regression/reference/classes/wrapclasses.cpp +++ b/regression/reference/classes/wrapclasses.cpp @@ -1,5 +1,5 @@ // wrapclasses.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapclasses.h b/regression/reference/classes/wrapclasses.h index da21bc159..045d78ad3 100644 --- a/regression/reference/classes/wrapclasses.h +++ b/regression/reference/classes/wrapclasses.h @@ -1,5 +1,5 @@ // wrapclasses.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/classes/wrapfclasses.f b/regression/reference/classes/wrapfclasses.f index 3e41aaecf..bc764e735 100644 --- a/regression/reference/classes/wrapfclasses.f +++ b/regression/reference/classes/wrapfclasses.f @@ -1,5 +1,5 @@ ! wrapfclasses.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,16 +22,16 @@ module classes_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: CLA_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type CLA_SHROUD_capsule_data ! start array_context ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: CLA_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(CLA_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,7 +43,7 @@ module classes_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type CLA_SHROUD_array ! end array_context ! enum classes::Class1::DIRECTION @@ -52,15 +52,15 @@ module classes_mod integer(C_INT), parameter :: class1_left = 100 integer(C_INT), parameter :: class1_right = 101 - ! start derived-type SHROUD_class1_capsule - type, bind(C) :: SHROUD_class1_capsule + ! start derived-type CLA_SHROUD_class1_capsule + type, bind(C) :: CLA_SHROUD_class1_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class1_capsule - ! end derived-type SHROUD_class1_capsule + end type CLA_SHROUD_class1_capsule + ! end derived-type CLA_SHROUD_class1_capsule type class1 - type(SHROUD_class1_capsule) :: cxxmem + type(CLA_SHROUD_class1_capsule) :: cxxmem ! splicer begin class.Class1.component_part ! splicer end class.Class1.component_part contains @@ -82,13 +82,13 @@ module classes_mod ! splicer end class.Class1.type_bound_procedure_part end type class1 - type, bind(C) :: SHROUD_class2_capsule + type, bind(C) :: CLA_SHROUD_class2_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class2_capsule + end type CLA_SHROUD_class2_capsule type class2 - type(SHROUD_class2_capsule) :: cxxmem + type(CLA_SHROUD_class2_capsule) :: cxxmem ! splicer begin class.Class2.component_part ! splicer end class.Class2.component_part contains @@ -100,13 +100,13 @@ module classes_mod ! splicer end class.Class2.type_bound_procedure_part end type class2 - type, bind(C) :: SHROUD_singleton_capsule + type, bind(C) :: CLA_SHROUD_singleton_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_singleton_capsule + end type CLA_SHROUD_singleton_capsule type singleton - type(SHROUD_singleton_capsule) :: cxxmem + type(CLA_SHROUD_singleton_capsule) :: cxxmem ! splicer begin class.Singleton.component_part ! splicer end class.Singleton.component_part contains @@ -139,9 +139,9 @@ function c_class1_ctor_default(SHT_crv) & result(SHT_rv) & bind(C, name="CLA_Class1_ctor_default") use iso_c_binding, only : C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_class1_ctor_default end interface @@ -160,10 +160,10 @@ function c_class1_ctor_flag(flag, SHT_crv) & result(SHT_rv) & bind(C, name="CLA_Class1_ctor_flag") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none integer(C_INT), value, intent(IN) :: flag - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_class1_ctor_flag end interface @@ -177,9 +177,9 @@ end function c_class1_ctor_flag interface subroutine c_class1_delete(self) & bind(C, name="CLA_Class1_delete") - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self end subroutine c_class1_delete end interface ! end c_class1_delete @@ -194,9 +194,9 @@ function c_class1_method1(self) & result(SHT_rv) & bind(C, name="CLA_Class1_method1") use iso_c_binding, only : C_INT - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_class1_method1 end interface @@ -216,10 +216,10 @@ pure function c_class1_equivalent(self, obj2) & result(SHT_rv) & bind(C, name="CLA_Class1_equivalent") use iso_c_binding, only : C_BOOL - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self - type(SHROUD_class1_capsule), intent(IN) :: obj2 + type(CLA_SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: obj2 logical(C_BOOL) :: SHT_rv end function c_class1_equivalent end interface @@ -233,9 +233,9 @@ end function c_class1_equivalent interface subroutine c_class1_return_this(self) & bind(C, name="CLA_Class1_return_this") - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self end subroutine c_class1_return_this end interface ! end c_class1_return_this @@ -258,12 +258,12 @@ function c_class1_return_this_buffer(self, name, flag, SHT_crv) & result(SHT_rv) & bind(C, name="CLA_Class1_return_this_buffer") use iso_c_binding, only : C_BOOL, C_CHAR, C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) logical(C_BOOL), value, intent(IN) :: flag - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_class1_return_this_buffer end interface @@ -288,13 +288,13 @@ function c_class1_return_this_buffer_bufferify(self, name, & result(SHT_rv) & bind(C, name="CLA_Class1_return_this_buffer_bufferify") use iso_c_binding, only : C_BOOL, C_CHAR, C_INT, C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self character(kind=C_CHAR), intent(IN) :: name(*) integer(C_INT), value, intent(IN) :: Lname logical(C_BOOL), value, intent(IN) :: flag - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_class1_return_this_buffer_bufferify end interface @@ -310,10 +310,10 @@ function c_class1_getclass3(self, SHT_crv) & result(SHT_rv) & bind(C, name="CLA_Class1_getclass3") use iso_c_binding, only : C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_class1_getclass3 end interface @@ -329,9 +329,9 @@ function c_class1_get_name(self) & result(SHT_rv) & bind(C, name="CLA_Class1_get_name") use iso_c_binding, only : C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_class1_get_name end interface @@ -349,10 +349,10 @@ end function c_class1_get_name interface subroutine c_class1_get_name_bufferify(self, DSHF_rv) & bind(C, name="CLA_Class1_get_name_bufferify") - import :: SHROUD_array, SHROUD_class1_capsule + import :: CLA_SHROUD_array, CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(CLA_SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_class1_get_name_bufferify end interface ! end c_class1_get_name_bufferify @@ -371,9 +371,9 @@ function c_class1_direction_func(self, arg) & result(SHT_rv) & bind(C, name="CLA_Class1_direction_func") use iso_c_binding, only : C_INT - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: arg integer(C_INT) :: SHT_rv end function c_class1_direction_func @@ -390,9 +390,9 @@ function c_class1_get_m_flag(self) & result(SHT_rv) & bind(C, name="CLA_Class1_get_m_flag") use iso_c_binding, only : C_INT - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_class1_get_m_flag end interface @@ -408,9 +408,9 @@ function c_class1_get_test(self) & result(SHT_rv) & bind(C, name="CLA_Class1_get_test") use iso_c_binding, only : C_INT - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_class1_get_test end interface @@ -429,9 +429,9 @@ end function c_class1_get_test subroutine c_class1_set_test(self, val) & bind(C, name="CLA_Class1_set_test") use iso_c_binding, only : C_INT - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(CLA_SHROUD_class1_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: val end subroutine c_class1_set_test end interface @@ -449,9 +449,9 @@ function c_class2_get_name(self) & result(SHT_rv) & bind(C, name="CLA_Class2_get_name") use iso_c_binding, only : C_PTR - import :: SHROUD_class2_capsule + import :: CLA_SHROUD_class2_capsule implicit none - type(SHROUD_class2_capsule), intent(IN) :: self + type(CLA_SHROUD_class2_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_class2_get_name end interface @@ -467,10 +467,10 @@ end function c_class2_get_name interface subroutine c_class2_get_name_bufferify(self, DSHF_rv) & bind(C, name="CLA_Class2_get_name_bufferify") - import :: SHROUD_array, SHROUD_class2_capsule + import :: CLA_SHROUD_array, CLA_SHROUD_class2_capsule implicit none - type(SHROUD_class2_capsule), intent(IN) :: self - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(CLA_SHROUD_class2_capsule), intent(IN) :: self + type(CLA_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_class2_get_name_bufferify end interface @@ -486,9 +486,9 @@ function c_singleton_get_reference(SHT_crv) & result(SHT_rv) & bind(C, name="CLA_Singleton_get_reference") use iso_c_binding, only : C_PTR - import :: SHROUD_singleton_capsule + import :: CLA_SHROUD_singleton_capsule implicit none - type(SHROUD_singleton_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_singleton_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_singleton_get_reference end interface @@ -525,9 +525,9 @@ end function direction_func interface subroutine c_pass_class_by_value(arg) & bind(C, name="CLA_pass_class_by_value") - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN), value :: arg + type(CLA_SHROUD_class1_capsule), intent(IN), value :: arg end subroutine c_pass_class_by_value end interface @@ -544,9 +544,9 @@ function c_useclass(arg) & result(SHT_rv) & bind(C, name="CLA_useclass") use iso_c_binding, only : C_INT - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: arg + type(CLA_SHROUD_class1_capsule), intent(IN) :: arg integer(C_INT) :: SHT_rv end function c_useclass end interface @@ -560,9 +560,9 @@ function c_getclass2(SHT_crv) & result(SHT_rv) & bind(C, name="CLA_getclass2") use iso_c_binding, only : C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_getclass2 end interface @@ -576,9 +576,9 @@ function c_getclass3(SHT_crv) & result(SHT_rv) & bind(C, name="CLA_getclass3") use iso_c_binding, only : C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_getclass3 end interface @@ -592,9 +592,9 @@ function c_get_const_class_reference(SHT_crv) & result(SHT_rv) & bind(C, name="CLA_get_const_class_reference") use iso_c_binding, only : C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_get_const_class_reference end interface @@ -608,9 +608,9 @@ function c_get_class_reference(SHT_crv) & result(SHT_rv) & bind(C, name="CLA_get_class_reference") use iso_c_binding, only : C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_get_class_reference end interface @@ -627,10 +627,10 @@ function c_get_class_copy(flag, SHT_crv) & result(SHT_rv) & bind(C, name="CLA_get_class_copy") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_class1_capsule + import :: CLA_SHROUD_class1_capsule implicit none integer(C_INT), value, intent(IN) :: flag - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(CLA_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_get_class_copy end interface @@ -713,14 +713,14 @@ end subroutine c_last_function_called_bufferify interface ! helper copy_string ! Copy the char* or std::string in context into c_var. - subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & + subroutine CLA_SHROUD_copy_string_and_free(context, c_var, c_var_size) & bind(c,name="CLA_ShroudCopyStringAndFree") use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import CLA_SHROUD_array + type(CLA_SHROUD_array), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_string_and_free + end subroutine CLA_SHROUD_copy_string_and_free end interface contains @@ -925,14 +925,12 @@ end function class1_getclass3 ! ---------------------------------------- ! Function: const std::string & getName +deref(allocatable) ! const std::string & getName +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getName ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable !> @@ -943,12 +941,12 @@ end function class1_getclass3 function class1_get_name(obj) & result(SHT_rv) class(class1) :: obj - type(SHROUD_array) :: DSHF_rv + type(CLA_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin class.Class1.method.get_name call c_class1_get_name_bufferify(obj%cxxmem, DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call CLA_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end class.Class1.method.get_name end function class1_get_name ! end class1_get_name @@ -1071,14 +1069,12 @@ end function class1_associated ! ---------------------------------------- ! Function: const std::string & getName +deref(allocatable) ! const std::string & getName +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getName ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable !> @@ -1088,12 +1084,12 @@ end function class1_associated function class2_get_name(obj) & result(SHT_rv) class(class2) :: obj - type(SHROUD_array) :: DSHF_rv + type(CLA_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin class.Class2.method.get_name call c_class2_get_name_bufferify(obj%cxxmem, DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call CLA_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end class.Class2.method.get_name end function class2_get_name diff --git a/regression/reference/clibrary/clibrary.json b/regression/reference/clibrary/clibrary.json index b73d80503..e9c23e322 100644 --- a/regression/reference/clibrary/clibrary.json +++ b/regression/reference/clibrary/clibrary.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wraparray_info.c", "C_name_scope": "array_info_", "C_type_name": "array_info", - "F_capsule_data_type": "SHROUD_array_info_capsule", + "F_capsule_data_type": "CLI_SHROUD_array_info_capsule", "F_derived_name": "array_info", "F_name_scope": "array_info_", "PY_struct_array_descr_create": "PY_array_info_create_array_descr", @@ -684,7 +684,7 @@ "cxx_var": "arg1", "data_var": "SHData_arg1", "numpy_type": "NPY_BOOL", - "py_type": "PyObject", + "py_object": "PyObject", "py_var": "SHPy_arg1", "size_var": "SHSize_arg1", "stmt0": "py_bool_scalar_in", @@ -787,7 +787,7 @@ "cxx_var": "arg3", "data_var": "SHData_arg3", "numpy_type": "NPY_BOOL", - "py_type": "PyObject", + "py_object": "PyObject", "py_var": "SHPy_arg3", "size_var": "SHSize_arg3", "stmt0": "py_bool_*_inout", diff --git a/regression/reference/clibrary/clibrary_types.yaml b/regression/reference/clibrary/clibrary_types.yaml index 49f398db6..423c3045c 100644 --- a/regression/reference/clibrary/clibrary_types.yaml +++ b/regression/reference/clibrary/clibrary_types.yaml @@ -1,5 +1,5 @@ # clibrary_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/clibrary/pyClibrarymodule.c b/regression/reference/clibrary/pyClibrarymodule.c index 412668445..70f50590c 100644 --- a/regression/reference/clibrary/pyClibrarymodule.c +++ b/regression/reference/clibrary/pyClibrarymodule.c @@ -1,5 +1,5 @@ // pyClibrarymodule.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/clibrary/pyClibrarymodule.h b/regression/reference/clibrary/pyClibrarymodule.h index 46d95dfac..f2db9b3ad 100644 --- a/regression/reference/clibrary/pyClibrarymodule.h +++ b/regression/reference/clibrary/pyClibrarymodule.h @@ -1,5 +1,5 @@ // pyClibrarymodule.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/clibrary/setup.py b/regression/reference/clibrary/setup.py index 8c5823342..8653028a0 100644 --- a/regression/reference/clibrary/setup.py +++ b/regression/reference/clibrary/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/clibrary/typesClibrary.h b/regression/reference/clibrary/typesClibrary.h index 5d989cf6e..673d075e0 100644 --- a/regression/reference/clibrary/typesClibrary.h +++ b/regression/reference/clibrary/typesClibrary.h @@ -1,5 +1,5 @@ // typesClibrary.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/clibrary/wrapClibrary.c b/regression/reference/clibrary/wrapClibrary.c index 27a8942b1..a1024bafc 100644 --- a/regression/reference/clibrary/wrapClibrary.c +++ b/regression/reference/clibrary/wrapClibrary.c @@ -1,5 +1,5 @@ // wrapClibrary.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/clibrary/wrapClibrary.h b/regression/reference/clibrary/wrapClibrary.h index 9dc94a406..d876a2e5a 100644 --- a/regression/reference/clibrary/wrapClibrary.h +++ b/regression/reference/clibrary/wrapClibrary.h @@ -1,5 +1,5 @@ // wrapClibrary.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/clibrary/wrapfclibrary.f b/regression/reference/clibrary/wrapfclibrary.f index 44d84464c..8dc941626 100644 --- a/regression/reference/clibrary/wrapfclibrary.f +++ b/regression/reference/clibrary/wrapfclibrary.f @@ -1,5 +1,5 @@ ! wrapfclibrary.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cxxlibrary/cxxlibrary.json b/regression/reference/cxxlibrary/cxxlibrary.json index 5a1e282f6..a045e0458 100644 --- a/regression/reference/cxxlibrary/cxxlibrary.json +++ b/regression/reference/cxxlibrary/cxxlibrary.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct1.cpp", "C_name_scope": "Cstruct1_", "C_type_name": "CXX_cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "CXX_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_PyObject": "PY_Cstruct1", @@ -87,7 +87,7 @@ "C_impl_filename": "wrapCstruct1_cls.cpp", "C_name_scope": "Cstruct1_cls_", "C_type_name": "CXX_cstruct1_cls", - "F_capsule_data_type": "SHROUD_cstruct1_cls_capsule", + "F_capsule_data_type": "CXX_SHROUD_cstruct1_cls_capsule", "F_derived_name": "cstruct1_cls", "F_name_scope": "cstruct1_cls_", "PY_PyObject": "PY_Cstruct1_cls", @@ -873,7 +873,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1_cls", + "py_object": "PY_Cstruct1_cls", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_&_inout_class", @@ -960,7 +960,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1_cls", + "py_object": "PY_Cstruct1_cls", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_&_in_class", @@ -1051,7 +1051,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1_cls", + "py_object": "PY_Cstruct1_cls", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_&_inout_class", @@ -1234,7 +1234,7 @@ }, { "_default_funcs": [ - 9 + 10 ], "_fmtargs": { "data": { @@ -1398,6 +1398,505 @@ "underscore_name": "default_ptr_is_null" }, "options": {} + }, + { + "_fmtargs": { + "in1": { + "fmtc": { + "c_addr": "&", + "c_const": "", + "c_deref": "", + "c_member": ".", + "c_var": "in1", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&in1", + "cxx_type": "int", + "cxx_var": "in1", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_scalar_in", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_in1", + "c_var": "in1", + "f_intent": "IN", + "f_type": "integer(C_INT)", + "f_var": "in1", + "sh_type": "SH_TYPE_INT", + "stmt0": "f_native_scalar_in", + "stmt1": "f_default", + "stmtc0": "c_native_scalar_in", + "stmtc1": "c_default" + } + }, + "out1": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "out1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "out1", + "cxx_type": "int", + "cxx_var": "out1", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_*_out", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_out1", + "c_var": "out1", + "f_intent": "OUT", + "f_type": "integer(C_INT)", + "f_var": "out1", + "sh_type": "SH_TYPE_INT", + "stmt0": "f_native_*_out", + "stmt1": "f_default", + "stmtc0": "c_native_*_out", + "stmtc1": "c_default" + } + }, + "out2": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "out2", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "out2", + "cxx_type": "int", + "cxx_var": "out2", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_*_out", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_out2", + "c_var": "out2", + "f_intent": "OUT", + "f_type": "integer(C_INT)", + "f_var": "out2", + "sh_type": "SH_TYPE_INT", + "stmt0": "f_native_*_out", + "stmt1": "f_default", + "stmtc0": "c_native_*_out", + "stmtc1": "c_default" + } + } + }, + "_generated": "has_default_arg", + "_overloaded": true, + "ast": { + "declarator": { + "name": "defaultArgsInOut", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "in", + "value": true + }, + "declarator": { + "name": "in1", + "pointer": [] + }, + "specifier": [ + "int" + ], + "typemap_name": "int" + }, + { + "attrs": { + "intent": "out" + }, + "declarator": { + "name": "out1", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "int" + ], + "typemap_name": "int" + }, + { + "attrs": { + "intent": "out" + }, + "declarator": { + "name": "out2", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "int" + ], + "typemap_name": "int" + } + ], + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void defaultArgsInOut(int in1, int *out1+intent(out), int *out2+intent(out), bool flag = false)", + "declgen": "void defaultArgsInOut(int in1 +intent(in)+value, int * out1 +intent(out), int * out2 +intent(out))", + "fmtdict": { + "C_call_list": "in1,\t out1,\t out2", + "C_name": "CXX_default_args_in_out_0", + "C_prototype": "int in1,\t int * out1,\t int * out2", + "C_return_type": "void", + "F_C_call": "c_default_args_in_out_0", + "F_C_name": "c_default_args_in_out_0", + "F_arg_c_call": "in1,\t out1,\t out2", + "F_arguments": "in1,\t out1,\t out2", + "F_name_function": "default_args_in_out_0", + "F_name_generic": "default_args_in_out", + "F_name_impl": "default_args_in_out_0", + "F_subprogram": "subroutine", + "function_name": "defaultArgsInOut", + "function_suffix": "_0", + "stmt0": "f_subroutine", + "stmt1": "f_default", + "stmtc0": "c", + "stmtc1": "c_default", + "underscore_name": "default_args_in_out" + }, + "options": { + "wrap_c": true, + "wrap_fortran": true, + "wrap_lua": false, + "wrap_python": false + } + }, + { + "_default_funcs": [ + 11 + ], + "_fmtargs": { + "flag": { + "fmtc": { + "c_addr": "&", + "c_const": "", + "c_deref": "", + "c_member": ".", + "c_var": "flag", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&flag", + "cxx_type": "bool", + "cxx_var": "flag", + "idtor": "0", + "sh_type": "SH_TYPE_BOOL", + "stmt0": "c_bool_scalar_in", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_flag", + "c_var": "SH_flag", + "f_intent": "IN", + "f_type": "logical", + "f_var": "flag", + "sh_type": "SH_TYPE_BOOL", + "stmt0": "f_bool_scalar_in", + "stmt1": "f_bool_in", + "stmtc0": "c_bool_scalar_in", + "stmtc1": "c_default" + }, + "fmtpy": { + "PyTypeObject": "PyBool_Type", + "c_const": "", + "c_deref": "", + "c_type": "bool", + "c_var": "flag", + "ctor_expr": "flag", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&flag", + "cxx_type": "bool", + "cxx_var": "flag", + "data_var": "SHData_flag", + "numpy_type": "NPY_BOOL", + "py_object": "PyObject", + "py_var": "SHPy_flag", + "size_var": "SHSize_flag", + "stmt0": "py_bool_scalar_in", + "stmt1": "py_bool_in", + "value_var": "SHValue_flag" + } + }, + "in1": { + "fmtc": { + "c_addr": "&", + "c_const": "", + "c_deref": "", + "c_member": ".", + "c_var": "in1", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&in1", + "cxx_type": "int", + "cxx_var": "in1", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_scalar_in", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_in1", + "c_var": "in1", + "f_intent": "IN", + "f_type": "integer(C_INT)", + "f_var": "in1", + "sh_type": "SH_TYPE_INT", + "stmt0": "f_native_scalar_in", + "stmt1": "f_default", + "stmtc0": "c_native_scalar_in", + "stmtc1": "c_default" + }, + "fmtpy": { + "c_const": "", + "c_deref": "", + "c_type": "int", + "c_var": "in1", + "ctor_expr": "in1", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&in1", + "cxx_type": "int", + "cxx_var": "in1", + "data_var": "SHData_in1", + "numpy_type": "NPY_INT", + "py_var": "SHPy_in1", + "size_var": "SHSize_in1", + "stmt0": "py_native_scalar_in", + "stmt1": "py_default", + "value_var": "SHValue_in1" + } + }, + "out1": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "out1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "out1", + "cxx_type": "int", + "cxx_var": "out1", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_*_out", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_out1", + "c_var": "out1", + "f_intent": "OUT", + "f_type": "integer(C_INT)", + "f_var": "out1", + "sh_type": "SH_TYPE_INT", + "stmt0": "f_native_*_out", + "stmt1": "f_default", + "stmtc0": "c_native_*_out", + "stmtc1": "c_default" + }, + "fmtpy": { + "array_size": "1", + "c_const": "", + "c_deref": "*", + "c_type": "int", + "c_var": "out1", + "ctor_expr": "out1", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "out1", + "cxx_type": "int", + "cxx_var": "out1", + "data_var": "SHData_out1", + "numpy_type": "NPY_INT", + "py_var": "SHPy_out1", + "size_var": "SHSize_out1", + "stmt0": "py_native_*_out", + "stmt1": "py_native_*_out", + "value_var": "SHValue_out1" + } + }, + "out2": { + "fmtc": { + "c_addr": "", + "c_const": "", + "c_deref": "*", + "c_member": "->", + "c_var": "out2", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "out2", + "cxx_type": "int", + "cxx_var": "out2", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_*_out", + "stmt1": "c_default" + }, + "fmtf": { + "F_pointer": "SHPTR_out2", + "c_var": "out2", + "f_intent": "OUT", + "f_type": "integer(C_INT)", + "f_var": "out2", + "sh_type": "SH_TYPE_INT", + "stmt0": "f_native_*_out", + "stmt1": "f_default", + "stmtc0": "c_native_*_out", + "stmtc1": "c_default" + }, + "fmtpy": { + "array_size": "1", + "c_const": "", + "c_deref": "*", + "c_type": "int", + "c_var": "out2", + "ctor_expr": "out2", + "cxx_addr": "", + "cxx_member": "->", + "cxx_nonconst_ptr": "out2", + "cxx_type": "int", + "cxx_var": "out2", + "data_var": "SHData_out2", + "numpy_type": "NPY_INT", + "py_var": "SHPy_out2", + "size_var": "SHSize_out2", + "stmt0": "py_native_*_out", + "stmt1": "py_native_*_out", + "value_var": "SHValue_out2" + } + } + }, + "_has_default_arg": true, + "_nargs": [ + 3, + 4 + ], + "_overloaded": true, + "ast": { + "declarator": { + "name": "defaultArgsInOut", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "in", + "value": true + }, + "declarator": { + "name": "in1", + "pointer": [] + }, + "specifier": [ + "int" + ], + "typemap_name": "int" + }, + { + "attrs": { + "intent": "out" + }, + "declarator": { + "name": "out1", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "int" + ], + "typemap_name": "int" + }, + { + "attrs": { + "intent": "out" + }, + "declarator": { + "name": "out2", + "pointer": [ + { + "ptr": "*" + } + ] + }, + "specifier": [ + "int" + ], + "typemap_name": "int" + }, + { + "attrs": { + "intent": "in", + "value": true + }, + "declarator": { + "name": "flag", + "pointer": [] + }, + "init": "false", + "specifier": [ + "bool" + ], + "typemap_name": "bool" + } + ], + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void defaultArgsInOut(int in1, int *out1+intent(out), int *out2+intent(out), bool flag = false)", + "declgen": "void defaultArgsInOut(int in1 +intent(in)+value, int * out1 +intent(out), int * out2 +intent(out), bool flag=false +intent(in)+value)", + "fmtdict": { + "C_call_list": "in1,\t out1,\t out2,\t flag", + "C_name": "CXX_default_args_in_out_1", + "C_prototype": "int in1,\t int * out1,\t int * out2,\t bool flag", + "C_return_type": "void", + "F_C_call": "c_default_args_in_out_1", + "F_C_name": "c_default_args_in_out_1", + "F_arg_c_call": "in1,\t out1,\t out2,\t SH_flag", + "F_arguments": "in1,\t out1,\t out2,\t flag", + "F_name_function": "default_args_in_out_1", + "F_name_generic": "default_args_in_out", + "F_name_impl": "default_args_in_out_1", + "F_subprogram": "subroutine", + "PY_cleanup_decref": "Py_XDECREF", + "PY_name_impl": "PY_defaultArgsInOut_1", + "function_name": "defaultArgsInOut", + "function_suffix": "_1", + "stmt0": "f_subroutine", + "stmt1": "f_default", + "stmtc0": "c", + "stmtc1": "c_default", + "underscore_name": "default_args_in_out" + }, + "options": {} } ], "language": "cxx", diff --git a/regression/reference/cxxlibrary/cxxlibrary.log b/regression/reference/cxxlibrary/cxxlibrary.log index 7494dfa12..e4220e3a3 100644 --- a/regression/reference/cxxlibrary/cxxlibrary.log +++ b/regression/reference/cxxlibrary/cxxlibrary.log @@ -7,6 +7,8 @@ C function void passStructByReferenceInout(Cstruct1 & arg +intent(inout)) C function void passStructByReferenceOut(Cstruct1 & arg +intent(out)) C function bool defaultPtrIsNULL() C function bool defaultPtrIsNULL(double * data=nullptr +intent(in)+rank(1)) +C function void defaultArgsInOut(int in1 +intent(in)+value, int * out1 +intent(out), int * out2 +intent(out)) +C function void defaultArgsInOut(int in1 +intent(in)+value, int * out1 +intent(out), int * out2 +intent(out), bool flag=false +intent(in)+value) Close wrapcxxlibrary.h Close wrapcxxlibrary.cpp Close typescxxlibrary.h @@ -17,6 +19,8 @@ C-interface, Fortran function void passStructByReferenceInout(Cstruct1 & arg +in C-interface, Fortran function void passStructByReferenceOut(Cstruct1 & arg +intent(out)) C-interface, Fortran function bool defaultPtrIsNULL() C-interface, Fortran function bool defaultPtrIsNULL(double * data=nullptr +intent(in)+rank(1)) +C-interface, Fortran function void defaultArgsInOut(int in1 +intent(in)+value, int * out1 +intent(out), int * out2 +intent(out)) +C-interface, Fortran function void defaultArgsInOut(int in1 +intent(in)+value, int * out1 +intent(out), int * out2 +intent(out), bool flag=false +intent(in)+value) Close wrapfcxxlibrary.f class Cstruct1_cls Python method Cstruct1_cls(int ifield +intent(in), double dfield +intent(in)) +name(Cstruct1_cls_ctor) @@ -30,6 +34,7 @@ Python function int passStructByReferenceInCls(const Cstruct1_cls & arg +intent( Python function void passStructByReferenceInoutCls(Cstruct1_cls & arg +intent(inout)) Python function void passStructByReferenceOutCls(Cstruct1_cls & arg +intent(out)) Python function bool defaultPtrIsNULL(double * data=nullptr +intent(in)+rank(1)) +Python function void defaultArgsInOut(int in1 +intent(in)+value, int * out1 +intent(out), int * out2 +intent(out), bool flag=false +intent(in)+value) Close pycxxlibrarymodule.cpp Close pycxxlibraryutil.cpp Close pycxxlibrarymodule.hpp diff --git a/regression/reference/cxxlibrary/cxxlibrary_types.yaml b/regression/reference/cxxlibrary/cxxlibrary_types.yaml index 7b65c5271..63980d0c5 100644 --- a/regression/reference/cxxlibrary/cxxlibrary_types.yaml +++ b/regression/reference/cxxlibrary/cxxlibrary_types.yaml @@ -1,5 +1,5 @@ # cxxlibrary_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cxxlibrary/pyCstruct1_clstype.cpp b/regression/reference/cxxlibrary/pyCstruct1_clstype.cpp index cd728c784..cdfcb8c6a 100644 --- a/regression/reference/cxxlibrary/pyCstruct1_clstype.cpp +++ b/regression/reference/cxxlibrary/pyCstruct1_clstype.cpp @@ -1,5 +1,5 @@ // pyCstruct1_clstype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cxxlibrary/pycxxlibrarymodule.cpp b/regression/reference/cxxlibrary/pycxxlibrarymodule.cpp index 417a399de..0f3f9c746 100644 --- a/regression/reference/cxxlibrary/pycxxlibrarymodule.cpp +++ b/regression/reference/cxxlibrary/pycxxlibrarymodule.cpp @@ -1,5 +1,5 @@ // pycxxlibrarymodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -491,6 +491,76 @@ PY_defaultPtrIsNULL_1( return nullptr; // splicer end function.default_ptr_is_null } + +// ---------------------------------------- +// Function: void defaultArgsInOut +// Exact: py_default +// ---------------------------------------- +// Argument: int in1 +intent(in)+value +// Requested: py_native_scalar_in +// Match: py_default +// ---------------------------------------- +// Argument: int * out1 +intent(out) +// Exact: py_native_*_out +// ---------------------------------------- +// Argument: int * out2 +intent(out) +// Exact: py_native_*_out +// ---------------------------------------- +// Argument: bool flag=false +intent(in)+value +// Requested: py_bool_scalar_in +// Match: py_bool_in +static char PY_defaultArgsInOut_1__doc__[] = +"documentation" +; + +static PyObject * +PY_defaultArgsInOut_1( + PyObject *SHROUD_UNUSED(self), + PyObject *args, + PyObject *kwds) +{ +// splicer begin function.default_args_in_out + Py_ssize_t SH_nargs = 0; + int in1; + int out1; + int out2; + bool flag; + PyObject * SHPy_flag; + const char *SHT_kwlist[] = { + "in1", + "flag", + nullptr }; + PyObject *SHTPy_rv = nullptr; // return value object + + if (args != nullptr) SH_nargs += PyTuple_Size(args); + if (kwds != nullptr) SH_nargs += PyDict_Size(args); + if (!PyArg_ParseTupleAndKeywords(args, kwds, + "i|O!:defaultArgsInOut", const_cast(SHT_kwlist), &in1, + &PyBool_Type, &SHPy_flag)) + return nullptr; + switch (SH_nargs) { + case 1: + defaultArgsInOut(in1, &out1, &out2); + break; + case 2: + { + // pre_call + flag = PyObject_IsTrue(SHPy_flag); + + defaultArgsInOut(in1, &out1, &out2, flag); + break; + } + default: + PyErr_SetString(PyExc_ValueError, "Wrong number of arguments"); + return nullptr; + } + + // post_call + SHTPy_rv = Py_BuildValue("ii", out1, out2); + + return SHTPy_rv; +// splicer end function.default_args_in_out +} static PyMethodDef PY_methods[] = { {"passStructByReference", (PyCFunction)PY_passStructByReference, METH_VARARGS|METH_KEYWORDS, PY_passStructByReference__doc__}, @@ -515,6 +585,8 @@ static PyMethodDef PY_methods[] = { PY_passStructByReferenceOutCls__doc__}, {"defaultPtrIsNULL", (PyCFunction)PY_defaultPtrIsNULL_1, METH_VARARGS|METH_KEYWORDS, PY_defaultPtrIsNULL_1__doc__}, +{"defaultArgsInOut", (PyCFunction)PY_defaultArgsInOut_1, + METH_VARARGS|METH_KEYWORDS, PY_defaultArgsInOut_1__doc__}, {nullptr, (PyCFunction)nullptr, 0, nullptr} /* sentinel */ }; diff --git a/regression/reference/cxxlibrary/pycxxlibrarymodule.hpp b/regression/reference/cxxlibrary/pycxxlibrarymodule.hpp index 4602911b9..1f49b8369 100644 --- a/regression/reference/cxxlibrary/pycxxlibrarymodule.hpp +++ b/regression/reference/cxxlibrary/pycxxlibrarymodule.hpp @@ -1,5 +1,5 @@ // pycxxlibrarymodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cxxlibrary/pycxxlibraryutil.cpp b/regression/reference/cxxlibrary/pycxxlibraryutil.cpp index 0cf85789d..ec69e147e 100644 --- a/regression/reference/cxxlibrary/pycxxlibraryutil.cpp +++ b/regression/reference/cxxlibrary/pycxxlibraryutil.cpp @@ -1,5 +1,5 @@ // pycxxlibraryutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cxxlibrary/setup.py b/regression/reference/cxxlibrary/setup.py index fca7d1edf..0e7711bd2 100644 --- a/regression/reference/cxxlibrary/setup.py +++ b/regression/reference/cxxlibrary/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cxxlibrary/typescxxlibrary.h b/regression/reference/cxxlibrary/typescxxlibrary.h index f7fccb1be..939f35c8e 100644 --- a/regression/reference/cxxlibrary/typescxxlibrary.h +++ b/regression/reference/cxxlibrary/typescxxlibrary.h @@ -1,5 +1,5 @@ // typescxxlibrary.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/cxxlibrary/wrapcxxlibrary.cpp b/regression/reference/cxxlibrary/wrapcxxlibrary.cpp index 67b253ce0..4caa8c8f7 100644 --- a/regression/reference/cxxlibrary/wrapcxxlibrary.cpp +++ b/regression/reference/cxxlibrary/wrapcxxlibrary.cpp @@ -1,5 +1,5 @@ // wrapcxxlibrary.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -123,6 +123,57 @@ bool CXX_default_ptr_is_null_1(double * data) // splicer end function.default_ptr_is_null_1 } +// ---------------------------------------- +// Function: void defaultArgsInOut +// Requested: c +// Match: c_default +// ---------------------------------------- +// Argument: int in1 +intent(in)+value +// Requested: c_native_scalar_in +// Match: c_default +// ---------------------------------------- +// Argument: int * out1 +intent(out) +// Requested: c_native_*_out +// Match: c_default +// ---------------------------------------- +// Argument: int * out2 +intent(out) +// Requested: c_native_*_out +// Match: c_default +void CXX_default_args_in_out_0(int in1, int * out1, int * out2) +{ + // splicer begin function.default_args_in_out_0 + defaultArgsInOut(in1, out1, out2); + // splicer end function.default_args_in_out_0 +} + +// ---------------------------------------- +// Function: void defaultArgsInOut +// Requested: c +// Match: c_default +// ---------------------------------------- +// Argument: int in1 +intent(in)+value +// Requested: c_native_scalar_in +// Match: c_default +// ---------------------------------------- +// Argument: int * out1 +intent(out) +// Requested: c_native_*_out +// Match: c_default +// ---------------------------------------- +// Argument: int * out2 +intent(out) +// Requested: c_native_*_out +// Match: c_default +// ---------------------------------------- +// Argument: bool flag=false +intent(in)+value +// Requested: c_bool_scalar_in +// Match: c_default +void CXX_default_args_in_out_1(int in1, int * out1, int * out2, + bool flag) +{ + // splicer begin function.default_args_in_out_1 + defaultArgsInOut(in1, out1, out2, flag); + // splicer end function.default_args_in_out_1 +} + // Release library allocated memory. void CXX_SHROUD_memory_destructor(CXX_SHROUD_capsule_data *cap) { diff --git a/regression/reference/cxxlibrary/wrapcxxlibrary.h b/regression/reference/cxxlibrary/wrapcxxlibrary.h index 61043fa76..58cca3d7d 100644 --- a/regression/reference/cxxlibrary/wrapcxxlibrary.h +++ b/regression/reference/cxxlibrary/wrapcxxlibrary.h @@ -1,5 +1,5 @@ // wrapcxxlibrary.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -49,6 +49,11 @@ bool CXX_default_ptr_is_null_0(void); bool CXX_default_ptr_is_null_1(double * data); +void CXX_default_args_in_out_0(int in1, int * out1, int * out2); + +void CXX_default_args_in_out_1(int in1, int * out1, int * out2, + bool flag); + #ifdef __cplusplus } #endif diff --git a/regression/reference/cxxlibrary/wrapfcxxlibrary.f b/regression/reference/cxxlibrary/wrapfcxxlibrary.f index a7761de22..89001db6b 100644 --- a/regression/reference/cxxlibrary/wrapfcxxlibrary.f +++ b/regression/reference/cxxlibrary/wrapfcxxlibrary.f @@ -1,5 +1,5 @@ ! wrapfcxxlibrary.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -124,10 +124,70 @@ function c_default_ptr_is_null_1(data) & logical(C_BOOL) :: SHT_rv end function c_default_ptr_is_null_1 + ! ---------------------------------------- + ! Function: void defaultArgsInOut + ! Requested: c_void_scalar_result + ! Match: c_default + ! ---------------------------------------- + ! Argument: int in1 +intent(in)+value + ! Requested: c_native_scalar_in + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * out1 +intent(out) + ! Requested: c_native_*_out + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * out2 +intent(out) + ! Requested: c_native_*_out + ! Match: c_default + subroutine c_default_args_in_out_0(in1, out1, out2) & + bind(C, name="CXX_default_args_in_out_0") + use iso_c_binding, only : C_INT + implicit none + integer(C_INT), value, intent(IN) :: in1 + integer(C_INT), intent(OUT) :: out1 + integer(C_INT), intent(OUT) :: out2 + end subroutine c_default_args_in_out_0 + + ! ---------------------------------------- + ! Function: void defaultArgsInOut + ! Requested: c_void_scalar_result + ! Match: c_default + ! ---------------------------------------- + ! Argument: int in1 +intent(in)+value + ! Requested: c_native_scalar_in + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * out1 +intent(out) + ! Requested: c_native_*_out + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * out2 +intent(out) + ! Requested: c_native_*_out + ! Match: c_default + ! ---------------------------------------- + ! Argument: bool flag=false +intent(in)+value + ! Requested: c_bool_scalar_in + ! Match: c_default + subroutine c_default_args_in_out_1(in1, out1, out2, flag) & + bind(C, name="CXX_default_args_in_out_1") + use iso_c_binding, only : C_BOOL, C_INT + implicit none + integer(C_INT), value, intent(IN) :: in1 + integer(C_INT), intent(OUT) :: out1 + integer(C_INT), intent(OUT) :: out2 + logical(C_BOOL), value, intent(IN) :: flag + end subroutine c_default_args_in_out_1 + ! splicer begin additional_interfaces ! splicer end additional_interfaces end interface + interface default_args_in_out + module procedure default_args_in_out_0 + module procedure default_args_in_out_1 + end interface default_args_in_out + interface default_ptr_is_null module procedure default_ptr_is_null_0 module procedure default_ptr_is_null_1 @@ -175,6 +235,86 @@ function default_ptr_is_null_1(data) & ! splicer end function.default_ptr_is_null_1 end function default_ptr_is_null_1 + ! Generated by has_default_arg + ! ---------------------------------------- + ! Function: void defaultArgsInOut + ! void defaultArgsInOut + ! Requested: f_subroutine + ! Match: f_default + ! Requested: c + ! Match: c_default + ! ---------------------------------------- + ! Argument: int in1 +intent(in)+value + ! Requested: f_native_scalar_in + ! Match: f_default + ! Requested: c_native_scalar_in + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * out1 +intent(out) + ! Requested: f_native_*_out + ! Match: f_default + ! Requested: c_native_*_out + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * out2 +intent(out) + ! Requested: f_native_*_out + ! Match: f_default + ! Requested: c_native_*_out + ! Match: c_default + subroutine default_args_in_out_0(in1, out1, out2) + use iso_c_binding, only : C_INT + integer(C_INT), value, intent(IN) :: in1 + integer(C_INT), intent(OUT) :: out1 + integer(C_INT), intent(OUT) :: out2 + ! splicer begin function.default_args_in_out_0 + call c_default_args_in_out_0(in1, out1, out2) + ! splicer end function.default_args_in_out_0 + end subroutine default_args_in_out_0 + + ! ---------------------------------------- + ! Function: void defaultArgsInOut + ! void defaultArgsInOut + ! Requested: f_subroutine + ! Match: f_default + ! Requested: c + ! Match: c_default + ! ---------------------------------------- + ! Argument: int in1 +intent(in)+value + ! Requested: f_native_scalar_in + ! Match: f_default + ! Requested: c_native_scalar_in + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * out1 +intent(out) + ! Requested: f_native_*_out + ! Match: f_default + ! Requested: c_native_*_out + ! Match: c_default + ! ---------------------------------------- + ! Argument: int * out2 +intent(out) + ! Requested: f_native_*_out + ! Match: f_default + ! Requested: c_native_*_out + ! Match: c_default + ! ---------------------------------------- + ! Argument: bool flag=false +intent(in)+value + ! Requested: f_bool_scalar_in + ! Match: f_bool_in + ! Requested: c_bool_scalar_in + ! Match: c_default + subroutine default_args_in_out_1(in1, out1, out2, flag) + use iso_c_binding, only : C_BOOL, C_INT + integer(C_INT), value, intent(IN) :: in1 + integer(C_INT), intent(OUT) :: out1 + integer(C_INT), intent(OUT) :: out2 + logical, value, intent(IN) :: flag + ! splicer begin function.default_args_in_out_1 + logical(C_BOOL) SH_flag + SH_flag = flag ! coerce to C_BOOL + call c_default_args_in_out_1(in1, out1, out2, SH_flag) + ! splicer end function.default_args_in_out_1 + end subroutine default_args_in_out_1 + ! splicer begin additional_functions ! splicer end additional_functions diff --git a/regression/reference/debugfalse/luaTutorialmodule.cpp b/regression/reference/debugfalse/luaTutorialmodule.cpp index c869b8687..9f977212b 100644 --- a/regression/reference/debugfalse/luaTutorialmodule.cpp +++ b/regression/reference/debugfalse/luaTutorialmodule.cpp @@ -1,5 +1,5 @@ // luaTutorialmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/luaTutorialmodule.hpp b/regression/reference/debugfalse/luaTutorialmodule.hpp index 160f1788e..a2279747f 100644 --- a/regression/reference/debugfalse/luaTutorialmodule.hpp +++ b/regression/reference/debugfalse/luaTutorialmodule.hpp @@ -1,5 +1,5 @@ // luaTutorialmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/pyTutorialmodule.cpp b/regression/reference/debugfalse/pyTutorialmodule.cpp index 14431131d..3e4d8fa3d 100644 --- a/regression/reference/debugfalse/pyTutorialmodule.cpp +++ b/regression/reference/debugfalse/pyTutorialmodule.cpp @@ -1,5 +1,5 @@ // pyTutorialmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/pyTutorialmodule.hpp b/regression/reference/debugfalse/pyTutorialmodule.hpp index d43a9e375..d04928034 100644 --- a/regression/reference/debugfalse/pyTutorialmodule.hpp +++ b/regression/reference/debugfalse/pyTutorialmodule.hpp @@ -1,5 +1,5 @@ // pyTutorialmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/setup.py b/regression/reference/debugfalse/setup.py index 565608948..71cc4d33e 100644 --- a/regression/reference/debugfalse/setup.py +++ b/regression/reference/debugfalse/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/tutorial.json b/regression/reference/debugfalse/tutorial.json index 5cbe40e0e..cdafdba03 100644 --- a/regression/reference/debugfalse/tutorial.json +++ b/regression/reference/debugfalse/tutorial.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -422,7 +422,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -553,9 +553,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "TUT_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_*_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_*_result_allocatable", "stmtc0": "c_string_*_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -1053,7 +1054,7 @@ "cxx_var": "arg2", "data_var": "SHData_arg2", "numpy_type": "NPY_BOOL", - "py_type": "PyObject", + "py_object": "PyObject", "py_var": "SHPy_arg2", "size_var": "SHSize_arg2", "stmt0": "py_bool_scalar_in", diff --git a/regression/reference/debugfalse/typesTutorial.h b/regression/reference/debugfalse/typesTutorial.h index 5deafff17..7a9515e36 100644 --- a/regression/reference/debugfalse/typesTutorial.h +++ b/regression/reference/debugfalse/typesTutorial.h @@ -1,5 +1,5 @@ // typesTutorial.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/utilTutorial.cpp b/regression/reference/debugfalse/utilTutorial.cpp index cf1930e2f..0ef1a0cc4 100644 --- a/regression/reference/debugfalse/utilTutorial.cpp +++ b/regression/reference/debugfalse/utilTutorial.cpp @@ -1,5 +1,5 @@ // utilTutorial.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/wrapTutorial.cpp b/regression/reference/debugfalse/wrapTutorial.cpp index 369da4aac..8456638f1 100644 --- a/regression/reference/debugfalse/wrapTutorial.cpp +++ b/regression/reference/debugfalse/wrapTutorial.cpp @@ -1,5 +1,5 @@ // wrapTutorial.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/wrapTutorial.h b/regression/reference/debugfalse/wrapTutorial.h index 4e26c2f34..caf782cef 100644 --- a/regression/reference/debugfalse/wrapTutorial.h +++ b/regression/reference/debugfalse/wrapTutorial.h @@ -1,5 +1,5 @@ // wrapTutorial.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/debugfalse/wrapftutorial.f b/regression/reference/debugfalse/wrapftutorial.f index 87a5a6af9..2852af65f 100644 --- a/regression/reference/debugfalse/wrapftutorial.f +++ b/regression/reference/debugfalse/wrapftutorial.f @@ -1,5 +1,5 @@ ! wrapftutorial.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,16 +22,16 @@ module tutorial_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: TUT_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type TUT_SHROUD_capsule_data ! start array_context ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: TUT_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(TUT_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,7 +43,7 @@ module tutorial_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type TUT_SHROUD_array ! end array_context ! enum tutorial::Color @@ -88,13 +88,13 @@ subroutine c_concatenate_strings_bufferify(arg1, Larg1, arg2, & Larg2, DSHF_rv) & bind(C, name="TUT_concatenate_strings_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SHROUD_array + import :: TUT_SHROUD_array implicit none character(kind=C_CHAR), intent(IN) :: arg1(*) integer(C_INT), value, intent(IN) :: Larg1 character(kind=C_CHAR), intent(IN) :: arg2(*) integer(C_INT), value, intent(IN) :: Larg2 - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(TUT_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_concatenate_strings_bufferify end interface @@ -434,14 +434,14 @@ end subroutine all_test1 interface ! helper copy_string ! Copy the char* or std::string in context into c_var. - subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & + subroutine TUT_SHROUD_copy_string_and_free(context, c_var, c_var_size) & bind(c,name="TUT_ShroudCopyStringAndFree") use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import TUT_SHROUD_array + type(TUT_SHROUD_array), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_string_and_free + end subroutine TUT_SHROUD_copy_string_and_free end interface contains @@ -455,14 +455,14 @@ function concatenate_strings(arg1, arg2) & use iso_c_binding, only : C_INT character(len=*), intent(IN) :: arg1 character(len=*), intent(IN) :: arg2 - type(SHROUD_array) :: DSHF_rv + type(TUT_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.concatenate_strings call c_concatenate_strings_bufferify(arg1, & len_trim(arg1, kind=C_INT), arg2, & len_trim(arg2, kind=C_INT), DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call TUT_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.concatenate_strings end function concatenate_strings diff --git a/regression/reference/enum-c/enum.json b/regression/reference/enum-c/enum.json index 7012df724..e274af0ba 100644 --- a/regression/reference/enum-c/enum.json +++ b/regression/reference/enum-c/enum.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/enum-c/pyenummodule.c b/regression/reference/enum-c/pyenummodule.c index 6cbfa4305..bf0573042 100644 --- a/regression/reference/enum-c/pyenummodule.c +++ b/regression/reference/enum-c/pyenummodule.c @@ -1,5 +1,5 @@ // pyenummodule.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-c/pyenummodule.h b/regression/reference/enum-c/pyenummodule.h index bff23c902..a73c14678 100644 --- a/regression/reference/enum-c/pyenummodule.h +++ b/regression/reference/enum-c/pyenummodule.h @@ -1,5 +1,5 @@ // pyenummodule.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-c/setup.py b/regression/reference/enum-c/setup.py index 03bf2fa9c..15fb9564e 100644 --- a/regression/reference/enum-c/setup.py +++ b/regression/reference/enum-c/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-c/typesenum.h b/regression/reference/enum-c/typesenum.h index 85e40825e..88e3cfb30 100644 --- a/regression/reference/enum-c/typesenum.h +++ b/regression/reference/enum-c/typesenum.h @@ -1,5 +1,5 @@ // typesenum.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-c/wrapenum.c b/regression/reference/enum-c/wrapenum.c index 6abde1cf2..e11a10af2 100644 --- a/regression/reference/enum-c/wrapenum.c +++ b/regression/reference/enum-c/wrapenum.c @@ -1,5 +1,5 @@ // wrapenum.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-c/wrapenum.h b/regression/reference/enum-c/wrapenum.h index df7af02ed..20b3fbb9d 100644 --- a/regression/reference/enum-c/wrapenum.h +++ b/regression/reference/enum-c/wrapenum.h @@ -1,5 +1,5 @@ // wrapenum.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-c/wrapfenum.f b/regression/reference/enum-c/wrapfenum.f index 36bca7ed7..38548ced4 100644 --- a/regression/reference/enum-c/wrapfenum.f +++ b/regression/reference/enum-c/wrapfenum.f @@ -1,5 +1,5 @@ ! wrapfenum.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-cxx/enum.json b/regression/reference/enum-cxx/enum.json index 24a583a8a..a81312ec0 100644 --- a/regression/reference/enum-cxx/enum.json +++ b/regression/reference/enum-cxx/enum.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/enum-cxx/pyenummodule.cpp b/regression/reference/enum-cxx/pyenummodule.cpp index e26ecd5c7..63e612cc3 100644 --- a/regression/reference/enum-cxx/pyenummodule.cpp +++ b/regression/reference/enum-cxx/pyenummodule.cpp @@ -1,5 +1,5 @@ // pyenummodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-cxx/pyenummodule.hpp b/regression/reference/enum-cxx/pyenummodule.hpp index a4cf446a9..675024507 100644 --- a/regression/reference/enum-cxx/pyenummodule.hpp +++ b/regression/reference/enum-cxx/pyenummodule.hpp @@ -1,5 +1,5 @@ // pyenummodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-cxx/setup.py b/regression/reference/enum-cxx/setup.py index 7c444273f..8bc0c15ac 100644 --- a/regression/reference/enum-cxx/setup.py +++ b/regression/reference/enum-cxx/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-cxx/typesenum.h b/regression/reference/enum-cxx/typesenum.h index 9ced9604c..fee4e843b 100644 --- a/regression/reference/enum-cxx/typesenum.h +++ b/regression/reference/enum-cxx/typesenum.h @@ -1,5 +1,5 @@ // typesenum.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-cxx/wrapenum.cpp b/regression/reference/enum-cxx/wrapenum.cpp index ddaf1153d..d79dc1b6c 100644 --- a/regression/reference/enum-cxx/wrapenum.cpp +++ b/regression/reference/enum-cxx/wrapenum.cpp @@ -1,5 +1,5 @@ // wrapenum.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-cxx/wrapenum.h b/regression/reference/enum-cxx/wrapenum.h index 940576d95..cd6c36657 100644 --- a/regression/reference/enum-cxx/wrapenum.h +++ b/regression/reference/enum-cxx/wrapenum.h @@ -1,5 +1,5 @@ // wrapenum.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/enum-cxx/wrapfenum.f b/regression/reference/enum-cxx/wrapfenum.f index 36bca7ed7..38548ced4 100644 --- a/regression/reference/enum-cxx/wrapfenum.f +++ b/regression/reference/enum-cxx/wrapfenum.f @@ -1,5 +1,5 @@ ! wrapfenum.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/example.json b/regression/reference/example/example.json index c2d6ec14a..95600cc6e 100644 --- a/regression/reference/example/example.json +++ b/regression/reference/example/example.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -43,7 +43,7 @@ "C_impl_filename": "wrapexample_nested_ExClass1.cpp", "C_name_scope": "example_nested_ExClass1_", "C_type_name": "AA_example_nested_ExClass1", - "F_capsule_data_type": "SHROUD_exclass1_capsule", + "F_capsule_data_type": "AA_SHROUD_exclass1_capsule", "F_derived_name": "exclass1", "F_name_scope": "exclass1_", "LUA_class_reg": "l_ExClass1_Reg", @@ -679,7 +679,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -783,9 +783,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "AA_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -1511,7 +1512,7 @@ "cxx_var": "in", "data_var": "SHData_in", "numpy_type": "NPY_BOOL", - "py_type": "PyObject", + "py_object": "PyObject", "py_var": "SHPy_in", "size_var": "SHSize_in", "stmt0": "py_bool_scalar_in", @@ -1691,7 +1692,7 @@ "C_impl_filename": "wrapexample_nested_ExClass2.cpp", "C_name_scope": "example_nested_ExClass2_", "C_type_name": "AA_example_nested_ExClass2", - "F_capsule_data_type": "SHROUD_exclass2_capsule", + "F_capsule_data_type": "AA_SHROUD_exclass2_capsule", "F_derived_name": "exclass2", "F_name_scope": "exclass2_", "LUA_class_reg": "l_ExClass2_Reg", @@ -2276,7 +2277,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -2379,9 +2380,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "AA_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -2483,7 +2485,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -2586,9 +2588,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "AA_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -2690,7 +2693,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -2792,9 +2795,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "AA_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -3029,7 +3033,7 @@ "cxx_var": "in", "data_var": "SHData_in", "numpy_type": null, - "py_type": "PP_ExClass1", + "py_object": "PP_ExClass1", "py_var": "SHPy_in", "size_var": "SHSize_in", "stmt0": "py_shadow_*_in", diff --git a/regression/reference/example/luaUserLibrarymodule.cpp b/regression/reference/example/luaUserLibrarymodule.cpp index 839bbe457..0ba0eefd9 100644 --- a/regression/reference/example/luaUserLibrarymodule.cpp +++ b/regression/reference/example/luaUserLibrarymodule.cpp @@ -1,5 +1,5 @@ // luaUserLibrarymodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/luaUserLibrarymodule.hpp b/regression/reference/example/luaUserLibrarymodule.hpp index 07a8e3499..762dedb5f 100644 --- a/regression/reference/example/luaUserLibrarymodule.hpp +++ b/regression/reference/example/luaUserLibrarymodule.hpp @@ -1,5 +1,5 @@ // luaUserLibrarymodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/pyUserLibrary_example_nestedmodule.cpp b/regression/reference/example/pyUserLibrary_example_nestedmodule.cpp index 8a0ed8c8d..6d119f3d7 100644 --- a/regression/reference/example/pyUserLibrary_example_nestedmodule.cpp +++ b/regression/reference/example/pyUserLibrary_example_nestedmodule.cpp @@ -1,5 +1,5 @@ // pyUserLibrary_example_nestedmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/pyUserLibrary_examplemodule.cpp b/regression/reference/example/pyUserLibrary_examplemodule.cpp index a414631f5..9c71d8df2 100644 --- a/regression/reference/example/pyUserLibrary_examplemodule.cpp +++ b/regression/reference/example/pyUserLibrary_examplemodule.cpp @@ -1,5 +1,5 @@ // pyUserLibrary_examplemodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/pyUserLibrarymodule.cpp b/regression/reference/example/pyUserLibrarymodule.cpp index 38c743273..b83591fa6 100644 --- a/regression/reference/example/pyUserLibrarymodule.cpp +++ b/regression/reference/example/pyUserLibrarymodule.cpp @@ -1,5 +1,5 @@ // pyUserLibrarymodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/pyUserLibrarymodule.hpp b/regression/reference/example/pyUserLibrarymodule.hpp index 43c8450ae..97f6b686e 100644 --- a/regression/reference/example/pyUserLibrarymodule.hpp +++ b/regression/reference/example/pyUserLibrarymodule.hpp @@ -1,5 +1,5 @@ // pyUserLibrarymodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/pyUserLibraryutil.cpp b/regression/reference/example/pyUserLibraryutil.cpp index f588878bd..f510ed2cf 100644 --- a/regression/reference/example/pyUserLibraryutil.cpp +++ b/regression/reference/example/pyUserLibraryutil.cpp @@ -1,5 +1,5 @@ // pyUserLibraryutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/pyexample_nested_ExClass1type.cpp b/regression/reference/example/pyexample_nested_ExClass1type.cpp index ab62c594e..eec4cb0a0 100644 --- a/regression/reference/example/pyexample_nested_ExClass1type.cpp +++ b/regression/reference/example/pyexample_nested_ExClass1type.cpp @@ -1,5 +1,5 @@ // pyexample_nested_ExClass1type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/pyexample_nested_ExClass2type.cpp b/regression/reference/example/pyexample_nested_ExClass2type.cpp index b4b8817eb..cebea32bc 100644 --- a/regression/reference/example/pyexample_nested_ExClass2type.cpp +++ b/regression/reference/example/pyexample_nested_ExClass2type.cpp @@ -1,5 +1,5 @@ // pyexample_nested_ExClass2type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/setup.py b/regression/reference/example/setup.py index d6d71bb1c..6d245f7a4 100644 --- a/regression/reference/example/setup.py +++ b/regression/reference/example/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/typesUserLibrary.h b/regression/reference/example/typesUserLibrary.h index a88f8765d..9fba333fa 100644 --- a/regression/reference/example/typesUserLibrary.h +++ b/regression/reference/example/typesUserLibrary.h @@ -1,5 +1,5 @@ // typesUserLibrary.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/userlibrary_types.yaml b/regression/reference/example/userlibrary_types.yaml index ada5f9cca..c9b309618 100644 --- a/regression/reference/example/userlibrary_types.yaml +++ b/regression/reference/example/userlibrary_types.yaml @@ -1,5 +1,5 @@ # userlibrary_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -20,7 +20,7 @@ typemap: c_type: AA_example_nested_ExClass1 f_module_name: userlibrary_example_nested_mod f_derived_type: exclass1 - f_capsule_data_type: SHROUD_exclass1_capsule + f_capsule_data_type: AA_SHROUD_exclass1_capsule f_to_c: "{f_var}%cxxmem" - type: ExClass2 fields: @@ -30,5 +30,5 @@ typemap: c_type: AA_example_nested_ExClass2 f_module_name: userlibrary_example_nested_mod f_derived_type: exclass2 - f_capsule_data_type: SHROUD_exclass2_capsule + f_capsule_data_type: AA_SHROUD_exclass2_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/example/utilUserLibrary.cpp b/regression/reference/example/utilUserLibrary.cpp index de9e022dd..caf8d9182 100644 --- a/regression/reference/example/utilUserLibrary.cpp +++ b/regression/reference/example/utilUserLibrary.cpp @@ -1,5 +1,5 @@ // utilUserLibrary.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapUserLibrary.cpp b/regression/reference/example/wrapUserLibrary.cpp index d12d610e0..53ccc3f29 100644 --- a/regression/reference/example/wrapUserLibrary.cpp +++ b/regression/reference/example/wrapUserLibrary.cpp @@ -1,5 +1,5 @@ // wrapUserLibrary.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapUserLibrary_example_nested.cpp b/regression/reference/example/wrapUserLibrary_example_nested.cpp index 3c5c80305..bacee8a6f 100644 --- a/regression/reference/example/wrapUserLibrary_example_nested.cpp +++ b/regression/reference/example/wrapUserLibrary_example_nested.cpp @@ -1,5 +1,5 @@ // wrapUserLibrary_example_nested.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapUserLibrary_example_nested.h b/regression/reference/example/wrapUserLibrary_example_nested.h index 63ef00bd0..8390bf2c4 100644 --- a/regression/reference/example/wrapUserLibrary_example_nested.h +++ b/regression/reference/example/wrapUserLibrary_example_nested.h @@ -1,5 +1,5 @@ // wrapUserLibrary_example_nested.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapexample_nested_ExClass1.cpp b/regression/reference/example/wrapexample_nested_ExClass1.cpp index 268177503..3ee04d3fb 100644 --- a/regression/reference/example/wrapexample_nested_ExClass1.cpp +++ b/regression/reference/example/wrapexample_nested_ExClass1.cpp @@ -1,5 +1,5 @@ // wrapexample_nested_ExClass1.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapexample_nested_ExClass1.h b/regression/reference/example/wrapexample_nested_ExClass1.h index 4e9b12f48..9fbc35530 100644 --- a/regression/reference/example/wrapexample_nested_ExClass1.h +++ b/regression/reference/example/wrapexample_nested_ExClass1.h @@ -1,5 +1,5 @@ // wrapexample_nested_ExClass1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapexample_nested_ExClass2.cpp b/regression/reference/example/wrapexample_nested_ExClass2.cpp index d761f1cce..d0e517241 100644 --- a/regression/reference/example/wrapexample_nested_ExClass2.cpp +++ b/regression/reference/example/wrapexample_nested_ExClass2.cpp @@ -1,5 +1,5 @@ // wrapexample_nested_ExClass2.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapexample_nested_ExClass2.h b/regression/reference/example/wrapexample_nested_ExClass2.h index 006661d6e..f1de45172 100644 --- a/regression/reference/example/wrapexample_nested_ExClass2.h +++ b/regression/reference/example/wrapexample_nested_ExClass2.h @@ -1,5 +1,5 @@ // wrapexample_nested_ExClass2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapfUserLibrary_example.f b/regression/reference/example/wrapfUserLibrary_example.f index bacab3c3f..6cefcc4b2 100644 --- a/regression/reference/example/wrapfUserLibrary_example.f +++ b/regression/reference/example/wrapfUserLibrary_example.f @@ -1,5 +1,5 @@ ! wrapfUserLibrary_example.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/example/wrapfUserLibrary_example_nested.f b/regression/reference/example/wrapfUserLibrary_example_nested.f index d93d440d6..5a779bc41 100644 --- a/regression/reference/example/wrapfUserLibrary_example_nested.f +++ b/regression/reference/example/wrapfUserLibrary_example_nested.f @@ -1,5 +1,5 @@ ! wrapfUserLibrary_example_nested.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -23,15 +23,15 @@ module userlibrary_example_nested_mod ! splicer end namespace.example::nested.module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: AA_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type AA_SHROUD_capsule_data ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: AA_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(AA_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,15 +43,15 @@ module userlibrary_example_nested_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type AA_SHROUD_array - type, bind(C) :: SHROUD_exclass1_capsule + type, bind(C) :: AA_SHROUD_exclass1_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_exclass1_capsule + end type AA_SHROUD_exclass1_capsule type exclass1 - type(SHROUD_exclass1_capsule) :: cxxmem + type(AA_SHROUD_exclass1_capsule) :: cxxmem ! splicer begin namespace.example::nested.class.ExClass1.component_part component part 1a component part 1b @@ -73,13 +73,13 @@ module userlibrary_example_nested_mod ! splicer end namespace.example::nested.class.ExClass1.type_bound_procedure_part end type exclass1 - type, bind(C) :: SHROUD_exclass2_capsule + type, bind(C) :: AA_SHROUD_exclass2_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_exclass2_capsule + end type AA_SHROUD_exclass2_capsule type exclass2 - type(SHROUD_exclass2_capsule) :: cxxmem + type(AA_SHROUD_exclass2_capsule) :: cxxmem ! splicer begin namespace.example::nested.class.ExClass2.component_part ! splicer end namespace.example::nested.class.ExClass2.component_part contains @@ -178,9 +178,9 @@ function c_exclass1_ctor_0(SHT_crv) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_ctor_0") use iso_c_binding, only : C_PTR - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(OUT) :: SHT_crv + type(AA_SHROUD_exclass1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_exclass1_ctor_0 @@ -195,10 +195,10 @@ function c_exclass1_ctor_1(name, SHT_crv) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_ctor_1") use iso_c_binding, only : C_CHAR, C_PTR - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none character(kind=C_CHAR), intent(IN) :: name(*) - type(SHROUD_exclass1_capsule), intent(OUT) :: SHT_crv + type(AA_SHROUD_exclass1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_exclass1_ctor_1 @@ -214,11 +214,11 @@ function c_exclass1_ctor_1_bufferify(name, Lname, SHT_crv) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_ctor_1_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none character(kind=C_CHAR), intent(IN) :: name(*) integer(C_INT), value, intent(IN) :: Lname - type(SHROUD_exclass1_capsule), intent(OUT) :: SHT_crv + type(AA_SHROUD_exclass1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_exclass1_ctor_1_bufferify @@ -228,9 +228,9 @@ end function c_exclass1_ctor_1_bufferify ! Match: c_default subroutine c_exclass1_dtor(self) & bind(C, name="AA_example_nested_ExClass1_dtor") - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self end subroutine c_exclass1_dtor ! ---------------------------------------- @@ -245,9 +245,9 @@ function c_exclass1_increment_count(self, incr) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_increment_count") use iso_c_binding, only : C_INT - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: incr integer(C_INT) :: SHT_rv end function c_exclass1_increment_count @@ -260,9 +260,9 @@ pure function c_exclass1_get_name_error_check(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_get_name_error_check") use iso_c_binding, only : C_PTR - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_exclass1_get_name_error_check @@ -277,10 +277,10 @@ end function c_exclass1_get_name_error_check subroutine c_exclass1_get_name_error_check_bufferify(self, & DSHF_rv) & bind(C, name="AA_example_nested_ExClass1_get_name_error_check_bufferify") - import :: SHROUD_array, SHROUD_exclass1_capsule + import :: AA_SHROUD_array, AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_exclass1_get_name_error_check_bufferify ! ---------------------------------------- @@ -291,9 +291,9 @@ pure function c_exclass1_get_name_arg(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_get_name_arg") use iso_c_binding, only : C_PTR - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_exclass1_get_name_arg @@ -308,9 +308,9 @@ end function c_exclass1_get_name_arg subroutine c_exclass1_get_name_arg_bufferify(self, name, Nname) & bind(C, name="AA_example_nested_ExClass1_get_name_arg_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self character(kind=C_CHAR), intent(OUT) :: name(*) integer(C_INT), value, intent(IN) :: Nname end subroutine c_exclass1_get_name_arg_bufferify @@ -327,9 +327,9 @@ function c_exclass1_get_value_from_int(self, value) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_get_value_from_int") use iso_c_binding, only : C_INT - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: value integer(C_INT) :: SHT_rv end function c_exclass1_get_value_from_int @@ -346,9 +346,9 @@ function c_exclass1_get_value_1(self, value) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_get_value_1") use iso_c_binding, only : C_LONG - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self integer(C_LONG), value, intent(IN) :: value integer(C_LONG) :: SHT_rv end function c_exclass1_get_value_1 @@ -365,9 +365,9 @@ function c_exclass1_has_addr(self, in) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass1_has_addr") use iso_c_binding, only : C_BOOL - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self logical(C_BOOL), value, intent(IN) :: in logical(C_BOOL) :: SHT_rv end function c_exclass1_has_addr @@ -378,9 +378,9 @@ end function c_exclass1_has_addr ! Match: c_default subroutine c_exclass1_splicer_special(self) & bind(C, name="AA_example_nested_ExClass1_splicer_special") - import :: SHROUD_exclass1_capsule + import :: AA_SHROUD_exclass1_capsule implicit none - type(SHROUD_exclass1_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: self end subroutine c_exclass1_splicer_special ! splicer begin namespace.example::nested.class.ExClass1.additional_interfaces @@ -397,10 +397,10 @@ function c_exclass2_ctor(name, SHT_crv) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_ctor") use iso_c_binding, only : C_CHAR, C_PTR - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none character(kind=C_CHAR), intent(IN) :: name(*) - type(SHROUD_exclass2_capsule), intent(OUT) :: SHT_crv + type(AA_SHROUD_exclass2_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_exclass2_ctor @@ -416,11 +416,11 @@ function c_exclass2_ctor_bufferify(name, trim_name, SHT_crv) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_ctor_bufferify") use iso_c_binding, only : C_CHAR, C_INT, C_PTR - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none character(kind=C_CHAR), intent(IN) :: name(*) integer(C_INT), value, intent(IN) :: trim_name - type(SHROUD_exclass2_capsule), intent(OUT) :: SHT_crv + type(AA_SHROUD_exclass2_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_exclass2_ctor_bufferify @@ -430,9 +430,9 @@ end function c_exclass2_ctor_bufferify ! Match: c_default subroutine c_exclass2_dtor(self) & bind(C, name="AA_example_nested_ExClass2_dtor") - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self end subroutine c_exclass2_dtor ! ---------------------------------------- @@ -443,9 +443,9 @@ pure function c_exclass2_get_name(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_name") use iso_c_binding, only : C_PTR - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_exclass2_get_name @@ -460,9 +460,9 @@ end function c_exclass2_get_name subroutine c_exclass2_get_name_bufferify(self, SHF_rv, NSHF_rv) & bind(C, name="AA_example_nested_ExClass2_get_name_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self character(kind=C_CHAR), intent(OUT) :: SHF_rv(*) integer(C_INT), value, intent(IN) :: NSHF_rv end subroutine c_exclass2_get_name_bufferify @@ -475,9 +475,9 @@ function c_exclass2_get_name2(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_name2") use iso_c_binding, only : C_PTR - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_exclass2_get_name2 @@ -491,10 +491,10 @@ end function c_exclass2_get_name2 ! Match: c_string_result_buf_allocatable subroutine c_exclass2_get_name2_bufferify(self, DSHF_rv) & bind(C, name="AA_example_nested_ExClass2_get_name2_bufferify") - import :: SHROUD_array, SHROUD_exclass2_capsule + import :: AA_SHROUD_array, AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_exclass2_get_name2_bufferify ! ---------------------------------------- @@ -505,9 +505,9 @@ pure function c_exclass2_get_name3(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_name3") use iso_c_binding, only : C_PTR - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_exclass2_get_name3 @@ -521,10 +521,10 @@ end function c_exclass2_get_name3 ! Match: c_string_result_buf_allocatable subroutine c_exclass2_get_name3_bufferify(self, DSHF_rv) & bind(C, name="AA_example_nested_ExClass2_get_name3_bufferify") - import :: SHROUD_array, SHROUD_exclass2_capsule + import :: AA_SHROUD_array, AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_exclass2_get_name3_bufferify ! ---------------------------------------- @@ -535,9 +535,9 @@ function c_exclass2_get_name4(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_name4") use iso_c_binding, only : C_PTR - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self type(C_PTR) SHT_rv end function c_exclass2_get_name4 @@ -551,10 +551,10 @@ end function c_exclass2_get_name4 ! Match: c_string_result_buf_allocatable subroutine c_exclass2_get_name4_bufferify(self, DSHF_rv) & bind(C, name="AA_example_nested_ExClass2_get_name4_bufferify") - import :: SHROUD_array, SHROUD_exclass2_capsule + import :: AA_SHROUD_array, AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_exclass2_get_name4_bufferify ! ---------------------------------------- @@ -565,9 +565,9 @@ pure function c_exclass2_get_name_length(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_name_length") use iso_c_binding, only : C_INT - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_exclass2_get_name_length @@ -583,11 +583,11 @@ function c_exclass2_get_class1(self, in, SHT_crv) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_class1") use iso_c_binding, only : C_PTR - import :: SHROUD_exclass1_capsule, SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass1_capsule, AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self - type(SHROUD_exclass1_capsule), intent(IN) :: in - type(SHROUD_exclass1_capsule), intent(OUT) :: SHT_crv + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass1_capsule), intent(IN) :: in + type(AA_SHROUD_exclass1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_exclass2_get_class1 @@ -602,9 +602,9 @@ end function c_exclass2_get_class1 subroutine c_exclass2_declare_0(self, type) & bind(C, name="AA_example_nested_ExClass2_declare_0") use iso_c_binding, only : C_INT - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: type end subroutine c_exclass2_declare_0 @@ -623,9 +623,9 @@ end subroutine c_exclass2_declare_0 subroutine c_exclass2_declare_1(self, type, len) & bind(C, name="AA_example_nested_ExClass2_declare_1") use iso_c_binding, only : C_INT, C_LONG - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: type integer(C_LONG), value, intent(IN) :: len end subroutine c_exclass2_declare_1 @@ -636,9 +636,9 @@ end subroutine c_exclass2_declare_1 ! Match: c_default subroutine c_exclass2_destroyall(self) & bind(C, name="AA_example_nested_ExClass2_destroyall") - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self end subroutine c_exclass2_destroyall ! ---------------------------------------- @@ -649,9 +649,9 @@ pure function c_exclass2_get_type_id(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_type_id") use iso_c_binding, only : C_INT - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_exclass2_get_type_id @@ -666,9 +666,9 @@ end function c_exclass2_get_type_id subroutine c_exclass2_set_value_int(self, value) & bind(C, name="AA_example_nested_ExClass2_set_value_int") use iso_c_binding, only : C_INT - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: value end subroutine c_exclass2_set_value_int @@ -683,9 +683,9 @@ end subroutine c_exclass2_set_value_int subroutine c_exclass2_set_value_long(self, value) & bind(C, name="AA_example_nested_ExClass2_set_value_long") use iso_c_binding, only : C_LONG - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self integer(C_LONG), value, intent(IN) :: value end subroutine c_exclass2_set_value_long @@ -700,9 +700,9 @@ end subroutine c_exclass2_set_value_long subroutine c_exclass2_set_value_float(self, value) & bind(C, name="AA_example_nested_ExClass2_set_value_float") use iso_c_binding, only : C_FLOAT - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self real(C_FLOAT), value, intent(IN) :: value end subroutine c_exclass2_set_value_float @@ -717,9 +717,9 @@ end subroutine c_exclass2_set_value_float subroutine c_exclass2_set_value_double(self, value) & bind(C, name="AA_example_nested_ExClass2_set_value_double") use iso_c_binding, only : C_DOUBLE - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self real(C_DOUBLE), value, intent(IN) :: value end subroutine c_exclass2_set_value_double @@ -731,9 +731,9 @@ function c_exclass2_get_value_int(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_value_int") use iso_c_binding, only : C_INT - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_exclass2_get_value_int @@ -745,9 +745,9 @@ function c_exclass2_get_value_double(self) & result(SHT_rv) & bind(C, name="AA_example_nested_ExClass2_get_value_double") use iso_c_binding, only : C_DOUBLE - import :: SHROUD_exclass2_capsule + import :: AA_SHROUD_exclass2_capsule implicit none - type(SHROUD_exclass2_capsule), intent(IN) :: self + type(AA_SHROUD_exclass2_capsule), intent(IN) :: self real(C_DOUBLE) :: SHT_rv end function c_exclass2_get_value_double @@ -1230,14 +1230,14 @@ end subroutine c_cos_doubles interface ! helper copy_string ! Copy the char* or std::string in context into c_var. - subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & + subroutine AA_SHROUD_copy_string_and_free(context, c_var, c_var_size) & bind(c,name="AA_ShroudCopyStringAndFree") use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import AA_SHROUD_array + type(AA_SHROUD_array), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_string_and_free + end subroutine AA_SHROUD_copy_string_and_free end interface contains @@ -1336,26 +1336,24 @@ end function exclass1_increment_count ! ---------------------------------------- ! Function: const string & getNameErrorCheck +deref(allocatable) ! const string & getNameErrorCheck +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getNameErrorCheck ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable function exclass1_get_name_error_check(obj) & result(SHT_rv) class(exclass1) :: obj - type(SHROUD_array) :: DSHF_rv + type(AA_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin namespace.example::nested.class.ExClass1.method.get_name_error_check call c_exclass1_get_name_error_check_bufferify(obj%cxxmem, & DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call AA_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end namespace.example::nested.class.ExClass1.method.get_name_error_check end function exclass1_get_name_error_check @@ -1564,25 +1562,23 @@ end function exclass2_get_name ! ---------------------------------------- ! Function: const string & getName2 +deref(allocatable) ! const string & getName2 +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getName2 ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable function exclass2_get_name2(obj) & result(SHT_rv) class(exclass2) :: obj - type(SHROUD_array) :: DSHF_rv + type(AA_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin namespace.example::nested.class.ExClass2.method.get_name2 call c_exclass2_get_name2_bufferify(obj%cxxmem, DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call AA_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end namespace.example::nested.class.ExClass2.method.get_name2 end function exclass2_get_name2 @@ -1590,25 +1586,23 @@ end function exclass2_get_name2 ! ---------------------------------------- ! Function: string & getName3 +deref(allocatable) ! string & getName3 +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getName3 ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable function exclass2_get_name3(obj) & result(SHT_rv) class(exclass2) :: obj - type(SHROUD_array) :: DSHF_rv + type(AA_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin namespace.example::nested.class.ExClass2.method.get_name3 call c_exclass2_get_name3_bufferify(obj%cxxmem, DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call AA_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end namespace.example::nested.class.ExClass2.method.get_name3 end function exclass2_get_name3 @@ -1616,25 +1610,23 @@ end function exclass2_get_name3 ! ---------------------------------------- ! Function: string & getName4 +deref(allocatable) ! string & getName4 +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getName4 ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable function exclass2_get_name4(obj) & result(SHT_rv) class(exclass2) :: obj - type(SHROUD_array) :: DSHF_rv + type(AA_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin namespace.example::nested.class.ExClass2.method.get_name4 call c_exclass2_get_name4_bufferify(obj%cxxmem, DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call AA_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end namespace.example::nested.class.ExClass2.method.get_name4 end function exclass2_get_name4 diff --git a/regression/reference/example/wrapfuserlibrary.f b/regression/reference/example/wrapfuserlibrary.f index 343dfec76..f78af06a2 100644 --- a/regression/reference/example/wrapfuserlibrary.f +++ b/regression/reference/example/wrapfuserlibrary.f @@ -1,5 +1,5 @@ ! wrapfuserlibrary.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/forward.json b/regression/reference/forward/forward.json index c44ac91ad..3e2d7080a 100644 --- a/regression/reference/forward/forward.json +++ b/regression/reference/forward/forward.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -14,7 +14,7 @@ "C_impl_filename": "wrapClass3.cpp", "C_name_scope": "Class3_", "C_type_name": "FOR_Class3", - "F_capsule_data_type": "SHROUD_class3_capsule", + "F_capsule_data_type": "FOR_SHROUD_class3_capsule", "F_derived_name": "class3", "F_name_scope": "class3_", "LUA_class_reg": "l_Class3_Reg", @@ -50,7 +50,7 @@ "C_impl_filename": "wrapClass2.cpp", "C_name_scope": "Class2_", "C_type_name": "FOR_Class2", - "F_capsule_data_type": "SHROUD_class2_capsule", + "F_capsule_data_type": "FOR_SHROUD_class2_capsule", "F_derived_name": "class2", "F_name_scope": "class2_", "LUA_class_reg": "l_Class2_Reg", @@ -266,7 +266,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PyObject", + "py_object": "PyObject", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_shadow_*_in", @@ -394,7 +394,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Class3", + "py_object": "PY_Class3", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_shadow_*_in", diff --git a/regression/reference/forward/forward_types.yaml b/regression/reference/forward/forward_types.yaml index 07e630820..ed9cf1dc5 100644 --- a/regression/reference/forward/forward_types.yaml +++ b/regression/reference/forward/forward_types.yaml @@ -1,5 +1,5 @@ # forward_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -18,7 +18,7 @@ typemap: c_type: FOR_Class2 f_module_name: forward_mod f_derived_type: class2 - f_capsule_data_type: SHROUD_class2_capsule + f_capsule_data_type: FOR_SHROUD_class2_capsule f_to_c: "{f_var}%cxxmem" - type: Class3 fields: @@ -28,5 +28,5 @@ typemap: c_type: FOR_Class3 f_module_name: forward_mod f_derived_type: class3 - f_capsule_data_type: SHROUD_class3_capsule + f_capsule_data_type: FOR_SHROUD_class3_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/forward/luaforwardmodule.cpp b/regression/reference/forward/luaforwardmodule.cpp index 6208759cb..8b7ce50c5 100644 --- a/regression/reference/forward/luaforwardmodule.cpp +++ b/regression/reference/forward/luaforwardmodule.cpp @@ -1,5 +1,5 @@ // luaforwardmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/luaforwardmodule.hpp b/regression/reference/forward/luaforwardmodule.hpp index 3e605e95f..ccbef52f7 100644 --- a/regression/reference/forward/luaforwardmodule.hpp +++ b/regression/reference/forward/luaforwardmodule.hpp @@ -1,5 +1,5 @@ // luaforwardmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/pyClass2type.cpp b/regression/reference/forward/pyClass2type.cpp index 3acb0f1f4..43bb9a8d7 100644 --- a/regression/reference/forward/pyClass2type.cpp +++ b/regression/reference/forward/pyClass2type.cpp @@ -1,5 +1,5 @@ // pyClass2type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/pyClass3type.cpp b/regression/reference/forward/pyClass3type.cpp index b27af592e..173c1c249 100644 --- a/regression/reference/forward/pyClass3type.cpp +++ b/regression/reference/forward/pyClass3type.cpp @@ -1,5 +1,5 @@ // pyClass3type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/pyforwardmodule.cpp b/regression/reference/forward/pyforwardmodule.cpp index df055b815..7adb8d115 100644 --- a/regression/reference/forward/pyforwardmodule.cpp +++ b/regression/reference/forward/pyforwardmodule.cpp @@ -1,5 +1,5 @@ // pyforwardmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/pyforwardmodule.hpp b/regression/reference/forward/pyforwardmodule.hpp index 2988c6171..1af6fedb8 100644 --- a/regression/reference/forward/pyforwardmodule.hpp +++ b/regression/reference/forward/pyforwardmodule.hpp @@ -1,5 +1,5 @@ // pyforwardmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/pyforwardutil.cpp b/regression/reference/forward/pyforwardutil.cpp index 449dd35ef..ab5fe3de1 100644 --- a/regression/reference/forward/pyforwardutil.cpp +++ b/regression/reference/forward/pyforwardutil.cpp @@ -1,5 +1,5 @@ // pyforwardutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/setup.py b/regression/reference/forward/setup.py index b6dda988e..10b81a538 100644 --- a/regression/reference/forward/setup.py +++ b/regression/reference/forward/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/typesforward.h b/regression/reference/forward/typesforward.h index c72808a07..38fe3fbbf 100644 --- a/regression/reference/forward/typesforward.h +++ b/regression/reference/forward/typesforward.h @@ -1,5 +1,5 @@ // typesforward.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/wrapClass2.cpp b/regression/reference/forward/wrapClass2.cpp index d69f79f50..c9a46370b 100644 --- a/regression/reference/forward/wrapClass2.cpp +++ b/regression/reference/forward/wrapClass2.cpp @@ -1,5 +1,5 @@ // wrapClass2.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/wrapClass2.h b/regression/reference/forward/wrapClass2.h index c08c75cfd..79612e701 100644 --- a/regression/reference/forward/wrapClass2.h +++ b/regression/reference/forward/wrapClass2.h @@ -1,5 +1,5 @@ // wrapClass2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/forward/wrapfforward.f b/regression/reference/forward/wrapfforward.f index bdecc7a3e..af0060e24 100644 --- a/regression/reference/forward/wrapfforward.f +++ b/regression/reference/forward/wrapfforward.f @@ -1,5 +1,5 @@ ! wrapfforward.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -21,13 +21,13 @@ module forward_mod ! splicer begin module_top ! splicer end module_top - type, bind(C) :: SHROUD_class3_capsule + type, bind(C) :: FOR_SHROUD_class3_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class3_capsule + end type FOR_SHROUD_class3_capsule type class3 - type(SHROUD_class3_capsule) :: cxxmem + type(FOR_SHROUD_class3_capsule) :: cxxmem ! splicer begin class.Class3.component_part ! splicer end class.Class3.component_part contains @@ -38,13 +38,13 @@ module forward_mod ! splicer end class.Class3.type_bound_procedure_part end type class3 - type, bind(C) :: SHROUD_class2_capsule + type, bind(C) :: FOR_SHROUD_class2_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class2_capsule + end type FOR_SHROUD_class2_capsule type class2 - type(SHROUD_class2_capsule) :: cxxmem + type(FOR_SHROUD_class2_capsule) :: cxxmem ! splicer begin class.Class2.component_part ! splicer end class.Class2.component_part contains @@ -80,9 +80,9 @@ function c_class2_ctor(SHT_crv) & result(SHT_rv) & bind(C, name="FOR_Class2_ctor") use iso_c_binding, only : C_PTR - import :: SHROUD_class2_capsule + import :: FOR_SHROUD_class2_capsule implicit none - type(SHROUD_class2_capsule), intent(OUT) :: SHT_crv + type(FOR_SHROUD_class2_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_class2_ctor @@ -92,9 +92,9 @@ end function c_class2_ctor ! Match: c_default subroutine c_class2_dtor(self) & bind(C, name="FOR_Class2_dtor") - import :: SHROUD_class2_capsule + import :: FOR_SHROUD_class2_capsule implicit none - type(SHROUD_class2_capsule), intent(IN) :: self + type(FOR_SHROUD_class2_capsule), intent(IN) :: self end subroutine c_class2_dtor ! ---------------------------------------- @@ -108,9 +108,9 @@ end subroutine c_class2_dtor subroutine c_class2_func1(self, arg) & bind(C, name="FOR_Class2_func1") use tutorial_mod, only : SHROUD_class1_capsule - import :: SHROUD_class2_capsule + import :: FOR_SHROUD_class2_capsule implicit none - type(SHROUD_class2_capsule), intent(IN) :: self + type(FOR_SHROUD_class2_capsule), intent(IN) :: self type(SHROUD_class1_capsule), intent(IN) :: arg end subroutine c_class2_func1 @@ -124,10 +124,10 @@ end subroutine c_class2_func1 ! Match: c_shadow_in subroutine c_class2_accept_class3(self, arg) & bind(C, name="FOR_Class2_accept_class3") - import :: SHROUD_class2_capsule, SHROUD_class3_capsule + import :: FOR_SHROUD_class2_capsule, FOR_SHROUD_class3_capsule implicit none - type(SHROUD_class2_capsule), intent(IN) :: self - type(SHROUD_class3_capsule), intent(IN) :: arg + type(FOR_SHROUD_class2_capsule), intent(IN) :: self + type(FOR_SHROUD_class3_capsule), intent(IN) :: arg end subroutine c_class2_accept_class3 ! splicer begin class.Class2.additional_interfaces diff --git a/regression/reference/forward/wrapforward.cpp b/regression/reference/forward/wrapforward.cpp index 957e6d402..213841aa3 100644 --- a/regression/reference/forward/wrapforward.cpp +++ b/regression/reference/forward/wrapforward.cpp @@ -1,5 +1,5 @@ // wrapforward.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/generic/generic.json b/regression/reference/generic/generic.json index e151a6b9e..b90f8e832 100644 --- a/regression/reference/generic/generic.json +++ b/regression/reference/generic/generic.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/generic/typesgeneric.h b/regression/reference/generic/typesgeneric.h index f3cde71d2..77a20ba06 100644 --- a/regression/reference/generic/typesgeneric.h +++ b/regression/reference/generic/typesgeneric.h @@ -1,5 +1,5 @@ // typesgeneric.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/generic/wrapfgeneric.f b/regression/reference/generic/wrapfgeneric.f index 7bf248290..d8cb991b2 100644 --- a/regression/reference/generic/wrapfgeneric.f +++ b/regression/reference/generic/wrapfgeneric.f @@ -1,5 +1,5 @@ ! wrapfgeneric.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/generic/wrapgeneric.c b/regression/reference/generic/wrapgeneric.c index 0c6abda7b..c101cdddc 100644 --- a/regression/reference/generic/wrapgeneric.c +++ b/regression/reference/generic/wrapgeneric.c @@ -1,5 +1,5 @@ // wrapgeneric.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/generic/wrapgeneric.h b/regression/reference/generic/wrapgeneric.h index 955c46625..1b703c357 100644 --- a/regression/reference/generic/wrapgeneric.h +++ b/regression/reference/generic/wrapgeneric.h @@ -1,5 +1,5 @@ // wrapgeneric.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/include.json b/regression/reference/include/include.json index 137876362..23b27e21f 100644 --- a/regression/reference/include/include.json +++ b/regression/reference/include/include.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapClass2.cpp", "C_name_scope": "Class2_", "C_type_name": "LIB_Class2", - "F_capsule_data_type": "SHROUD_class2_capsule", + "F_capsule_data_type": "LIB_SHROUD_class2_capsule", "F_derived_name": "class2", "F_name_scope": "class2_", "class_scope": "Class2::", @@ -317,7 +317,7 @@ "C_impl_filename": "wrapthree_Class1.cpp", "C_name_scope": "three_Class1_", "C_type_name": "LIB_three_Class1", - "F_capsule_data_type": "SHROUD_class1_capsule", + "F_capsule_data_type": "LIB_SHROUD_class1_capsule", "F_derived_name": "class1", "F_name_scope": "class1_", "class_scope": "Class1::", @@ -453,7 +453,7 @@ "C_impl_filename": "wrapouter1_class0.cpp", "C_name_scope": "outer1_class0_", "C_type_name": "LIB_outer1_class0", - "F_capsule_data_type": "SHROUD_class0_capsule", + "F_capsule_data_type": "LIB_SHROUD_class0_capsule", "F_derived_name": "class0", "F_name_scope": "class0_", "class_scope": "class0::", @@ -580,7 +580,7 @@ "C_impl_filename": "wrapouter2_class0.cpp", "C_name_scope": "outer2_class0_", "C_type_name": "LIB_outer2_class0", - "F_capsule_data_type": "SHROUD_class0_capsule", + "F_capsule_data_type": "LIB_SHROUD_class0_capsule", "F_derived_name": "class0", "F_name_scope": "class0_", "class_scope": "class0::", diff --git a/regression/reference/include/library_types.yaml b/regression/reference/include/library_types.yaml index 1a37f75c6..1fe1f5cc2 100644 --- a/regression/reference/include/library_types.yaml +++ b/regression/reference/include/library_types.yaml @@ -1,5 +1,5 @@ # library_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -16,7 +16,7 @@ typemap: c_type: LIB_Class2 f_module_name: library_mod f_derived_type: class2 - f_capsule_data_type: SHROUD_class2_capsule + f_capsule_data_type: LIB_SHROUD_class2_capsule f_to_c: "{f_var}%cxxmem" - namespace: one declarations: one @@ -30,7 +30,7 @@ typemap: c_type: LIB_outer1_class0 f_module_name: library_outer1_mod f_derived_type: class0 - f_capsule_data_type: SHROUD_class0_capsule + f_capsule_data_type: LIB_SHROUD_class0_capsule f_to_c: "{f_var}%cxxmem" - namespace: outer2 declarations: outer2 @@ -42,7 +42,7 @@ typemap: c_type: LIB_outer2_class0 f_module_name: library_outer2_mod f_derived_type: class0 - f_capsule_data_type: SHROUD_class0_capsule + f_capsule_data_type: LIB_SHROUD_class0_capsule f_to_c: "{f_var}%cxxmem" - namespace: three declarations: three @@ -54,5 +54,5 @@ typemap: c_type: LIB_three_Class1 f_module_name: library_three_mod f_derived_type: class1 - f_capsule_data_type: SHROUD_class1_capsule + f_capsule_data_type: LIB_SHROUD_class1_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/include/typeslibrary.h b/regression/reference/include/typeslibrary.h index 21364c0ce..0c6408c8a 100644 --- a/regression/reference/include/typeslibrary.h +++ b/regression/reference/include/typeslibrary.h @@ -1,5 +1,5 @@ // typeslibrary.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapClass2.cpp b/regression/reference/include/wrapClass2.cpp index d4a8b6aaf..a854f0224 100644 --- a/regression/reference/include/wrapClass2.cpp +++ b/regression/reference/include/wrapClass2.cpp @@ -1,5 +1,5 @@ // wrapClass2.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapClass2.h b/regression/reference/include/wrapClass2.h index 91f65e82f..dbef60289 100644 --- a/regression/reference/include/wrapClass2.h +++ b/regression/reference/include/wrapClass2.h @@ -1,5 +1,5 @@ // wrapClass2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapflibrary.f b/regression/reference/include/wrapflibrary.f index 4a2325aac..85ff4b8aa 100644 --- a/regression/reference/include/wrapflibrary.f +++ b/regression/reference/include/wrapflibrary.f @@ -1,5 +1,5 @@ ! wrapflibrary.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -15,13 +15,13 @@ module library_mod implicit none - type, bind(C) :: SHROUD_class2_capsule + type, bind(C) :: LIB_SHROUD_class2_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class2_capsule + end type LIB_SHROUD_class2_capsule type class2 - type(SHROUD_class2_capsule) :: cxxmem + type(LIB_SHROUD_class2_capsule) :: cxxmem contains procedure :: method1 => class2_method1 procedure :: method2 => class2_method2 @@ -51,9 +51,9 @@ module library_mod subroutine c_class2_method1(self, comm) & bind(C, name="LIB_Class2_method1") use iso_c_binding, only : C_INT - import :: SHROUD_class2_capsule + import :: LIB_SHROUD_class2_capsule implicit none - type(SHROUD_class2_capsule), intent(IN) :: self + type(LIB_SHROUD_class2_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: comm end subroutine c_class2_method1 @@ -67,10 +67,10 @@ end subroutine c_class2_method1 ! Match: c_shadow_inout subroutine c_class2_method2(self, c2) & bind(C, name="LIB_Class2_method2") - import :: SHROUD_class1_capsule, SHROUD_class2_capsule + import :: LIB_SHROUD_class1_capsule, LIB_SHROUD_class2_capsule implicit none - type(SHROUD_class2_capsule), intent(IN) :: self - type(SHROUD_class1_capsule), intent(INOUT) :: c2 + type(LIB_SHROUD_class2_capsule), intent(IN) :: self + type(LIB_SHROUD_class1_capsule), intent(INOUT) :: c2 end subroutine c_class2_method2 diff --git a/regression/reference/include/wrapflibrary_one.f b/regression/reference/include/wrapflibrary_one.f index 1ba886339..c371b1e98 100644 --- a/regression/reference/include/wrapflibrary_one.f +++ b/regression/reference/include/wrapflibrary_one.f @@ -1,5 +1,5 @@ ! wrapflibrary_one.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapflibrary_one_two.f b/regression/reference/include/wrapflibrary_one_two.f index 1bf6de3c5..58b494028 100644 --- a/regression/reference/include/wrapflibrary_one_two.f +++ b/regression/reference/include/wrapflibrary_one_two.f @@ -1,5 +1,5 @@ ! wrapflibrary_one_two.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapflibrary_outer1.f b/regression/reference/include/wrapflibrary_outer1.f index 476d7473e..39334276a 100644 --- a/regression/reference/include/wrapflibrary_outer1.f +++ b/regression/reference/include/wrapflibrary_outer1.f @@ -1,5 +1,5 @@ ! wrapflibrary_outer1.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -15,13 +15,13 @@ module library_outer1_mod implicit none - type, bind(C) :: SHROUD_class0_capsule + type, bind(C) :: LIB_SHROUD_class0_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class0_capsule + end type LIB_SHROUD_class0_capsule type class0 - type(SHROUD_class0_capsule) :: cxxmem + type(LIB_SHROUD_class0_capsule) :: cxxmem contains procedure :: method => class0_method procedure :: get_instance => class0_get_instance @@ -45,9 +45,9 @@ module library_outer1_mod ! Match: c_default subroutine c_class0_method(self) & bind(C, name="LIB_outer1_class0_method") - import :: SHROUD_class0_capsule + import :: LIB_SHROUD_class0_capsule implicit none - type(SHROUD_class0_capsule), intent(IN) :: self + type(LIB_SHROUD_class0_capsule), intent(IN) :: self end subroutine c_class0_method diff --git a/regression/reference/include/wrapflibrary_outer2.f b/regression/reference/include/wrapflibrary_outer2.f index 70e5d244c..3c7a2e40c 100644 --- a/regression/reference/include/wrapflibrary_outer2.f +++ b/regression/reference/include/wrapflibrary_outer2.f @@ -1,5 +1,5 @@ ! wrapflibrary_outer2.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -15,13 +15,13 @@ module library_outer2_mod implicit none - type, bind(C) :: SHROUD_class0_capsule + type, bind(C) :: LIB_SHROUD_class0_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class0_capsule + end type LIB_SHROUD_class0_capsule type class0 - type(SHROUD_class0_capsule) :: cxxmem + type(LIB_SHROUD_class0_capsule) :: cxxmem contains procedure :: method => class0_method procedure :: get_instance => class0_get_instance @@ -45,9 +45,9 @@ module library_outer2_mod ! Match: c_default subroutine c_class0_method(self) & bind(C, name="LIB_outer2_class0_method") - import :: SHROUD_class0_capsule + import :: LIB_SHROUD_class0_capsule implicit none - type(SHROUD_class0_capsule), intent(IN) :: self + type(LIB_SHROUD_class0_capsule), intent(IN) :: self end subroutine c_class0_method diff --git a/regression/reference/include/wrapflibrary_three.f b/regression/reference/include/wrapflibrary_three.f index 3282e3450..000453772 100644 --- a/regression/reference/include/wrapflibrary_three.f +++ b/regression/reference/include/wrapflibrary_three.f @@ -1,5 +1,5 @@ ! wrapflibrary_three.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -15,13 +15,13 @@ module library_three_mod implicit none - type, bind(C) :: SHROUD_class1_capsule + type, bind(C) :: LIB_SHROUD_class1_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class1_capsule + end type LIB_SHROUD_class1_capsule type class1 - type(SHROUD_class1_capsule) :: cxxmem + type(LIB_SHROUD_class1_capsule) :: cxxmem contains procedure :: method1 => class1_method1 procedure :: get_instance => class1_get_instance @@ -50,9 +50,9 @@ module library_three_mod subroutine c_class1_method1(self, arg1) & bind(C, name="LIB_three_Class1_method1") use iso_c_binding, only : C_INT - import :: SHROUD_class1_capsule + import :: LIB_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(LIB_SHROUD_class1_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: arg1 end subroutine c_class1_method1 diff --git a/regression/reference/include/wraplibrary.cpp b/regression/reference/include/wraplibrary.cpp index 88c2de542..dfb6affa6 100644 --- a/regression/reference/include/wraplibrary.cpp +++ b/regression/reference/include/wraplibrary.cpp @@ -1,5 +1,5 @@ // wraplibrary.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wraplibrary_one_two.cpp b/regression/reference/include/wraplibrary_one_two.cpp index 4e7b6b123..0f77548dc 100644 --- a/regression/reference/include/wraplibrary_one_two.cpp +++ b/regression/reference/include/wraplibrary_one_two.cpp @@ -1,5 +1,5 @@ // wraplibrary_one_two.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wraplibrary_one_two.h b/regression/reference/include/wraplibrary_one_two.h index 54c5927ec..23947498d 100644 --- a/regression/reference/include/wraplibrary_one_two.h +++ b/regression/reference/include/wraplibrary_one_two.h @@ -1,5 +1,5 @@ // wraplibrary_one_two.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wraplibrary_outer1.cpp b/regression/reference/include/wraplibrary_outer1.cpp index 2a9ffa017..ca65248f8 100644 --- a/regression/reference/include/wraplibrary_outer1.cpp +++ b/regression/reference/include/wraplibrary_outer1.cpp @@ -1,5 +1,5 @@ // wraplibrary_outer1.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wraplibrary_outer1.h b/regression/reference/include/wraplibrary_outer1.h index 61f585cb1..4477536a0 100644 --- a/regression/reference/include/wraplibrary_outer1.h +++ b/regression/reference/include/wraplibrary_outer1.h @@ -1,5 +1,5 @@ // wraplibrary_outer1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wraplibrary_outer2.cpp b/regression/reference/include/wraplibrary_outer2.cpp index 93e805547..ff135e3cc 100644 --- a/regression/reference/include/wraplibrary_outer2.cpp +++ b/regression/reference/include/wraplibrary_outer2.cpp @@ -1,5 +1,5 @@ // wraplibrary_outer2.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wraplibrary_outer2.h b/regression/reference/include/wraplibrary_outer2.h index 69ba32f51..89920cbab 100644 --- a/regression/reference/include/wraplibrary_outer2.h +++ b/regression/reference/include/wraplibrary_outer2.h @@ -1,5 +1,5 @@ // wraplibrary_outer2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapouter1_class0.cpp b/regression/reference/include/wrapouter1_class0.cpp index 99202c9e2..7ba755f12 100644 --- a/regression/reference/include/wrapouter1_class0.cpp +++ b/regression/reference/include/wrapouter1_class0.cpp @@ -1,5 +1,5 @@ // wrapouter1_class0.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapouter1_class0.h b/regression/reference/include/wrapouter1_class0.h index fffe558d0..689c7b7e4 100644 --- a/regression/reference/include/wrapouter1_class0.h +++ b/regression/reference/include/wrapouter1_class0.h @@ -1,5 +1,5 @@ // wrapouter1_class0.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapouter2_class0.cpp b/regression/reference/include/wrapouter2_class0.cpp index 0b643cb4c..ab66758fd 100644 --- a/regression/reference/include/wrapouter2_class0.cpp +++ b/regression/reference/include/wrapouter2_class0.cpp @@ -1,5 +1,5 @@ // wrapouter2_class0.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapouter2_class0.h b/regression/reference/include/wrapouter2_class0.h index 2cb3c5caa..b72d29df3 100644 --- a/regression/reference/include/wrapouter2_class0.h +++ b/regression/reference/include/wrapouter2_class0.h @@ -1,5 +1,5 @@ // wrapouter2_class0.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapthree_Class1.cpp b/regression/reference/include/wrapthree_Class1.cpp index 3b1a52d8a..9b5c70885 100644 --- a/regression/reference/include/wrapthree_Class1.cpp +++ b/regression/reference/include/wrapthree_Class1.cpp @@ -1,5 +1,5 @@ // wrapthree_Class1.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/include/wrapthree_Class1.h b/regression/reference/include/wrapthree_Class1.h index 028892ef1..9319dd225 100644 --- a/regression/reference/include/wrapthree_Class1.h +++ b/regression/reference/include/wrapthree_Class1.h @@ -1,5 +1,5 @@ // wrapthree_Class1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/interface/interface.json b/regression/reference/interface/interface.json index 9d70612d3..b1c922bcb 100644 --- a/regression/reference/interface/interface.json +++ b/regression/reference/interface/interface.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/interface/typesInterface.h b/regression/reference/interface/typesInterface.h index fa148a199..aaa979fb8 100644 --- a/regression/reference/interface/typesInterface.h +++ b/regression/reference/interface/typesInterface.h @@ -1,5 +1,5 @@ // typesInterface.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/interface/wrapInterface.c b/regression/reference/interface/wrapInterface.c index 0946947e1..5401b61a2 100644 --- a/regression/reference/interface/wrapInterface.c +++ b/regression/reference/interface/wrapInterface.c @@ -1,5 +1,5 @@ // wrapInterface.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/interface/wrapfinterface.f b/regression/reference/interface/wrapfinterface.f index cc0e4e91e..f9f19e38c 100644 --- a/regression/reference/interface/wrapfinterface.f +++ b/regression/reference/interface/wrapfinterface.f @@ -1,5 +1,5 @@ ! wrapfinterface.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/memdoc/memdoc.json b/regression/reference/memdoc/memdoc.json index 79b88037d..2b3e27b7c 100644 --- a/regression/reference/memdoc/memdoc.json +++ b/regression/reference/memdoc/memdoc.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -34,7 +34,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable_library", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" } @@ -107,9 +107,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_*_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_*_result_allocatable", "stmtc0": "c_string_*_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } diff --git a/regression/reference/memdoc/typesmemdoc.h b/regression/reference/memdoc/typesmemdoc.h index ffac21c4c..71dedde52 100644 --- a/regression/reference/memdoc/typesmemdoc.h +++ b/regression/reference/memdoc/typesmemdoc.h @@ -1,5 +1,5 @@ // typesmemdoc.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/memdoc/utilmemdoc.cpp b/regression/reference/memdoc/utilmemdoc.cpp index 589455b9b..08610de2f 100644 --- a/regression/reference/memdoc/utilmemdoc.cpp +++ b/regression/reference/memdoc/utilmemdoc.cpp @@ -1,5 +1,5 @@ // utilmemdoc.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/memdoc/wrapfmemdoc.f b/regression/reference/memdoc/wrapfmemdoc.f index 4900e09e2..672e6a621 100644 --- a/regression/reference/memdoc/wrapfmemdoc.f +++ b/regression/reference/memdoc/wrapfmemdoc.f @@ -1,5 +1,5 @@ ! wrapfmemdoc.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,16 +22,16 @@ module memdoc_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: STR_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type STR_SHROUD_capsule_data ! start array_context ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: STR_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(STR_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,7 +43,7 @@ module memdoc_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type STR_SHROUD_array ! end array_context ! ---------------------------------------- @@ -74,9 +74,9 @@ end function c_get_const_string_ptr_alloc interface subroutine c_get_const_string_ptr_alloc_bufferify(DSHF_rv) & bind(C, name="STR_get_const_string_ptr_alloc_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_const_string_ptr_alloc_bufferify end interface ! end c_get_const_string_ptr_alloc_bufferify @@ -89,14 +89,14 @@ end subroutine c_get_const_string_ptr_alloc_bufferify interface ! helper copy_string ! Copy the char* or std::string in context into c_var. - subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & + subroutine STR_SHROUD_copy_string_and_free(context, c_var, c_var_size) & bind(c,name="STR_ShroudCopyStringAndFree") use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import STR_SHROUD_array + type(STR_SHROUD_array), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_string_and_free + end subroutine STR_SHROUD_copy_string_and_free end interface contains @@ -106,24 +106,23 @@ end subroutine SHROUD_copy_string_and_free ! Function: const std::string * getConstStringPtrAlloc +deref(allocatable)+owner(library) ! const std::string * getConstStringPtrAlloc +deref(allocatable)+owner(library) ! Requested: f_string_scalar_result_allocatable_library - ! Match: f_string_result_allocatable + ! Match: f_string_scalar_result_allocatable ! Function: void getConstStringPtrAlloc ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string * SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out)+owner(library) - ! Requested: f_string_*_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_*_result_allocatable ! Requested: c_string_*_result_buf_allocatable ! Match: c_string_result_buf_allocatable ! start get_const_string_ptr_alloc function get_const_string_ptr_alloc() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_const_string_ptr_alloc call c_get_const_string_ptr_alloc_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_const_string_ptr_alloc end function get_const_string_ptr_alloc ! end get_const_string_ptr_alloc diff --git a/regression/reference/memdoc/wrapmemdoc.cpp b/regression/reference/memdoc/wrapmemdoc.cpp index eb9007624..26ce60f4c 100644 --- a/regression/reference/memdoc/wrapmemdoc.cpp +++ b/regression/reference/memdoc/wrapmemdoc.cpp @@ -1,5 +1,5 @@ // wrapmemdoc.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/memdoc/wrapmemdoc.h b/regression/reference/memdoc/wrapmemdoc.h index f4308b2f6..67847b5f9 100644 --- a/regression/reference/memdoc/wrapmemdoc.h +++ b/regression/reference/memdoc/wrapmemdoc.h @@ -1,5 +1,5 @@ // wrapmemdoc.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/foo.cpp b/regression/reference/names/foo.cpp index f6d762663..559ae63d0 100644 --- a/regression/reference/names/foo.cpp +++ b/regression/reference/names/foo.cpp @@ -1,5 +1,5 @@ // foo.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/foo.f b/regression/reference/names/foo.f index 8e15499c6..126d13db7 100644 --- a/regression/reference/names/foo.f +++ b/regression/reference/names/foo.f @@ -1,5 +1,5 @@ ! foo.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -21,13 +21,13 @@ module name_module ! splicer begin namespace.ns0.module_top ! splicer end namespace.ns0.module_top - type, bind(C) :: SHROUD_names_capsule + type, bind(C) :: TES_SHROUD_names_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_names_capsule + end type TES_SHROUD_names_capsule type FNames - type(SHROUD_names_capsule) :: cxxmem + type(TES_SHROUD_names_capsule) :: cxxmem ! splicer begin namespace.ns0.class.Names.component_part ! splicer end namespace.ns0.class.Names.component_part contains @@ -57,9 +57,9 @@ function xxx_tes_names_defaultctor(SHT_crv) & result(SHT_rv) & bind(C, name="XXX_TES_ns0_Names_defaultctor") use iso_c_binding, only : C_PTR - import :: SHROUD_names_capsule + import :: TES_SHROUD_names_capsule implicit none - type(SHROUD_names_capsule), intent(OUT) :: SHT_crv + type(TES_SHROUD_names_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function xxx_tes_names_defaultctor @@ -69,9 +69,9 @@ end function xxx_tes_names_defaultctor ! Match: c_default subroutine xxx_tes_names_method1(self) & bind(C, name="XXX_TES_ns0_Names_method1") - import :: SHROUD_names_capsule + import :: TES_SHROUD_names_capsule implicit none - type(SHROUD_names_capsule), intent(IN) :: self + type(TES_SHROUD_names_capsule), intent(IN) :: self end subroutine xxx_tes_names_method1 ! ---------------------------------------- @@ -80,9 +80,9 @@ end subroutine xxx_tes_names_method1 ! Match: c_default subroutine xxx_tes_names_method2(self2) & bind(C, name="XXX_TES_ns0_Names_method2") - import :: SHROUD_names_capsule + import :: TES_SHROUD_names_capsule implicit none - type(SHROUD_names_capsule), intent(IN) :: self2 + type(TES_SHROUD_names_capsule), intent(IN) :: self2 end subroutine xxx_tes_names_method2 ! splicer begin namespace.ns0.class.Names.additional_interfaces diff --git a/regression/reference/names/foo.h b/regression/reference/names/foo.h index 2b10961fd..3a3be20bb 100644 --- a/regression/reference/names/foo.h +++ b/regression/reference/names/foo.h @@ -1,5 +1,5 @@ // foo.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/foons0.cpp b/regression/reference/names/foons0.cpp index f8703fb74..da80b4471 100644 --- a/regression/reference/names/foons0.cpp +++ b/regression/reference/names/foons0.cpp @@ -1,5 +1,5 @@ // foons0.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/names.json b/regression/reference/names/names.json index 210054c3a..c9fdd439b 100644 --- a/regression/reference/names/names.json +++ b/regression/reference/names/names.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapNames2.cc", "C_name_scope": "Names2_", "C_type_name": "TES_Names2", - "F_capsule_data_type": "SHROUD_names2_capsule", + "F_capsule_data_type": "TES_SHROUD_names2_capsule", "F_derived_name": "names2", "F_name_scope": "names2_", "PY_PyObject": "PY_Names2", @@ -39,7 +39,7 @@ "C_impl_filename": "wraptwoTs_0.cc", "C_name_scope": "twoTs_0_", "C_type_name": "TES_twoTs_0", - "F_capsule_data_type": "SHROUD_twots_0_capsule", + "F_capsule_data_type": "TES_SHROUD_twots_0_capsule", "F_derived_name": "twots_0", "F_name_scope": "twots_0_", "PY_PyObject": "PY_twoTs_0", @@ -111,7 +111,7 @@ "C_impl_filename": "wraptwoTs_instantiation4.cc", "C_name_scope": "twoTs_instantiation4_", "C_type_name": "TES_twoTs_instantiation4", - "F_capsule_data_type": "SHROUD_twots_instantiation4_capsule", + "F_capsule_data_type": "TES_SHROUD_twots_instantiation4_capsule", "F_derived_name": "twots_instantiation4", "F_name_scope": "twots_instantiation4_", "PY_PyObject": "PY_twoTs_instantiation4", @@ -2071,7 +2071,7 @@ "C_impl_filename": "foo.cpp", "C_name_scope": "ns0_Names_", "C_type_name": "TES_ns0_Names", - "F_capsule_data_type": "SHROUD_names_capsule", + "F_capsule_data_type": "TES_SHROUD_names_capsule", "F_derived_name": "FNames", "F_name_scope": "names_", "PY_PyObject": "PY_Names", @@ -2398,7 +2398,7 @@ "C_impl_filename": "wrapinternal_ImplWorker1.cc", "C_name_scope": "internal_ImplWorker1_", "C_type_name": "TES_internal_ImplWorker1", - "F_capsule_data_type": "SHROUD_implworker1_capsule", + "F_capsule_data_type": "TES_SHROUD_implworker1_capsule", "F_derived_name": "implworker1", "F_name_scope": "implworker1_", "class_scope": "ImplWorker1::", @@ -2453,7 +2453,7 @@ "C_impl_filename": "wrapstd_vector_int.cc", "C_name_scope": "std_Vvv1_", "C_type_name": "TES_std_Vvv1", - "F_capsule_data_type": "SHROUD_vvv1_capsule", + "F_capsule_data_type": "TES_SHROUD_vvv1_capsule", "F_derived_name": "FFvvv1", "F_name_scope": "vvv1_", "PY_PyObject": "PY_Vvv1", @@ -2540,7 +2540,7 @@ "C_impl_filename": "wrapstd_vector_double.cc", "C_name_scope": "std_vector_double_", "C_type_name": "TES_std_vector_double", - "F_capsule_data_type": "SHROUD_vector_double_capsule", + "F_capsule_data_type": "TES_SHROUD_vector_double_capsule", "F_derived_name": "vector_double", "F_name_scope": "vector_double_", "PY_PyObject": "PY_vector_double", @@ -2627,7 +2627,7 @@ "C_impl_filename": "wrapstd_vector_instantiation5.cc", "C_name_scope": "std_vector_instantiation5_", "C_type_name": "TES_std_vector_instantiation5", - "F_capsule_data_type": "SHROUD_vector_instantiation5_capsule", + "F_capsule_data_type": "TES_SHROUD_vector_instantiation5_capsule", "F_derived_name": "vector_instantiation5", "F_name_scope": "vector_instantiation5_", "PY_PyObject": "PY_vector_instantiation5", @@ -2715,7 +2715,7 @@ "C_impl_filename": "wrapstd_vector_instantiation3.cc", "C_name_scope": "std_vector_instantiation3_", "C_type_name": "TES_std_vector_instantiation3", - "F_capsule_data_type": "SHROUD_vector_instantiation3_capsule", + "F_capsule_data_type": "TES_SHROUD_vector_instantiation3_capsule", "F_derived_name": "vector_instantiation3", "F_name_scope": "vector_instantiation3_", "PY_PyObject": "PY_vector_instantiation3", @@ -2828,7 +2828,7 @@ "C_impl_filename": "wrapCAPI_Class1.cc", "C_name_scope": "capi_class1_", "C_type_name": "TES_capi_class1", - "F_capsule_data_type": "SHROUD_class1_capsule", + "F_capsule_data_type": "TES_SHROUD_class1_capsule", "F_derived_name": "class1", "F_name_scope": "class1_", "class_scope": "Class1::", diff --git a/regression/reference/names/pyNames2type.cpp b/regression/reference/names/pyNames2type.cpp index 7b96f0e93..815487358 100644 --- a/regression/reference/names/pyNames2type.cpp +++ b/regression/reference/names/pyNames2type.cpp @@ -1,5 +1,5 @@ // pyNames2type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pyns0_Namestype.cpp b/regression/reference/names/pyns0_Namestype.cpp index 1203b5299..961924bfc 100644 --- a/regression/reference/names/pyns0_Namestype.cpp +++ b/regression/reference/names/pyns0_Namestype.cpp @@ -1,5 +1,5 @@ // pyns0_Namestype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pystd_vector_doubletype.cpp b/regression/reference/names/pystd_vector_doubletype.cpp index 0440738d7..ed553318d 100644 --- a/regression/reference/names/pystd_vector_doubletype.cpp +++ b/regression/reference/names/pystd_vector_doubletype.cpp @@ -1,5 +1,5 @@ // pystd_vector_doubletype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pystd_vector_instantiation3type.cpp b/regression/reference/names/pystd_vector_instantiation3type.cpp index 21d481b78..81856d5ad 100644 --- a/regression/reference/names/pystd_vector_instantiation3type.cpp +++ b/regression/reference/names/pystd_vector_instantiation3type.cpp @@ -1,5 +1,5 @@ // pystd_vector_instantiation3type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pystd_vector_instantiation5type.cpp b/regression/reference/names/pystd_vector_instantiation5type.cpp index 7b54a118e..a7ed90d35 100644 --- a/regression/reference/names/pystd_vector_instantiation5type.cpp +++ b/regression/reference/names/pystd_vector_instantiation5type.cpp @@ -1,5 +1,5 @@ // pystd_vector_instantiation5type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pystd_vector_inttype.cpp b/regression/reference/names/pystd_vector_inttype.cpp index bbb26110d..b4de50c09 100644 --- a/regression/reference/names/pystd_vector_inttype.cpp +++ b/regression/reference/names/pystd_vector_inttype.cpp @@ -1,5 +1,5 @@ // pystd_vector_inttype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytestnames_internalmodule.cpp b/regression/reference/names/pytestnames_internalmodule.cpp index a738a9e81..439f730b1 100644 --- a/regression/reference/names/pytestnames_internalmodule.cpp +++ b/regression/reference/names/pytestnames_internalmodule.cpp @@ -1,5 +1,5 @@ // pytestnames_internalmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytestnames_ns0_innermodule.cpp b/regression/reference/names/pytestnames_ns0_innermodule.cpp index ba649c98b..dff96b95f 100644 --- a/regression/reference/names/pytestnames_ns0_innermodule.cpp +++ b/regression/reference/names/pytestnames_ns0_innermodule.cpp @@ -1,5 +1,5 @@ // pytestnames_ns0_innermodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytestnames_ns0module.cpp b/regression/reference/names/pytestnames_ns0module.cpp index 6e0028732..949e99d23 100644 --- a/regression/reference/names/pytestnames_ns0module.cpp +++ b/regression/reference/names/pytestnames_ns0module.cpp @@ -1,5 +1,5 @@ // pytestnames_ns0module.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytestnames_ns1module.cpp b/regression/reference/names/pytestnames_ns1module.cpp index fdc26591a..20e0c285c 100644 --- a/regression/reference/names/pytestnames_ns1module.cpp +++ b/regression/reference/names/pytestnames_ns1module.cpp @@ -1,5 +1,5 @@ // pytestnames_ns1module.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytestnames_stdmodule.cpp b/regression/reference/names/pytestnames_stdmodule.cpp index 6e3a3baec..b134cd1ec 100644 --- a/regression/reference/names/pytestnames_stdmodule.cpp +++ b/regression/reference/names/pytestnames_stdmodule.cpp @@ -1,5 +1,5 @@ // pytestnames_stdmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytestnamesmodule.cpp b/regression/reference/names/pytestnamesmodule.cpp index 323f2bbe7..cc57ef9bc 100644 --- a/regression/reference/names/pytestnamesmodule.cpp +++ b/regression/reference/names/pytestnamesmodule.cpp @@ -1,5 +1,5 @@ // pytestnamesmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytestnamesmodule.hpp b/regression/reference/names/pytestnamesmodule.hpp index 2a4249c0e..2b9f96d3b 100644 --- a/regression/reference/names/pytestnamesmodule.hpp +++ b/regression/reference/names/pytestnamesmodule.hpp @@ -1,5 +1,5 @@ // pytestnamesmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytestnamesutil.cpp b/regression/reference/names/pytestnamesutil.cpp index 46a0b76e5..c1e1c74e8 100644 --- a/regression/reference/names/pytestnamesutil.cpp +++ b/regression/reference/names/pytestnamesutil.cpp @@ -1,5 +1,5 @@ // pytestnamesutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytwoTs_0type.cpp b/regression/reference/names/pytwoTs_0type.cpp index 95b473b21..a733daf18 100644 --- a/regression/reference/names/pytwoTs_0type.cpp +++ b/regression/reference/names/pytwoTs_0type.cpp @@ -1,5 +1,5 @@ // pytwoTs_0type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/pytwoTs_instantiation4type.cpp b/regression/reference/names/pytwoTs_instantiation4type.cpp index 1eb043e05..7d9cd87ed 100644 --- a/regression/reference/names/pytwoTs_instantiation4type.cpp +++ b/regression/reference/names/pytwoTs_instantiation4type.cpp @@ -1,5 +1,5 @@ // pytwoTs_instantiation4type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/setup.py b/regression/reference/names/setup.py index 4aa9a460c..2c1a23301 100644 --- a/regression/reference/names/setup.py +++ b/regression/reference/names/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/testnames_types.yaml b/regression/reference/names/testnames_types.yaml index c7e790a64..b4116728d 100644 --- a/regression/reference/names/testnames_types.yaml +++ b/regression/reference/names/testnames_types.yaml @@ -1,5 +1,5 @@ # testnames_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -18,7 +18,7 @@ typemap: c_type: TES_capi_class1 f_module_name: testnames_capi_mod f_derived_type: class1 - f_capsule_data_type: SHROUD_class1_capsule + f_capsule_data_type: TES_SHROUD_class1_capsule f_to_c: "{f_var}%cxxmem" - type: Names2 fields: @@ -28,7 +28,7 @@ typemap: c_type: TES_Names2 f_module_name: top_module f_derived_type: names2 - f_capsule_data_type: SHROUD_names2_capsule + f_capsule_data_type: TES_SHROUD_names2_capsule f_to_c: "{f_var}%cxxmem" - namespace: internal declarations: internal @@ -40,7 +40,7 @@ typemap: c_type: TES_internal_ImplWorker1 f_module_name: testnames_internal_mod f_derived_type: implworker1 - f_capsule_data_type: SHROUD_implworker1_capsule + f_capsule_data_type: TES_SHROUD_implworker1_capsule f_to_c: "{f_var}%cxxmem" - namespace: ns0 declarations: ns0 @@ -52,7 +52,7 @@ typemap: c_type: TES_ns0_Names f_module_name: name_module f_derived_type: FNames - f_capsule_data_type: SHROUD_names_capsule + f_capsule_data_type: TES_SHROUD_names_capsule f_to_c: "{f_var}%cxxmem" - namespace: std declarations: std @@ -64,7 +64,7 @@ typemap: c_type: TES_std_Vvv1 f_module_name: testnames_std_mod f_derived_type: FFvvv1 - f_capsule_data_type: SHROUD_vvv1_capsule + f_capsule_data_type: TES_SHROUD_vvv1_capsule f_to_c: "{f_var}%cxxmem" - type: vector_double fields: @@ -74,7 +74,7 @@ typemap: c_type: TES_std_vector_double f_module_name: testnames_std_mod f_derived_type: vector_double - f_capsule_data_type: SHROUD_vector_double_capsule + f_capsule_data_type: TES_SHROUD_vector_double_capsule f_to_c: "{f_var}%cxxmem" - type: vector_instantiation3 fields: @@ -84,7 +84,7 @@ typemap: c_type: TES_std_vector_instantiation3 f_module_name: testnames_std_mod f_derived_type: vector_instantiation3 - f_capsule_data_type: SHROUD_vector_instantiation3_capsule + f_capsule_data_type: TES_SHROUD_vector_instantiation3_capsule f_to_c: "{f_var}%cxxmem" - type: vector_instantiation5 fields: @@ -94,7 +94,7 @@ typemap: c_type: TES_std_vector_instantiation5 f_module_name: testnames_std_mod f_derived_type: vector_instantiation5 - f_capsule_data_type: SHROUD_vector_instantiation5_capsule + f_capsule_data_type: TES_SHROUD_vector_instantiation5_capsule f_to_c: "{f_var}%cxxmem" - type: twoTs_0 fields: @@ -104,7 +104,7 @@ typemap: c_type: TES_twoTs_0 f_module_name: top_module f_derived_type: twots_0 - f_capsule_data_type: SHROUD_twots_0_capsule + f_capsule_data_type: TES_SHROUD_twots_0_capsule f_to_c: "{f_var}%cxxmem" - type: twoTs_instantiation4 fields: @@ -114,5 +114,5 @@ typemap: c_type: TES_twoTs_instantiation4 f_module_name: top_module f_derived_type: twots_instantiation4 - f_capsule_data_type: SHROUD_twots_instantiation4_capsule + f_capsule_data_type: TES_SHROUD_twots_instantiation4_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/names/top.cpp b/regression/reference/names/top.cpp index 5fa3da845..5df3dfc88 100644 --- a/regression/reference/names/top.cpp +++ b/regression/reference/names/top.cpp @@ -1,5 +1,5 @@ // top.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/top.f b/regression/reference/names/top.f index f242ad7f2..f61e42803 100644 --- a/regression/reference/names/top.f +++ b/regression/reference/names/top.f @@ -1,5 +1,5 @@ ! top.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -26,13 +26,13 @@ module top_module integer(C_INT), parameter :: blue = 1 integer(C_INT), parameter :: white = 2 - type, bind(C) :: SHROUD_names2_capsule + type, bind(C) :: TES_SHROUD_names2_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_names2_capsule + end type TES_SHROUD_names2_capsule type names2 - type(SHROUD_names2_capsule) :: cxxmem + type(TES_SHROUD_names2_capsule) :: cxxmem ! splicer begin class.Names2.component_part ! splicer end class.Names2.component_part contains @@ -43,13 +43,13 @@ module top_module ! splicer end class.Names2.type_bound_procedure_part end type names2 - type, bind(C) :: SHROUD_twots_0_capsule + type, bind(C) :: TES_SHROUD_twots_0_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_twots_0_capsule + end type TES_SHROUD_twots_0_capsule type twots_0 - type(SHROUD_twots_0_capsule) :: cxxmem + type(TES_SHROUD_twots_0_capsule) :: cxxmem ! splicer begin class.twoTs_0.component_part ! splicer end class.twoTs_0.component_part contains @@ -60,13 +60,13 @@ module top_module ! splicer end class.twoTs_0.type_bound_procedure_part end type twots_0 - type, bind(C) :: SHROUD_twots_instantiation4_capsule + type, bind(C) :: TES_SHROUD_twots_instantiation4_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_twots_instantiation4_capsule + end type TES_SHROUD_twots_instantiation4_capsule type twots_instantiation4 - type(SHROUD_twots_instantiation4_capsule) :: cxxmem + type(TES_SHROUD_twots_instantiation4_capsule) :: cxxmem ! splicer begin class.twoTs_instantiation4.component_part ! splicer end class.twoTs_instantiation4.component_part contains diff --git a/regression/reference/names/top.h b/regression/reference/names/top.h index 2faf41b4e..a12673807 100644 --- a/regression/reference/names/top.h +++ b/regression/reference/names/top.h @@ -1,5 +1,5 @@ // top.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/typestestnames.hh b/regression/reference/names/typestestnames.hh index 88e270f93..c7bff986a 100644 --- a/regression/reference/names/typestestnames.hh +++ b/regression/reference/names/typestestnames.hh @@ -1,5 +1,5 @@ // typestestnames.hh -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wrapCAPI_Class1.cc b/regression/reference/names/wrapCAPI_Class1.cc index 745284345..c48c379e7 100644 --- a/regression/reference/names/wrapCAPI_Class1.cc +++ b/regression/reference/names/wrapCAPI_Class1.cc @@ -1,5 +1,5 @@ // wrapCAPI_Class1.cc -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wrapCAPI_Class1.hh b/regression/reference/names/wrapCAPI_Class1.hh index 5182ba880..ba1cac81f 100644 --- a/regression/reference/names/wrapCAPI_Class1.hh +++ b/regression/reference/names/wrapCAPI_Class1.hh @@ -1,5 +1,5 @@ // wrapCAPI_Class1.hh -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wrapNames2.cc b/regression/reference/names/wrapNames2.cc index f730cfda3..1521cc1a9 100644 --- a/regression/reference/names/wrapNames2.cc +++ b/regression/reference/names/wrapNames2.cc @@ -1,5 +1,5 @@ // wrapNames2.cc -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wrapftestnames_CAPI.F b/regression/reference/names/wrapftestnames_CAPI.F index 7b29204a8..357147b9a 100644 --- a/regression/reference/names/wrapftestnames_CAPI.F +++ b/regression/reference/names/wrapftestnames_CAPI.F @@ -1,5 +1,5 @@ ! wrapftestnames_CAPI.F -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -21,13 +21,13 @@ module testnames_capi_mod ! splicer begin namespace.CAPI.module_top ! splicer end namespace.CAPI.module_top - type, bind(C) :: SHROUD_class1_capsule + type, bind(C) :: TES_SHROUD_class1_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class1_capsule + end type TES_SHROUD_class1_capsule type class1 - type(SHROUD_class1_capsule) :: cxxmem + type(TES_SHROUD_class1_capsule) :: cxxmem ! splicer begin namespace.CAPI.class.Class1.component_part ! splicer end namespace.CAPI.class.Class1.component_part contains @@ -55,9 +55,9 @@ module testnames_capi_mod ! Match: c_default subroutine c_class1_member1(self) & bind(C, name="TES_capi_class1_member1") - import :: SHROUD_class1_capsule + import :: TES_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(TES_SHROUD_class1_capsule), intent(IN) :: self end subroutine c_class1_member1 ! splicer begin namespace.CAPI.class.Class1.additional_interfaces diff --git a/regression/reference/names/wrapftestnames_internal.F b/regression/reference/names/wrapftestnames_internal.F index a672e6867..c015fd449 100644 --- a/regression/reference/names/wrapftestnames_internal.F +++ b/regression/reference/names/wrapftestnames_internal.F @@ -1,5 +1,5 @@ ! wrapftestnames_internal.F -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wrapftestnames_ns0_inner.F b/regression/reference/names/wrapftestnames_ns0_inner.F index 478528244..b4135537b 100644 --- a/regression/reference/names/wrapftestnames_ns0_inner.F +++ b/regression/reference/names/wrapftestnames_ns0_inner.F @@ -1,5 +1,5 @@ ! wrapftestnames_ns0_inner.F -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wrapftestnames_ns1.F b/regression/reference/names/wrapftestnames_ns1.F index b8552c2b1..9ebc5cdb3 100644 --- a/regression/reference/names/wrapftestnames_ns1.F +++ b/regression/reference/names/wrapftestnames_ns1.F @@ -1,5 +1,5 @@ ! wrapftestnames_ns1.F -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wrapftestnames_std.F b/regression/reference/names/wrapftestnames_std.F index ab5d130b0..273fadac8 100644 --- a/regression/reference/names/wrapftestnames_std.F +++ b/regression/reference/names/wrapftestnames_std.F @@ -1,5 +1,5 @@ ! wrapftestnames_std.F -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -21,13 +21,13 @@ module testnames_std_mod ! splicer begin namespace.std.module_top ! splicer end namespace.std.module_top - type, bind(C) :: SHROUD_vvv1_capsule + type, bind(C) :: TES_SHROUD_vvv1_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_vvv1_capsule + end type TES_SHROUD_vvv1_capsule type FFvvv1 - type(SHROUD_vvv1_capsule) :: cxxmem + type(TES_SHROUD_vvv1_capsule) :: cxxmem ! splicer begin namespace.std.class.Vvv1.component_part ! splicer end namespace.std.class.Vvv1.component_part contains @@ -38,13 +38,13 @@ module testnames_std_mod ! splicer end namespace.std.class.Vvv1.type_bound_procedure_part end type FFvvv1 - type, bind(C) :: SHROUD_vector_double_capsule + type, bind(C) :: TES_SHROUD_vector_double_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_vector_double_capsule + end type TES_SHROUD_vector_double_capsule type vector_double - type(SHROUD_vector_double_capsule) :: cxxmem + type(TES_SHROUD_vector_double_capsule) :: cxxmem ! splicer begin namespace.std.class.vector_double.component_part ! splicer end namespace.std.class.vector_double.component_part contains @@ -55,13 +55,13 @@ module testnames_std_mod ! splicer end namespace.std.class.vector_double.type_bound_procedure_part end type vector_double - type, bind(C) :: SHROUD_vector_instantiation5_capsule + type, bind(C) :: TES_SHROUD_vector_instantiation5_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_vector_instantiation5_capsule + end type TES_SHROUD_vector_instantiation5_capsule type vector_instantiation5 - type(SHROUD_vector_instantiation5_capsule) :: cxxmem + type(TES_SHROUD_vector_instantiation5_capsule) :: cxxmem ! splicer begin namespace.std.class.vector_instantiation5.component_part ! splicer end namespace.std.class.vector_instantiation5.component_part contains @@ -72,13 +72,13 @@ module testnames_std_mod ! splicer end namespace.std.class.vector_instantiation5.type_bound_procedure_part end type vector_instantiation5 - type, bind(C) :: SHROUD_vector_instantiation3_capsule + type, bind(C) :: TES_SHROUD_vector_instantiation3_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_vector_instantiation3_capsule + end type TES_SHROUD_vector_instantiation3_capsule type vector_instantiation3 - type(SHROUD_vector_instantiation3_capsule) :: cxxmem + type(TES_SHROUD_vector_instantiation3_capsule) :: cxxmem ! splicer begin namespace.std.class.vector_instantiation3.component_part ! splicer end namespace.std.class.vector_instantiation3.component_part contains diff --git a/regression/reference/names/wraptestnames_CAPI.cc b/regression/reference/names/wraptestnames_CAPI.cc index 715e18d8f..f24e26a52 100644 --- a/regression/reference/names/wraptestnames_CAPI.cc +++ b/regression/reference/names/wraptestnames_CAPI.cc @@ -1,5 +1,5 @@ // wraptestnames_CAPI.cc -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wraptestnames_CAPI.hh b/regression/reference/names/wraptestnames_CAPI.hh index bc3ff7a0f..49fb23ae8 100644 --- a/regression/reference/names/wraptestnames_CAPI.hh +++ b/regression/reference/names/wraptestnames_CAPI.hh @@ -1,5 +1,5 @@ // wraptestnames_CAPI.hh -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wraptestnames_ns0_inner.cc b/regression/reference/names/wraptestnames_ns0_inner.cc index d04c7ae56..9f5fb1a0e 100644 --- a/regression/reference/names/wraptestnames_ns0_inner.cc +++ b/regression/reference/names/wraptestnames_ns0_inner.cc @@ -1,5 +1,5 @@ // wraptestnames_ns0_inner.cc -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wraptestnames_ns1.cc b/regression/reference/names/wraptestnames_ns1.cc index 280c2a6b3..d2d2a4b6c 100644 --- a/regression/reference/names/wraptestnames_ns1.cc +++ b/regression/reference/names/wraptestnames_ns1.cc @@ -1,5 +1,5 @@ // wraptestnames_ns1.cc -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names/wraptestnames_ns1.hh b/regression/reference/names/wraptestnames_ns1.hh index 1a2dc621b..c381d5cfa 100644 --- a/regression/reference/names/wraptestnames_ns1.hh +++ b/regression/reference/names/wraptestnames_ns1.hh @@ -1,5 +1,5 @@ // wraptestnames_ns1.hh -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names2/names2.json b/regression/reference/names2/names2.json index 3a44ee073..399feadf5 100644 --- a/regression/reference/names2/names2.json +++ b/regression/reference/names2/names2.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/names2/names_types.yaml b/regression/reference/names2/names_types.yaml index e36ac1a06..0bbcdedad 100644 --- a/regression/reference/names2/names_types.yaml +++ b/regression/reference/names2/names_types.yaml @@ -1,5 +1,5 @@ # names_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names2/typesNames.h b/regression/reference/names2/typesNames.h index e367c8253..0fdc65625 100644 --- a/regression/reference/names2/typesNames.h +++ b/regression/reference/names2/typesNames.h @@ -1,5 +1,5 @@ // typesNames.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names2/wrapNames.cpp b/regression/reference/names2/wrapNames.cpp index 634e89f12..6a8a466ce 100644 --- a/regression/reference/names2/wrapNames.cpp +++ b/regression/reference/names2/wrapNames.cpp @@ -1,5 +1,5 @@ // wrapNames.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names2/wrapNames.h b/regression/reference/names2/wrapNames.h index f4fc1f5ae..3cef6acc2 100644 --- a/regression/reference/names2/wrapNames.h +++ b/regression/reference/names2/wrapNames.h @@ -1,5 +1,5 @@ // wrapNames.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/names2/wrapfnames.f b/regression/reference/names2/wrapfnames.f index 01075b99c..bec2ba546 100644 --- a/regression/reference/names2/wrapfnames.f +++ b/regression/reference/names2/wrapfnames.f @@ -1,5 +1,5 @@ ! wrapfnames.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/namespace.json b/regression/reference/namespace/namespace.json index f4bf069aa..c1e0087da 100644 --- a/regression/reference/namespace/namespace.json +++ b/regression/reference/namespace/namespace.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -37,7 +37,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -128,9 +128,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "NS_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -323,7 +324,7 @@ "C_impl_filename": "wrapouter_Cstruct1.cpp", "C_name_scope": "outer_Cstruct1_", "C_type_name": "NS_cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "NS_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_PyObject": "PY_Cstruct1", @@ -608,7 +609,7 @@ "C_impl_filename": "wrapnswork_ClassWork.cpp", "C_name_scope": "nswork_ClassWork_", "C_type_name": "NS_nswork_ClassWork", - "F_capsule_data_type": "SHROUD_nswork_classwork_capsule", + "F_capsule_data_type": "NS_SHROUD_nswork_classwork_capsule", "F_derived_name": "classwork", "F_name_scope": "nswork_classwork_", "PY_PyObject": "PY_ClassWork", diff --git a/regression/reference/namespace/ns_types.yaml b/regression/reference/namespace/ns_types.yaml index 3cb9e1fef..1ed464b38 100644 --- a/regression/reference/namespace/ns_types.yaml +++ b/regression/reference/namespace/ns_types.yaml @@ -1,5 +1,5 @@ # ns_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -18,7 +18,7 @@ typemap: c_type: NS_nswork_ClassWork f_module_name: ns_nswork_mod f_derived_type: classwork - f_capsule_data_type: SHROUD_nswork_classwork_capsule + f_capsule_data_type: NS_SHROUD_nswork_classwork_capsule f_to_c: "{f_var}%cxxmem" - namespace: outer declarations: outer diff --git a/regression/reference/namespace/pyns_nsworkmodule.cpp b/regression/reference/namespace/pyns_nsworkmodule.cpp index 182817fff..8b8dc3d0f 100644 --- a/regression/reference/namespace/pyns_nsworkmodule.cpp +++ b/regression/reference/namespace/pyns_nsworkmodule.cpp @@ -1,5 +1,5 @@ // pyns_nsworkmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/pyns_outermodule.cpp b/regression/reference/namespace/pyns_outermodule.cpp index c0143edb3..5dca027af 100644 --- a/regression/reference/namespace/pyns_outermodule.cpp +++ b/regression/reference/namespace/pyns_outermodule.cpp @@ -1,5 +1,5 @@ // pyns_outermodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/pynsmodule.cpp b/regression/reference/namespace/pynsmodule.cpp index a2fef0f5a..e355c19db 100644 --- a/regression/reference/namespace/pynsmodule.cpp +++ b/regression/reference/namespace/pynsmodule.cpp @@ -1,5 +1,5 @@ // pynsmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/pynsmodule.hpp b/regression/reference/namespace/pynsmodule.hpp index a2ee49758..155509ddb 100644 --- a/regression/reference/namespace/pynsmodule.hpp +++ b/regression/reference/namespace/pynsmodule.hpp @@ -1,5 +1,5 @@ // pynsmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/pynsutil.cpp b/regression/reference/namespace/pynsutil.cpp index c64976f3d..3ac365349 100644 --- a/regression/reference/namespace/pynsutil.cpp +++ b/regression/reference/namespace/pynsutil.cpp @@ -1,5 +1,5 @@ // pynsutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/pynswork_ClassWorktype.cpp b/regression/reference/namespace/pynswork_ClassWorktype.cpp index f717b905d..3d86ff474 100644 --- a/regression/reference/namespace/pynswork_ClassWorktype.cpp +++ b/regression/reference/namespace/pynswork_ClassWorktype.cpp @@ -1,5 +1,5 @@ // pynswork_ClassWorktype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/pyouter_Cstruct1type.cpp b/regression/reference/namespace/pyouter_Cstruct1type.cpp index 38aae068f..541cfc4b7 100644 --- a/regression/reference/namespace/pyouter_Cstruct1type.cpp +++ b/regression/reference/namespace/pyouter_Cstruct1type.cpp @@ -1,5 +1,5 @@ // pyouter_Cstruct1type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/setup.py b/regression/reference/namespace/setup.py index e0dd5cde8..72f8a5a9e 100644 --- a/regression/reference/namespace/setup.py +++ b/regression/reference/namespace/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/typesns.h b/regression/reference/namespace/typesns.h index 6bc4806c0..1904c5b6e 100644 --- a/regression/reference/namespace/typesns.h +++ b/regression/reference/namespace/typesns.h @@ -1,5 +1,5 @@ // typesns.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/utilns.cpp b/regression/reference/namespace/utilns.cpp index 0008af2d9..e0efba161 100644 --- a/regression/reference/namespace/utilns.cpp +++ b/regression/reference/namespace/utilns.cpp @@ -1,5 +1,5 @@ // utilns.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/wrapfns.f b/regression/reference/namespace/wrapfns.f index 170fcbad2..559366261 100644 --- a/regression/reference/namespace/wrapfns.f +++ b/regression/reference/namespace/wrapfns.f @@ -1,5 +1,5 @@ ! wrapfns.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,15 +22,15 @@ module ns_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: NS_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type NS_SHROUD_capsule_data ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: NS_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(NS_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -42,19 +42,19 @@ module ns_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type NS_SHROUD_array ! enum upper::Color integer(C_INT), parameter :: upper_error = 0 integer(C_INT), parameter :: upper_warn = 1 - type, bind(C) :: SHROUD_nswork_classwork_capsule + type, bind(C) :: NS_SHROUD_nswork_classwork_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_nswork_classwork_capsule + end type NS_SHROUD_nswork_classwork_capsule type classwork - type(SHROUD_nswork_classwork_capsule) :: cxxmem + type(NS_SHROUD_nswork_classwork_capsule) :: cxxmem ! splicer begin namespace.outer.class.ClassWork.component_part ! splicer end namespace.outer.class.ClassWork.component_part contains @@ -97,9 +97,9 @@ end function c_last_function_called ! Match: c_string_result_buf_allocatable subroutine c_last_function_called_bufferify(DSHF_rv) & bind(C, name="NS_last_function_called_bufferify") - import :: SHROUD_array + import :: NS_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(NS_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_last_function_called_bufferify ! ---------------------------------------- @@ -121,14 +121,14 @@ end subroutine one interface ! helper copy_string ! Copy the char* or std::string in context into c_var. - subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & + subroutine NS_SHROUD_copy_string_and_free(context, c_var, c_var_size) & bind(c,name="NS_ShroudCopyStringAndFree") use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import NS_SHROUD_array + type(NS_SHROUD_array), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_string_and_free + end subroutine NS_SHROUD_copy_string_and_free end interface contains @@ -137,24 +137,22 @@ end subroutine SHROUD_copy_string_and_free ! ---------------------------------------- ! Function: const std::string & LastFunctionCalled +deref(allocatable) ! const std::string & LastFunctionCalled +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void LastFunctionCalled ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable function last_function_called() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(NS_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.last_function_called call c_last_function_called_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call NS_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.last_function_called end function last_function_called diff --git a/regression/reference/namespace/wrapfns_outer.f b/regression/reference/namespace/wrapfns_outer.f index 2e4d1a136..9f351cab5 100644 --- a/regression/reference/namespace/wrapfns_outer.f +++ b/regression/reference/namespace/wrapfns_outer.f @@ -1,5 +1,5 @@ ! wrapfns_outer.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/wrapns.cpp b/regression/reference/namespace/wrapns.cpp index 252effd0e..4f2827c55 100644 --- a/regression/reference/namespace/wrapns.cpp +++ b/regression/reference/namespace/wrapns.cpp @@ -1,5 +1,5 @@ // wrapns.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/wrapns.h b/regression/reference/namespace/wrapns.h index bf1d65236..7e58e3a65 100644 --- a/regression/reference/namespace/wrapns.h +++ b/regression/reference/namespace/wrapns.h @@ -1,5 +1,5 @@ // wrapns.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/wrapns_outer.cpp b/regression/reference/namespace/wrapns_outer.cpp index 7bcc06aa7..1fa6579ac 100644 --- a/regression/reference/namespace/wrapns_outer.cpp +++ b/regression/reference/namespace/wrapns_outer.cpp @@ -1,5 +1,5 @@ // wrapns_outer.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/wrapns_outer.h b/regression/reference/namespace/wrapns_outer.h index e61c1daf7..623dce32d 100644 --- a/regression/reference/namespace/wrapns_outer.h +++ b/regression/reference/namespace/wrapns_outer.h @@ -1,5 +1,5 @@ // wrapns_outer.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespace/wrapns_upper.h b/regression/reference/namespace/wrapns_upper.h index 71748e955..dddfe6460 100644 --- a/regression/reference/namespace/wrapns_upper.h +++ b/regression/reference/namespace/wrapns_upper.h @@ -1,5 +1,5 @@ // wrapns_upper.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/namespacedoc.json b/regression/reference/namespacedoc/namespacedoc.json index 1e976ef33..ea6700e1c 100644 --- a/regression/reference/namespacedoc/namespacedoc.json +++ b/regression/reference/namespacedoc/namespacedoc.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/namespacedoc/pywrapped_inner1module.cpp b/regression/reference/namespacedoc/pywrapped_inner1module.cpp index cc9fa3703..80e76ae82 100644 --- a/regression/reference/namespacedoc/pywrapped_inner1module.cpp +++ b/regression/reference/namespacedoc/pywrapped_inner1module.cpp @@ -1,5 +1,5 @@ // pywrapped_inner1module.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/pywrapped_inner2module.cpp b/regression/reference/namespacedoc/pywrapped_inner2module.cpp index 180ff42ca..a32c41932 100644 --- a/regression/reference/namespacedoc/pywrapped_inner2module.cpp +++ b/regression/reference/namespacedoc/pywrapped_inner2module.cpp @@ -1,5 +1,5 @@ // pywrapped_inner2module.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/pywrapped_inner4module.cpp b/regression/reference/namespacedoc/pywrapped_inner4module.cpp index 36d506d24..e7b146de5 100644 --- a/regression/reference/namespacedoc/pywrapped_inner4module.cpp +++ b/regression/reference/namespacedoc/pywrapped_inner4module.cpp @@ -1,5 +1,5 @@ // pywrapped_inner4module.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/pywrappedmodule.cpp b/regression/reference/namespacedoc/pywrappedmodule.cpp index 27de52fe8..2bfb9e1c4 100644 --- a/regression/reference/namespacedoc/pywrappedmodule.cpp +++ b/regression/reference/namespacedoc/pywrappedmodule.cpp @@ -1,5 +1,5 @@ // pywrappedmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/pywrappedmodule.hpp b/regression/reference/namespacedoc/pywrappedmodule.hpp index 524350a2d..bf9d4b129 100644 --- a/regression/reference/namespacedoc/pywrappedmodule.hpp +++ b/regression/reference/namespacedoc/pywrappedmodule.hpp @@ -1,5 +1,5 @@ // pywrappedmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/setup.py b/regression/reference/namespacedoc/setup.py index ce094890d..22a69ef7c 100644 --- a/regression/reference/namespacedoc/setup.py +++ b/regression/reference/namespacedoc/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/typeswrapped.h b/regression/reference/namespacedoc/typeswrapped.h index 047439314..998d0af66 100644 --- a/regression/reference/namespacedoc/typeswrapped.h +++ b/regression/reference/namespacedoc/typeswrapped.h @@ -1,5 +1,5 @@ // typeswrapped.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapfwrapped.f b/regression/reference/namespacedoc/wrapfwrapped.f index 7e49ed443..b6c5b163e 100644 --- a/regression/reference/namespacedoc/wrapfwrapped.f +++ b/regression/reference/namespacedoc/wrapfwrapped.f @@ -1,5 +1,5 @@ ! wrapfwrapped.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapfwrapped_inner1.f b/regression/reference/namespacedoc/wrapfwrapped_inner1.f index 9e533e213..53dd5dc82 100644 --- a/regression/reference/namespacedoc/wrapfwrapped_inner1.f +++ b/regression/reference/namespacedoc/wrapfwrapped_inner1.f @@ -1,5 +1,5 @@ ! wrapfwrapped_inner1.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapfwrapped_inner2.f b/regression/reference/namespacedoc/wrapfwrapped_inner2.f index f194c796d..4d972ecb4 100644 --- a/regression/reference/namespacedoc/wrapfwrapped_inner2.f +++ b/regression/reference/namespacedoc/wrapfwrapped_inner2.f @@ -1,5 +1,5 @@ ! wrapfwrapped_inner2.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapped_types.yaml b/regression/reference/namespacedoc/wrapped_types.yaml index 7a6e549db..57cbf2c57 100644 --- a/regression/reference/namespacedoc/wrapped_types.yaml +++ b/regression/reference/namespacedoc/wrapped_types.yaml @@ -1,5 +1,5 @@ # wrapped_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapwrapped.cpp b/regression/reference/namespacedoc/wrapwrapped.cpp index 13903d0d2..b8098cfa6 100644 --- a/regression/reference/namespacedoc/wrapwrapped.cpp +++ b/regression/reference/namespacedoc/wrapwrapped.cpp @@ -1,5 +1,5 @@ // wrapwrapped.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapwrapped.h b/regression/reference/namespacedoc/wrapwrapped.h index 269e67928..8e9a8f82a 100644 --- a/regression/reference/namespacedoc/wrapwrapped.h +++ b/regression/reference/namespacedoc/wrapwrapped.h @@ -1,5 +1,5 @@ // wrapwrapped.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapwrapped_inner1.cpp b/regression/reference/namespacedoc/wrapwrapped_inner1.cpp index cfed01b28..ada5b409e 100644 --- a/regression/reference/namespacedoc/wrapwrapped_inner1.cpp +++ b/regression/reference/namespacedoc/wrapwrapped_inner1.cpp @@ -1,5 +1,5 @@ // wrapwrapped_inner1.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapwrapped_inner1.h b/regression/reference/namespacedoc/wrapwrapped_inner1.h index 8f66dde0a..10f3df1f4 100644 --- a/regression/reference/namespacedoc/wrapwrapped_inner1.h +++ b/regression/reference/namespacedoc/wrapwrapped_inner1.h @@ -1,5 +1,5 @@ // wrapwrapped_inner1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapwrapped_inner2.cpp b/regression/reference/namespacedoc/wrapwrapped_inner2.cpp index cdc955c67..800a61e4e 100644 --- a/regression/reference/namespacedoc/wrapwrapped_inner2.cpp +++ b/regression/reference/namespacedoc/wrapwrapped_inner2.cpp @@ -1,5 +1,5 @@ // wrapwrapped_inner2.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapwrapped_inner2.h b/regression/reference/namespacedoc/wrapwrapped_inner2.h index e623cb55a..a64f7fdce 100644 --- a/regression/reference/namespacedoc/wrapwrapped_inner2.h +++ b/regression/reference/namespacedoc/wrapwrapped_inner2.h @@ -1,5 +1,5 @@ // wrapwrapped_inner2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapwrapped_inner4.cpp b/regression/reference/namespacedoc/wrapwrapped_inner4.cpp index 8572fcc49..640438a0f 100644 --- a/regression/reference/namespacedoc/wrapwrapped_inner4.cpp +++ b/regression/reference/namespacedoc/wrapwrapped_inner4.cpp @@ -1,5 +1,5 @@ // wrapwrapped_inner4.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/namespacedoc/wrapwrapped_inner4.h b/regression/reference/namespacedoc/wrapwrapped_inner4.h index f9419e870..daa3f9e0b 100644 --- a/regression/reference/namespacedoc/wrapwrapped_inner4.h +++ b/regression/reference/namespacedoc/wrapwrapped_inner4.h @@ -1,5 +1,5 @@ // wrapwrapped_inner4.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2019, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/none/def_types.yaml b/regression/reference/none/def_types.yaml index 831add847..93e8f0272 100644 --- a/regression/reference/none/def_types.yaml +++ b/regression/reference/none/def_types.yaml @@ -1,5 +1,5 @@ # def_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud 0.12.2. Do not edit. # # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. @@ -102,6 +102,38 @@ typemap: LUA_push: lua_pushnumber({LUA_state_var}, {c_var}) sgroup: native sh_type: SH_TYPE_DOUBLE + - type: double_complex + fields: + flat_name: double_complex + base: unknown + idtor: 0 + cxx_type: std::complex + cxx_header: + - + c_type: double complex + c_header: + - + f_type: complex(C_DOUBLE_COMPLEX) + f_kind: C_DOUBLE_COMPLEX + f_module: + iso_c_binding: + - C_DOUBLE_COMPLEX + f_cast: cmplx({f_var}, C_DOUBLE_COMPLEX) + PY_format: D + PY_ctor: PyComplex_FromDoubles({ctor_expr}) + PY_get: PyComplex_AsCComplex({py_var}) + py_ctype: Py_complex + pytype_to_pyctor: creal({ctor_expr}), cimag({ctor_expr}) + pytype_to_cxx: "{work_var}.real + {work_var}.imag * I" + cxx_to_pytype: "{ctype_var}.real = creal({cxx_var}); + {ctype_var}.imag = cimag({cxx_var});" + PY_build_arg: &{ctype_var} + PYN_typenum: NPY_DOUBLE + LUA_type: LUA_TNUMBER + LUA_pop: lua_tonumber({LUA_state_var}, {LUA_index}) + LUA_push: lua_pushnumber({LUA_state_var}, {c_var}) + sgroup: native + sh_type: SH_TYPE_DOUBLE_COMPLEX - type: float fields: flat_name: float @@ -124,6 +156,38 @@ typemap: LUA_push: lua_pushnumber({LUA_state_var}, {c_var}) sgroup: native sh_type: SH_TYPE_FLOAT + - type: float_complex + fields: + flat_name: float_complex + base: unknown + idtor: 0 + cxx_type: std::complex + cxx_header: + - + c_type: float complex + c_header: + - + f_type: complex(C_FLOAT_COMPLEX) + f_kind: C_FLOAT_COMPLEX + f_module: + iso_c_binding: + - C_FLOAT_COMPLEX + f_cast: cmplx({f_var}, C_FLOAT_COMPLEX) + PY_format: D + PY_ctor: PyComplex_FromDoubles({ctor_expr}) + PY_get: PyComplex_AsCComplex({py_var}) + py_ctype: Py_complex + pytype_to_pyctor: creal({ctor_expr}), cimag({ctor_expr}) + pytype_to_cxx: "{work_var}.real + {work_var}.imag * I" + cxx_to_pytype: "{py_var}.real = creal({cxx_var}); + {py_var}.imag = cimag({cxx_var});" + PY_build_arg: &{ctype_var} + PYN_typenum: NPY_DOUBLE + LUA_type: LUA_TNUMBER + LUA_pop: lua_tonumber({LUA_state_var}, {LUA_index}) + LUA_push: lua_pushnumber({LUA_state_var}, {c_var}) + sgroup: native + sh_type: SH_TYPE_FLOAT_COMPLEX - type: int fields: flat_name: int diff --git a/regression/reference/none/helpers.c b/regression/reference/none/helpers.c index 5421b2cf1..630e84e52 100644 --- a/regression/reference/none/helpers.c +++ b/regression/reference/none/helpers.c @@ -360,7 +360,7 @@ static int SHROUD_create_from_PyObject_vector_double(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyFloat_AsDouble(item)); + double cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -368,12 +368,46 @@ static int SHROUD_create_from_PyObject_vector_double(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; } ##### end create_from_PyObject_vector_double cxx_source +##### start create_from_PyObject_vector_double_complex cxx_source + +// helper create_from_PyObject_vector_double_complex +// Convert obj into an array of type std::complex +// Return -1 on error. +static int SHROUD_create_from_PyObject_vector_double_complex + (PyObject *obj, const char *name, + std::vector> & in) +{ + PyObject *seq = PySequence_Fast(obj, "holder"); + if (seq == NULL) { + PyErr_Format(PyExc_TypeError, "argument '%s' must be iterable", + name); + return -1; + } + Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); + for (Py_ssize_t i = 0; i < size; i++) { + PyObject *item = PySequence_Fast_GET_ITEM(seq, i); + Py_complex cvalue = PyComplex_AsCComplex(item); + if (PyErr_Occurred()) { + Py_DECREF(seq); + PyErr_Format(PyExc_ValueError, + "argument '%s', index %d must be double complex", name, + (int) i); + return -1; + } + in.push_back(cvalue.real + cvalue.imag * I); + } + Py_DECREF(seq); + return 0; +} +##### end create_from_PyObject_vector_double_complex cxx_source + ##### start create_from_PyObject_vector_float cxx_source // helper create_from_PyObject_vector_float @@ -391,19 +425,53 @@ static int SHROUD_create_from_PyObject_vector_float(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyFloat_AsDouble(item)); + float cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, "argument '%s', index %d must be float", name, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; } ##### end create_from_PyObject_vector_float cxx_source +##### start create_from_PyObject_vector_float_complex cxx_source + +// helper create_from_PyObject_vector_float_complex +// Convert obj into an array of type std::complex +// Return -1 on error. +static int SHROUD_create_from_PyObject_vector_float_complex + (PyObject *obj, const char *name, + std::vector> & in) +{ + PyObject *seq = PySequence_Fast(obj, "holder"); + if (seq == NULL) { + PyErr_Format(PyExc_TypeError, "argument '%s' must be iterable", + name); + return -1; + } + Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); + for (Py_ssize_t i = 0; i < size; i++) { + PyObject *item = PySequence_Fast_GET_ITEM(seq, i); + Py_complex cvalue = PyComplex_AsCComplex(item); + if (PyErr_Occurred()) { + Py_DECREF(seq); + PyErr_Format(PyExc_ValueError, + "argument '%s', index %d must be float complex", name, + (int) i); + return -1; + } + in.push_back(cvalue.real + cvalue.imag * I); + } + Py_DECREF(seq); + return 0; +} +##### end create_from_PyObject_vector_float_complex cxx_source + ##### start create_from_PyObject_vector_int cxx_source // helper create_from_PyObject_vector_int @@ -421,13 +489,14 @@ static int SHROUD_create_from_PyObject_vector_int(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, "argument '%s', index %d must be int", name, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -451,7 +520,7 @@ static int SHROUD_create_from_PyObject_vector_int16_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + int16_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -459,6 +528,7 @@ static int SHROUD_create_from_PyObject_vector_int16_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -482,7 +552,7 @@ static int SHROUD_create_from_PyObject_vector_int32_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + int32_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -490,6 +560,7 @@ static int SHROUD_create_from_PyObject_vector_int32_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -513,7 +584,7 @@ static int SHROUD_create_from_PyObject_vector_int64_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + int64_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -521,6 +592,7 @@ static int SHROUD_create_from_PyObject_vector_int64_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -544,7 +616,7 @@ static int SHROUD_create_from_PyObject_vector_int8_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + int8_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -552,6 +624,7 @@ static int SHROUD_create_from_PyObject_vector_int8_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -575,13 +648,14 @@ static int SHROUD_create_from_PyObject_vector_long(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + long cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, "argument '%s', index %d must be long", name, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -605,7 +679,7 @@ static int SHROUD_create_from_PyObject_vector_long_long(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(XXXPy_get); + long long cvalue = XXXPy_get; if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -613,6 +687,7 @@ static int SHROUD_create_from_PyObject_vector_long_long(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -636,13 +711,14 @@ static int SHROUD_create_from_PyObject_vector_short(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + short cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, "argument '%s', index %d must be short", name, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -666,7 +742,7 @@ static int SHROUD_create_from_PyObject_vector_size_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(XXXPy_get); + size_t cvalue = XXXPy_get; if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -674,6 +750,7 @@ static int SHROUD_create_from_PyObject_vector_size_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -697,7 +774,7 @@ static int SHROUD_create_from_PyObject_vector_uint16_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + uint16_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -705,6 +782,7 @@ static int SHROUD_create_from_PyObject_vector_uint16_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -728,7 +806,7 @@ static int SHROUD_create_from_PyObject_vector_uint32_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + uint32_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -736,6 +814,7 @@ static int SHROUD_create_from_PyObject_vector_uint32_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -759,7 +838,7 @@ static int SHROUD_create_from_PyObject_vector_uint64_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + uint64_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -767,6 +846,7 @@ static int SHROUD_create_from_PyObject_vector_uint64_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -790,7 +870,7 @@ static int SHROUD_create_from_PyObject_vector_uint8_t(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + uint8_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -798,6 +878,7 @@ static int SHROUD_create_from_PyObject_vector_uint8_t(PyObject *obj, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -821,7 +902,7 @@ static int SHROUD_create_from_PyObject_vector_unsigned_int Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + unsigned int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -829,6 +910,7 @@ static int SHROUD_create_from_PyObject_vector_unsigned_int (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -852,7 +934,7 @@ static int SHROUD_create_from_PyObject_vector_unsigned_long Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + unsigned long cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -860,6 +942,7 @@ static int SHROUD_create_from_PyObject_vector_unsigned_long (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -884,7 +967,7 @@ static int SHROUD_create_from_PyObject_vector_unsigned_long_long Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(XXXPy_get); + unsigned long long cvalue = XXXPy_get; if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -892,6 +975,7 @@ static int SHROUD_create_from_PyObject_vector_unsigned_long_long name, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -915,7 +999,7 @@ static int SHROUD_create_from_PyObject_vector_unsigned_short Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + unsigned short cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, @@ -923,6 +1007,7 @@ static int SHROUD_create_from_PyObject_vector_unsigned_short (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; @@ -953,6 +1038,96 @@ static int SHROUD_fill_from_PyObject_char(PyObject *obj, } ##### end fill_from_PyObject_char source +##### start fill_from_PyObject_double_complex_list source + +// helper fill_from_PyObject_double_complex_list +// Fill double complex array from Python sequence object. +// If obj is a scalar, broadcast to array. +// Return 0 on success, -1 on error. +static int SHROUD_fill_from_PyObject_double_complex_list(PyObject *obj, + const char *name, double complex *in, Py_ssize_t insize) +{ + Py_complex cvalue = PyComplex_AsCComplex(obj); + if (!PyErr_Occurred()) { + // Broadcast scalar. + for (Py_ssize_t i = 0; i < insize; ++i) { + in[i] = cvalue.real + cvalue.imag * I; + } + return 0; + } + PyErr_Clear(); + + // Look for sequence. + PyObject *seq = PySequence_Fast(obj, "holder"); + if (seq == NULL) { + PyErr_Format(PyExc_TypeError, "argument '%s' must be iterable", + name); + return -1; + } + Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); + if (size > insize) { + size = insize; + } + for (Py_ssize_t i = 0; i < size; ++i) { + PyObject *item = PySequence_Fast_GET_ITEM(seq, i); + cvalue = PyComplex_AsCComplex(item); + if (PyErr_Occurred()) { + Py_DECREF(seq); + PyErr_Format(PyExc_TypeError, + "argument '%s', index %d must be double complex", name, + (int) i); + return -1; + } + in[i] = cvalue.real + cvalue.imag * I; + } + Py_DECREF(seq); + return 0; +} +##### end fill_from_PyObject_double_complex_list source + +##### start fill_from_PyObject_double_complex_numpy source + +// helper fill_from_PyObject_double_complex_numpy +// Fill double complex array from Python object using NumPy. +// If obj is a scalar, broadcast to array. +// Return 0 on success, -1 on error. +static int SHROUD_fill_from_PyObject_double_complex_numpy(PyObject *obj, + const char *name, double complex *in, Py_ssize_t insize) +{ + Py_complex cvalue = PyComplex_AsCComplex(obj); + if (!PyErr_Occurred()) { + // Broadcast scalar. + for (Py_ssize_t i = 0; i < insize; ++i) { + in[i] = cvalue.real + cvalue.imag * I; + } + return 0; + } + PyErr_Clear(); + + PyObject *array = PyArray_FROM_OTF(obj, NPY_DOUBLE, + NPY_ARRAY_IN_ARRAY); + if (array == nullptr) { + PyErr_Format(PyExc_TypeError, + "argument '%s' must be a 1-D array of double complex", + name); + return -1; + } + PyArrayObject *pyarray = reinterpret_cast(array); + + double complex *data = static_cast + (PyArray_DATA(pyarray)); + npy_intp size = PyArray_SIZE(pyarray); + if (size > insize) { + size = insize; + } + for (Py_ssize_t i = 0; i < size; ++i) { + in[i] = data[i]; + } + Py_DECREF(pyarray); + return 0; +} +##### end fill_from_PyObject_double_complex_numpy source + ##### start fill_from_PyObject_double_list source // helper fill_from_PyObject_double_list @@ -962,11 +1137,11 @@ static int SHROUD_fill_from_PyObject_char(PyObject *obj, static int SHROUD_fill_from_PyObject_double_list(PyObject *obj, const char *name, double *in, Py_ssize_t insize) { - double value = PyFloat_AsDouble(obj); + double cvalue = PyFloat_AsDouble(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -985,7 +1160,7 @@ static int SHROUD_fill_from_PyObject_double_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyFloat_AsDouble(item); + cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -993,6 +1168,7 @@ static int SHROUD_fill_from_PyObject_double_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1008,11 +1184,11 @@ static int SHROUD_fill_from_PyObject_double_list(PyObject *obj, static int SHROUD_fill_from_PyObject_double_numpy(PyObject *obj, const char *name, double *in, Py_ssize_t insize) { - double value = PyFloat_AsDouble(obj); + double cvalue = PyFloat_AsDouble(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1040,6 +1216,95 @@ static int SHROUD_fill_from_PyObject_double_numpy(PyObject *obj, } ##### end fill_from_PyObject_double_numpy source +##### start fill_from_PyObject_float_complex_list source + +// helper fill_from_PyObject_float_complex_list +// Fill float complex array from Python sequence object. +// If obj is a scalar, broadcast to array. +// Return 0 on success, -1 on error. +static int SHROUD_fill_from_PyObject_float_complex_list(PyObject *obj, + const char *name, float complex *in, Py_ssize_t insize) +{ + Py_complex cvalue = PyComplex_AsCComplex(obj); + if (!PyErr_Occurred()) { + // Broadcast scalar. + for (Py_ssize_t i = 0; i < insize; ++i) { + in[i] = cvalue.real + cvalue.imag * I; + } + return 0; + } + PyErr_Clear(); + + // Look for sequence. + PyObject *seq = PySequence_Fast(obj, "holder"); + if (seq == NULL) { + PyErr_Format(PyExc_TypeError, "argument '%s' must be iterable", + name); + return -1; + } + Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); + if (size > insize) { + size = insize; + } + for (Py_ssize_t i = 0; i < size; ++i) { + PyObject *item = PySequence_Fast_GET_ITEM(seq, i); + cvalue = PyComplex_AsCComplex(item); + if (PyErr_Occurred()) { + Py_DECREF(seq); + PyErr_Format(PyExc_TypeError, + "argument '%s', index %d must be float complex", name, + (int) i); + return -1; + } + in[i] = cvalue.real + cvalue.imag * I; + } + Py_DECREF(seq); + return 0; +} +##### end fill_from_PyObject_float_complex_list source + +##### start fill_from_PyObject_float_complex_numpy source + +// helper fill_from_PyObject_float_complex_numpy +// Fill float complex array from Python object using NumPy. +// If obj is a scalar, broadcast to array. +// Return 0 on success, -1 on error. +static int SHROUD_fill_from_PyObject_float_complex_numpy(PyObject *obj, + const char *name, float complex *in, Py_ssize_t insize) +{ + Py_complex cvalue = PyComplex_AsCComplex(obj); + if (!PyErr_Occurred()) { + // Broadcast scalar. + for (Py_ssize_t i = 0; i < insize; ++i) { + in[i] = cvalue.real + cvalue.imag * I; + } + return 0; + } + PyErr_Clear(); + + PyObject *array = PyArray_FROM_OTF(obj, NPY_DOUBLE, + NPY_ARRAY_IN_ARRAY); + if (array == nullptr) { + PyErr_Format(PyExc_TypeError, + "argument '%s' must be a 1-D array of float complex", name); + return -1; + } + PyArrayObject *pyarray = reinterpret_cast(array); + + float complex *data = static_cast + (PyArray_DATA(pyarray)); + npy_intp size = PyArray_SIZE(pyarray); + if (size > insize) { + size = insize; + } + for (Py_ssize_t i = 0; i < size; ++i) { + in[i] = data[i]; + } + Py_DECREF(pyarray); + return 0; +} +##### end fill_from_PyObject_float_complex_numpy source + ##### start fill_from_PyObject_float_list source // helper fill_from_PyObject_float_list @@ -1049,11 +1314,11 @@ static int SHROUD_fill_from_PyObject_double_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_float_list(PyObject *obj, const char *name, float *in, Py_ssize_t insize) { - float value = PyFloat_AsDouble(obj); + float cvalue = PyFloat_AsDouble(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1072,13 +1337,14 @@ static int SHROUD_fill_from_PyObject_float_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyFloat_AsDouble(item); + cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, "argument '%s', index %d must be float", name, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1094,11 +1360,11 @@ static int SHROUD_fill_from_PyObject_float_list(PyObject *obj, static int SHROUD_fill_from_PyObject_float_numpy(PyObject *obj, const char *name, float *in, Py_ssize_t insize) { - float value = PyFloat_AsDouble(obj); + float cvalue = PyFloat_AsDouble(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1135,11 +1401,11 @@ static int SHROUD_fill_from_PyObject_float_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_int16_t_list(PyObject *obj, const char *name, int16_t *in, Py_ssize_t insize) { - int16_t value = PyInt_AsLong(obj); + int16_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1158,7 +1424,7 @@ static int SHROUD_fill_from_PyObject_int16_t_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -1166,6 +1432,7 @@ static int SHROUD_fill_from_PyObject_int16_t_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1181,11 +1448,11 @@ static int SHROUD_fill_from_PyObject_int16_t_list(PyObject *obj, static int SHROUD_fill_from_PyObject_int16_t_numpy(PyObject *obj, const char *name, int16_t *in, Py_ssize_t insize) { - int16_t value = PyInt_AsLong(obj); + int16_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1222,11 +1489,11 @@ static int SHROUD_fill_from_PyObject_int16_t_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_int32_t_list(PyObject *obj, const char *name, int32_t *in, Py_ssize_t insize) { - int32_t value = PyInt_AsLong(obj); + int32_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1245,7 +1512,7 @@ static int SHROUD_fill_from_PyObject_int32_t_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -1253,6 +1520,7 @@ static int SHROUD_fill_from_PyObject_int32_t_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1268,11 +1536,11 @@ static int SHROUD_fill_from_PyObject_int32_t_list(PyObject *obj, static int SHROUD_fill_from_PyObject_int32_t_numpy(PyObject *obj, const char *name, int32_t *in, Py_ssize_t insize) { - int32_t value = PyInt_AsLong(obj); + int32_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1309,11 +1577,11 @@ static int SHROUD_fill_from_PyObject_int32_t_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_int64_t_list(PyObject *obj, const char *name, int64_t *in, Py_ssize_t insize) { - int64_t value = PyInt_AsLong(obj); + int64_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1332,7 +1600,7 @@ static int SHROUD_fill_from_PyObject_int64_t_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -1340,6 +1608,7 @@ static int SHROUD_fill_from_PyObject_int64_t_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1355,11 +1624,11 @@ static int SHROUD_fill_from_PyObject_int64_t_list(PyObject *obj, static int SHROUD_fill_from_PyObject_int64_t_numpy(PyObject *obj, const char *name, int64_t *in, Py_ssize_t insize) { - int64_t value = PyInt_AsLong(obj); + int64_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1396,11 +1665,11 @@ static int SHROUD_fill_from_PyObject_int64_t_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_int8_t_list(PyObject *obj, const char *name, int8_t *in, Py_ssize_t insize) { - int8_t value = PyInt_AsLong(obj); + int8_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1419,7 +1688,7 @@ static int SHROUD_fill_from_PyObject_int8_t_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -1427,6 +1696,7 @@ static int SHROUD_fill_from_PyObject_int8_t_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1442,11 +1712,11 @@ static int SHROUD_fill_from_PyObject_int8_t_list(PyObject *obj, static int SHROUD_fill_from_PyObject_int8_t_numpy(PyObject *obj, const char *name, int8_t *in, Py_ssize_t insize) { - int8_t value = PyInt_AsLong(obj); + int8_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1483,11 +1753,11 @@ static int SHROUD_fill_from_PyObject_int8_t_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_int_list(PyObject *obj, const char *name, int *in, Py_ssize_t insize) { - int value = PyInt_AsLong(obj); + int cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1506,13 +1776,14 @@ static int SHROUD_fill_from_PyObject_int_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, "argument '%s', index %d must be int", name, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1528,11 +1799,11 @@ static int SHROUD_fill_from_PyObject_int_list(PyObject *obj, static int SHROUD_fill_from_PyObject_int_numpy(PyObject *obj, const char *name, int *in, Py_ssize_t insize) { - int value = PyInt_AsLong(obj); + int cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1569,11 +1840,11 @@ static int SHROUD_fill_from_PyObject_int_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_long_list(PyObject *obj, const char *name, long *in, Py_ssize_t insize) { - long value = PyInt_AsLong(obj); + long cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1592,13 +1863,14 @@ static int SHROUD_fill_from_PyObject_long_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, "argument '%s', index %d must be long", name, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1614,11 +1886,11 @@ static int SHROUD_fill_from_PyObject_long_list(PyObject *obj, static int SHROUD_fill_from_PyObject_long_numpy(PyObject *obj, const char *name, long *in, Py_ssize_t insize) { - long value = PyInt_AsLong(obj); + long cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1655,11 +1927,11 @@ static int SHROUD_fill_from_PyObject_long_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_short_list(PyObject *obj, const char *name, short *in, Py_ssize_t insize) { - short value = PyInt_AsLong(obj); + short cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1678,13 +1950,14 @@ static int SHROUD_fill_from_PyObject_short_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, "argument '%s', index %d must be short", name, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1700,11 +1973,11 @@ static int SHROUD_fill_from_PyObject_short_list(PyObject *obj, static int SHROUD_fill_from_PyObject_short_numpy(PyObject *obj, const char *name, short *in, Py_ssize_t insize) { - short value = PyInt_AsLong(obj); + short cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1741,11 +2014,11 @@ static int SHROUD_fill_from_PyObject_short_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_uint16_t_list(PyObject *obj, const char *name, uint16_t *in, Py_ssize_t insize) { - uint16_t value = PyInt_AsLong(obj); + uint16_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1764,7 +2037,7 @@ static int SHROUD_fill_from_PyObject_uint16_t_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -1772,6 +2045,7 @@ static int SHROUD_fill_from_PyObject_uint16_t_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1787,11 +2061,11 @@ static int SHROUD_fill_from_PyObject_uint16_t_list(PyObject *obj, static int SHROUD_fill_from_PyObject_uint16_t_numpy(PyObject *obj, const char *name, uint16_t *in, Py_ssize_t insize) { - uint16_t value = PyInt_AsLong(obj); + uint16_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1828,11 +2102,11 @@ static int SHROUD_fill_from_PyObject_uint16_t_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_uint32_t_list(PyObject *obj, const char *name, uint32_t *in, Py_ssize_t insize) { - uint32_t value = PyInt_AsLong(obj); + uint32_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1851,7 +2125,7 @@ static int SHROUD_fill_from_PyObject_uint32_t_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -1859,6 +2133,7 @@ static int SHROUD_fill_from_PyObject_uint32_t_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1874,11 +2149,11 @@ static int SHROUD_fill_from_PyObject_uint32_t_list(PyObject *obj, static int SHROUD_fill_from_PyObject_uint32_t_numpy(PyObject *obj, const char *name, uint32_t *in, Py_ssize_t insize) { - uint32_t value = PyInt_AsLong(obj); + uint32_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1915,11 +2190,11 @@ static int SHROUD_fill_from_PyObject_uint32_t_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_uint64_t_list(PyObject *obj, const char *name, uint64_t *in, Py_ssize_t insize) { - uint64_t value = PyInt_AsLong(obj); + uint64_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -1938,7 +2213,7 @@ static int SHROUD_fill_from_PyObject_uint64_t_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -1946,6 +2221,7 @@ static int SHROUD_fill_from_PyObject_uint64_t_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -1961,11 +2237,11 @@ static int SHROUD_fill_from_PyObject_uint64_t_list(PyObject *obj, static int SHROUD_fill_from_PyObject_uint64_t_numpy(PyObject *obj, const char *name, uint64_t *in, Py_ssize_t insize) { - uint64_t value = PyInt_AsLong(obj); + uint64_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2002,11 +2278,11 @@ static int SHROUD_fill_from_PyObject_uint64_t_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_uint8_t_list(PyObject *obj, const char *name, uint8_t *in, Py_ssize_t insize) { - uint8_t value = PyInt_AsLong(obj); + uint8_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2025,7 +2301,7 @@ static int SHROUD_fill_from_PyObject_uint8_t_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -2033,6 +2309,7 @@ static int SHROUD_fill_from_PyObject_uint8_t_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -2048,11 +2325,11 @@ static int SHROUD_fill_from_PyObject_uint8_t_list(PyObject *obj, static int SHROUD_fill_from_PyObject_uint8_t_numpy(PyObject *obj, const char *name, uint8_t *in, Py_ssize_t insize) { - uint8_t value = PyInt_AsLong(obj); + uint8_t cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2089,11 +2366,11 @@ static int SHROUD_fill_from_PyObject_uint8_t_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_unsigned_int_list(PyObject *obj, const char *name, unsigned int *in, Py_ssize_t insize) { - unsigned int value = PyInt_AsLong(obj); + unsigned int cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2112,7 +2389,7 @@ static int SHROUD_fill_from_PyObject_unsigned_int_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -2120,6 +2397,7 @@ static int SHROUD_fill_from_PyObject_unsigned_int_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -2135,11 +2413,11 @@ static int SHROUD_fill_from_PyObject_unsigned_int_list(PyObject *obj, static int SHROUD_fill_from_PyObject_unsigned_int_numpy(PyObject *obj, const char *name, unsigned int *in, Py_ssize_t insize) { - unsigned int value = PyInt_AsLong(obj); + unsigned int cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2177,11 +2455,11 @@ static int SHROUD_fill_from_PyObject_unsigned_int_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_unsigned_long_list(PyObject *obj, const char *name, unsigned long *in, Py_ssize_t insize) { - unsigned long value = PyInt_AsLong(obj); + unsigned long cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2200,7 +2478,7 @@ static int SHROUD_fill_from_PyObject_unsigned_long_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -2208,6 +2486,7 @@ static int SHROUD_fill_from_PyObject_unsigned_long_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -2223,11 +2502,11 @@ static int SHROUD_fill_from_PyObject_unsigned_long_list(PyObject *obj, static int SHROUD_fill_from_PyObject_unsigned_long_numpy(PyObject *obj, const char *name, unsigned long *in, Py_ssize_t insize) { - unsigned long value = PyInt_AsLong(obj); + unsigned long cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2265,11 +2544,11 @@ static int SHROUD_fill_from_PyObject_unsigned_long_numpy(PyObject *obj, static int SHROUD_fill_from_PyObject_unsigned_short_list(PyObject *obj, const char *name, unsigned short *in, Py_ssize_t insize) { - unsigned short value = PyInt_AsLong(obj); + unsigned short cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2288,7 +2567,7 @@ static int SHROUD_fill_from_PyObject_unsigned_short_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, @@ -2296,6 +2575,7 @@ static int SHROUD_fill_from_PyObject_unsigned_short_list(PyObject *obj, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; @@ -2311,11 +2591,11 @@ static int SHROUD_fill_from_PyObject_unsigned_short_list(PyObject *obj, static int SHROUD_fill_from_PyObject_unsigned_short_numpy(PyObject *obj, const char *name, unsigned short *in, Py_ssize_t insize) { - unsigned short value = PyInt_AsLong(obj); + unsigned short cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -2477,6 +2757,71 @@ static int SHROUD_get_from_object_charptr(PyObject *obj, } ##### end get_from_object_charptr source +##### start get_from_object_double_complex_list source + +// helper get_from_object_double_complex_list +// Convert list of PyObject to array of double complex. +// Return 0 on error, 1 on success. +// Set Python exception on error. +static int SHROUD_get_from_object_double_complex_list(PyObject *obj, + LIB_SHROUD_converter_value *value) +{ + PyObject *seq = PySequence_Fast(obj, "holder"); + if (seq == NULL) { + PyErr_Format(PyExc_TypeError, "argument '%s' must be iterable", + value->name); + return 0; + } + Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); + double complex *in = static_cast + (std::malloc(size * sizeof(double complex))); + for (Py_ssize_t i = 0; i < size; i++) { + PyObject *item = PySequence_Fast_GET_ITEM(seq, i); + double complex cvalue = PyComplex_AsCComplex(item); + if (PyErr_Occurred()) { + std::free(in); + Py_DECREF(seq); + PyErr_Format(PyExc_TypeError, + "argument '%s', index %d must be double complex", + value->name, (int) i); + return 0; + } + in[i] = cvalue.real + cvalue.imag * I; + } + Py_DECREF(seq); + + value->obj = nullptr; // Do not save list object. + value->dataobj = PyCapsule_New(in, nullptr, FREE_py_capsule_dtor); + value->data = static_cast(in); + value->size = size; + return 1; +} +##### end get_from_object_double_complex_list source + +##### start get_from_object_double_complex_numpy source + +// helper get_from_object_double_complex_numpy +// Convert PyObject to double complex pointer. +static int SHROUD_get_from_object_double_complex_numpy(PyObject *obj, + LIB_SHROUD_converter_value *value) +{ + PyObject *array = PyArray_FROM_OTF(obj, NPY_DOUBLE, + NPY_ARRAY_IN_ARRAY); + if (array == nullptr) { + PyErr_SetString(PyExc_ValueError, + "must be a 1-D array of double complex"); + return 0; + } + value->obj = array; + value->dataobj = nullptr; + value->data = PyArray_DATA(reinterpret_cast + (array)); + value->size = PyArray_SIZE(reinterpret_cast + (array)); + return 1; +} +##### end get_from_object_double_complex_numpy source + ##### start get_from_object_double_list source // helper get_from_object_double_list @@ -2497,7 +2842,7 @@ static int SHROUD_get_from_object_double_list(PyObject *obj, (std::malloc(size * sizeof(double))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyFloat_AsDouble(item); + double cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -2506,6 +2851,7 @@ static int SHROUD_get_from_object_double_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -2541,6 +2887,71 @@ static int SHROUD_get_from_object_double_numpy(PyObject *obj, } ##### end get_from_object_double_numpy source +##### start get_from_object_float_complex_list source + +// helper get_from_object_float_complex_list +// Convert list of PyObject to array of float complex. +// Return 0 on error, 1 on success. +// Set Python exception on error. +static int SHROUD_get_from_object_float_complex_list(PyObject *obj, + LIB_SHROUD_converter_value *value) +{ + PyObject *seq = PySequence_Fast(obj, "holder"); + if (seq == NULL) { + PyErr_Format(PyExc_TypeError, "argument '%s' must be iterable", + value->name); + return 0; + } + Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); + float complex *in = static_cast + (std::malloc(size * sizeof(float complex))); + for (Py_ssize_t i = 0; i < size; i++) { + PyObject *item = PySequence_Fast_GET_ITEM(seq, i); + float complex cvalue = PyComplex_AsCComplex(item); + if (PyErr_Occurred()) { + std::free(in); + Py_DECREF(seq); + PyErr_Format(PyExc_TypeError, + "argument '%s', index %d must be float complex", + value->name, (int) i); + return 0; + } + in[i] = cvalue.real + cvalue.imag * I; + } + Py_DECREF(seq); + + value->obj = nullptr; // Do not save list object. + value->dataobj = PyCapsule_New(in, nullptr, FREE_py_capsule_dtor); + value->data = static_cast(in); + value->size = size; + return 1; +} +##### end get_from_object_float_complex_list source + +##### start get_from_object_float_complex_numpy source + +// helper get_from_object_float_complex_numpy +// Convert PyObject to float complex pointer. +static int SHROUD_get_from_object_float_complex_numpy(PyObject *obj, + LIB_SHROUD_converter_value *value) +{ + PyObject *array = PyArray_FROM_OTF(obj, NPY_DOUBLE, + NPY_ARRAY_IN_ARRAY); + if (array == nullptr) { + PyErr_SetString(PyExc_ValueError, + "must be a 1-D array of float complex"); + return 0; + } + value->obj = array; + value->dataobj = nullptr; + value->data = PyArray_DATA(reinterpret_cast + (array)); + value->size = PyArray_SIZE(reinterpret_cast + (array)); + return 1; +} +##### end get_from_object_float_complex_numpy source + ##### start get_from_object_float_list source // helper get_from_object_float_list @@ -2560,7 +2971,7 @@ static int SHROUD_get_from_object_float_list(PyObject *obj, float *in = static_cast(std::malloc(size * sizeof(float))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyFloat_AsDouble(item); + float cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -2569,6 +2980,7 @@ static int SHROUD_get_from_object_float_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -2624,7 +3036,7 @@ static int SHROUD_get_from_object_int16_t_list(PyObject *obj, (std::malloc(size * sizeof(int16_t))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int16_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -2633,6 +3045,7 @@ static int SHROUD_get_from_object_int16_t_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -2688,7 +3101,7 @@ static int SHROUD_get_from_object_int32_t_list(PyObject *obj, (std::malloc(size * sizeof(int32_t))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int32_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -2697,6 +3110,7 @@ static int SHROUD_get_from_object_int32_t_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -2752,7 +3166,7 @@ static int SHROUD_get_from_object_int64_t_list(PyObject *obj, (std::malloc(size * sizeof(int64_t))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int64_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -2761,6 +3175,7 @@ static int SHROUD_get_from_object_int64_t_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -2816,7 +3231,7 @@ static int SHROUD_get_from_object_int8_t_list(PyObject *obj, (std::malloc(size * sizeof(int8_t))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int8_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -2825,6 +3240,7 @@ static int SHROUD_get_from_object_int8_t_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -2879,7 +3295,7 @@ static int SHROUD_get_from_object_int_list(PyObject *obj, int *in = static_cast(std::malloc(size * sizeof(int))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -2888,6 +3304,7 @@ static int SHROUD_get_from_object_int_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -2941,7 +3358,7 @@ static int SHROUD_get_from_object_long_list(PyObject *obj, long *in = static_cast(std::malloc(size * sizeof(long))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + long cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -2950,6 +3367,7 @@ static int SHROUD_get_from_object_long_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3028,7 +3446,7 @@ static int SHROUD_get_from_object_short_list(PyObject *obj, short *in = static_cast(std::malloc(size * sizeof(short))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + short cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -3037,6 +3455,7 @@ static int SHROUD_get_from_object_short_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3115,7 +3534,7 @@ static int SHROUD_get_from_object_uint16_t_list(PyObject *obj, (std::malloc(size * sizeof(uint16_t))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + uint16_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -3124,6 +3543,7 @@ static int SHROUD_get_from_object_uint16_t_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3179,7 +3599,7 @@ static int SHROUD_get_from_object_uint32_t_list(PyObject *obj, (std::malloc(size * sizeof(uint32_t))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + uint32_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -3188,6 +3608,7 @@ static int SHROUD_get_from_object_uint32_t_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3243,7 +3664,7 @@ static int SHROUD_get_from_object_uint64_t_list(PyObject *obj, (std::malloc(size * sizeof(uint64_t))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + uint64_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -3252,6 +3673,7 @@ static int SHROUD_get_from_object_uint64_t_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3307,7 +3729,7 @@ static int SHROUD_get_from_object_uint8_t_list(PyObject *obj, (std::malloc(size * sizeof(uint8_t))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + uint8_t cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -3316,6 +3738,7 @@ static int SHROUD_get_from_object_uint8_t_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3371,7 +3794,7 @@ static int SHROUD_get_from_object_unsigned_int_list(PyObject *obj, (std::malloc(size * sizeof(unsigned int))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + unsigned int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -3380,6 +3803,7 @@ static int SHROUD_get_from_object_unsigned_int_list(PyObject *obj, value->name, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3435,7 +3859,7 @@ static int SHROUD_get_from_object_unsigned_long_list(PyObject *obj, (std::malloc(size * sizeof(unsigned long))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + unsigned long cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -3444,6 +3868,7 @@ static int SHROUD_get_from_object_unsigned_long_list(PyObject *obj, value->name, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3523,7 +3948,7 @@ static int SHROUD_get_from_object_unsigned_short_list(PyObject *obj, (std::malloc(size * sizeof(unsigned short))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + unsigned short cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -3532,6 +3957,7 @@ static int SHROUD_get_from_object_unsigned_short_list(PyObject *obj, value->name, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -3609,6 +4035,22 @@ static PyObject *SHROUD_to_PyList_double(const double *in, size_t size) } ##### end to_PyList_double source +##### start to_PyList_double_complex source + +// helper to_PyList_double_complex +// Convert double complex pointer to PyList of PyObjects. +static PyObject *SHROUD_to_PyList_double_complex + (const double complex *in, size_t size) +{ + PyObject *out = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + PyList_SET_ITEM(out, i, PyComplex_FromDoubles( + creal(in[i]), cimag(in[i]))); + } + return out; +} +##### end to_PyList_double_complex source + ##### start to_PyList_float source // helper to_PyList_float @@ -3623,6 +4065,22 @@ static PyObject *SHROUD_to_PyList_float(const float *in, size_t size) } ##### end to_PyList_float source +##### start to_PyList_float_complex source + +// helper to_PyList_float_complex +// Convert float complex pointer to PyList of PyObjects. +static PyObject *SHROUD_to_PyList_float_complex + (const float complex *in, size_t size) +{ + PyObject *out = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + PyList_SET_ITEM(out, i, PyComplex_FromDoubles( + creal(in[i]), cimag(in[i]))); + } + return out; +} +##### end to_PyList_float_complex source + ##### start to_PyList_int source // helper to_PyList_int @@ -3858,6 +4316,22 @@ static PyObject *SHROUD_to_PyList_vector_double } ##### end to_PyList_vector_double source +##### start to_PyList_vector_double_complex source + +// helper to_PyList_vector_double_complex +static PyObject *SHROUD_to_PyList_vector_double_complex + (std::vector & in) +{ + size_t size = in.size(); + PyObject *out = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + PyList_SET_ITEM(out, i, PyComplex_FromDoubles( + creal(in[i]), cimag(in[i]))); + } + return out; +} +##### end to_PyList_vector_double_complex source + ##### start to_PyList_vector_float source // helper to_PyList_vector_float @@ -3872,6 +4346,22 @@ static PyObject *SHROUD_to_PyList_vector_float(std::vector & in) } ##### end to_PyList_vector_float source +##### start to_PyList_vector_float_complex source + +// helper to_PyList_vector_float_complex +static PyObject *SHROUD_to_PyList_vector_float_complex + (std::vector & in) +{ + size_t size = in.size(); + PyObject *out = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + PyList_SET_ITEM(out, i, PyComplex_FromDoubles( + creal(in[i]), cimag(in[i]))); + } + return out; +} +##### end to_PyList_vector_float_complex source + ##### start to_PyList_vector_int source // helper to_PyList_vector_int @@ -4140,6 +4630,23 @@ static void SHROUD_update_PyList_double } ##### end update_PyList_double source +##### start update_PyList_double_complex source + +// helper update_PyList_double_complex +// Replace members of existing list with new values. +// out is known to be a PyList of the correct length. +static void SHROUD_update_PyList_double_complex + (PyObject *out, double complex *in, size_t size) +{ + for (size_t i = 0; i < size; ++i) { + PyObject *item = PyList_GET_ITEM(out, i); + Py_DECREF(item); + PyList_SET_ITEM(out, i, PyComplex_FromDoubles( + creal(in[i]), cimag(in[i]))); + } +} +##### end update_PyList_double_complex source + ##### start update_PyList_float source // helper update_PyList_float @@ -4156,6 +4663,23 @@ static void SHROUD_update_PyList_float } ##### end update_PyList_float source +##### start update_PyList_float_complex source + +// helper update_PyList_float_complex +// Replace members of existing list with new values. +// out is known to be a PyList of the correct length. +static void SHROUD_update_PyList_float_complex + (PyObject *out, float complex *in, size_t size) +{ + for (size_t i = 0; i < size; ++i) { + PyObject *item = PyList_GET_ITEM(out, i); + Py_DECREF(item); + PyList_SET_ITEM(out, i, PyComplex_FromDoubles( + creal(in[i]), cimag(in[i]))); + } +} +##### end update_PyList_float_complex source + ##### start update_PyList_int source // helper update_PyList_int @@ -4412,6 +4936,23 @@ static void SHROUD_update_PyList_vector_double } ##### end update_PyList_vector_double source +##### start update_PyList_vector_double_complex source + +// helper update_PyList_vector_double_complex +// Replace members of existing list with new values. +// out is known to be a PyList of the correct length. +static void SHROUD_update_PyList_vector_double_complex + (PyObject *out, double complex *in, size_t size) +{ + for (size_t i = 0; i < size; ++i) { + PyObject *item = PyList_GET_ITEM(out, i); + Py_DECREF(item); + PyList_SET_ITEM(out, i, PyComplex_FromDoubles( + creal(in[i]), cimag(in[i]))); + } +} +##### end update_PyList_vector_double_complex source + ##### start update_PyList_vector_float source // helper update_PyList_vector_float @@ -4428,6 +4969,23 @@ static void SHROUD_update_PyList_vector_float } ##### end update_PyList_vector_float source +##### start update_PyList_vector_float_complex source + +// helper update_PyList_vector_float_complex +// Replace members of existing list with new values. +// out is known to be a PyList of the correct length. +static void SHROUD_update_PyList_vector_float_complex + (PyObject *out, float complex *in, size_t size) +{ + for (size_t i = 0; i < size; ++i) { + PyObject *item = PyList_GET_ITEM(out, i); + Py_DECREF(item); + PyList_SET_ITEM(out, i, PyComplex_FromDoubles( + creal(in[i]), cimag(in[i]))); + } +} +##### end update_PyList_vector_float_complex source + ##### start update_PyList_vector_int source // helper update_PyList_vector_int diff --git a/regression/reference/none/helpers.f b/regression/reference/none/helpers.f index 5d5ddf678..96f0c7b3e 100644 --- a/regression/reference/none/helpers.f +++ b/regression/reference/none/helpers.f @@ -38,9 +38,9 @@ ##### start array_context derived_type ! helper array_context -type, bind(C) :: SHROUD_array +type, bind(C) :: LIB_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(LIB_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -52,16 +52,16 @@ ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 -end type SHROUD_array +end type LIB_SHROUD_array ##### end array_context derived_type ##### start capsule_data_helper derived_type ! helper capsule_data_helper -type, bind(C) :: SHROUD_capsule_data +type, bind(C) :: LIB_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor -end type SHROUD_capsule_data +end type LIB_SHROUD_capsule_data ##### end capsule_data_helper derived_type ##### start capsule_dtor interface @@ -69,39 +69,39 @@ interface ! helper capsule_dtor ! Delete memory in a capsule. - subroutine SHROUD_capsule_dtor(ptr)& + subroutine LIB_SHROUD_capsule_dtor(ptr)& bind(C, name="LIB_SHROUD_memory_destructor") - import SHROUD_capsule_data + import LIB_SHROUD_capsule_data implicit none - type(SHROUD_capsule_data), intent(INOUT) :: ptr - end subroutine SHROUD_capsule_dtor + type(LIB_SHROUD_capsule_data), intent(INOUT) :: ptr + end subroutine LIB_SHROUD_capsule_dtor end interface ##### end capsule_dtor interface ##### start capsule_helper derived_type ! helper capsule_helper -type SHROUD_capsule +type :: LIB_SHROUD_capsule private - type(SHROUD_capsule_data) :: mem + type(LIB_SHROUD_capsule_data) :: mem contains final :: SHROUD_capsule_final procedure :: delete => SHROUD_capsule_delete -end type SHROUD_capsule +end type LIB_SHROUD_capsule ##### end capsule_helper derived_type ##### start capsule_helper source ! helper capsule_helper -! finalize a static SHROUD_capsule_data +! finalize a static LIB_SHROUD_capsule_data subroutine SHROUD_capsule_final(cap) - type(SHROUD_capsule), intent(INOUT) :: cap - call SHROUD_capsule_dtor(cap%mem) + type(LIB_SHROUD_capsule), intent(INOUT) :: cap + call LIB_SHROUD_capsule_dtor(cap%mem) end subroutine SHROUD_capsule_final subroutine SHROUD_capsule_delete(cap) - class(SHROUD_capsule) :: cap - call SHROUD_capsule_dtor(cap%mem) + class(LIB_SHROUD_capsule) :: cap + call LIB_SHROUD_capsule_dtor(cap%mem) end subroutine SHROUD_capsule_delete ##### end capsule_helper source @@ -110,46 +110,78 @@ end subroutine SHROUD_capsule_delete interface ! helper copy_array_double ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_double(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_double(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_DOUBLE, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context real(C_DOUBLE), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_double + end subroutine LIB_SHROUD_copy_array_double end interface ##### end copy_array_double interface +##### start copy_array_double_complex interface + +interface + ! helper copy_array_double_complex + ! Copy contents of context into c_var. + subroutine LIB_SHROUD_copy_array_double_complex(context, c_var, c_var_size) & + bind(C, name="LIB_ShroudCopyArray") + use iso_c_binding, only : C_DOUBLE_COMPLEX, C_SIZE_T + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context + complex(C_DOUBLE_COMPLEX), intent(OUT) :: c_var(*) + integer(C_SIZE_T), value :: c_var_size + end subroutine LIB_SHROUD_copy_array_double_complex +end interface +##### end copy_array_double_complex interface + ##### start copy_array_float interface interface ! helper copy_array_float ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_float(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_float(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_FLOAT, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context real(C_FLOAT), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_float + end subroutine LIB_SHROUD_copy_array_float end interface ##### end copy_array_float interface +##### start copy_array_float_complex interface + +interface + ! helper copy_array_float_complex + ! Copy contents of context into c_var. + subroutine LIB_SHROUD_copy_array_float_complex(context, c_var, c_var_size) & + bind(C, name="LIB_ShroudCopyArray") + use iso_c_binding, only : C_FLOAT_COMPLEX, C_SIZE_T + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context + complex(C_FLOAT_COMPLEX), intent(OUT) :: c_var(*) + integer(C_SIZE_T), value :: c_var_size + end subroutine LIB_SHROUD_copy_array_float_complex +end interface +##### end copy_array_float_complex interface + ##### start copy_array_int interface interface ! helper copy_array_int ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_int(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_int(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_int + end subroutine LIB_SHROUD_copy_array_int end interface ##### end copy_array_int interface @@ -158,14 +190,14 @@ end subroutine SHROUD_copy_array_int interface ! helper copy_array_int16_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_int16_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_int16_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT16_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT16_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_int16_t + end subroutine LIB_SHROUD_copy_array_int16_t end interface ##### end copy_array_int16_t interface @@ -174,14 +206,14 @@ end subroutine SHROUD_copy_array_int16_t interface ! helper copy_array_int32_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_int32_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_int32_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT32_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT32_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_int32_t + end subroutine LIB_SHROUD_copy_array_int32_t end interface ##### end copy_array_int32_t interface @@ -190,14 +222,14 @@ end subroutine SHROUD_copy_array_int32_t interface ! helper copy_array_int64_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_int64_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_int64_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT64_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT64_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_int64_t + end subroutine LIB_SHROUD_copy_array_int64_t end interface ##### end copy_array_int64_t interface @@ -206,14 +238,14 @@ end subroutine SHROUD_copy_array_int64_t interface ! helper copy_array_int8_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_int8_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_int8_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT8_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT8_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_int8_t + end subroutine LIB_SHROUD_copy_array_int8_t end interface ##### end copy_array_int8_t interface @@ -222,14 +254,14 @@ end subroutine SHROUD_copy_array_int8_t interface ! helper copy_array_long ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_long(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_long(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_LONG, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_LONG), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_long + end subroutine LIB_SHROUD_copy_array_long end interface ##### end copy_array_long interface @@ -238,14 +270,14 @@ end subroutine SHROUD_copy_array_long interface ! helper copy_array_long_long ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_long_long(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_long_long(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_LONG_LONG, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_LONG_LONG), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_long_long + end subroutine LIB_SHROUD_copy_array_long_long end interface ##### end copy_array_long_long interface @@ -254,14 +286,14 @@ end subroutine SHROUD_copy_array_long_long interface ! helper copy_array_short ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_short(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_short(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_SHORT, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_SHORT), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_short + end subroutine LIB_SHROUD_copy_array_short end interface ##### end copy_array_short interface @@ -270,14 +302,14 @@ end subroutine SHROUD_copy_array_short interface ! helper copy_array_size_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_size_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_size_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_SIZE_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_SIZE_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_size_t + end subroutine LIB_SHROUD_copy_array_size_t end interface ##### end copy_array_size_t interface @@ -286,14 +318,14 @@ end subroutine SHROUD_copy_array_size_t interface ! helper copy_array_uint16_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_uint16_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_uint16_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT16_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT16_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_uint16_t + end subroutine LIB_SHROUD_copy_array_uint16_t end interface ##### end copy_array_uint16_t interface @@ -302,14 +334,14 @@ end subroutine SHROUD_copy_array_uint16_t interface ! helper copy_array_uint32_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_uint32_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_uint32_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT32_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT32_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_uint32_t + end subroutine LIB_SHROUD_copy_array_uint32_t end interface ##### end copy_array_uint32_t interface @@ -318,14 +350,14 @@ end subroutine SHROUD_copy_array_uint32_t interface ! helper copy_array_uint64_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_uint64_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_uint64_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT64_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT64_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_uint64_t + end subroutine LIB_SHROUD_copy_array_uint64_t end interface ##### end copy_array_uint64_t interface @@ -334,14 +366,14 @@ end subroutine SHROUD_copy_array_uint64_t interface ! helper copy_array_uint8_t ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_uint8_t(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_uint8_t(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT8_T, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT8_T), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_uint8_t + end subroutine LIB_SHROUD_copy_array_uint8_t end interface ##### end copy_array_uint8_t interface @@ -350,14 +382,14 @@ end subroutine SHROUD_copy_array_uint8_t interface ! helper copy_array_unsigned_int ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_unsigned_int(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_unsigned_int(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_INT, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_INT), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_unsigned_int + end subroutine LIB_SHROUD_copy_array_unsigned_int end interface ##### end copy_array_unsigned_int interface @@ -366,14 +398,14 @@ end subroutine SHROUD_copy_array_unsigned_int interface ! helper copy_array_unsigned_long ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_unsigned_long(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_unsigned_long(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_LONG, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_LONG), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_unsigned_long + end subroutine LIB_SHROUD_copy_array_unsigned_long end interface ##### end copy_array_unsigned_long interface @@ -382,14 +414,14 @@ end subroutine SHROUD_copy_array_unsigned_long interface ! helper copy_array_unsigned_long_long ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_unsigned_long_long(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_unsigned_long_long(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_LONG_LONG, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_LONG_LONG), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_unsigned_long_long + end subroutine LIB_SHROUD_copy_array_unsigned_long_long end interface ##### end copy_array_unsigned_long_long interface @@ -398,14 +430,14 @@ end subroutine SHROUD_copy_array_unsigned_long_long interface ! helper copy_array_unsigned_short ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_unsigned_short(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_array_unsigned_short(context, c_var, c_var_size) & bind(C, name="LIB_ShroudCopyArray") use iso_c_binding, only : C_SHORT, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context integer(C_SHORT), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_unsigned_short + end subroutine LIB_SHROUD_copy_array_unsigned_short end interface ##### end copy_array_unsigned_short interface @@ -414,13 +446,13 @@ end subroutine SHROUD_copy_array_unsigned_short interface ! helper copy_string ! Copy the char* or std::string in context into c_var. - subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & + subroutine LIB_SHROUD_copy_string_and_free(context, c_var, c_var_size) & bind(c,name="LIB_ShroudCopyStringAndFree") use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import LIB_SHROUD_array + type(LIB_SHROUD_array), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_string_and_free + end subroutine LIB_SHROUD_copy_string_and_free end interface ##### end copy_string interface diff --git a/regression/reference/none/none.json b/regression/reference/none/none.json index 2b8897593..eefb1c03b 100644 --- a/regression/reference/none/none.json +++ b/regression/reference/none/none.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud 0.12.2 and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -39,11 +39,11 @@ "F_C_pure_clause": "", "F_C_result_clause": "", "F_arg_c_call": "", - "F_array_type": "SHROUD_array", - "F_capsule_data_type": "SHROUD_capsule_data", + "F_array_type": "LIB_SHROUD_array", + "F_capsule_data_type": "LIB_SHROUD_capsule_data", "F_capsule_delete_function": "SHROUD_capsule_delete", "F_capsule_final_function": "SHROUD_capsule_final", - "F_capsule_type": "SHROUD_capsule", + "F_capsule_type": "LIB_SHROUD_capsule", "F_derived_member": "cxxmem", "F_filename_suffix": "f", "F_impl_filename": "wrapflibrary.f", @@ -145,8 +145,11 @@ "F_C_name_template": "{F_C_prefix}{F_name_scope}{underscore_name}{function_suffix}{template_suffix}", "F_abstract_interface_argument_template": "arg{index}", "F_abstract_interface_subprogram_template": "{underscore_name}_{argname}", + "F_array_type_template": "{C_prefix}SHROUD_array", "F_auto_reference_count": false, - "F_capsule_data_type_class_template": "SHROUD_{F_name_scope}capsule", + "F_capsule_data_type_class_template": "{C_prefix}SHROUD_{F_name_scope}capsule", + "F_capsule_data_type_template": "{C_prefix}SHROUD_capsule_data", + "F_capsule_type_template": "{C_prefix}SHROUD_capsule", "F_create_bufferify_function": true, "F_create_generic": true, "F_enum_member_template": "{F_name_scope}{enum_member_lower}", @@ -307,6 +310,39 @@ "sgroup": "native", "sh_type": "SH_TYPE_DOUBLE" }, + "double_complex": { + "LUA_pop": "lua_tonumber({LUA_state_var}, {LUA_index})", + "LUA_push": "lua_pushnumber({LUA_state_var}, {c_var})", + "LUA_type": "LUA_TNUMBER", + "PYN_typenum": "NPY_DOUBLE", + "PY_build_arg": "&{ctype_var}", + "PY_ctor": "PyComplex_FromDoubles(\t{ctor_expr})", + "PY_format": "D", + "PY_get": "PyComplex_AsCComplex({py_var})", + "c_header": [ + "" + ], + "c_type": "double complex", + "cxx_header": [ + "" + ], + "cxx_to_pytype": "{ctype_var}.real = creal({cxx_var});\n{ctype_var}.imag = cimag({cxx_var});", + "cxx_type": "std::complex", + "f_cast": "cmplx({f_var}, C_DOUBLE_COMPLEX)", + "f_kind": "C_DOUBLE_COMPLEX", + "f_module": { + "iso_c_binding": [ + "C_DOUBLE_COMPLEX" + ] + }, + "f_type": "complex(C_DOUBLE_COMPLEX)", + "flat_name": "double_complex", + "py_ctype": "Py_complex", + "pytype_to_cxx": "{work_var}.real + {work_var}.imag * I", + "pytype_to_pyctor": "creal({ctor_expr}), cimag({ctor_expr})", + "sgroup": "native", + "sh_type": "SH_TYPE_DOUBLE_COMPLEX" + }, "float": { "LUA_pop": "lua_tonumber({LUA_state_var}, {LUA_index})", "LUA_push": "lua_pushnumber({LUA_state_var}, {c_var})", @@ -329,6 +365,39 @@ "sgroup": "native", "sh_type": "SH_TYPE_FLOAT" }, + "float_complex": { + "LUA_pop": "lua_tonumber({LUA_state_var}, {LUA_index})", + "LUA_push": "lua_pushnumber({LUA_state_var}, {c_var})", + "LUA_type": "LUA_TNUMBER", + "PYN_typenum": "NPY_DOUBLE", + "PY_build_arg": "&{ctype_var}", + "PY_ctor": "PyComplex_FromDoubles(\t{ctor_expr})", + "PY_format": "D", + "PY_get": "PyComplex_AsCComplex({py_var})", + "c_header": [ + "" + ], + "c_type": "float complex", + "cxx_header": [ + "" + ], + "cxx_to_pytype": "{py_var}.real = creal({cxx_var});\n{py_var}.imag = cimag({cxx_var});", + "cxx_type": "std::complex", + "f_cast": "cmplx({f_var}, C_FLOAT_COMPLEX)", + "f_kind": "C_FLOAT_COMPLEX", + "f_module": { + "iso_c_binding": [ + "C_FLOAT_COMPLEX" + ] + }, + "f_type": "complex(C_FLOAT_COMPLEX)", + "flat_name": "float_complex", + "py_ctype": "Py_complex", + "pytype_to_cxx": "{work_var}.real + {work_var}.imag * I", + "pytype_to_pyctor": "creal({ctor_expr}), cimag({ctor_expr})", + "sgroup": "native", + "sh_type": "SH_TYPE_FLOAT_COMPLEX" + }, "int": { "LUA_pop": "lua_tointeger({LUA_state_var}, {LUA_index})", "LUA_push": "lua_pushinteger({LUA_state_var}, {c_var})", diff --git a/regression/reference/none/typeslibrary.h b/regression/reference/none/typeslibrary.h index cc59b0786..1d4449822 100644 --- a/regression/reference/none/typeslibrary.h +++ b/regression/reference/none/typeslibrary.h @@ -1,5 +1,5 @@ // typeslibrary.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud 0.12.2. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/none/wrapflibrary.f b/regression/reference/none/wrapflibrary.f index 76119fced..b5764151a 100644 --- a/regression/reference/none/wrapflibrary.f +++ b/regression/reference/none/wrapflibrary.f @@ -1,5 +1,5 @@ ! wrapflibrary.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud 0.12.2. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/none/wraplibrary.cpp b/regression/reference/none/wraplibrary.cpp index 4976cdaed..ddc2c9c76 100644 --- a/regression/reference/none/wraplibrary.cpp +++ b/regression/reference/none/wraplibrary.cpp @@ -1,5 +1,5 @@ // wraplibrary.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud 0.12.2. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/luaownershipmodule.cpp b/regression/reference/ownership/luaownershipmodule.cpp index 2dcb5cb5a..6ec145d42 100644 --- a/regression/reference/ownership/luaownershipmodule.cpp +++ b/regression/reference/ownership/luaownershipmodule.cpp @@ -1,5 +1,5 @@ // luaownershipmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/luaownershipmodule.hpp b/regression/reference/ownership/luaownershipmodule.hpp index 1d8368d14..ac0bc251a 100644 --- a/regression/reference/ownership/luaownershipmodule.hpp +++ b/regression/reference/ownership/luaownershipmodule.hpp @@ -1,5 +1,5 @@ // luaownershipmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/ownership.json b/regression/reference/ownership/ownership.json index 15a0bd724..2c2c77cc2 100644 --- a/regression/reference/ownership/ownership.json +++ b/regression/reference/ownership/ownership.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapClass1.cpp", "C_name_scope": "Class1_", "C_type_name": "OWN_Class1", - "F_capsule_data_type": "SHROUD_class1_capsule", + "F_capsule_data_type": "OWN_SHROUD_class1_capsule", "F_derived_name": "class1", "F_name_scope": "class1_", "LUA_class_reg": "l_Class1_Reg", @@ -582,6 +582,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_pointer", @@ -796,6 +797,7 @@ "cxx_rv_decl": "int * SHC_rv", "function_name": "ReturnIntPtrDimPointer", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_dim_pointer" }, "options": { @@ -872,6 +874,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "OWN_SHROUD_copy_array_int", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_allocatable", @@ -1086,6 +1089,7 @@ "cxx_rv_decl": "int * SHC_rv", "function_name": "ReturnIntPtrDimAlloc", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_dim_alloc" }, "options": { @@ -1162,6 +1166,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_pointer", @@ -1376,6 +1381,7 @@ "cxx_rv_decl": "int * SHC_rv", "function_name": "ReturnIntPtrDimDefault", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_dim_default" }, "options": { @@ -1559,6 +1565,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "capsule_helper", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_pointer_caller", @@ -1778,6 +1785,7 @@ "cxx_rv_decl": "int * SHC_rv", "function_name": "ReturnIntPtrDimPointerNew", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_dim_pointer_new" }, "options": { @@ -2002,6 +2010,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "capsule_helper", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_pointer_caller", @@ -2221,6 +2230,7 @@ "cxx_rv_decl": "int * SHC_rv", "function_name": "ReturnIntPtrDimDefaultNew", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_dim_default_new" }, "options": { diff --git a/regression/reference/ownership/ownership_types.yaml b/regression/reference/ownership/ownership_types.yaml index f6599937e..50cd37cba 100644 --- a/regression/reference/ownership/ownership_types.yaml +++ b/regression/reference/ownership/ownership_types.yaml @@ -1,5 +1,5 @@ # ownership_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -16,5 +16,5 @@ typemap: c_type: OWN_Class1 f_module_name: ownership_mod f_derived_type: class1 - f_capsule_data_type: SHROUD_class1_capsule + f_capsule_data_type: OWN_SHROUD_class1_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/ownership/pyClass1type.cpp b/regression/reference/ownership/pyClass1type.cpp index b8cd29a29..b535d23af 100644 --- a/regression/reference/ownership/pyClass1type.cpp +++ b/regression/reference/ownership/pyClass1type.cpp @@ -1,5 +1,5 @@ // pyClass1type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/pyownershipmodule.cpp b/regression/reference/ownership/pyownershipmodule.cpp index a8a5ec12b..aed9e0e28 100644 --- a/regression/reference/ownership/pyownershipmodule.cpp +++ b/regression/reference/ownership/pyownershipmodule.cpp @@ -1,5 +1,5 @@ // pyownershipmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/pyownershipmodule.hpp b/regression/reference/ownership/pyownershipmodule.hpp index cd37446e6..d2d3d8c9f 100644 --- a/regression/reference/ownership/pyownershipmodule.hpp +++ b/regression/reference/ownership/pyownershipmodule.hpp @@ -1,5 +1,5 @@ // pyownershipmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/pyownershiputil.cpp b/regression/reference/ownership/pyownershiputil.cpp index b3b0190f2..dbde6ec6d 100644 --- a/regression/reference/ownership/pyownershiputil.cpp +++ b/regression/reference/ownership/pyownershiputil.cpp @@ -1,5 +1,5 @@ // pyownershiputil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/setup.py b/regression/reference/ownership/setup.py index 7b18eec61..619de873e 100644 --- a/regression/reference/ownership/setup.py +++ b/regression/reference/ownership/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/typesownership.h b/regression/reference/ownership/typesownership.h index 4bf362e6f..4de027022 100644 --- a/regression/reference/ownership/typesownership.h +++ b/regression/reference/ownership/typesownership.h @@ -1,5 +1,5 @@ // typesownership.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/utilownership.cpp b/regression/reference/ownership/utilownership.cpp index 156a21ef7..2d964f4a0 100644 --- a/regression/reference/ownership/utilownership.cpp +++ b/regression/reference/ownership/utilownership.cpp @@ -1,5 +1,5 @@ // utilownership.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/wrapClass1.cpp b/regression/reference/ownership/wrapClass1.cpp index d3ec47afc..c4b39b990 100644 --- a/regression/reference/ownership/wrapClass1.cpp +++ b/regression/reference/ownership/wrapClass1.cpp @@ -1,5 +1,5 @@ // wrapClass1.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/wrapClass1.h b/regression/reference/ownership/wrapClass1.h index b8931bfc2..e70787a9e 100644 --- a/regression/reference/ownership/wrapClass1.h +++ b/regression/reference/ownership/wrapClass1.h @@ -1,5 +1,5 @@ // wrapClass1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/wrapfownership.f b/regression/reference/ownership/wrapfownership.f index 5a281b602..9170f8919 100644 --- a/regression/reference/ownership/wrapfownership.f +++ b/regression/reference/ownership/wrapfownership.f @@ -1,5 +1,5 @@ ! wrapfownership.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,15 +22,15 @@ module ownership_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: OWN_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type OWN_SHROUD_capsule_data ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: OWN_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(OWN_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -42,24 +42,24 @@ module ownership_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type OWN_SHROUD_array ! helper capsule_helper - type SHROUD_capsule + type :: OWN_SHROUD_capsule private - type(SHROUD_capsule_data) :: mem + type(OWN_SHROUD_capsule_data) :: mem contains final :: SHROUD_capsule_final procedure :: delete => SHROUD_capsule_delete - end type SHROUD_capsule + end type OWN_SHROUD_capsule - type, bind(C) :: SHROUD_class1_capsule + type, bind(C) :: OWN_SHROUD_class1_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class1_capsule + end type OWN_SHROUD_class1_capsule type class1 - type(SHROUD_class1_capsule) :: cxxmem + type(OWN_SHROUD_class1_capsule) :: cxxmem ! splicer begin class.Class1.component_part ! splicer end class.Class1.component_part contains @@ -88,9 +88,9 @@ module ownership_mod ! Match: c_default subroutine c_class1_dtor(self) & bind(C, name="OWN_Class1_dtor") - import :: SHROUD_class1_capsule + import :: OWN_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(OWN_SHROUD_class1_capsule), intent(IN) :: self end subroutine c_class1_dtor ! ---------------------------------------- @@ -101,9 +101,9 @@ function c_class1_get_flag(self) & result(SHT_rv) & bind(C, name="OWN_Class1_get_flag") use iso_c_binding, only : C_INT - import :: SHROUD_class1_capsule + import :: OWN_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(IN) :: self + type(OWN_SHROUD_class1_capsule), intent(IN) :: self integer(C_INT) :: SHT_rv end function c_class1_get_flag @@ -191,9 +191,9 @@ function c_return_int_ptr_dim_pointer_bufferify(DSHC_rv, len) & result(SHT_rv) & bind(C, name="OWN_return_int_ptr_dim_pointer_bufferify") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_array + import :: OWN_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(OWN_SHROUD_array), intent(INOUT) :: DSHC_rv integer(C_INT), intent(OUT) :: len type(C_PTR) SHT_rv end function c_return_int_ptr_dim_pointer_bufferify @@ -226,9 +226,9 @@ function c_return_int_ptr_dim_alloc_bufferify(DSHC_rv, len) & result(SHT_rv) & bind(C, name="OWN_return_int_ptr_dim_alloc_bufferify") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_array + import :: OWN_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(OWN_SHROUD_array), intent(INOUT) :: DSHC_rv integer(C_INT), intent(OUT) :: len type(C_PTR) SHT_rv end function c_return_int_ptr_dim_alloc_bufferify @@ -261,9 +261,9 @@ function c_return_int_ptr_dim_default_bufferify(DSHC_rv, len) & result(SHT_rv) & bind(C, name="OWN_return_int_ptr_dim_default_bufferify") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_array + import :: OWN_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(OWN_SHROUD_array), intent(INOUT) :: DSHC_rv integer(C_INT), intent(OUT) :: len type(C_PTR) SHT_rv end function c_return_int_ptr_dim_default_bufferify @@ -314,9 +314,9 @@ function c_return_int_ptr_dim_pointer_new_bufferify(DSHC_rv, & result(SHT_rv) & bind(C, name="OWN_return_int_ptr_dim_pointer_new_bufferify") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_array + import :: OWN_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(OWN_SHROUD_array), intent(INOUT) :: DSHC_rv integer(C_INT), intent(OUT) :: len type(C_PTR) SHT_rv end function c_return_int_ptr_dim_pointer_new_bufferify @@ -367,9 +367,9 @@ function c_return_int_ptr_dim_default_new_bufferify(DSHC_rv, & result(SHT_rv) & bind(C, name="OWN_return_int_ptr_dim_default_new_bufferify") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_array + import :: OWN_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(OWN_SHROUD_array), intent(INOUT) :: DSHC_rv integer(C_INT), intent(OUT) :: len type(C_PTR) SHT_rv end function c_return_int_ptr_dim_default_new_bufferify @@ -397,9 +397,9 @@ function c_get_class_static(SHT_crv) & result(SHT_rv) & bind(C, name="OWN_get_class_static") use iso_c_binding, only : C_PTR - import :: SHROUD_class1_capsule + import :: OWN_SHROUD_class1_capsule implicit none - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(OWN_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_get_class_static @@ -415,10 +415,10 @@ function c_get_class_new(flag, SHT_crv) & result(SHT_rv) & bind(C, name="OWN_get_class_new") use iso_c_binding, only : C_INT, C_PTR - import :: SHROUD_class1_capsule + import :: OWN_SHROUD_class1_capsule implicit none integer(C_INT), value, intent(IN) :: flag - type(SHROUD_class1_capsule), intent(OUT) :: SHT_crv + type(OWN_SHROUD_class1_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_get_class_new @@ -429,25 +429,25 @@ end function c_get_class_new interface ! helper capsule_dtor ! Delete memory in a capsule. - subroutine SHROUD_capsule_dtor(ptr) & + subroutine OWN_SHROUD_capsule_dtor(ptr) & bind(C, name="OWN_SHROUD_memory_destructor") - import SHROUD_capsule_data + import OWN_SHROUD_capsule_data implicit none - type(SHROUD_capsule_data), intent(INOUT) :: ptr - end subroutine SHROUD_capsule_dtor + type(OWN_SHROUD_capsule_data), intent(INOUT) :: ptr + end subroutine OWN_SHROUD_capsule_dtor end interface interface ! helper copy_array_int ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_int(context, c_var, c_var_size) & + subroutine OWN_SHROUD_copy_array_int(context, c_var, c_var_size) & bind(C, name="OWN_ShroudCopyArray") use iso_c_binding, only : C_INT, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import OWN_SHROUD_array + type(OWN_SHROUD_array), intent(IN) :: context integer(C_INT), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_int + end subroutine OWN_SHROUD_copy_array_int end interface contains @@ -541,7 +541,7 @@ end function return_int_ptr_pointer function return_int_ptr_dim_pointer() & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR, c_f_pointer - type(SHROUD_array) :: DSHC_rv + type(OWN_SHROUD_array) :: DSHC_rv integer(C_INT) :: len integer(C_INT), pointer :: SHT_rv(:) ! splicer begin function.return_int_ptr_dim_pointer @@ -567,14 +567,14 @@ end function return_int_ptr_dim_pointer function return_int_ptr_dim_alloc() & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR - type(SHROUD_array) :: DSHC_rv + type(OWN_SHROUD_array) :: DSHC_rv integer(C_INT) :: len integer(C_INT), allocatable :: SHT_rv(:) ! splicer begin function.return_int_ptr_dim_alloc type(C_PTR) :: SHT_ptr SHT_ptr = c_return_int_ptr_dim_alloc_bufferify(DSHC_rv, len) allocate(SHT_rv(len)) - call SHROUD_copy_array_int(DSHC_rv, SHT_rv, size(SHT_rv, kind=C_SIZE_T)) + call OWN_SHROUD_copy_array_int(DSHC_rv, SHT_rv, size(SHT_rv, kind=C_SIZE_T)) ! splicer end function.return_int_ptr_dim_alloc end function return_int_ptr_dim_alloc @@ -594,7 +594,7 @@ end function return_int_ptr_dim_alloc function return_int_ptr_dim_default() & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR, c_f_pointer - type(SHROUD_array) :: DSHC_rv + type(OWN_SHROUD_array) :: DSHC_rv integer(C_INT) :: len integer(C_INT), pointer :: SHT_rv(:) ! splicer begin function.return_int_ptr_dim_default @@ -620,10 +620,10 @@ end function return_int_ptr_dim_default function return_int_ptr_dim_pointer_new(Crv) & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR, c_f_pointer - type(SHROUD_array) :: DSHC_rv + type(OWN_SHROUD_array) :: DSHC_rv integer(C_INT) :: len integer(C_INT), pointer :: SHT_rv(:) - type(SHROUD_capsule), intent(OUT) :: Crv + type(OWN_SHROUD_capsule), intent(OUT) :: Crv ! splicer begin function.return_int_ptr_dim_pointer_new type(C_PTR) :: SHT_ptr SHT_ptr = c_return_int_ptr_dim_pointer_new_bufferify(DSHC_rv, & @@ -649,10 +649,10 @@ end function return_int_ptr_dim_pointer_new function return_int_ptr_dim_default_new(Crv) & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR, c_f_pointer - type(SHROUD_array) :: DSHC_rv + type(OWN_SHROUD_array) :: DSHC_rv integer(C_INT) :: len integer(C_INT), pointer :: SHT_rv(:) - type(SHROUD_capsule), intent(OUT) :: Crv + type(OWN_SHROUD_capsule), intent(OUT) :: Crv ! splicer begin function.return_int_ptr_dim_default_new type(C_PTR) :: SHT_ptr SHT_ptr = c_return_int_ptr_dim_default_new_bufferify(DSHC_rv, & @@ -733,15 +733,15 @@ function class1_ne(a,b) result (rv) end function class1_ne ! helper capsule_helper - ! finalize a static SHROUD_capsule_data + ! finalize a static OWN_SHROUD_capsule_data subroutine SHROUD_capsule_final(cap) - type(SHROUD_capsule), intent(INOUT) :: cap - call SHROUD_capsule_dtor(cap%mem) + type(OWN_SHROUD_capsule), intent(INOUT) :: cap + call OWN_SHROUD_capsule_dtor(cap%mem) end subroutine SHROUD_capsule_final subroutine SHROUD_capsule_delete(cap) - class(SHROUD_capsule) :: cap - call SHROUD_capsule_dtor(cap%mem) + class(OWN_SHROUD_capsule) :: cap + call OWN_SHROUD_capsule_dtor(cap%mem) end subroutine SHROUD_capsule_delete end module ownership_mod diff --git a/regression/reference/ownership/wrapownership.cpp b/regression/reference/ownership/wrapownership.cpp index c5c825ee9..ee0512b95 100644 --- a/regression/reference/ownership/wrapownership.cpp +++ b/regression/reference/ownership/wrapownership.cpp @@ -1,5 +1,5 @@ // wrapownership.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/ownership/wrapownership.h b/regression/reference/ownership/wrapownership.h index 77f5ad67c..a169adfc6 100644 --- a/regression/reference/ownership/wrapownership.h +++ b/regression/reference/ownership/wrapownership.h @@ -1,5 +1,5 @@ // wrapownership.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-c/pointers.json b/regression/reference/pointers-c/pointers.json index a84c4ade2..8e56e20fc 100644 --- a/regression/reference/pointers-c/pointers.json +++ b/regression/reference/pointers-c/pointers.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -2633,6 +2633,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "nitems", + "hnamefunc0": "array_context", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", "stmt1": "f_native_**_out", @@ -2822,6 +2823,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -3059,6 +3061,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -3310,6 +3313,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -3496,6 +3500,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "nitems", + "hnamefunc0": "array_context", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", "stmt1": "f_native_**_out", @@ -3684,6 +3689,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -3917,6 +3923,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -5485,6 +5492,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_pointer", @@ -5600,6 +5608,7 @@ "cxx_rv_decl": "int * SHC_rv", "function_name": "returnIntPtrToFixedArray", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_to_fixed_array" }, "options": { @@ -5703,6 +5712,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_pointer", @@ -5820,6 +5830,7 @@ "cxx_rv_decl": "const int * SHC_rv", "function_name": "returnIntPtrToFixedConstArray", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_to_fixed_const_array" }, "options": { diff --git a/regression/reference/pointers-c/typespointers.h b/regression/reference/pointers-c/typespointers.h index 72a096d97..50d2740b5 100644 --- a/regression/reference/pointers-c/typespointers.h +++ b/regression/reference/pointers-c/typespointers.h @@ -1,5 +1,5 @@ // typespointers.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-c/wrapfpointers.f b/regression/reference/pointers-c/wrapfpointers.f index 92bfbc95a..edbd7da28 100644 --- a/regression/reference/pointers-c/wrapfpointers.f +++ b/regression/reference/pointers-c/wrapfpointers.f @@ -1,5 +1,5 @@ ! wrapfpointers.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,16 +22,16 @@ module pointers_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: POI_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type POI_SHROUD_capsule_data ! start array_context ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: POI_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(POI_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,7 +43,7 @@ module pointers_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type POI_SHROUD_array ! end array_context ! ---------------------------------------- @@ -516,9 +516,9 @@ end subroutine c_get_ptr_to_scalar interface subroutine c_get_ptr_to_scalar_bufferify(Dnitems) & bind(C, name="POI_get_ptr_to_scalar_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dnitems + type(POI_SHROUD_array), intent(INOUT) :: Dnitems end subroutine c_get_ptr_to_scalar_bufferify end interface ! end c_get_ptr_to_scalar_bufferify @@ -554,9 +554,9 @@ end subroutine c_get_ptr_to_fixed_array interface subroutine c_get_ptr_to_fixed_array_bufferify(Dcount) & bind(C, name="POI_get_ptr_to_fixed_array_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_ptr_to_fixed_array_bufferify end interface ! end c_get_ptr_to_fixed_array_bufferify @@ -602,9 +602,9 @@ end subroutine c_get_ptr_to_dynamic_array subroutine c_get_ptr_to_dynamic_array_bufferify(Dcount, ncount) & bind(C, name="POI_get_ptr_to_dynamic_array_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount integer(C_INT), intent(OUT) :: ncount end subroutine c_get_ptr_to_dynamic_array_bufferify end interface @@ -641,9 +641,9 @@ end subroutine c_get_ptr_to_func_array interface subroutine c_get_ptr_to_func_array_bufferify(Dcount) & bind(C, name="POI_get_ptr_to_func_array_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_ptr_to_func_array_bufferify end interface ! end c_get_ptr_to_func_array_bufferify @@ -679,9 +679,9 @@ end subroutine c_get_ptr_to_const_scalar interface subroutine c_get_ptr_to_const_scalar_bufferify(Dnitems) & bind(C, name="POI_get_ptr_to_const_scalar_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dnitems + type(POI_SHROUD_array), intent(INOUT) :: Dnitems end subroutine c_get_ptr_to_const_scalar_bufferify end interface ! end c_get_ptr_to_const_scalar_bufferify @@ -717,9 +717,9 @@ end subroutine c_get_ptr_to_fixed_const_array interface subroutine c_get_ptr_to_fixed_const_array_bufferify(Dcount) & bind(C, name="POI_get_ptr_to_fixed_const_array_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_ptr_to_fixed_const_array_bufferify end interface ! end c_get_ptr_to_fixed_const_array_bufferify @@ -766,9 +766,9 @@ subroutine c_get_ptr_to_dynamic_const_array_bufferify(Dcount, & ncount) & bind(C, name="POI_get_ptr_to_dynamic_const_array_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount integer(C_INT), intent(OUT) :: ncount end subroutine c_get_ptr_to_dynamic_const_array_bufferify end interface @@ -805,9 +805,9 @@ end subroutine c_get_raw_ptr_to_scalar interface subroutine c_get_raw_ptr_to_scalar_bufferify(Dnitems) & bind(C, name="POI_get_raw_ptr_to_scalar_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dnitems + type(POI_SHROUD_array), intent(INOUT) :: Dnitems end subroutine c_get_raw_ptr_to_scalar_bufferify end interface ! end c_get_raw_ptr_to_scalar_bufferify @@ -843,9 +843,9 @@ end subroutine c_get_raw_ptr_to_scalar_force interface subroutine c_get_raw_ptr_to_scalar_force_bufferify(Dnitems) & bind(C, name="POI_get_raw_ptr_to_scalar_force_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dnitems + type(POI_SHROUD_array), intent(INOUT) :: Dnitems end subroutine c_get_raw_ptr_to_scalar_force_bufferify end interface ! end c_get_raw_ptr_to_scalar_force_bufferify @@ -881,9 +881,9 @@ end subroutine c_get_raw_ptr_to_fixed_array interface subroutine c_get_raw_ptr_to_fixed_array_bufferify(Dcount) & bind(C, name="POI_get_raw_ptr_to_fixed_array_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_raw_ptr_to_fixed_array_bufferify end interface ! end c_get_raw_ptr_to_fixed_array_bufferify @@ -919,9 +919,9 @@ end subroutine c_get_raw_ptr_to_fixed_array_force interface subroutine c_get_raw_ptr_to_fixed_array_force_bufferify(Dcount) & bind(C, name="POI_get_raw_ptr_to_fixed_array_force_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_raw_ptr_to_fixed_array_force_bufferify end interface ! end c_get_raw_ptr_to_fixed_array_force_bufferify @@ -1086,9 +1086,9 @@ function c_return_int_ptr_to_fixed_array_bufferify(DSHC_rv) & result(SHT_rv) & bind(C, name="POI_return_int_ptr_to_fixed_array_bufferify") use iso_c_binding, only : C_PTR - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(POI_SHROUD_array), intent(INOUT) :: DSHC_rv type(C_PTR) SHT_rv end function c_return_int_ptr_to_fixed_array_bufferify end interface @@ -1136,9 +1136,9 @@ function c_return_int_ptr_to_fixed_const_array_bufferify( & result(SHT_rv) & bind(C, name="POI_return_int_ptr_to_fixed_const_array_bufferify") use iso_c_binding, only : C_PTR - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(POI_SHROUD_array), intent(INOUT) :: DSHC_rv type(C_PTR) SHT_rv end function c_return_int_ptr_to_fixed_const_array_bufferify end interface @@ -1485,7 +1485,7 @@ end function accept_char_array_in subroutine get_ptr_to_scalar(nitems) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: nitems - type(SHROUD_array) :: Dnitems + type(POI_SHROUD_array) :: Dnitems ! splicer begin function.get_ptr_to_scalar call c_get_ptr_to_scalar_bufferify(Dnitems) call c_f_pointer(Dnitems%base_addr, nitems) @@ -1514,7 +1514,7 @@ end subroutine get_ptr_to_scalar subroutine get_ptr_to_fixed_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount ! splicer begin function.get_ptr_to_fixed_array call c_get_ptr_to_fixed_array_bufferify(Dcount) call c_f_pointer(Dcount%base_addr, count, Dcount%shape(1:1)) @@ -1550,7 +1550,7 @@ end subroutine get_ptr_to_fixed_array subroutine get_ptr_to_dynamic_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount integer(C_INT) :: ncount ! splicer begin function.get_ptr_to_dynamic_array call c_get_ptr_to_dynamic_array_bufferify(Dcount, ncount) @@ -1582,7 +1582,7 @@ end subroutine get_ptr_to_dynamic_array subroutine get_ptr_to_func_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount ! splicer begin function.get_ptr_to_func_array call c_get_ptr_to_func_array_bufferify(Dcount) call c_f_pointer(Dcount%base_addr, count, Dcount%shape(1:1)) @@ -1608,7 +1608,7 @@ end subroutine get_ptr_to_func_array subroutine get_ptr_to_const_scalar(nitems) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: nitems - type(SHROUD_array) :: Dnitems + type(POI_SHROUD_array) :: Dnitems ! splicer begin function.get_ptr_to_const_scalar call c_get_ptr_to_const_scalar_bufferify(Dnitems) call c_f_pointer(Dnitems%base_addr, nitems) @@ -1634,7 +1634,7 @@ end subroutine get_ptr_to_const_scalar subroutine get_ptr_to_fixed_const_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount ! splicer begin function.get_ptr_to_fixed_const_array call c_get_ptr_to_fixed_const_array_bufferify(Dcount) call c_f_pointer(Dcount%base_addr, count, Dcount%shape(1:1)) @@ -1666,7 +1666,7 @@ end subroutine get_ptr_to_fixed_const_array subroutine get_ptr_to_dynamic_const_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount integer(C_INT) :: ncount ! splicer begin function.get_ptr_to_dynamic_const_array call c_get_ptr_to_dynamic_const_array_bufferify(Dcount, ncount) @@ -1696,7 +1696,7 @@ subroutine get_raw_ptr_to_scalar(nitems) use iso_c_binding, only : C_INT, C_PTR type(C_PTR), intent(OUT) :: nitems ! splicer begin function.get_raw_ptr_to_scalar - type(SHROUD_array) Dnitems + type(POI_SHROUD_array) Dnitems call c_get_raw_ptr_to_scalar_bufferify(Dnitems) nitems = Dnitems%base_addr ! splicer end function.get_raw_ptr_to_scalar @@ -1724,7 +1724,7 @@ subroutine get_raw_ptr_to_scalar_force(nitems) use iso_c_binding, only : C_INT, C_PTR type(C_PTR), intent(OUT) :: nitems ! splicer begin function.get_raw_ptr_to_scalar_force - type(SHROUD_array) Dnitems + type(POI_SHROUD_array) Dnitems call c_get_raw_ptr_to_scalar_force_bufferify(Dnitems) nitems = Dnitems%base_addr ! splicer end function.get_raw_ptr_to_scalar_force @@ -1754,7 +1754,7 @@ subroutine get_raw_ptr_to_fixed_array(count) use iso_c_binding, only : C_INT, C_PTR type(C_PTR), intent(OUT) :: count ! splicer begin function.get_raw_ptr_to_fixed_array - type(SHROUD_array) Dcount + type(POI_SHROUD_array) Dcount call c_get_raw_ptr_to_fixed_array_bufferify(Dcount) count = Dcount%base_addr ! splicer end function.get_raw_ptr_to_fixed_array @@ -1783,7 +1783,7 @@ subroutine get_raw_ptr_to_fixed_array_force(count) use iso_c_binding, only : C_INT, C_PTR type(C_PTR), intent(OUT) :: count ! splicer begin function.get_raw_ptr_to_fixed_array_force - type(SHROUD_array) Dcount + type(POI_SHROUD_array) Dcount call c_get_raw_ptr_to_fixed_array_force_bufferify(Dcount) count = Dcount%base_addr ! splicer end function.get_raw_ptr_to_fixed_array_force @@ -1871,7 +1871,7 @@ end function return_int_ptr_to_scalar function return_int_ptr_to_fixed_array() & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR, c_f_pointer - type(SHROUD_array) :: DSHC_rv + type(POI_SHROUD_array) :: DSHC_rv integer(C_INT), pointer :: SHT_rv(:) ! splicer begin function.return_int_ptr_to_fixed_array type(C_PTR) :: SHT_ptr @@ -1911,7 +1911,7 @@ end function return_int_ptr_to_const_scalar function return_int_ptr_to_fixed_const_array() & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR, c_f_pointer - type(SHROUD_array) :: DSHC_rv + type(POI_SHROUD_array) :: DSHC_rv integer(C_INT), pointer :: SHT_rv(:) ! splicer begin function.return_int_ptr_to_fixed_const_array type(C_PTR) :: SHT_ptr diff --git a/regression/reference/pointers-c/wrappointers.c b/regression/reference/pointers-c/wrappointers.c index a4e679ac0..33bfaacff 100644 --- a/regression/reference/pointers-c/wrappointers.c +++ b/regression/reference/pointers-c/wrappointers.c @@ -1,5 +1,5 @@ // wrappointers.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-c/wrappointers.h b/regression/reference/pointers-c/wrappointers.h index 007dd9d7f..c1b5c283d 100644 --- a/regression/reference/pointers-c/wrappointers.h +++ b/regression/reference/pointers-c/wrappointers.h @@ -1,5 +1,5 @@ // wrappointers.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-cxx/pointers.json b/regression/reference/pointers-cxx/pointers.json index 6b85bcca3..629e02d94 100644 --- a/regression/reference/pointers-cxx/pointers.json +++ b/regression/reference/pointers-cxx/pointers.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -2633,6 +2633,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "nitems", + "hnamefunc0": "array_context", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", "stmt1": "f_native_**_out", @@ -2822,6 +2823,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -3059,6 +3061,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -3310,6 +3313,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -3496,6 +3500,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "nitems", + "hnamefunc0": "array_context", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", "stmt1": "f_native_**_out", @@ -3684,6 +3689,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -3917,6 +3923,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "count", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_**_out_pointer", @@ -5485,6 +5492,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_pointer", @@ -5600,6 +5608,7 @@ "cxx_rv_decl": "int * SHC_rv", "function_name": "returnIntPtrToFixedArray", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_to_fixed_array" }, "options": { @@ -5703,6 +5712,7 @@ "f_assumed_shape": "(:)", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "array_context", "rank": "1", "sh_type": "SH_TYPE_INT", "stmt0": "f_native_*_result_pointer", @@ -5820,6 +5830,7 @@ "cxx_rv_decl": "const int * SHC_rv", "function_name": "returnIntPtrToFixedConstArray", "function_suffix": "_bufferify", + "hnamefunc0": "array_context", "underscore_name": "return_int_ptr_to_fixed_const_array" }, "options": { diff --git a/regression/reference/pointers-cxx/typespointers.h b/regression/reference/pointers-cxx/typespointers.h index 669db69a5..61e2d19d1 100644 --- a/regression/reference/pointers-cxx/typespointers.h +++ b/regression/reference/pointers-cxx/typespointers.h @@ -1,5 +1,5 @@ // typespointers.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-cxx/wrapfpointers.f b/regression/reference/pointers-cxx/wrapfpointers.f index 5d919f7d2..34a40c695 100644 --- a/regression/reference/pointers-cxx/wrapfpointers.f +++ b/regression/reference/pointers-cxx/wrapfpointers.f @@ -1,5 +1,5 @@ ! wrapfpointers.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,16 +22,16 @@ module pointers_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: POI_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type POI_SHROUD_capsule_data ! start array_context ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: POI_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(POI_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,7 +43,7 @@ module pointers_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type POI_SHROUD_array ! end array_context ! ---------------------------------------- @@ -516,9 +516,9 @@ end subroutine c_get_ptr_to_scalar interface subroutine c_get_ptr_to_scalar_bufferify(Dnitems) & bind(C, name="POI_get_ptr_to_scalar_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dnitems + type(POI_SHROUD_array), intent(INOUT) :: Dnitems end subroutine c_get_ptr_to_scalar_bufferify end interface ! end c_get_ptr_to_scalar_bufferify @@ -554,9 +554,9 @@ end subroutine c_get_ptr_to_fixed_array interface subroutine c_get_ptr_to_fixed_array_bufferify(Dcount) & bind(C, name="POI_get_ptr_to_fixed_array_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_ptr_to_fixed_array_bufferify end interface ! end c_get_ptr_to_fixed_array_bufferify @@ -602,9 +602,9 @@ end subroutine c_get_ptr_to_dynamic_array subroutine c_get_ptr_to_dynamic_array_bufferify(Dcount, ncount) & bind(C, name="POI_get_ptr_to_dynamic_array_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount integer(C_INT), intent(OUT) :: ncount end subroutine c_get_ptr_to_dynamic_array_bufferify end interface @@ -641,9 +641,9 @@ end subroutine c_get_ptr_to_func_array interface subroutine c_get_ptr_to_func_array_bufferify(Dcount) & bind(C, name="POI_get_ptr_to_func_array_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_ptr_to_func_array_bufferify end interface ! end c_get_ptr_to_func_array_bufferify @@ -679,9 +679,9 @@ end subroutine c_get_ptr_to_const_scalar interface subroutine c_get_ptr_to_const_scalar_bufferify(Dnitems) & bind(C, name="POI_get_ptr_to_const_scalar_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dnitems + type(POI_SHROUD_array), intent(INOUT) :: Dnitems end subroutine c_get_ptr_to_const_scalar_bufferify end interface ! end c_get_ptr_to_const_scalar_bufferify @@ -717,9 +717,9 @@ end subroutine c_get_ptr_to_fixed_const_array interface subroutine c_get_ptr_to_fixed_const_array_bufferify(Dcount) & bind(C, name="POI_get_ptr_to_fixed_const_array_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_ptr_to_fixed_const_array_bufferify end interface ! end c_get_ptr_to_fixed_const_array_bufferify @@ -766,9 +766,9 @@ subroutine c_get_ptr_to_dynamic_const_array_bufferify(Dcount, & ncount) & bind(C, name="POI_get_ptr_to_dynamic_const_array_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount integer(C_INT), intent(OUT) :: ncount end subroutine c_get_ptr_to_dynamic_const_array_bufferify end interface @@ -805,9 +805,9 @@ end subroutine c_get_raw_ptr_to_scalar interface subroutine c_get_raw_ptr_to_scalar_bufferify(Dnitems) & bind(C, name="POI_get_raw_ptr_to_scalar_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dnitems + type(POI_SHROUD_array), intent(INOUT) :: Dnitems end subroutine c_get_raw_ptr_to_scalar_bufferify end interface ! end c_get_raw_ptr_to_scalar_bufferify @@ -843,9 +843,9 @@ end subroutine c_get_raw_ptr_to_scalar_force interface subroutine c_get_raw_ptr_to_scalar_force_bufferify(Dnitems) & bind(C, name="POI_get_raw_ptr_to_scalar_force_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dnitems + type(POI_SHROUD_array), intent(INOUT) :: Dnitems end subroutine c_get_raw_ptr_to_scalar_force_bufferify end interface ! end c_get_raw_ptr_to_scalar_force_bufferify @@ -881,9 +881,9 @@ end subroutine c_get_raw_ptr_to_fixed_array interface subroutine c_get_raw_ptr_to_fixed_array_bufferify(Dcount) & bind(C, name="POI_get_raw_ptr_to_fixed_array_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_raw_ptr_to_fixed_array_bufferify end interface ! end c_get_raw_ptr_to_fixed_array_bufferify @@ -919,9 +919,9 @@ end subroutine c_get_raw_ptr_to_fixed_array_force interface subroutine c_get_raw_ptr_to_fixed_array_force_bufferify(Dcount) & bind(C, name="POI_get_raw_ptr_to_fixed_array_force_bufferify") - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Dcount + type(POI_SHROUD_array), intent(INOUT) :: Dcount end subroutine c_get_raw_ptr_to_fixed_array_force_bufferify end interface ! end c_get_raw_ptr_to_fixed_array_force_bufferify @@ -1086,9 +1086,9 @@ function c_return_int_ptr_to_fixed_array_bufferify(DSHC_rv) & result(SHT_rv) & bind(C, name="POI_return_int_ptr_to_fixed_array_bufferify") use iso_c_binding, only : C_PTR - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(POI_SHROUD_array), intent(INOUT) :: DSHC_rv type(C_PTR) SHT_rv end function c_return_int_ptr_to_fixed_array_bufferify end interface @@ -1136,9 +1136,9 @@ function c_return_int_ptr_to_fixed_const_array_bufferify( & result(SHT_rv) & bind(C, name="POI_return_int_ptr_to_fixed_const_array_bufferify") use iso_c_binding, only : C_PTR - import :: SHROUD_array + import :: POI_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: DSHC_rv + type(POI_SHROUD_array), intent(INOUT) :: DSHC_rv type(C_PTR) SHT_rv end function c_return_int_ptr_to_fixed_const_array_bufferify end interface @@ -1485,7 +1485,7 @@ end function accept_char_array_in subroutine get_ptr_to_scalar(nitems) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: nitems - type(SHROUD_array) :: Dnitems + type(POI_SHROUD_array) :: Dnitems ! splicer begin function.get_ptr_to_scalar call c_get_ptr_to_scalar_bufferify(Dnitems) call c_f_pointer(Dnitems%base_addr, nitems) @@ -1514,7 +1514,7 @@ end subroutine get_ptr_to_scalar subroutine get_ptr_to_fixed_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount ! splicer begin function.get_ptr_to_fixed_array call c_get_ptr_to_fixed_array_bufferify(Dcount) call c_f_pointer(Dcount%base_addr, count, Dcount%shape(1:1)) @@ -1550,7 +1550,7 @@ end subroutine get_ptr_to_fixed_array subroutine get_ptr_to_dynamic_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount integer(C_INT) :: ncount ! splicer begin function.get_ptr_to_dynamic_array call c_get_ptr_to_dynamic_array_bufferify(Dcount, ncount) @@ -1582,7 +1582,7 @@ end subroutine get_ptr_to_dynamic_array subroutine get_ptr_to_func_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount ! splicer begin function.get_ptr_to_func_array call c_get_ptr_to_func_array_bufferify(Dcount) call c_f_pointer(Dcount%base_addr, count, Dcount%shape(1:1)) @@ -1608,7 +1608,7 @@ end subroutine get_ptr_to_func_array subroutine get_ptr_to_const_scalar(nitems) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: nitems - type(SHROUD_array) :: Dnitems + type(POI_SHROUD_array) :: Dnitems ! splicer begin function.get_ptr_to_const_scalar call c_get_ptr_to_const_scalar_bufferify(Dnitems) call c_f_pointer(Dnitems%base_addr, nitems) @@ -1634,7 +1634,7 @@ end subroutine get_ptr_to_const_scalar subroutine get_ptr_to_fixed_const_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount ! splicer begin function.get_ptr_to_fixed_const_array call c_get_ptr_to_fixed_const_array_bufferify(Dcount) call c_f_pointer(Dcount%base_addr, count, Dcount%shape(1:1)) @@ -1666,7 +1666,7 @@ end subroutine get_ptr_to_fixed_const_array subroutine get_ptr_to_dynamic_const_array(count) use iso_c_binding, only : C_INT, c_f_pointer integer(C_INT), intent(OUT), pointer :: count(:) - type(SHROUD_array) :: Dcount + type(POI_SHROUD_array) :: Dcount integer(C_INT) :: ncount ! splicer begin function.get_ptr_to_dynamic_const_array call c_get_ptr_to_dynamic_const_array_bufferify(Dcount, ncount) @@ -1696,7 +1696,7 @@ subroutine get_raw_ptr_to_scalar(nitems) use iso_c_binding, only : C_INT, C_PTR type(C_PTR), intent(OUT) :: nitems ! splicer begin function.get_raw_ptr_to_scalar - type(SHROUD_array) Dnitems + type(POI_SHROUD_array) Dnitems call c_get_raw_ptr_to_scalar_bufferify(Dnitems) nitems = Dnitems%base_addr ! splicer end function.get_raw_ptr_to_scalar @@ -1724,7 +1724,7 @@ subroutine get_raw_ptr_to_scalar_force(nitems) use iso_c_binding, only : C_INT, C_PTR type(C_PTR), intent(OUT) :: nitems ! splicer begin function.get_raw_ptr_to_scalar_force - type(SHROUD_array) Dnitems + type(POI_SHROUD_array) Dnitems call c_get_raw_ptr_to_scalar_force_bufferify(Dnitems) nitems = Dnitems%base_addr ! splicer end function.get_raw_ptr_to_scalar_force @@ -1754,7 +1754,7 @@ subroutine get_raw_ptr_to_fixed_array(count) use iso_c_binding, only : C_INT, C_PTR type(C_PTR), intent(OUT) :: count ! splicer begin function.get_raw_ptr_to_fixed_array - type(SHROUD_array) Dcount + type(POI_SHROUD_array) Dcount call c_get_raw_ptr_to_fixed_array_bufferify(Dcount) count = Dcount%base_addr ! splicer end function.get_raw_ptr_to_fixed_array @@ -1783,7 +1783,7 @@ subroutine get_raw_ptr_to_fixed_array_force(count) use iso_c_binding, only : C_INT, C_PTR type(C_PTR), intent(OUT) :: count ! splicer begin function.get_raw_ptr_to_fixed_array_force - type(SHROUD_array) Dcount + type(POI_SHROUD_array) Dcount call c_get_raw_ptr_to_fixed_array_force_bufferify(Dcount) count = Dcount%base_addr ! splicer end function.get_raw_ptr_to_fixed_array_force @@ -1871,7 +1871,7 @@ end function return_int_ptr_to_scalar function return_int_ptr_to_fixed_array() & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR, c_f_pointer - type(SHROUD_array) :: DSHC_rv + type(POI_SHROUD_array) :: DSHC_rv integer(C_INT), pointer :: SHT_rv(:) ! splicer begin function.return_int_ptr_to_fixed_array type(C_PTR) :: SHT_ptr @@ -1911,7 +1911,7 @@ end function return_int_ptr_to_const_scalar function return_int_ptr_to_fixed_const_array() & result(SHT_rv) use iso_c_binding, only : C_INT, C_PTR, c_f_pointer - type(SHROUD_array) :: DSHC_rv + type(POI_SHROUD_array) :: DSHC_rv integer(C_INT), pointer :: SHT_rv(:) ! splicer begin function.return_int_ptr_to_fixed_const_array type(C_PTR) :: SHT_ptr diff --git a/regression/reference/pointers-cxx/wrappointers.cpp b/regression/reference/pointers-cxx/wrappointers.cpp index c207ee6d5..de3085de6 100644 --- a/regression/reference/pointers-cxx/wrappointers.cpp +++ b/regression/reference/pointers-cxx/wrappointers.cpp @@ -1,5 +1,5 @@ // wrappointers.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-cxx/wrappointers.h b/regression/reference/pointers-cxx/wrappointers.h index 8cf3a6064..fa6e6fdee 100644 --- a/regression/reference/pointers-cxx/wrappointers.h +++ b/regression/reference/pointers-cxx/wrappointers.h @@ -1,5 +1,5 @@ // wrappointers.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-list-c/pointers.json b/regression/reference/pointers-list-c/pointers.json index fcbb4bd06..173c3d42c 100644 --- a/regression/reference/pointers-list-c/pointers.json +++ b/regression/reference/pointers-list-c/pointers.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/pointers-list-c/pypointersmodule.c b/regression/reference/pointers-list-c/pypointersmodule.c index d8c0b0ea7..7406c0d75 100644 --- a/regression/reference/pointers-list-c/pypointersmodule.c +++ b/regression/reference/pointers-list-c/pypointersmodule.c @@ -1,5 +1,5 @@ // pypointersmodule.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -178,7 +178,7 @@ static int SHROUD_get_from_object_double_list(PyObject *obj, double *in = (double *) malloc(size * sizeof(double)); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyFloat_AsDouble(item); + double cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { free(in); Py_DECREF(seq); @@ -187,6 +187,7 @@ static int SHROUD_get_from_object_double_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -214,7 +215,7 @@ static int SHROUD_get_from_object_int_list(PyObject *obj, int *in = (int *) malloc(size * sizeof(int)); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { free(in); Py_DECREF(seq); @@ -223,6 +224,7 @@ static int SHROUD_get_from_object_int_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); diff --git a/regression/reference/pointers-list-c/pypointersmodule.h b/regression/reference/pointers-list-c/pypointersmodule.h index 41196f06e..492bdc2c9 100644 --- a/regression/reference/pointers-list-c/pypointersmodule.h +++ b/regression/reference/pointers-list-c/pypointersmodule.h @@ -1,5 +1,5 @@ // pypointersmodule.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-list-c/setup.py b/regression/reference/pointers-list-c/setup.py index d00f5c6ee..d23891f9d 100644 --- a/regression/reference/pointers-list-c/setup.py +++ b/regression/reference/pointers-list-c/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-list-cxx/pointers.json b/regression/reference/pointers-list-cxx/pointers.json index 147a4c66c..adbfd1c8b 100644 --- a/regression/reference/pointers-list-cxx/pointers.json +++ b/regression/reference/pointers-list-cxx/pointers.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/pointers-list-cxx/pypointersmodule.cpp b/regression/reference/pointers-list-cxx/pypointersmodule.cpp index 6aa5151da..1e78618a5 100644 --- a/regression/reference/pointers-list-cxx/pypointersmodule.cpp +++ b/regression/reference/pointers-list-cxx/pypointersmodule.cpp @@ -1,5 +1,5 @@ // pypointersmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -181,7 +181,7 @@ static int SHROUD_get_from_object_double_list(PyObject *obj, (std::malloc(size * sizeof(double))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyFloat_AsDouble(item); + double cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -190,6 +190,7 @@ static int SHROUD_get_from_object_double_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -217,7 +218,7 @@ static int SHROUD_get_from_object_int_list(PyObject *obj, int *in = static_cast(std::malloc(size * sizeof(int))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -226,6 +227,7 @@ static int SHROUD_get_from_object_int_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); diff --git a/regression/reference/pointers-list-cxx/pypointersmodule.hpp b/regression/reference/pointers-list-cxx/pypointersmodule.hpp index fce176858..670ebe2d1 100644 --- a/regression/reference/pointers-list-cxx/pypointersmodule.hpp +++ b/regression/reference/pointers-list-cxx/pypointersmodule.hpp @@ -1,5 +1,5 @@ // pypointersmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-list-cxx/setup.py b/regression/reference/pointers-list-cxx/setup.py index c3b3d6605..ea92f191a 100644 --- a/regression/reference/pointers-list-cxx/setup.py +++ b/regression/reference/pointers-list-cxx/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-numpy-c/pointers.json b/regression/reference/pointers-numpy-c/pointers.json index 942f1bbee..576559195 100644 --- a/regression/reference/pointers-numpy-c/pointers.json +++ b/regression/reference/pointers-numpy-c/pointers.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/pointers-numpy-c/pypointersmodule.c b/regression/reference/pointers-numpy-c/pypointersmodule.c index cdd62d093..74e9fadda 100644 --- a/regression/reference/pointers-numpy-c/pypointersmodule.c +++ b/regression/reference/pointers-numpy-c/pypointersmodule.c @@ -1,5 +1,5 @@ // pypointersmodule.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-numpy-c/pypointersmodule.h b/regression/reference/pointers-numpy-c/pypointersmodule.h index 41196f06e..492bdc2c9 100644 --- a/regression/reference/pointers-numpy-c/pypointersmodule.h +++ b/regression/reference/pointers-numpy-c/pypointersmodule.h @@ -1,5 +1,5 @@ // pypointersmodule.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-numpy-c/setup.py b/regression/reference/pointers-numpy-c/setup.py index 90e260184..6be2a7cda 100644 --- a/regression/reference/pointers-numpy-c/setup.py +++ b/regression/reference/pointers-numpy-c/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-numpy-cxx/pointers.json b/regression/reference/pointers-numpy-cxx/pointers.json index ae044fc17..7968a6fae 100644 --- a/regression/reference/pointers-numpy-cxx/pointers.json +++ b/regression/reference/pointers-numpy-cxx/pointers.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/pointers-numpy-cxx/pypointersmodule.cpp b/regression/reference/pointers-numpy-cxx/pypointersmodule.cpp index 3516c2f23..911f4d951 100644 --- a/regression/reference/pointers-numpy-cxx/pypointersmodule.cpp +++ b/regression/reference/pointers-numpy-cxx/pypointersmodule.cpp @@ -1,5 +1,5 @@ // pypointersmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-numpy-cxx/pypointersmodule.hpp b/regression/reference/pointers-numpy-cxx/pypointersmodule.hpp index fce176858..670ebe2d1 100644 --- a/regression/reference/pointers-numpy-cxx/pypointersmodule.hpp +++ b/regression/reference/pointers-numpy-cxx/pypointersmodule.hpp @@ -1,5 +1,5 @@ // pypointersmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/pointers-numpy-cxx/setup.py b/regression/reference/pointers-numpy-cxx/setup.py index 8124f37c8..0d4e8388b 100644 --- a/regression/reference/pointers-numpy-cxx/setup.py +++ b/regression/reference/pointers-numpy-cxx/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/preprocess.json b/regression/reference/preprocess/preprocess.json index 69591da2e..3dd8f14b7 100644 --- a/regression/reference/preprocess/preprocess.json +++ b/regression/reference/preprocess/preprocess.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapUser1.cpp", "C_name_scope": "User1_", "C_type_name": "PRE_User1", - "F_capsule_data_type": "SHROUD_user1_capsule", + "F_capsule_data_type": "PRE_SHROUD_user1_capsule", "F_derived_name": "user1", "F_name_scope": "user1_", "PY_PyObject": "PY_User1", @@ -289,7 +289,7 @@ "C_impl_filename": "wrapUser2.cpp", "C_name_scope": "User2_", "C_type_name": "PRE_User2", - "F_capsule_data_type": "SHROUD_user2_capsule", + "F_capsule_data_type": "PRE_SHROUD_user2_capsule", "F_derived_name": "user2", "F_name_scope": "user2_", "PY_PyObject": "PY_User2", diff --git a/regression/reference/preprocess/preprocess_types.yaml b/regression/reference/preprocess/preprocess_types.yaml index 66a9fb86f..72db9577a 100644 --- a/regression/reference/preprocess/preprocess_types.yaml +++ b/regression/reference/preprocess/preprocess_types.yaml @@ -1,5 +1,5 @@ # preprocess_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -16,7 +16,7 @@ typemap: c_type: PRE_User1 f_module_name: preprocess_mod f_derived_type: user1 - f_capsule_data_type: SHROUD_user1_capsule + f_capsule_data_type: PRE_SHROUD_user1_capsule f_to_c: "{f_var}%cxxmem" - type: User2 fields: @@ -26,5 +26,5 @@ typemap: c_type: PRE_User2 f_module_name: preprocess_mod f_derived_type: user2 - f_capsule_data_type: SHROUD_user2_capsule + f_capsule_data_type: PRE_SHROUD_user2_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/preprocess/pyUser1type.cpp b/regression/reference/preprocess/pyUser1type.cpp index 7ec2a6c7f..226373de5 100644 --- a/regression/reference/preprocess/pyUser1type.cpp +++ b/regression/reference/preprocess/pyUser1type.cpp @@ -1,5 +1,5 @@ // pyUser1type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/pyUser2type.cpp b/regression/reference/preprocess/pyUser2type.cpp index f54388ad6..d517861a6 100644 --- a/regression/reference/preprocess/pyUser2type.cpp +++ b/regression/reference/preprocess/pyUser2type.cpp @@ -1,5 +1,5 @@ // pyUser2type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/pypreprocessmodule.cpp b/regression/reference/preprocess/pypreprocessmodule.cpp index 5d481e7a8..0559d78dd 100644 --- a/regression/reference/preprocess/pypreprocessmodule.cpp +++ b/regression/reference/preprocess/pypreprocessmodule.cpp @@ -1,5 +1,5 @@ // pypreprocessmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/pypreprocessmodule.hpp b/regression/reference/preprocess/pypreprocessmodule.hpp index debaf9ba1..5bf1fa3ac 100644 --- a/regression/reference/preprocess/pypreprocessmodule.hpp +++ b/regression/reference/preprocess/pypreprocessmodule.hpp @@ -1,5 +1,5 @@ // pypreprocessmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/pypreprocessutil.cpp b/regression/reference/preprocess/pypreprocessutil.cpp index 6ec305935..cf1b3cac2 100644 --- a/regression/reference/preprocess/pypreprocessutil.cpp +++ b/regression/reference/preprocess/pypreprocessutil.cpp @@ -1,5 +1,5 @@ // pypreprocessutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/setup.py b/regression/reference/preprocess/setup.py index 8bde5858b..edd9ccab8 100644 --- a/regression/reference/preprocess/setup.py +++ b/regression/reference/preprocess/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/typespreprocess.h b/regression/reference/preprocess/typespreprocess.h index d4cb6a918..55c9d806d 100644 --- a/regression/reference/preprocess/typespreprocess.h +++ b/regression/reference/preprocess/typespreprocess.h @@ -1,5 +1,5 @@ // typespreprocess.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/wrapUser1.cpp b/regression/reference/preprocess/wrapUser1.cpp index 5d77e2f17..753d601ac 100644 --- a/regression/reference/preprocess/wrapUser1.cpp +++ b/regression/reference/preprocess/wrapUser1.cpp @@ -1,5 +1,5 @@ // wrapUser1.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/wrapUser1.h b/regression/reference/preprocess/wrapUser1.h index 9103ae9ca..53e58dd9a 100644 --- a/regression/reference/preprocess/wrapUser1.h +++ b/regression/reference/preprocess/wrapUser1.h @@ -1,5 +1,5 @@ // wrapUser1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/wrapUser2.cpp b/regression/reference/preprocess/wrapUser2.cpp index e55817a22..57364e4b7 100644 --- a/regression/reference/preprocess/wrapUser2.cpp +++ b/regression/reference/preprocess/wrapUser2.cpp @@ -1,5 +1,5 @@ // wrapUser2.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/wrapUser2.h b/regression/reference/preprocess/wrapUser2.h index 917da76ec..1664d1332 100644 --- a/regression/reference/preprocess/wrapUser2.h +++ b/regression/reference/preprocess/wrapUser2.h @@ -1,5 +1,5 @@ // wrapUser2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/preprocess/wrapfpreprocess.f b/regression/reference/preprocess/wrapfpreprocess.f index 5f1aec608..dcc0be620 100644 --- a/regression/reference/preprocess/wrapfpreprocess.f +++ b/regression/reference/preprocess/wrapfpreprocess.f @@ -1,5 +1,5 @@ ! wrapfpreprocess.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -21,13 +21,13 @@ module preprocess_mod ! splicer begin module_top ! splicer end module_top - type, bind(C) :: SHROUD_user1_capsule + type, bind(C) :: PRE_SHROUD_user1_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_user1_capsule + end type PRE_SHROUD_user1_capsule type user1 - type(SHROUD_user1_capsule) :: cxxmem + type(PRE_SHROUD_user1_capsule) :: cxxmem ! splicer begin class.User1.component_part ! splicer end class.User1.component_part contains @@ -55,13 +55,13 @@ module preprocess_mod end type user1 #ifdef USE_USER2 - type, bind(C) :: SHROUD_user2_capsule + type, bind(C) :: PRE_SHROUD_user2_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_user2_capsule + end type PRE_SHROUD_user2_capsule type user2 - type(SHROUD_user2_capsule) :: cxxmem + type(PRE_SHROUD_user2_capsule) :: cxxmem ! splicer begin class.User2.component_part ! splicer end class.User2.component_part contains @@ -107,9 +107,9 @@ module preprocess_mod ! Match: c_default subroutine c_user1_method1(self) & bind(C, name="PRE_User1_method1") - import :: SHROUD_user1_capsule + import :: PRE_SHROUD_user1_capsule implicit none - type(SHROUD_user1_capsule), intent(IN) :: self + type(PRE_SHROUD_user1_capsule), intent(IN) :: self end subroutine c_user1_method1 #if defined(USE_TWO) @@ -119,9 +119,9 @@ end subroutine c_user1_method1 ! Match: c_default subroutine c_user1_method2(self) & bind(C, name="PRE_User1_method2") - import :: SHROUD_user1_capsule + import :: PRE_SHROUD_user1_capsule implicit none - type(SHROUD_user1_capsule), intent(IN) :: self + type(PRE_SHROUD_user1_capsule), intent(IN) :: self end subroutine c_user1_method2 #endif @@ -132,9 +132,9 @@ end subroutine c_user1_method2 ! Match: c_default subroutine c_user1_method3def_0(self) & bind(C, name="PRE_User1_method3def_0") - import :: SHROUD_user1_capsule + import :: PRE_SHROUD_user1_capsule implicit none - type(SHROUD_user1_capsule), intent(IN) :: self + type(PRE_SHROUD_user1_capsule), intent(IN) :: self end subroutine c_user1_method3def_0 #endif @@ -150,9 +150,9 @@ end subroutine c_user1_method3def_0 subroutine c_user1_method3def_1(self, i) & bind(C, name="PRE_User1_method3def_1") use iso_c_binding, only : C_INT - import :: SHROUD_user1_capsule + import :: PRE_SHROUD_user1_capsule implicit none - type(SHROUD_user1_capsule), intent(IN) :: self + type(PRE_SHROUD_user1_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: i end subroutine c_user1_method3def_1 #endif @@ -168,9 +168,9 @@ end subroutine c_user1_method3def_1 ! Match: c_default subroutine c_user2_exfunc_0(self) & bind(C, name="PRE_User2_exfunc_0") - import :: SHROUD_user2_capsule + import :: PRE_SHROUD_user2_capsule implicit none - type(SHROUD_user2_capsule), intent(IN) :: self + type(PRE_SHROUD_user2_capsule), intent(IN) :: self end subroutine c_user2_exfunc_0 #endif @@ -186,9 +186,9 @@ end subroutine c_user2_exfunc_0 subroutine c_user2_exfunc_1(self, flag) & bind(C, name="PRE_User2_exfunc_1") use iso_c_binding, only : C_INT - import :: SHROUD_user2_capsule + import :: PRE_SHROUD_user2_capsule implicit none - type(SHROUD_user2_capsule), intent(IN) :: self + type(PRE_SHROUD_user2_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: flag end subroutine c_user2_exfunc_1 #endif diff --git a/regression/reference/preprocess/wrappreprocess.cpp b/regression/reference/preprocess/wrappreprocess.cpp index a8ed24c61..d65f1602a 100644 --- a/regression/reference/preprocess/wrappreprocess.cpp +++ b/regression/reference/preprocess/wrappreprocess.cpp @@ -1,5 +1,5 @@ // wrappreprocess.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/scope.json b/regression/reference/scope/scope.json index b188340b2..3fc6ecd3f 100644 --- a/regression/reference/scope/scope.json +++ b/regression/reference/scope/scope.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -69,7 +69,7 @@ "C_impl_filename": "wrapClass1.cpp", "C_name_scope": "Class1_", "C_type_name": "SCO_Class1", - "F_capsule_data_type": "SHROUD_class1_capsule", + "F_capsule_data_type": "SCO_SHROUD_class1_capsule", "F_derived_name": "class1", "F_name_scope": "class1_", "class_scope": "Class1::", @@ -149,7 +149,7 @@ "C_impl_filename": "wrapClass2.cpp", "C_name_scope": "Class2_", "C_type_name": "SCO_Class2", - "F_capsule_data_type": "SHROUD_class2_capsule", + "F_capsule_data_type": "SCO_SHROUD_class2_capsule", "F_derived_name": "class2", "F_name_scope": "class2_", "class_scope": "Class2::", diff --git a/regression/reference/scope/scope_types.yaml b/regression/reference/scope/scope_types.yaml index 593fd5aeb..1cdb780bd 100644 --- a/regression/reference/scope/scope_types.yaml +++ b/regression/reference/scope/scope_types.yaml @@ -1,5 +1,5 @@ # scope_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -16,7 +16,7 @@ typemap: c_type: SCO_Class1 f_module_name: scope_mod f_derived_type: class1 - f_capsule_data_type: SHROUD_class1_capsule + f_capsule_data_type: SCO_SHROUD_class1_capsule f_to_c: "{f_var}%cxxmem" - type: Class2 fields: @@ -26,5 +26,5 @@ typemap: c_type: SCO_Class2 f_module_name: scope_mod f_derived_type: class2 - f_capsule_data_type: SHROUD_class2_capsule + f_capsule_data_type: SCO_SHROUD_class2_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/scope/typesscope.h b/regression/reference/scope/typesscope.h index ae40448a7..641a95ab5 100644 --- a/regression/reference/scope/typesscope.h +++ b/regression/reference/scope/typesscope.h @@ -1,5 +1,5 @@ // typesscope.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/wrapClass1.h b/regression/reference/scope/wrapClass1.h index f7905f26b..b94788834 100644 --- a/regression/reference/scope/wrapClass1.h +++ b/regression/reference/scope/wrapClass1.h @@ -1,5 +1,5 @@ // wrapClass1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/wrapClass2.h b/regression/reference/scope/wrapClass2.h index d8abc59e9..fd3bab131 100644 --- a/regression/reference/scope/wrapClass2.h +++ b/regression/reference/scope/wrapClass2.h @@ -1,5 +1,5 @@ // wrapClass2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/wrapfscope.f b/regression/reference/scope/wrapfscope.f index fd146c571..787b838c8 100644 --- a/regression/reference/scope/wrapfscope.f +++ b/regression/reference/scope/wrapfscope.f @@ -1,5 +1,5 @@ ! wrapfscope.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -46,13 +46,13 @@ module scope_mod integer(C_INT), parameter :: colorenum_blue = 61 integer(C_INT), parameter :: colorenum_white = 62 - type, bind(C) :: SHROUD_class1_capsule + type, bind(C) :: SCO_SHROUD_class1_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class1_capsule + end type SCO_SHROUD_class1_capsule type class1 - type(SHROUD_class1_capsule) :: cxxmem + type(SCO_SHROUD_class1_capsule) :: cxxmem ! splicer begin class.Class1.component_part ! splicer end class.Class1.component_part contains @@ -63,13 +63,13 @@ module scope_mod ! splicer end class.Class1.type_bound_procedure_part end type class1 - type, bind(C) :: SHROUD_class2_capsule + type, bind(C) :: SCO_SHROUD_class2_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_class2_capsule + end type SCO_SHROUD_class2_capsule type class2 - type(SHROUD_class2_capsule) :: cxxmem + type(SCO_SHROUD_class2_capsule) :: cxxmem ! splicer begin class.Class2.component_part ! splicer end class.Class2.component_part contains diff --git a/regression/reference/scope/wrapfscope_ns1.f b/regression/reference/scope/wrapfscope_ns1.f index eb94cad8c..4d977840c 100644 --- a/regression/reference/scope/wrapfscope_ns1.f +++ b/regression/reference/scope/wrapfscope_ns1.f @@ -1,5 +1,5 @@ ! wrapfscope_ns1.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/wrapfscope_ns2.f b/regression/reference/scope/wrapfscope_ns2.f index 7bb86adb5..32e80123c 100644 --- a/regression/reference/scope/wrapfscope_ns2.f +++ b/regression/reference/scope/wrapfscope_ns2.f @@ -1,5 +1,5 @@ ! wrapfscope_ns2.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/wrapscope.cpp b/regression/reference/scope/wrapscope.cpp index b4ecc1735..4566a8da8 100644 --- a/regression/reference/scope/wrapscope.cpp +++ b/regression/reference/scope/wrapscope.cpp @@ -1,5 +1,5 @@ // wrapscope.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/wrapscope.h b/regression/reference/scope/wrapscope.h index 77a581c69..53235e161 100644 --- a/regression/reference/scope/wrapscope.h +++ b/regression/reference/scope/wrapscope.h @@ -1,5 +1,5 @@ // wrapscope.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/wrapscope_ns1.h b/regression/reference/scope/wrapscope_ns1.h index 064e69bdd..7ac4a45bf 100644 --- a/regression/reference/scope/wrapscope_ns1.h +++ b/regression/reference/scope/wrapscope_ns1.h @@ -1,5 +1,5 @@ // wrapscope_ns1.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/scope/wrapscope_ns2.h b/regression/reference/scope/wrapscope_ns2.h index 878ffbf2c..db3ad038f 100644 --- a/regression/reference/scope/wrapscope_ns2.h +++ b/regression/reference/scope/wrapscope_ns2.h @@ -1,5 +1,5 @@ // wrapscope_ns2.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/statement/statement.json b/regression/reference/statement/statement.json index ac562f53c..c309113c0 100644 --- a/regression/reference/statement/statement.json +++ b/regression/reference/statement/statement.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/statement/typesstatement.h b/regression/reference/statement/typesstatement.h index 793bd7f00..9dd3f89b9 100644 --- a/regression/reference/statement/typesstatement.h +++ b/regression/reference/statement/typesstatement.h @@ -1,5 +1,5 @@ // typesstatement.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/statement/wrapfstatement.f b/regression/reference/statement/wrapfstatement.f index 8f3d1a0b2..d3b8078ea 100644 --- a/regression/reference/statement/wrapfstatement.f +++ b/regression/reference/statement/wrapfstatement.f @@ -1,5 +1,5 @@ ! wrapfstatement.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/statement/wrapstatement.cpp b/regression/reference/statement/wrapstatement.cpp index 38c8389f9..d850a248f 100644 --- a/regression/reference/statement/wrapstatement.cpp +++ b/regression/reference/statement/wrapstatement.cpp @@ -1,5 +1,5 @@ // wrapstatement.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/statement/wrapstatement.h b/regression/reference/statement/wrapstatement.h index c1d76f1b2..055849ea7 100644 --- a/regression/reference/statement/wrapstatement.h +++ b/regression/reference/statement/wrapstatement.h @@ -1,5 +1,5 @@ // wrapstatement.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/strings/pystringsmodule.cpp b/regression/reference/strings/pystringsmodule.cpp index becd24d41..c1c2daae0 100644 --- a/regression/reference/strings/pystringsmodule.cpp +++ b/regression/reference/strings/pystringsmodule.cpp @@ -1,5 +1,5 @@ // pystringsmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -54,7 +54,7 @@ static int SHROUD_get_from_object_int_list(PyObject *obj, int *in = static_cast(std::malloc(size * sizeof(int))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -63,6 +63,7 @@ static int SHROUD_get_from_object_int_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -1052,6 +1053,51 @@ PY_fetchStringPointerLen( // splicer end function.fetch_string_pointer_len } +// ---------------------------------------- +// Function: int acceptStringInstance +// Requested: py_native_scalar_result +// Match: py_default +// ---------------------------------------- +// Argument: std::string arg1 +intent(in)+value +// Exact: py_string_scalar_in +static char PY_acceptStringInstance__doc__[] = +"documentation" +; + +/** + * \brief Accept a string instance + * + */ +static PyObject * +PY_acceptStringInstance( + PyObject *SHROUD_UNUSED(self), + PyObject *args, + PyObject *kwds) +{ +// splicer begin function.accept_string_instance + char * arg1; + const char *SHT_kwlist[] = { + "arg1", + nullptr }; + PyObject * SHTPy_rv = nullptr; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, + "s:acceptStringInstance", const_cast(SHT_kwlist), + &arg1)) + return nullptr; + + // post_declare + std::string SH_arg1(arg1); + + int SHCXX_rv = acceptStringInstance(SH_arg1); + + // post_call + SHTPy_rv = PyInt_FromLong(SHCXX_rv); + + return (PyObject *) SHTPy_rv; +// splicer end function.accept_string_instance +} + // ---------------------------------------- // Function: void returnStrings // Exact: py_default @@ -1309,6 +1355,8 @@ static PyMethodDef PY_methods[] = { METH_VARARGS|METH_KEYWORDS, PY_acceptStringPointerLen__doc__}, {"fetchStringPointerLen", (PyCFunction)PY_fetchStringPointerLen, METH_NOARGS, PY_fetchStringPointerLen__doc__}, +{"acceptStringInstance", (PyCFunction)PY_acceptStringInstance, + METH_VARARGS|METH_KEYWORDS, PY_acceptStringInstance__doc__}, {"returnStrings", (PyCFunction)PY_returnStrings, METH_NOARGS, PY_returnStrings__doc__}, {"explicit1", (PyCFunction)PY_explicit1, METH_VARARGS|METH_KEYWORDS, diff --git a/regression/reference/strings/pystringsmodule.hpp b/regression/reference/strings/pystringsmodule.hpp index efb49ead1..382bf79f1 100644 --- a/regression/reference/strings/pystringsmodule.hpp +++ b/regression/reference/strings/pystringsmodule.hpp @@ -1,5 +1,5 @@ // pystringsmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/strings/setup.py b/regression/reference/strings/setup.py index 292b4951d..5293cce13 100644 --- a/regression/reference/strings/setup.py +++ b/regression/reference/strings/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/strings/strings.json b/regression/reference/strings/strings.json index c46a456c7..d27f14cd8 100644 --- a/regression/reference/strings/strings.json +++ b/regression/reference/strings/strings.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -1008,6 +1008,7 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_char_*_result_allocatable", "stmt1": "f_char_*_result_allocatable", @@ -1618,7 +1619,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -1705,9 +1706,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_*_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_*_result_allocatable", "stmtc0": "c_string_*_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -2192,7 +2194,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -2275,9 +2277,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_*_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_*_result_allocatable", "stmtc0": "c_string_*_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -2375,7 +2378,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -2471,9 +2474,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -3234,7 +3238,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -3325,9 +3329,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_&_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_&_result_allocatable", "stmtc0": "c_string_&_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -3643,7 +3648,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable_library", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -3735,9 +3740,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_*_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_*_result_allocatable", "stmtc0": "c_string_*_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -3836,7 +3842,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable_caller", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -3931,9 +3937,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_*_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_*_result_allocatable", "stmtc0": "c_string_*_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -4035,7 +4042,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable_caller", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -4131,9 +4138,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "STR_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_*_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_*_result_allocatable", "stmtc0": "c_string_*_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -5959,6 +5967,246 @@ "wrap_python": false } }, + { + "_fmtargs": { + "arg1": { + "fmtc": { + "c_addr": "&", + "c_const": "", + "c_deref": "", + "c_member": ".", + "c_var": "arg1", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&arg1", + "cxx_type": "std::string", + "cxx_var": "arg1", + "idtor": "0", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "c_string_scalar_in", + "stmt1": "c_string_scalar_in" + }, + "fmtpy": { + "c_const": "", + "c_deref": "", + "c_type": "char", + "c_var": "arg1", + "ctor_expr": "SH_arg1.data(),\t SH_arg1.size()", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&arg1", + "cxx_type": "std::string", + "cxx_var": "SH_arg1", + "data_var": "SHData_arg1", + "numpy_type": null, + "py_var": "SHPy_arg1", + "size_var": "SHSize_arg1", + "stmt0": "py_string_scalar_in", + "stmt1": "py_string_scalar_in", + "value_var": "SHValue_arg1" + } + } + }, + "_fmtresult": { + "fmtc": { + "c_const": "", + "c_get_value": "", + "c_type": "int", + "c_var": "SHC_rv", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&SHC_rv", + "cxx_type": "int", + "cxx_var": "SHC_rv", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_scalar_result", + "stmt1": "c_default" + }, + "fmtf": { + "cxx_type": "int", + "f_type": "integer(C_INT)", + "f_var": "SHT_rv", + "sh_type": "SH_TYPE_INT", + "stmt0": "f_native_scalar_result", + "stmt1": "f_default", + "stmtc0": "c_native_scalar_result_buf", + "stmtc1": "c_default" + }, + "fmtpy": { + "c_deref": "", + "c_var": "SHCXX_rv", + "ctor_expr": "SHCXX_rv", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&SHCXX_rv", + "cxx_type": "int", + "cxx_var": "SHCXX_rv", + "data_var": "SHData_rv", + "numpy_type": "NPY_INT", + "py_var": "SHTPy_rv", + "size_var": "SHSize_rv", + "stmt0": "py_native_scalar_result", + "stmt1": "py_default", + "value_var": "SHValue_rv" + } + }, + "ast": { + "declarator": { + "name": "acceptStringInstance", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "in", + "value": true + }, + "declarator": { + "name": "arg1", + "pointer": [] + }, + "specifier": [ + "std::string" + ], + "typemap_name": "std::string" + } + ], + "specifier": [ + "int" + ], + "typemap_name": "int" + }, + "decl": "int acceptStringInstance(std::string arg1)", + "declgen": "int acceptStringInstance(std::string arg1 +intent(in)+value)", + "doxygen": { + "brief": "Accept a string instance" + }, + "fmtdict": { + "C_call_list": "arg1", + "C_name": "STR_accept_string_instance", + "C_prototype": "char *arg1", + "C_return_type": "int", + "F_C_call": "c_accept_string_instance_bufferify", + "F_C_name": "c_accept_string_instance", + "F_arg_c_call": "arg1,\t len_trim(arg1, kind=C_INT)", + "F_arguments": "arg1", + "F_name_function": "accept_string_instance", + "F_name_generic": "accept_string_instance", + "F_name_impl": "accept_string_instance", + "F_result_clause": "\fresult(SHT_rv)", + "F_subprogram": "function", + "PY_name_impl": "PY_acceptStringInstance", + "cxx_rv_decl": "int SHC_rv", + "function_name": "acceptStringInstance", + "underscore_name": "accept_string_instance" + }, + "options": {} + }, + { + "_fmtargs": { + "arg1": { + "fmtc": { + "c_addr": "&", + "c_const": "", + "c_deref": "", + "c_member": ".", + "c_var": "arg1", + "c_var_trim": "Larg1", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&SHCXX_arg1", + "cxx_type": "std::string", + "cxx_var": "SHCXX_arg1", + "idtor": "0", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "c_string_scalar_in_buf", + "stmt1": "c_string_scalar_in_buf" + }, + "fmtf": { + "F_pointer": "SHPTR_arg1", + "c_var": "arg1", + "c_var_trim": "Larg1", + "f_intent": "IN", + "f_type": "character(*)", + "f_var": "arg1", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "f_string_scalar_in", + "stmt1": "f_string_scalar_in", + "stmtc0": "c_string_scalar_in_buf", + "stmtc1": "c_string_scalar_in_buf" + } + } + }, + "_fmtresult": { + "fmtc": { + "c_const": "", + "c_get_value": "", + "c_type": "int", + "c_var": "SHC_rv", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "&SHC_rv", + "cxx_type": "int", + "cxx_var": "SHC_rv", + "idtor": "0", + "sh_type": "SH_TYPE_INT", + "stmt0": "c_native_scalar_result_buf", + "stmt1": "c_default" + } + }, + "_generated": "arg_to_buffer", + "ast": { + "declarator": { + "name": "acceptStringInstance", + "pointer": [] + }, + "params": [ + { + "attrs": { + "intent": "in", + "len_trim": "Larg1", + "value": true + }, + "declarator": { + "name": "arg1", + "pointer": [] + }, + "specifier": [ + "std::string" + ], + "stmts_suffix": "buf", + "typemap_name": "std::string" + } + ], + "specifier": [ + "int" + ], + "typemap_name": "int" + }, + "decl": "int acceptStringInstance(std::string arg1)", + "declgen": "int acceptStringInstance(std::string arg1 +intent(in)+len_trim+value)", + "doxygen": { + "brief": "Accept a string instance" + }, + "fmtdict": { + "C_call_list": "SHCXX_arg1", + "C_name": "STR_accept_string_instance_bufferify", + "C_prototype": "char *arg1,\t int Larg1", + "C_return_type": "int", + "F_C_name": "c_accept_string_instance_bufferify", + "cxx_rv_decl": "int SHC_rv", + "function_name": "acceptStringInstance", + "function_suffix": "_bufferify", + "underscore_name": "accept_string_instance" + }, + "options": { + "wrap_c": true, + "wrap_fortran": false, + "wrap_lua": false, + "wrap_python": false + } + }, { "_fmtargs": { "arg1": { diff --git a/regression/reference/strings/strings.log b/regression/reference/strings/strings.log index 1f9ec30b3..23931e182 100644 --- a/regression/reference/strings/strings.log +++ b/regression/reference/strings/strings.log @@ -56,6 +56,8 @@ C function void acceptStringPointerLen(std::string * arg1 +intent(inout), int * C function void acceptStringPointerLen(std::string * arg1 +intent(inout)+len+len_trim, int * nlen +intent(out)) C function void fetchStringPointerLen(std::string * arg1 +intent(out), int * nlen +intent(out)) C function void fetchStringPointerLen(std::string * arg1 +intent(out)+len, int * nlen +intent(out)) +C function int acceptStringInstance(std::string arg1 +intent(in)+value) +C function int acceptStringInstance(std::string arg1 +intent(in)+len_trim+value) C function void explicit1(char * name +intent(in)+len_trim(AAlen)) C function void explicit2(char * name +intent(out)+len(AAtrim)) C function void explicit2(char * name +intent(out)+len(AAtrim)) @@ -128,6 +130,8 @@ C-interface, Fortran function void acceptStringPointerLen(std::string * arg1 +in C-interface function void acceptStringPointerLen(std::string * arg1 +intent(inout)+len+len_trim, int * nlen +intent(out)) C-interface, Fortran function void fetchStringPointerLen(std::string * arg1 +intent(out), int * nlen +intent(out)) C-interface function void fetchStringPointerLen(std::string * arg1 +intent(out)+len, int * nlen +intent(out)) +C-interface, Fortran function int acceptStringInstance(std::string arg1 +intent(in)+value) +C-interface function int acceptStringInstance(std::string arg1 +intent(in)+len_trim+value) C-interface, Fortran function void explicit1(char * name +intent(in)+len_trim(AAlen)) C-interface, Fortran function void explicit2(char * name +intent(out)+len(AAtrim)) C-interface function void explicit2(char * name +intent(out)+len(AAtrim)) @@ -168,6 +172,7 @@ Python function void acceptStringPointer(std::string * arg1 +intent(inout)) Python function void fetchStringPointer(std::string * arg1 +intent(out)) Python function void acceptStringPointerLen(std::string * arg1 +intent(inout), int * nlen +intent(out)) Python function void fetchStringPointerLen(std::string * arg1 +intent(out), int * nlen +intent(out)) +Python function int acceptStringInstance(std::string arg1 +intent(in)+value) Python function void returnStrings(std::string & arg1 +intent(out), std::string & arg2 +intent(out)) Python function void explicit1(char * name +intent(in)+len_trim(AAlen)) Python function void CpassChar(char status +intent(in)+value) diff --git a/regression/reference/strings/typesstrings.h b/regression/reference/strings/typesstrings.h index 4cde58664..8c4eec22a 100644 --- a/regression/reference/strings/typesstrings.h +++ b/regression/reference/strings/typesstrings.h @@ -1,5 +1,5 @@ // typesstrings.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/strings/utilstrings.cpp b/regression/reference/strings/utilstrings.cpp index 30c22c9e7..b0dfd0c02 100644 --- a/regression/reference/strings/utilstrings.cpp +++ b/regression/reference/strings/utilstrings.cpp @@ -1,5 +1,5 @@ // utilstrings.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/strings/wrapfstrings.f b/regression/reference/strings/wrapfstrings.f index a5a645db0..e1d34c06b 100644 --- a/regression/reference/strings/wrapfstrings.f +++ b/regression/reference/strings/wrapfstrings.f @@ -1,5 +1,5 @@ ! wrapfstrings.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,16 +22,16 @@ module strings_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: STR_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type STR_SHROUD_capsule_data ! start array_context ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: STR_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(STR_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,7 +43,7 @@ module strings_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type STR_SHROUD_array ! end array_context ! ---------------------------------------- @@ -217,9 +217,9 @@ end function c_get_char_ptr1 interface subroutine c_get_char_ptr1_bufferify(DSHF_rv) & bind(C, name="STR_get_char_ptr1_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_char_ptr1_bufferify end interface ! end c_get_char_ptr1_bufferify @@ -316,9 +316,9 @@ end function get_char_ptr4 interface subroutine c_get_const_string_result_bufferify(DSHF_rv) & bind(C, name="STR_get_const_string_result_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_const_string_result_bufferify end interface @@ -369,9 +369,9 @@ end subroutine c_get_const_string_as_arg_bufferify interface subroutine c_get_const_string_alloc_bufferify(DSHF_rv) & bind(C, name="STR_get_const_string_alloc_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_const_string_alloc_bufferify end interface @@ -403,9 +403,9 @@ end function c_get_const_string_ref_pure interface subroutine c_get_const_string_ref_pure_bufferify(DSHF_rv) & bind(C, name="STR_get_const_string_ref_pure_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_const_string_ref_pure_bufferify end interface ! end c_get_const_string_ref_pure_bufferify @@ -533,9 +533,9 @@ end function c_get_const_string_ref_alloc interface subroutine c_get_const_string_ref_alloc_bufferify(DSHF_rv) & bind(C, name="STR_get_const_string_ref_alloc_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_const_string_ref_alloc_bufferify end interface @@ -596,9 +596,9 @@ end function c_get_const_string_ptr_alloc interface subroutine c_get_const_string_ptr_alloc_bufferify(DSHF_rv) & bind(C, name="STR_get_const_string_ptr_alloc_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_const_string_ptr_alloc_bufferify end interface @@ -627,9 +627,9 @@ end function c_get_const_string_ptr_owns_alloc interface subroutine c_get_const_string_ptr_owns_alloc_bufferify(DSHF_rv) & bind(C, name="STR_get_const_string_ptr_owns_alloc_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_const_string_ptr_owns_alloc_bufferify end interface @@ -659,9 +659,9 @@ end function c_get_const_string_ptr_owns_alloc_pattern subroutine c_get_const_string_ptr_owns_alloc_pattern_bufferify( & DSHF_rv) & bind(C, name="STR_get_const_string_ptr_owns_alloc_pattern_bufferify") - import :: SHROUD_array + import :: STR_SHROUD_array implicit none - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(STR_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_get_const_string_ptr_owns_alloc_pattern_bufferify end interface @@ -976,6 +976,43 @@ subroutine c_fetch_string_pointer_len_bufferify(arg1, Narg1, & end subroutine c_fetch_string_pointer_len_bufferify end interface + ! ---------------------------------------- + ! Function: int acceptStringInstance + ! Requested: c_native_scalar_result + ! Match: c_default + ! ---------------------------------------- + ! Argument: std::string arg1 +intent(in)+value + ! Exact: c_string_scalar_in + interface + function c_accept_string_instance(arg1) & + result(SHT_rv) & + bind(C, name="STR_accept_string_instance") + use iso_c_binding, only : C_CHAR, C_INT + implicit none + character(kind=C_CHAR), intent(IN) :: arg1(*) + integer(C_INT) :: SHT_rv + end function c_accept_string_instance + end interface + + ! ---------------------------------------- + ! Function: int acceptStringInstance + ! Requested: c_native_scalar_result_buf + ! Match: c_default + ! ---------------------------------------- + ! Argument: std::string arg1 +intent(in)+len_trim(Larg1)+value + ! Exact: c_string_scalar_in_buf + interface + function c_accept_string_instance_bufferify(arg1, Larg1) & + result(SHT_rv) & + bind(C, name="STR_accept_string_instance_bufferify") + use iso_c_binding, only : C_CHAR, C_INT + implicit none + character(kind=C_CHAR), intent(IN) :: arg1(*) + integer(C_INT), value, intent(IN) :: Larg1 + integer(C_INT) :: SHT_rv + end function c_accept_string_instance_bufferify + end interface + ! ---------------------------------------- ! Function: void explicit1 ! Requested: c_void_scalar_result @@ -1171,14 +1208,14 @@ end subroutine c_post_declare_bufferify interface ! helper copy_string ! Copy the char* or std::string in context into c_var. - subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & + subroutine STR_SHROUD_copy_string_and_free(context, c_var, c_var_size) & bind(c,name="STR_ShroudCopyStringAndFree") use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import STR_SHROUD_array + type(STR_SHROUD_array), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_string_and_free + end subroutine STR_SHROUD_copy_string_and_free end interface contains @@ -1311,12 +1348,12 @@ end subroutine pass_char_ptr_in_out ! start get_char_ptr1 function get_char_ptr1() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_char_ptr1 call c_get_char_ptr1_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_char_ptr1 end function get_char_ptr1 ! end get_char_ptr1 @@ -1380,14 +1417,12 @@ end subroutine get_char_ptr3 ! ---------------------------------------- ! Function: const string getConstStringResult +deref(allocatable) ! const string getConstStringResult +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getConstStringResult ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const string * SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_*_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_*_result_allocatable ! Requested: c_string_*_result_buf_allocatable ! Match: c_string_result_buf_allocatable !> @@ -1396,12 +1431,12 @@ end subroutine get_char_ptr3 !< function get_const_string_result() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_const_string_result call c_get_const_string_result_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_const_string_result end function get_const_string_result @@ -1464,24 +1499,22 @@ end subroutine get_const_string_as_arg ! ---------------------------------------- ! Function: const std::string getConstStringAlloc +deref(allocatable) ! const std::string getConstStringAlloc +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getConstStringAlloc ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string * SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_*_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_*_result_allocatable ! Requested: c_string_*_result_buf_allocatable ! Match: c_string_result_buf_allocatable function get_const_string_alloc() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_const_string_alloc call c_get_const_string_alloc_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_const_string_alloc end function get_const_string_alloc @@ -1489,14 +1522,12 @@ end function get_const_string_alloc ! ---------------------------------------- ! Function: const string & getConstStringRefPure +deref(allocatable) ! const string & getConstStringRefPure +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getConstStringRefPure ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable !> @@ -1506,12 +1537,12 @@ end function get_const_string_alloc ! start get_const_string_ref_pure function get_const_string_ref_pure() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_const_string_ref_pure call c_get_const_string_ref_pure_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_const_string_ref_pure end function get_const_string_ref_pure ! end get_const_string_ref_pure @@ -1608,24 +1639,22 @@ end function get_const_string_ref_len_empty ! ---------------------------------------- ! Function: const std::string & getConstStringRefAlloc +deref(allocatable) ! const std::string & getConstStringRefAlloc +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void getConstStringRefAlloc ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string & SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_&_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_&_result_allocatable ! Requested: c_string_&_result_buf_allocatable ! Match: c_string_result_buf_allocatable function get_const_string_ref_alloc() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_const_string_ref_alloc call c_get_const_string_ref_alloc_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_const_string_ref_alloc end function get_const_string_ref_alloc @@ -1666,23 +1695,22 @@ end function get_const_string_ptr_len ! Function: const std::string * getConstStringPtrAlloc +deref(allocatable)+owner(library) ! const std::string * getConstStringPtrAlloc +deref(allocatable)+owner(library) ! Requested: f_string_scalar_result_allocatable_library - ! Match: f_string_result_allocatable + ! Match: f_string_scalar_result_allocatable ! Function: void getConstStringPtrAlloc ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string * SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out)+owner(library) - ! Requested: f_string_*_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_*_result_allocatable ! Requested: c_string_*_result_buf_allocatable ! Match: c_string_result_buf_allocatable function get_const_string_ptr_alloc() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_const_string_ptr_alloc call c_get_const_string_ptr_alloc_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_const_string_ptr_alloc end function get_const_string_ptr_alloc @@ -1691,13 +1719,12 @@ end function get_const_string_ptr_alloc ! Function: const std::string * getConstStringPtrOwnsAlloc +deref(allocatable)+owner(caller) ! const std::string * getConstStringPtrOwnsAlloc +deref(allocatable)+owner(caller) ! Requested: f_string_scalar_result_allocatable_caller - ! Match: f_string_result_allocatable + ! Match: f_string_scalar_result_allocatable ! Function: void getConstStringPtrOwnsAlloc ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string * SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out)+owner(caller) - ! Requested: f_string_*_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_*_result_allocatable ! Requested: c_string_*_result_buf_allocatable ! Match: c_string_result_buf_allocatable !> @@ -1709,12 +1736,12 @@ end function get_const_string_ptr_alloc !< function get_const_string_ptr_owns_alloc() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_const_string_ptr_owns_alloc call c_get_const_string_ptr_owns_alloc_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_const_string_ptr_owns_alloc end function get_const_string_ptr_owns_alloc @@ -1723,13 +1750,12 @@ end function get_const_string_ptr_owns_alloc ! Function: const std::string * getConstStringPtrOwnsAllocPattern +deref(allocatable)+free_pattern(C_string_free)+owner(caller) ! const std::string * getConstStringPtrOwnsAllocPattern +deref(allocatable)+free_pattern(C_string_free)+owner(caller) ! Requested: f_string_scalar_result_allocatable_caller - ! Match: f_string_result_allocatable + ! Match: f_string_scalar_result_allocatable ! Function: void getConstStringPtrOwnsAllocPattern ! Exact: c_string_scalar_result_buf ! ---------------------------------------- ! Argument: const std::string * SHF_rv +context(DSHF_rv)+deref(allocatable)+free_pattern(C_string_free)+intent(out)+owner(caller) - ! Requested: f_string_*_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_*_result_allocatable ! Requested: c_string_*_result_buf_allocatable ! Match: c_string_result_buf_allocatable !> @@ -1737,12 +1763,12 @@ end function get_const_string_ptr_owns_alloc !< function get_const_string_ptr_owns_alloc_pattern() & result(SHT_rv) - type(SHROUD_array) :: DSHF_rv + type(STR_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.get_const_string_ptr_owns_alloc_pattern call c_get_const_string_ptr_owns_alloc_pattern_bufferify(DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call STR_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.get_const_string_ptr_owns_alloc_pattern end function get_const_string_ptr_owns_alloc_pattern @@ -2001,6 +2027,34 @@ subroutine fetch_string_pointer_len(arg1, nlen) ! splicer end function.fetch_string_pointer_len end subroutine fetch_string_pointer_len + ! Generated by arg_to_buffer + ! ---------------------------------------- + ! Function: int acceptStringInstance + ! int acceptStringInstance + ! Requested: f_native_scalar_result + ! Match: f_default + ! Requested: c_native_scalar_result_buf + ! Match: c_default + ! ---------------------------------------- + ! Argument: std::string arg1 +intent(in)+value + ! Exact: f_string_scalar_in + ! Argument: std::string arg1 +intent(in)+len_trim(Larg1)+value + ! Exact: c_string_scalar_in_buf + !> + !! \brief Accept a string instance + !! + !< + function accept_string_instance(arg1) & + result(SHT_rv) + use iso_c_binding, only : C_INT + character(len=*), intent(IN) :: arg1 + integer(C_INT) :: SHT_rv + ! splicer begin function.accept_string_instance + SHT_rv = c_accept_string_instance_bufferify(arg1, & + len_trim(arg1, kind=C_INT)) + ! splicer end function.accept_string_instance + end function accept_string_instance + ! ---------------------------------------- ! Function: void explicit1 ! void explicit1 diff --git a/regression/reference/strings/wrapstrings.cpp b/regression/reference/strings/wrapstrings.cpp index 55d4bed2a..6c7d79ed7 100644 --- a/regression/reference/strings/wrapstrings.cpp +++ b/regression/reference/strings/wrapstrings.cpp @@ -1,5 +1,5 @@ // wrapstrings.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -1250,6 +1250,45 @@ void STR_fetch_string_pointer_len_bufferify(char * arg1, int Narg1, // splicer end function.fetch_string_pointer_len_bufferify } +/** + * \brief Accept a string instance + * + */ +// ---------------------------------------- +// Function: int acceptStringInstance +// Requested: c_native_scalar_result +// Match: c_default +// ---------------------------------------- +// Argument: std::string arg1 +intent(in)+value +// Exact: c_string_scalar_in +int STR_accept_string_instance(char *arg1) +{ + // splicer begin function.accept_string_instance + int SHC_rv = acceptStringInstance(arg1); + return SHC_rv; + // splicer end function.accept_string_instance +} + +/** + * \brief Accept a string instance + * + */ +// ---------------------------------------- +// Function: int acceptStringInstance +// Requested: c_native_scalar_result_buf +// Match: c_default +// ---------------------------------------- +// Argument: std::string arg1 +intent(in)+len_trim(Larg1)+value +// Exact: c_string_scalar_in_buf +int STR_accept_string_instance_bufferify(char *arg1, int Larg1) +{ + // splicer begin function.accept_string_instance_bufferify + std::string SHCXX_arg1(arg1, Larg1); + int SHC_rv = acceptStringInstance(SHCXX_arg1); + return SHC_rv; + // splicer end function.accept_string_instance_bufferify +} + // ---------------------------------------- // Function: void explicit1 // Requested: c diff --git a/regression/reference/strings/wrapstrings.h b/regression/reference/strings/wrapstrings.h index 492364180..820e171b5 100644 --- a/regression/reference/strings/wrapstrings.h +++ b/regression/reference/strings/wrapstrings.h @@ -1,5 +1,5 @@ // wrapstrings.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -146,6 +146,10 @@ void STR_fetch_string_pointer_len(char * arg1, int * nlen); void STR_fetch_string_pointer_len_bufferify(char * arg1, int Narg1, int * nlen); +int STR_accept_string_instance(char *arg1); + +int STR_accept_string_instance_bufferify(char *arg1, int Larg1); + void STR_explicit1(char * name); void STR_explicit2(char * name); diff --git a/regression/reference/struct-c/struct.json b/regression/reference/struct-c/struct.json index abc95a27e..804d1ba35 100644 --- a/regression/reference/struct-c/struct.json +++ b/regression/reference/struct-c/struct.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct1.c", "C_name_scope": "Cstruct1_", "C_type_name": "Cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_struct_array_descr_create": "PY_Cstruct1_create_array_descr", @@ -82,7 +82,7 @@ "C_impl_filename": "wrapCstruct_ptr.c", "C_name_scope": "Cstruct_ptr_", "C_type_name": "Cstruct_ptr", - "F_capsule_data_type": "SHROUD_cstruct_ptr_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_ptr_capsule", "F_derived_name": "cstruct_ptr", "F_name_scope": "cstruct_ptr_", "PY_struct_array_descr_create": "PY_Cstruct_ptr_create_array_descr", @@ -161,7 +161,7 @@ "C_impl_filename": "wrapCstruct_list.c", "C_name_scope": "Cstruct_list_", "C_type_name": "Cstruct_list", - "F_capsule_data_type": "SHROUD_cstruct_list_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_list_capsule", "F_derived_name": "cstruct_list", "F_name_scope": "cstruct_list_", "PY_struct_array_descr_create": "PY_Cstruct_list_create_array_descr", @@ -334,7 +334,7 @@ "C_impl_filename": "wrapCstruct_numpy.c", "C_name_scope": "Cstruct_numpy_", "C_type_name": "Cstruct_numpy", - "F_capsule_data_type": "SHROUD_cstruct_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_numpy_capsule", "F_derived_name": "cstruct_numpy", "F_name_scope": "cstruct_numpy_", "PY_struct_array_descr_create": "PY_Cstruct_numpy_create_array_descr", @@ -456,7 +456,7 @@ "C_impl_filename": "wrapArrays1.c", "C_name_scope": "Arrays1_", "C_type_name": "Arrays1", - "F_capsule_data_type": "SHROUD_arrays1_capsule", + "F_capsule_data_type": "STR_SHROUD_arrays1_capsule", "F_derived_name": "arrays1", "F_name_scope": "arrays1_", "PY_struct_array_descr_create": "PY_Arrays1_create_array_descr", @@ -1589,159 +1589,6 @@ }, "options": {} }, - { - "_fmtargs": { - "d": { - "fmtc": { - "c_addr": "&", - "c_const": "", - "c_deref": "", - "c_member": ".", - "c_var": "d", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&d", - "cxx_type": "double", - "cxx_var": "d", - "idtor": "0", - "sh_type": "SH_TYPE_DOUBLE", - "stmt0": "c_native_scalar_in", - "stmt1": "c_default" - }, - "fmtf": { - "F_pointer": "SHPTR_d", - "c_var": "d", - "f_intent": "IN", - "f_type": "real(C_DOUBLE)", - "f_var": "d", - "sh_type": "SH_TYPE_DOUBLE", - "stmt0": "f_native_scalar_in", - "stmt1": "f_default", - "stmtc0": "c_native_scalar_in", - "stmtc1": "c_default" - } - }, - "i": { - "fmtc": { - "c_addr": "&", - "c_const": "", - "c_deref": "", - "c_member": ".", - "c_var": "i", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&i", - "cxx_type": "int", - "cxx_var": "i", - "idtor": "0", - "sh_type": "SH_TYPE_INT", - "stmt0": "c_native_scalar_in", - "stmt1": "c_default" - }, - "fmtf": { - "F_pointer": "SHPTR_i", - "c_var": "i", - "f_intent": "IN", - "f_type": "integer(C_INT)", - "f_var": "i", - "sh_type": "SH_TYPE_INT", - "stmt0": "f_native_scalar_in", - "stmt1": "f_default", - "stmtc0": "c_native_scalar_in", - "stmtc1": "c_default" - } - } - }, - "_fmtresult": { - "fmtc": { - "c_const": "const ", - "c_get_value": "", - "c_type": "Cstruct1", - "c_var": "SHC_rv", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "(Cstruct1 *) &SHC_rv", - "cxx_type": "Cstruct1", - "cxx_var": "SHC_rv", - "idtor": "0", - "sh_type": "SH_TYPE_STRUCT", - "stmt0": "c_struct_scalar_result", - "stmt1": "c_struct_result" - }, - "fmtf": { - "cxx_type": "Cstruct1", - "f_type": "type(cstruct1)", - "f_var": "SHT_rv", - "sh_type": "SH_TYPE_STRUCT", - "stmt0": "f_struct_scalar_result", - "stmt1": "f_struct_scalar_result", - "stmtc0": "c_struct_scalar_result", - "stmtc1": "c_struct_result" - } - }, - "ast": { - "const": true, - "declarator": { - "name": "returnConstStructByValue", - "pointer": [] - }, - "params": [ - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "i", - "pointer": [] - }, - "specifier": [ - "int" - ], - "typemap_name": "int" - }, - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "d", - "pointer": [] - }, - "specifier": [ - "double" - ], - "typemap_name": "double" - } - ], - "specifier": [ - "Cstruct1" - ], - "typemap_name": "Cstruct1" - }, - "decl": "const Cstruct1 returnConstStructByValue(int i, double d);", - "declgen": "const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value)", - "fmtdict": { - "C_call_list": "i,\t d", - "C_name": "returnConstStructByValue", - "C_prototype": "int i,\t double d", - "C_return_type": "const Cstruct1", - "F_C_call": "c_return_const_struct_by_value", - "F_C_name": "return_const_struct_by_value", - "F_arg_c_call": "i,\t d", - "F_arguments": "i,\t d", - "F_name_function": "return_const_struct_by_value", - "F_name_generic": "return_const_struct_by_value", - "F_name_impl": "return_const_struct_by_value", - "F_result_clause": "\fresult(SHT_rv)", - "F_subprogram": "function", - "cxx_rv_decl": "const Cstruct1 SHC_rv", - "function_name": "returnConstStructByValue", - "underscore_name": "return_const_struct_by_value" - }, - "options": {} - }, { "_fmtargs": { "d": { diff --git a/regression/reference/struct-c/struct.log b/regression/reference/struct-c/struct.log index 61918bcaa..dbc64730a 100644 --- a/regression/reference/struct-c/struct.log +++ b/regression/reference/struct-c/struct.log @@ -8,7 +8,6 @@ C function int acceptStructInPtr(Cstruct1 * arg +intent(in)) C function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) C function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) C function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -C function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) C function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) C function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) C function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)+len) @@ -29,7 +28,6 @@ C-interface, Fortran function int acceptStructInPtr(Cstruct1 * arg +intent(in)) C-interface, Fortran function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) C-interface, Fortran function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) C-interface, Fortran function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -C-interface, Fortran function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) C-interface, Fortran function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) C-interface, Fortran function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) C-interface function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)+len) diff --git a/regression/reference/struct-c/struct_types.yaml b/regression/reference/struct-c/struct_types.yaml index a033ef2f5..34a3991ed 100644 --- a/regression/reference/struct-c/struct_types.yaml +++ b/regression/reference/struct-c/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-c/typesstruct.h b/regression/reference/struct-c/typesstruct.h index 93a2cf3db..d1f973ef4 100644 --- a/regression/reference/struct-c/typesstruct.h +++ b/regression/reference/struct-c/typesstruct.h @@ -1,5 +1,5 @@ // typesstruct.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-c/wrapfstruct.f b/regression/reference/struct-c/wrapfstruct.f index 7a8da95bc..f69c31685 100644 --- a/regression/reference/struct-c/wrapfstruct.f +++ b/regression/reference/struct-c/wrapfstruct.f @@ -1,5 +1,5 @@ ! wrapfstruct.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -241,31 +241,6 @@ function return_struct_by_value(i, d) & end function return_struct_by_value end interface - ! ---------------------------------------- - ! Function: const Cstruct1 returnConstStructByValue - ! Requested: c_struct_scalar_result - ! Match: c_struct_result - ! ---------------------------------------- - ! Argument: int i +intent(in)+value - ! Requested: c_native_scalar_in - ! Match: c_default - ! ---------------------------------------- - ! Argument: double d +intent(in)+value - ! Requested: c_native_scalar_in - ! Match: c_default - interface - function return_const_struct_by_value(i, d) & - result(SHT_rv) & - bind(C, name="returnConstStructByValue") - use iso_c_binding, only : C_DOUBLE, C_INT - import :: cstruct1 - implicit none - integer(C_INT), value, intent(IN) :: i - real(C_DOUBLE), value, intent(IN) :: d - type(cstruct1) :: SHT_rv - end function return_const_struct_by_value - end interface - ! ---------------------------------------- ! Function: Cstruct1 * returnStructPtr1 +deref(pointer) ! Requested: c_struct_*_result diff --git a/regression/reference/struct-c/wrapstruct.c b/regression/reference/struct-c/wrapstruct.c index 8a2591d43..48ebefdd3 100644 --- a/regression/reference/struct-c/wrapstruct.c +++ b/regression/reference/struct-c/wrapstruct.c @@ -1,5 +1,5 @@ // wrapstruct.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-c/wrapstruct.h b/regression/reference/struct-c/wrapstruct.h index 7dd329ed5..bc6c7b683 100644 --- a/regression/reference/struct-c/wrapstruct.h +++ b/regression/reference/struct-c/wrapstruct.h @@ -1,5 +1,5 @@ // wrapstruct.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-c/pyArrays1type.c b/regression/reference/struct-class-c/pyArrays1type.c index cc6b30ee0..3d573f62f 100644 --- a/regression/reference/struct-class-c/pyArrays1type.c +++ b/regression/reference/struct-class-c/pyArrays1type.c @@ -1,5 +1,5 @@ // pyArrays1type.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-c/pyCstruct1type.c b/regression/reference/struct-class-c/pyCstruct1type.c index 43f06a2ef..26a62b8a5 100644 --- a/regression/reference/struct-class-c/pyCstruct1type.c +++ b/regression/reference/struct-class-c/pyCstruct1type.c @@ -1,5 +1,5 @@ // pyCstruct1type.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-c/pyCstruct_listtype.c b/regression/reference/struct-class-c/pyCstruct_listtype.c index ce50ce25d..72b3056e9 100644 --- a/regression/reference/struct-class-c/pyCstruct_listtype.c +++ b/regression/reference/struct-class-c/pyCstruct_listtype.c @@ -1,5 +1,5 @@ // pyCstruct_listtype.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-c/pyCstruct_numpytype.c b/regression/reference/struct-class-c/pyCstruct_numpytype.c index 15d3cbfc2..446fae143 100644 --- a/regression/reference/struct-class-c/pyCstruct_numpytype.c +++ b/regression/reference/struct-class-c/pyCstruct_numpytype.c @@ -1,5 +1,5 @@ // pyCstruct_numpytype.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-c/pyCstruct_ptrtype.c b/regression/reference/struct-class-c/pyCstruct_ptrtype.c index 74de41b83..8574f10ca 100644 --- a/regression/reference/struct-class-c/pyCstruct_ptrtype.c +++ b/regression/reference/struct-class-c/pyCstruct_ptrtype.c @@ -1,5 +1,5 @@ // pyCstruct_ptrtype.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-c/pystructmodule.c b/regression/reference/struct-class-c/pystructmodule.c index 0b9e60c2d..5f8bebc45 100644 --- a/regression/reference/struct-class-c/pystructmodule.c +++ b/regression/reference/struct-class-c/pystructmodule.c @@ -1,5 +1,5 @@ // pystructmodule.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -353,65 +353,6 @@ PY_returnStructByValue( // splicer end function.return_struct_by_value } -// ---------------------------------------- -// Function: const Cstruct1 returnConstStructByValue -// Exact: py_struct_result_class -// ---------------------------------------- -// Argument: int i +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -// ---------------------------------------- -// Argument: double d +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -static char PY_returnConstStructByValue__doc__[] = -"documentation" -; - -static PyObject * -PY_returnConstStructByValue( - PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) -{ -// splicer begin function.return_const_struct_by_value - int i; - double d; - char *SHT_kwlist[] = { - "i", - "d", - NULL }; - Cstruct1 * SHCXX_rv = NULL; - PyObject *SHTPy_rv = NULL; // struct_result_class - - if (!PyArg_ParseTupleAndKeywords(args, kwds, - "id:returnConstStructByValue", SHT_kwlist, &i, &d)) - return NULL; - - // result pre_call - SHCXX_rv = malloc(sizeof(Cstruct1)); - if (SHCXX_rv == NULL) { - PyErr_NoMemory(); - goto fail; - } - - *SHCXX_rv = returnConstStructByValue(i, d); - - // post_call - SHTPy_rv = PP_Cstruct1_to_Object_idtor(SHCXX_rv, 6); - if (SHTPy_rv == NULL) goto fail; - - return (PyObject *) SHTPy_rv; - -fail: - if (SHCXX_rv != NULL) { - PY_SHROUD_release_memory(6, SHCXX_rv); - } - Py_XDECREF(SHTPy_rv); - return NULL; -// splicer end function.return_const_struct_by_value -} - // ---------------------------------------- // Function: Cstruct1 * returnStructPtr1 +deref(pointer) // Exact: py_struct_result_class @@ -568,8 +509,6 @@ static PyMethodDef PY_methods[] = { METH_VARARGS|METH_KEYWORDS, PY_acceptStructInOutPtr__doc__}, {"returnStructByValue", (PyCFunction)PY_returnStructByValue, METH_VARARGS|METH_KEYWORDS, PY_returnStructByValue__doc__}, -{"returnConstStructByValue", (PyCFunction)PY_returnConstStructByValue, - METH_VARARGS|METH_KEYWORDS, PY_returnConstStructByValue__doc__}, {"returnStructPtr1", (PyCFunction)PY_returnStructPtr1, METH_VARARGS|METH_KEYWORDS, PY_returnStructPtr1__doc__}, {"returnStructPtr2", (PyCFunction)PY_returnStructPtr2, diff --git a/regression/reference/struct-class-c/pystructmodule.h b/regression/reference/struct-class-c/pystructmodule.h index ea7f97dec..d74f21b21 100644 --- a/regression/reference/struct-class-c/pystructmodule.h +++ b/regression/reference/struct-class-c/pystructmodule.h @@ -1,5 +1,5 @@ // pystructmodule.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-c/pystructutil.c b/regression/reference/struct-class-c/pystructutil.c index 6a3228a51..73a555d3b 100644 --- a/regression/reference/struct-class-c/pystructutil.c +++ b/regression/reference/struct-class-c/pystructutil.c @@ -1,5 +1,5 @@ // pystructutil.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -116,11 +116,11 @@ int STR_SHROUD_fill_from_PyObject_char(PyObject *obj, const char *name, int STR_SHROUD_fill_from_PyObject_int_numpy(PyObject *obj, const char *name, int *in, Py_ssize_t insize) { - int value = PyInt_AsLong(obj); + int cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -239,7 +239,7 @@ int STR_SHROUD_get_from_object_double_list(PyObject *obj, double *in = (double *) malloc(size * sizeof(double)); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyFloat_AsDouble(item); + double cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { free(in); Py_DECREF(seq); @@ -248,6 +248,7 @@ int STR_SHROUD_get_from_object_double_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -294,7 +295,7 @@ int STR_SHROUD_get_from_object_int_list(PyObject *obj, int *in = (int *) malloc(size * sizeof(int)); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { free(in); Py_DECREF(seq); @@ -303,6 +304,7 @@ int STR_SHROUD_get_from_object_int_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -663,12 +665,6 @@ static void PY_SHROUD_capsule_destructor_5(void *ptr) free(ptr); } -// 6 - c const Cstruct1 * -static void PY_SHROUD_capsule_destructor_6(void *ptr) -{ - free(ptr); -} - // Code used to release arrays for NumPy objects // via a Capsule base object with a destructor. // Context strings @@ -679,7 +675,6 @@ static PY_SHROUD_dtor_context PY_SHROUD_capsule_context[] = { {"c Cstruct_list *", PY_SHROUD_capsule_destructor_3}, {"c Cstruct_numpy *", PY_SHROUD_capsule_destructor_4}, {"c Arrays1 *", PY_SHROUD_capsule_destructor_5}, - {"c const Cstruct1 *", PY_SHROUD_capsule_destructor_6}, {NULL, NULL}, }; diff --git a/regression/reference/struct-class-c/setup.py b/regression/reference/struct-class-c/setup.py index c6898518a..6dc3f31df 100644 --- a/regression/reference/struct-class-c/setup.py +++ b/regression/reference/struct-class-c/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-c/struct.json b/regression/reference/struct-class-c/struct.json index dbbb8a073..74a28431f 100644 --- a/regression/reference/struct-class-c/struct.json +++ b/regression/reference/struct-class-c/struct.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct1.c", "C_name_scope": "Cstruct1_", "C_type_name": "Cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_PyObject": "PY_Cstruct1", @@ -232,7 +232,7 @@ "C_impl_filename": "wrapCstruct_ptr.c", "C_name_scope": "Cstruct_ptr_", "C_type_name": "Cstruct_ptr", - "F_capsule_data_type": "SHROUD_cstruct_ptr_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_ptr_capsule", "F_derived_name": "cstruct_ptr", "F_name_scope": "cstruct_ptr_", "PY_PyObject": "PY_Cstruct_ptr", @@ -482,7 +482,7 @@ "C_impl_filename": "wrapCstruct_list.c", "C_name_scope": "Cstruct_list_", "C_type_name": "Cstruct_list", - "F_capsule_data_type": "SHROUD_cstruct_list_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_list_capsule", "F_derived_name": "cstruct_list", "F_name_scope": "cstruct_list_", "PY_PyObject": "PY_Cstruct_list", @@ -967,7 +967,7 @@ "C_impl_filename": "wrapCstruct_numpy.c", "C_name_scope": "Cstruct_numpy_", "C_type_name": "Cstruct_numpy", - "F_capsule_data_type": "SHROUD_cstruct_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_numpy_capsule", "F_derived_name": "cstruct_numpy", "F_name_scope": "cstruct_numpy_", "PY_PyObject": "PY_Cstruct_numpy", @@ -1323,7 +1323,7 @@ "C_impl_filename": "wrapArrays1.c", "C_name_scope": "Arrays1_", "C_type_name": "Arrays1", - "F_capsule_data_type": "SHROUD_arrays1_capsule", + "F_capsule_data_type": "STR_SHROUD_arrays1_capsule", "F_derived_name": "arrays1", "F_name_scope": "arrays1_", "PY_PyObject": "PY_Arrays1", @@ -1602,7 +1602,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_scalar_in_class", @@ -1688,7 +1688,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_in_class", @@ -1801,7 +1801,7 @@ "cxx_var": "s1", "data_var": "SHData_s1", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_s1", "size_var": "SHSize_s1", "stmt0": "py_struct_*_in_class", @@ -1910,7 +1910,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_in_class", @@ -2137,7 +2137,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_inout_class", @@ -2304,127 +2304,6 @@ }, "options": {} }, - { - "_fmtargs": { - "d": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "double", - "c_var": "d", - "ctor_expr": "d", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&d", - "cxx_type": "double", - "cxx_var": "d", - "data_var": "SHData_d", - "numpy_type": "NPY_DOUBLE", - "py_var": "SHPy_d", - "size_var": "SHSize_d", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_d" - } - }, - "i": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "int", - "c_var": "i", - "ctor_expr": "i", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&i", - "cxx_type": "int", - "cxx_var": "i", - "data_var": "SHData_i", - "numpy_type": "NPY_INT", - "py_var": "SHPy_i", - "size_var": "SHSize_i", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_i" - } - } - }, - "_fmtresult": { - "fmtpy": { - "PYN_descr": "PY_Cstruct1_array_descr", - "PY_to_object_idtor_func": "PP_Cstruct1_to_Object_idtor", - "PyObject": "PY_Cstruct1", - "PyTypeObject": "PY_Cstruct1_Type", - "c_deref": "*", - "c_var": "SHCXX_rv", - "capsule_order": "6", - "ctor_expr": "*SHCXX_rv", - "cxx_addr": "", - "cxx_alloc_decl": "Cstruct1 * SHCXX_rv", - "cxx_member": "->", - "cxx_nonconst_ptr": "(Cstruct1 *) &SHCXX_rv", - "cxx_type": "Cstruct1", - "cxx_var": "SHCXX_rv", - "data_var": "SHData_rv", - "numpy_type": null, - "py_capsule": "SHC_SHCXX_rv", - "py_var": "SHTPy_rv", - "size_var": "SHSize_rv", - "stmt0": "py_struct_result_class", - "stmt1": "py_struct_result_class", - "value_var": "SHValue_rv" - } - }, - "ast": { - "const": true, - "declarator": { - "name": "returnConstStructByValue", - "pointer": [] - }, - "params": [ - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "i", - "pointer": [] - }, - "specifier": [ - "int" - ], - "typemap_name": "int" - }, - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "d", - "pointer": [] - }, - "specifier": [ - "double" - ], - "typemap_name": "double" - } - ], - "specifier": [ - "Cstruct1" - ], - "typemap_name": "Cstruct1" - }, - "decl": "const Cstruct1 returnConstStructByValue(int i, double d);", - "declgen": "const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value)", - "fmtdict": { - "PY_name_impl": "PY_returnConstStructByValue", - "function_name": "returnConstStructByValue", - "underscore_name": "return_const_struct_by_value" - }, - "options": {} - }, { "_fmtargs": { "d": { diff --git a/regression/reference/struct-class-c/struct.log b/regression/reference/struct-class-c/struct.log index ba8f5f9cd..41e1d43ce 100644 --- a/regression/reference/struct-class-c/struct.log +++ b/regression/reference/struct-class-c/struct.log @@ -22,7 +22,6 @@ Python function int acceptStructInPtr(Cstruct1 * arg +intent(in)) Python function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) Python function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) Python function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -Python function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) Python function Cstruct_list * get_global_struct_list() diff --git a/regression/reference/struct-class-c/struct_types.yaml b/regression/reference/struct-class-c/struct_types.yaml index a033ef2f5..34a3991ed 100644 --- a/regression/reference/struct-class-c/struct_types.yaml +++ b/regression/reference/struct-class-c/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-cxx/pyArrays1type.cpp b/regression/reference/struct-class-cxx/pyArrays1type.cpp index 7ff4aa421..4a0301a5d 100644 --- a/regression/reference/struct-class-cxx/pyArrays1type.cpp +++ b/regression/reference/struct-class-cxx/pyArrays1type.cpp @@ -1,5 +1,5 @@ // pyArrays1type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-cxx/pyCstruct1type.cpp b/regression/reference/struct-class-cxx/pyCstruct1type.cpp index 48f62d106..6339105ac 100644 --- a/regression/reference/struct-class-cxx/pyCstruct1type.cpp +++ b/regression/reference/struct-class-cxx/pyCstruct1type.cpp @@ -1,5 +1,5 @@ // pyCstruct1type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-cxx/pyCstruct_listtype.cpp b/regression/reference/struct-class-cxx/pyCstruct_listtype.cpp index ff0f1ed7d..755cf3efd 100644 --- a/regression/reference/struct-class-cxx/pyCstruct_listtype.cpp +++ b/regression/reference/struct-class-cxx/pyCstruct_listtype.cpp @@ -1,5 +1,5 @@ // pyCstruct_listtype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-cxx/pyCstruct_numpytype.cpp b/regression/reference/struct-class-cxx/pyCstruct_numpytype.cpp index eb9f9b625..14e58a0de 100644 --- a/regression/reference/struct-class-cxx/pyCstruct_numpytype.cpp +++ b/regression/reference/struct-class-cxx/pyCstruct_numpytype.cpp @@ -1,5 +1,5 @@ // pyCstruct_numpytype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-cxx/pyCstruct_ptrtype.cpp b/regression/reference/struct-class-cxx/pyCstruct_ptrtype.cpp index 896d18ddf..f339c15c4 100644 --- a/regression/reference/struct-class-cxx/pyCstruct_ptrtype.cpp +++ b/regression/reference/struct-class-cxx/pyCstruct_ptrtype.cpp @@ -1,5 +1,5 @@ // pyCstruct_ptrtype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-cxx/pystructmodule.cpp b/regression/reference/struct-class-cxx/pystructmodule.cpp index b3517f4c7..e73419a4a 100644 --- a/regression/reference/struct-class-cxx/pystructmodule.cpp +++ b/regression/reference/struct-class-cxx/pystructmodule.cpp @@ -1,5 +1,5 @@ // pystructmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -355,66 +355,6 @@ PY_returnStructByValue( // splicer end function.return_struct_by_value } -// ---------------------------------------- -// Function: const Cstruct1 returnConstStructByValue -// Exact: py_struct_result_class -// ---------------------------------------- -// Argument: int i +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -// ---------------------------------------- -// Argument: double d +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -static char PY_returnConstStructByValue__doc__[] = -"documentation" -; - -static PyObject * -PY_returnConstStructByValue( - PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) -{ -// splicer begin function.return_const_struct_by_value - int i; - double d; - const char *SHT_kwlist[] = { - "i", - "d", - nullptr }; - Cstruct1 * SHCXX_rv = nullptr; - PyObject *SHTPy_rv = nullptr; // struct_result_class - - if (!PyArg_ParseTupleAndKeywords(args, kwds, - "id:returnConstStructByValue", const_cast(SHT_kwlist), - &i, &d)) - return nullptr; - - // result pre_call - SHCXX_rv = new Cstruct1; - if (SHCXX_rv == nullptr) { - PyErr_NoMemory(); - goto fail; - } - - *SHCXX_rv = returnConstStructByValue(i, d); - - // post_call - SHTPy_rv = PP_Cstruct1_to_Object_idtor(SHCXX_rv, 6); - if (SHTPy_rv == nullptr) goto fail; - - return (PyObject *) SHTPy_rv; - -fail: - if (SHCXX_rv != nullptr) { - PY_SHROUD_release_memory(6, SHCXX_rv); - } - Py_XDECREF(SHTPy_rv); - return nullptr; -// splicer end function.return_const_struct_by_value -} - // ---------------------------------------- // Function: Cstruct1 * returnStructPtr1 +deref(pointer) // Exact: py_struct_result_class @@ -571,8 +511,6 @@ static PyMethodDef PY_methods[] = { METH_VARARGS|METH_KEYWORDS, PY_acceptStructInOutPtr__doc__}, {"returnStructByValue", (PyCFunction)PY_returnStructByValue, METH_VARARGS|METH_KEYWORDS, PY_returnStructByValue__doc__}, -{"returnConstStructByValue", (PyCFunction)PY_returnConstStructByValue, - METH_VARARGS|METH_KEYWORDS, PY_returnConstStructByValue__doc__}, {"returnStructPtr1", (PyCFunction)PY_returnStructPtr1, METH_VARARGS|METH_KEYWORDS, PY_returnStructPtr1__doc__}, {"returnStructPtr2", (PyCFunction)PY_returnStructPtr2, diff --git a/regression/reference/struct-class-cxx/pystructmodule.hpp b/regression/reference/struct-class-cxx/pystructmodule.hpp index 5abd0d084..51793fea5 100644 --- a/regression/reference/struct-class-cxx/pystructmodule.hpp +++ b/regression/reference/struct-class-cxx/pystructmodule.hpp @@ -1,5 +1,5 @@ // pystructmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-cxx/pystructutil.cpp b/regression/reference/struct-class-cxx/pystructutil.cpp index cf9a584ff..a7297c6d0 100644 --- a/regression/reference/struct-class-cxx/pystructutil.cpp +++ b/regression/reference/struct-class-cxx/pystructutil.cpp @@ -1,5 +1,5 @@ // pystructutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -116,11 +116,11 @@ int STR_SHROUD_fill_from_PyObject_char(PyObject *obj, const char *name, int STR_SHROUD_fill_from_PyObject_int_numpy(PyObject *obj, const char *name, int *in, Py_ssize_t insize) { - int value = PyInt_AsLong(obj); + int cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -242,7 +242,7 @@ int STR_SHROUD_get_from_object_double_list(PyObject *obj, (std::malloc(size * sizeof(double))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyFloat_AsDouble(item); + double cvalue = PyFloat_AsDouble(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -251,6 +251,7 @@ int STR_SHROUD_get_from_object_double_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -299,7 +300,7 @@ int STR_SHROUD_get_from_object_int_list(PyObject *obj, int *in = static_cast(std::malloc(size * sizeof(int))); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { std::free(in); Py_DECREF(seq); @@ -308,6 +309,7 @@ int STR_SHROUD_get_from_object_int_list(PyObject *obj, (int) i); return 0; } + in[i] = cvalue; } Py_DECREF(seq); @@ -675,13 +677,6 @@ static void PY_SHROUD_capsule_destructor_5(void *ptr) delete cxx_ptr; } -// 6 - cxx const Cstruct1 * -static void PY_SHROUD_capsule_destructor_6(void *ptr) -{ - const Cstruct1 * cxx_ptr = static_cast(ptr); - delete cxx_ptr; -} - // Code used to release arrays for NumPy objects // via a Capsule base object with a destructor. // Context strings @@ -692,7 +687,6 @@ static PY_SHROUD_dtor_context PY_SHROUD_capsule_context[] = { {"cxx Cstruct_list *", PY_SHROUD_capsule_destructor_3}, {"cxx Cstruct_numpy *", PY_SHROUD_capsule_destructor_4}, {"cxx Arrays1 *", PY_SHROUD_capsule_destructor_5}, - {"cxx const Cstruct1 *", PY_SHROUD_capsule_destructor_6}, {nullptr, nullptr}, }; diff --git a/regression/reference/struct-class-cxx/setup.py b/regression/reference/struct-class-cxx/setup.py index b4a68682a..48284256d 100644 --- a/regression/reference/struct-class-cxx/setup.py +++ b/regression/reference/struct-class-cxx/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-class-cxx/struct.json b/regression/reference/struct-class-cxx/struct.json index 04be9ec56..541b3de73 100644 --- a/regression/reference/struct-class-cxx/struct.json +++ b/regression/reference/struct-class-cxx/struct.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct1.cpp", "C_name_scope": "Cstruct1_", "C_type_name": "STR_cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_PyObject": "PY_Cstruct1", @@ -232,7 +232,7 @@ "C_impl_filename": "wrapCstruct_ptr.cpp", "C_name_scope": "Cstruct_ptr_", "C_type_name": "STR_cstruct_ptr", - "F_capsule_data_type": "SHROUD_cstruct_ptr_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_ptr_capsule", "F_derived_name": "cstruct_ptr", "F_name_scope": "cstruct_ptr_", "PY_PyObject": "PY_Cstruct_ptr", @@ -482,7 +482,7 @@ "C_impl_filename": "wrapCstruct_list.cpp", "C_name_scope": "Cstruct_list_", "C_type_name": "STR_cstruct_list", - "F_capsule_data_type": "SHROUD_cstruct_list_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_list_capsule", "F_derived_name": "cstruct_list", "F_name_scope": "cstruct_list_", "PY_PyObject": "PY_Cstruct_list", @@ -967,7 +967,7 @@ "C_impl_filename": "wrapCstruct_numpy.cpp", "C_name_scope": "Cstruct_numpy_", "C_type_name": "STR_cstruct_numpy", - "F_capsule_data_type": "SHROUD_cstruct_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_numpy_capsule", "F_derived_name": "cstruct_numpy", "F_name_scope": "cstruct_numpy_", "PY_PyObject": "PY_Cstruct_numpy", @@ -1323,7 +1323,7 @@ "C_impl_filename": "wrapArrays1.cpp", "C_name_scope": "Arrays1_", "C_type_name": "STR_arrays1", - "F_capsule_data_type": "SHROUD_arrays1_capsule", + "F_capsule_data_type": "STR_SHROUD_arrays1_capsule", "F_derived_name": "arrays1", "F_name_scope": "arrays1_", "PY_PyObject": "PY_Arrays1", @@ -1602,7 +1602,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_scalar_in_class", @@ -1688,7 +1688,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_in_class", @@ -1801,7 +1801,7 @@ "cxx_var": "s1", "data_var": "SHData_s1", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_s1", "size_var": "SHSize_s1", "stmt0": "py_struct_*_in_class", @@ -1910,7 +1910,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_in_class", @@ -2137,7 +2137,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_inout_class", @@ -2304,127 +2304,6 @@ }, "options": {} }, - { - "_fmtargs": { - "d": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "double", - "c_var": "d", - "ctor_expr": "d", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&d", - "cxx_type": "double", - "cxx_var": "d", - "data_var": "SHData_d", - "numpy_type": "NPY_DOUBLE", - "py_var": "SHPy_d", - "size_var": "SHSize_d", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_d" - } - }, - "i": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "int", - "c_var": "i", - "ctor_expr": "i", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&i", - "cxx_type": "int", - "cxx_var": "i", - "data_var": "SHData_i", - "numpy_type": "NPY_INT", - "py_var": "SHPy_i", - "size_var": "SHSize_i", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_i" - } - } - }, - "_fmtresult": { - "fmtpy": { - "PYN_descr": "PY_Cstruct1_array_descr", - "PY_to_object_idtor_func": "PP_Cstruct1_to_Object_idtor", - "PyObject": "PY_Cstruct1", - "PyTypeObject": "PY_Cstruct1_Type", - "c_deref": "*", - "c_var": "SHCXX_rv", - "capsule_order": "6", - "ctor_expr": "*SHCXX_rv", - "cxx_addr": "", - "cxx_alloc_decl": "Cstruct1 * SHCXX_rv", - "cxx_member": "->", - "cxx_nonconst_ptr": "const_cast\t(&SHCXX_rv)", - "cxx_type": "Cstruct1", - "cxx_var": "SHCXX_rv", - "data_var": "SHData_rv", - "numpy_type": null, - "py_capsule": "SHC_SHCXX_rv", - "py_var": "SHTPy_rv", - "size_var": "SHSize_rv", - "stmt0": "py_struct_result_class", - "stmt1": "py_struct_result_class", - "value_var": "SHValue_rv" - } - }, - "ast": { - "const": true, - "declarator": { - "name": "returnConstStructByValue", - "pointer": [] - }, - "params": [ - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "i", - "pointer": [] - }, - "specifier": [ - "int" - ], - "typemap_name": "int" - }, - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "d", - "pointer": [] - }, - "specifier": [ - "double" - ], - "typemap_name": "double" - } - ], - "specifier": [ - "Cstruct1" - ], - "typemap_name": "Cstruct1" - }, - "decl": "const Cstruct1 returnConstStructByValue(int i, double d);", - "declgen": "const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value)", - "fmtdict": { - "PY_name_impl": "PY_returnConstStructByValue", - "function_name": "returnConstStructByValue", - "underscore_name": "return_const_struct_by_value" - }, - "options": {} - }, { "_fmtargs": { "d": { diff --git a/regression/reference/struct-class-cxx/struct.log b/regression/reference/struct-class-cxx/struct.log index dfb8b0e1d..cdc4af1df 100644 --- a/regression/reference/struct-class-cxx/struct.log +++ b/regression/reference/struct-class-cxx/struct.log @@ -22,7 +22,6 @@ Python function int acceptStructInPtr(Cstruct1 * arg +intent(in)) Python function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) Python function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) Python function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -Python function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) Python function Cstruct_list * get_global_struct_list() diff --git a/regression/reference/struct-class-cxx/struct_types.yaml b/regression/reference/struct-class-cxx/struct_types.yaml index 573b2dbc3..2e659c47d 100644 --- a/regression/reference/struct-class-cxx/struct_types.yaml +++ b/regression/reference/struct-class-cxx/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-cxx/struct.json b/regression/reference/struct-cxx/struct.json index 8f70605b9..a15dad0f0 100644 --- a/regression/reference/struct-cxx/struct.json +++ b/regression/reference/struct-cxx/struct.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct1.cpp", "C_name_scope": "Cstruct1_", "C_type_name": "STR_cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_struct_array_descr_create": "PY_Cstruct1_create_array_descr", @@ -82,7 +82,7 @@ "C_impl_filename": "wrapCstruct_ptr.cpp", "C_name_scope": "Cstruct_ptr_", "C_type_name": "STR_cstruct_ptr", - "F_capsule_data_type": "SHROUD_cstruct_ptr_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_ptr_capsule", "F_derived_name": "cstruct_ptr", "F_name_scope": "cstruct_ptr_", "PY_struct_array_descr_create": "PY_Cstruct_ptr_create_array_descr", @@ -161,7 +161,7 @@ "C_impl_filename": "wrapCstruct_list.cpp", "C_name_scope": "Cstruct_list_", "C_type_name": "STR_cstruct_list", - "F_capsule_data_type": "SHROUD_cstruct_list_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_list_capsule", "F_derived_name": "cstruct_list", "F_name_scope": "cstruct_list_", "PY_struct_array_descr_create": "PY_Cstruct_list_create_array_descr", @@ -334,7 +334,7 @@ "C_impl_filename": "wrapCstruct_numpy.cpp", "C_name_scope": "Cstruct_numpy_", "C_type_name": "STR_cstruct_numpy", - "F_capsule_data_type": "SHROUD_cstruct_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_numpy_capsule", "F_derived_name": "cstruct_numpy", "F_name_scope": "cstruct_numpy_", "PY_struct_array_descr_create": "PY_Cstruct_numpy_create_array_descr", @@ -456,7 +456,7 @@ "C_impl_filename": "wrapArrays1.cpp", "C_name_scope": "Arrays1_", "C_type_name": "STR_arrays1", - "F_capsule_data_type": "SHROUD_arrays1_capsule", + "F_capsule_data_type": "STR_SHROUD_arrays1_capsule", "F_derived_name": "arrays1", "F_name_scope": "arrays1_", "PY_struct_array_descr_create": "PY_Arrays1_create_array_descr", @@ -1589,159 +1589,6 @@ }, "options": {} }, - { - "_fmtargs": { - "d": { - "fmtc": { - "c_addr": "&", - "c_const": "", - "c_deref": "", - "c_member": ".", - "c_var": "d", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&d", - "cxx_type": "double", - "cxx_var": "d", - "idtor": "0", - "sh_type": "SH_TYPE_DOUBLE", - "stmt0": "c_native_scalar_in", - "stmt1": "c_default" - }, - "fmtf": { - "F_pointer": "SHPTR_d", - "c_var": "d", - "f_intent": "IN", - "f_type": "real(C_DOUBLE)", - "f_var": "d", - "sh_type": "SH_TYPE_DOUBLE", - "stmt0": "f_native_scalar_in", - "stmt1": "f_default", - "stmtc0": "c_native_scalar_in", - "stmtc1": "c_default" - } - }, - "i": { - "fmtc": { - "c_addr": "&", - "c_const": "", - "c_deref": "", - "c_member": ".", - "c_var": "i", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&i", - "cxx_type": "int", - "cxx_var": "i", - "idtor": "0", - "sh_type": "SH_TYPE_INT", - "stmt0": "c_native_scalar_in", - "stmt1": "c_default" - }, - "fmtf": { - "F_pointer": "SHPTR_i", - "c_var": "i", - "f_intent": "IN", - "f_type": "integer(C_INT)", - "f_var": "i", - "sh_type": "SH_TYPE_INT", - "stmt0": "f_native_scalar_in", - "stmt1": "f_default", - "stmtc0": "c_native_scalar_in", - "stmtc1": "c_default" - } - } - }, - "_fmtresult": { - "fmtc": { - "c_const": "const ", - "c_get_value": "*", - "c_type": "STR_cstruct1", - "c_var": "SHC_rv", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "const_cast\t(&SHCXX_rv)", - "cxx_type": "Cstruct1", - "cxx_var": "SHCXX_rv", - "idtor": "0", - "sh_type": "SH_TYPE_STRUCT", - "stmt0": "c_struct_scalar_result", - "stmt1": "c_struct_result" - }, - "fmtf": { - "cxx_type": "Cstruct1", - "f_type": "type(cstruct1)", - "f_var": "SHT_rv", - "sh_type": "SH_TYPE_STRUCT", - "stmt0": "f_struct_scalar_result", - "stmt1": "f_struct_scalar_result", - "stmtc0": "c_struct_scalar_result", - "stmtc1": "c_struct_result" - } - }, - "ast": { - "const": true, - "declarator": { - "name": "returnConstStructByValue", - "pointer": [] - }, - "params": [ - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "i", - "pointer": [] - }, - "specifier": [ - "int" - ], - "typemap_name": "int" - }, - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "d", - "pointer": [] - }, - "specifier": [ - "double" - ], - "typemap_name": "double" - } - ], - "specifier": [ - "Cstruct1" - ], - "typemap_name": "Cstruct1" - }, - "decl": "const Cstruct1 returnConstStructByValue(int i, double d);", - "declgen": "const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value)", - "fmtdict": { - "C_call_list": "i,\t d", - "C_name": "STR_return_const_struct_by_value", - "C_prototype": "int i,\t double d", - "C_return_type": "const STR_cstruct1", - "F_C_call": "c_return_const_struct_by_value", - "F_C_name": "return_const_struct_by_value", - "F_arg_c_call": "i,\t d", - "F_arguments": "i,\t d", - "F_name_function": "return_const_struct_by_value", - "F_name_generic": "return_const_struct_by_value", - "F_name_impl": "return_const_struct_by_value", - "F_result_clause": "\fresult(SHT_rv)", - "F_subprogram": "function", - "cxx_rv_decl": "const Cstruct1 SHCXX_rv", - "function_name": "returnConstStructByValue", - "underscore_name": "return_const_struct_by_value" - }, - "options": {} - }, { "_fmtargs": { "d": { diff --git a/regression/reference/struct-cxx/struct.log b/regression/reference/struct-cxx/struct.log index a89bf029c..2e4ab8eff 100644 --- a/regression/reference/struct-cxx/struct.log +++ b/regression/reference/struct-cxx/struct.log @@ -13,7 +13,6 @@ C function int acceptStructInPtr(Cstruct1 * arg +intent(in)) C function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) C function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) C function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -C function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) C function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) C function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) C function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)+len) @@ -34,7 +33,6 @@ C-interface, Fortran function int acceptStructInPtr(Cstruct1 * arg +intent(in)) C-interface, Fortran function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) C-interface, Fortran function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) C-interface, Fortran function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -C-interface, Fortran function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) C-interface, Fortran function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) C-interface, Fortran function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) C-interface function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)+len) diff --git a/regression/reference/struct-cxx/struct_types.yaml b/regression/reference/struct-cxx/struct_types.yaml index 573b2dbc3..2e659c47d 100644 --- a/regression/reference/struct-cxx/struct_types.yaml +++ b/regression/reference/struct-cxx/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-cxx/typesstruct.h b/regression/reference/struct-cxx/typesstruct.h index d836e2c58..0c3b0bbd6 100644 --- a/regression/reference/struct-cxx/typesstruct.h +++ b/regression/reference/struct-cxx/typesstruct.h @@ -1,5 +1,5 @@ // typesstruct.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-cxx/wrapfstruct.f b/regression/reference/struct-cxx/wrapfstruct.f index b486290d6..1dac7fde9 100644 --- a/regression/reference/struct-cxx/wrapfstruct.f +++ b/regression/reference/struct-cxx/wrapfstruct.f @@ -1,5 +1,5 @@ ! wrapfstruct.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -227,29 +227,6 @@ function return_struct_by_value(i, d) & type(cstruct1) :: SHT_rv end function return_struct_by_value - ! ---------------------------------------- - ! Function: const Cstruct1 returnConstStructByValue - ! Requested: c_struct_scalar_result - ! Match: c_struct_result - ! ---------------------------------------- - ! Argument: int i +intent(in)+value - ! Requested: c_native_scalar_in - ! Match: c_default - ! ---------------------------------------- - ! Argument: double d +intent(in)+value - ! Requested: c_native_scalar_in - ! Match: c_default - function return_const_struct_by_value(i, d) & - result(SHT_rv) & - bind(C, name="STR_return_const_struct_by_value") - use iso_c_binding, only : C_DOUBLE, C_INT - import :: cstruct1 - implicit none - integer(C_INT), value, intent(IN) :: i - real(C_DOUBLE), value, intent(IN) :: d - type(cstruct1) :: SHT_rv - end function return_const_struct_by_value - ! ---------------------------------------- ! Function: Cstruct1 * returnStructPtr1 +deref(pointer) ! Requested: c_struct_*_result diff --git a/regression/reference/struct-cxx/wrapstruct.cpp b/regression/reference/struct-cxx/wrapstruct.cpp index 608ad8041..bbeaf7c98 100644 --- a/regression/reference/struct-cxx/wrapstruct.cpp +++ b/regression/reference/struct-cxx/wrapstruct.cpp @@ -1,5 +1,5 @@ // wrapstruct.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -204,28 +204,6 @@ STR_cstruct1 STR_return_struct_by_value(int i, double d) // splicer end function.return_struct_by_value } -// ---------------------------------------- -// Function: const Cstruct1 returnConstStructByValue -// Requested: c_struct_scalar_result -// Match: c_struct_result -// ---------------------------------------- -// Argument: int i +intent(in)+value -// Requested: c_native_scalar_in -// Match: c_default -// ---------------------------------------- -// Argument: double d +intent(in)+value -// Requested: c_native_scalar_in -// Match: c_default -const STR_cstruct1 STR_return_const_struct_by_value(int i, double d) -{ - // splicer begin function.return_const_struct_by_value - const Cstruct1 SHCXX_rv = returnConstStructByValue(i, d); - const STR_cstruct1 * SHC_rv = static_cast( - static_cast(&SHCXX_rv)); - return *SHC_rv; - // splicer end function.return_const_struct_by_value -} - /** * \brief Return a pointer to a struct * diff --git a/regression/reference/struct-cxx/wrapstruct.h b/regression/reference/struct-cxx/wrapstruct.h index 657124eff..050c276e6 100644 --- a/regression/reference/struct-cxx/wrapstruct.h +++ b/regression/reference/struct-cxx/wrapstruct.h @@ -1,5 +1,5 @@ // wrapstruct.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -82,8 +82,6 @@ void STR_accept_struct_in_out_ptr(STR_cstruct1 * arg); STR_cstruct1 STR_return_struct_by_value(int i, double d); -const STR_cstruct1 STR_return_const_struct_by_value(int i, double d); - STR_cstruct1 * STR_return_struct_ptr1(int i, double d); STR_cstruct1 * STR_return_struct_ptr2(int i, double d, char * outbuf); diff --git a/regression/reference/struct-list-cxx/pystructmodule.cpp b/regression/reference/struct-list-cxx/pystructmodule.cpp index 68c977b8d..5662967b7 100644 --- a/regression/reference/struct-list-cxx/pystructmodule.cpp +++ b/regression/reference/struct-list-cxx/pystructmodule.cpp @@ -1,5 +1,5 @@ // pystructmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -329,51 +329,6 @@ PY_returnStructByValue( // splicer end function.return_struct_by_value } -// ---------------------------------------- -// Function: const Cstruct1 returnConstStructByValue -// Requested: py_struct_result_list -// Match: py_default -// ---------------------------------------- -// Argument: int i +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -// ---------------------------------------- -// Argument: double d +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -static char PY_returnConstStructByValue__doc__[] = -"documentation" -; - -static PyObject * -PY_returnConstStructByValue( - PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) -{ -// splicer begin function.return_const_struct_by_value - int i; - double d; - const char *SHT_kwlist[] = { - "i", - "d", - nullptr }; - PY_Cstruct1 * SHTPy_rv = nullptr; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, - "id:returnConstStructByValue", const_cast(SHT_kwlist), - &i, &d)) - return nullptr; - - const Cstruct1 SHCXX_rv = returnConstStructByValue(i, d); - - // post_call - SHTPy_rv = Py_BuildValue("O", SHCXX_rv); - - return (PyObject *) SHTPy_rv; -// splicer end function.return_const_struct_by_value -} - // ---------------------------------------- // Function: Cstruct1 * returnStructPtr1 +deref(pointer) // Requested: py_struct_result_list @@ -516,8 +471,6 @@ static PyMethodDef PY_methods[] = { METH_VARARGS|METH_KEYWORDS, PY_acceptStructInOutPtr__doc__}, {"returnStructByValue", (PyCFunction)PY_returnStructByValue, METH_VARARGS|METH_KEYWORDS, PY_returnStructByValue__doc__}, -{"returnConstStructByValue", (PyCFunction)PY_returnConstStructByValue, - METH_VARARGS|METH_KEYWORDS, PY_returnConstStructByValue__doc__}, {"returnStructPtr1", (PyCFunction)PY_returnStructPtr1, METH_VARARGS|METH_KEYWORDS, PY_returnStructPtr1__doc__}, {"returnStructPtr2", (PyCFunction)PY_returnStructPtr2, diff --git a/regression/reference/struct-list-cxx/pystructmodule.hpp b/regression/reference/struct-list-cxx/pystructmodule.hpp index 305a36c63..7c3253560 100644 --- a/regression/reference/struct-list-cxx/pystructmodule.hpp +++ b/regression/reference/struct-list-cxx/pystructmodule.hpp @@ -1,5 +1,5 @@ // pystructmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-list-cxx/setup.py b/regression/reference/struct-list-cxx/setup.py index 7ac1bdf49..b31afe47c 100644 --- a/regression/reference/struct-list-cxx/setup.py +++ b/regression/reference/struct-list-cxx/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-list-cxx/struct.json b/regression/reference/struct-list-cxx/struct.json index 0ed8d6c0e..9d2d62d24 100644 --- a/regression/reference/struct-list-cxx/struct.json +++ b/regression/reference/struct-list-cxx/struct.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct1.cpp", "C_name_scope": "Cstruct1_", "C_type_name": "STR_cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_PyObject": "PY_Cstruct1", @@ -87,7 +87,7 @@ "C_impl_filename": "wrapCstruct_ptr.cpp", "C_name_scope": "Cstruct_ptr_", "C_type_name": "STR_cstruct_ptr", - "F_capsule_data_type": "SHROUD_cstruct_ptr_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_ptr_capsule", "F_derived_name": "cstruct_ptr", "F_name_scope": "cstruct_ptr_", "PY_PyObject": "PY_Cstruct_ptr", @@ -171,7 +171,7 @@ "C_impl_filename": "wrapCstruct_list.cpp", "C_name_scope": "Cstruct_list_", "C_type_name": "STR_cstruct_list", - "F_capsule_data_type": "SHROUD_cstruct_list_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_list_capsule", "F_derived_name": "cstruct_list", "F_name_scope": "cstruct_list_", "PY_PyObject": "PY_Cstruct_list", @@ -349,7 +349,7 @@ "C_impl_filename": "wrapCstruct_numpy.cpp", "C_name_scope": "Cstruct_numpy_", "C_type_name": "STR_cstruct_numpy", - "F_capsule_data_type": "SHROUD_cstruct_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_numpy_capsule", "F_derived_name": "cstruct_numpy", "F_name_scope": "cstruct_numpy_", "PY_PyObject": "PY_Cstruct_numpy", @@ -476,7 +476,7 @@ "C_impl_filename": "wrapArrays1.cpp", "C_name_scope": "Arrays1_", "C_type_name": "STR_arrays1", - "F_capsule_data_type": "SHROUD_arrays1_capsule", + "F_capsule_data_type": "STR_SHROUD_arrays1_capsule", "F_derived_name": "arrays1", "F_name_scope": "arrays1_", "PY_PyObject": "PY_Arrays1", @@ -588,7 +588,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_scalar_in_list", @@ -674,7 +674,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_in_list", @@ -787,7 +787,7 @@ "cxx_var": "s1", "data_var": "SHData_s1", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_s1", "size_var": "SHSize_s1", "stmt0": "py_struct_*_in_list", @@ -896,7 +896,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_in_list", @@ -1126,7 +1126,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": null, - "py_type": "PY_Cstruct1", + "py_object": "PY_Cstruct1", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_struct_*_inout_list", @@ -1293,126 +1293,6 @@ }, "options": {} }, - { - "_fmtargs": { - "d": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "double", - "c_var": "d", - "ctor_expr": "d", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&d", - "cxx_type": "double", - "cxx_var": "d", - "data_var": "SHData_d", - "numpy_type": "NPY_DOUBLE", - "py_var": "SHPy_d", - "size_var": "SHSize_d", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_d" - } - }, - "i": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "int", - "c_var": "i", - "ctor_expr": "i", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&i", - "cxx_type": "int", - "cxx_var": "i", - "data_var": "SHData_i", - "numpy_type": "NPY_INT", - "py_var": "SHPy_i", - "size_var": "SHSize_i", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_i" - } - } - }, - "_fmtresult": { - "fmtpy": { - "PYN_descr": "PY_Cstruct1_array_descr", - "PY_build_format": "O", - "PY_to_object_idtor_func": "PP_Cstruct1_to_Object_idtor", - "PyObject": "PY_Cstruct1", - "PyTypeObject": "PY_Cstruct1_Type", - "c_deref": "", - "c_var": "SHCXX_rv", - "ctor_expr": "SHCXX_rv", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "const_cast\t(&SHCXX_rv)", - "cxx_type": "Cstruct1", - "cxx_var": "SHCXX_rv", - "data_var": "SHData_rv", - "numpy_type": null, - "py_var": "SHTPy_rv", - "size_var": "SHSize_rv", - "stmt0": "py_struct_result_list", - "stmt1": "py_default", - "value_var": "SHValue_rv", - "vargs": "SHCXX_rv" - } - }, - "ast": { - "const": true, - "declarator": { - "name": "returnConstStructByValue", - "pointer": [] - }, - "params": [ - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "i", - "pointer": [] - }, - "specifier": [ - "int" - ], - "typemap_name": "int" - }, - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "d", - "pointer": [] - }, - "specifier": [ - "double" - ], - "typemap_name": "double" - } - ], - "specifier": [ - "Cstruct1" - ], - "typemap_name": "Cstruct1" - }, - "decl": "const Cstruct1 returnConstStructByValue(int i, double d);", - "declgen": "const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value)", - "fmtdict": { - "PY_name_impl": "PY_returnConstStructByValue", - "function_name": "returnConstStructByValue", - "underscore_name": "return_const_struct_by_value" - }, - "options": {} - }, { "_fmtargs": { "d": { diff --git a/regression/reference/struct-list-cxx/struct.log b/regression/reference/struct-list-cxx/struct.log index 6487138d0..0bfa9e9e9 100644 --- a/regression/reference/struct-list-cxx/struct.log +++ b/regression/reference/struct-list-cxx/struct.log @@ -7,7 +7,6 @@ Python function int acceptStructInPtr(Cstruct1 * arg +intent(in)) Python function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) Python function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) Python function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -Python function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) Python function Cstruct_list * get_global_struct_list() diff --git a/regression/reference/struct-list-cxx/struct_types.yaml b/regression/reference/struct-list-cxx/struct_types.yaml index 573b2dbc3..2e659c47d 100644 --- a/regression/reference/struct-list-cxx/struct_types.yaml +++ b/regression/reference/struct-list-cxx/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-numpy-c/pystructmodule.c b/regression/reference/struct-numpy-c/pystructmodule.c index 46f792058..8cedd860b 100644 --- a/regression/reference/struct-numpy-c/pystructmodule.c +++ b/regression/reference/struct-numpy-c/pystructmodule.c @@ -1,5 +1,5 @@ // pystructmodule.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -468,75 +468,6 @@ PY_returnStructByValue( // splicer end function.return_struct_by_value } -// ---------------------------------------- -// Function: const Cstruct1 returnConstStructByValue -// Exact: py_struct_result_numpy -// ---------------------------------------- -// Argument: int i +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -// ---------------------------------------- -// Argument: double d +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -static char PY_returnConstStructByValue__doc__[] = -"documentation" -; - -static PyObject * -PY_returnConstStructByValue( - PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) -{ -// splicer begin function.return_const_struct_by_value - int i; - double d; - char *SHT_kwlist[] = { - "i", - "d", - NULL }; - Cstruct1 * SHCXX_rv = NULL; - PyObject * SHTPy_rv = NULL; - PyObject *SHC_SHCXX_rv = NULL; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, - "id:returnConstStructByValue", SHT_kwlist, &i, &d)) - return NULL; - - // result pre_call - SHCXX_rv = malloc(sizeof(Cstruct1)); - if (SHCXX_rv == NULL) { - PyErr_NoMemory(); - goto fail; - } - - *SHCXX_rv = returnConstStructByValue(i, d); - - // post_call - Py_INCREF(PY_Cstruct1_array_descr); - SHTPy_rv = PyArray_NewFromDescr(&PyArray_Type, - PY_Cstruct1_array_descr, 0, NULL, NULL, SHCXX_rv, 0, NULL); - if (SHTPy_rv == NULL) goto fail; - SHC_SHCXX_rv = PyCapsule_New(SHCXX_rv, "PY_array_dtor", - PY_SHROUD_capsule_destructor); - if (SHC_SHCXX_rv == NULL) goto fail; - PyCapsule_SetContext(SHC_SHCXX_rv, PY_SHROUD_fetch_context(2)); - if (PyArray_SetBaseObject((PyArrayObject *) SHTPy_rv, - SHC_SHCXX_rv) < 0) goto fail; - - return (PyObject *) SHTPy_rv; - -fail: - if (SHCXX_rv != NULL) { - PY_SHROUD_release_memory(2, SHCXX_rv); - } - Py_XDECREF(SHTPy_rv); - Py_XDECREF(SHC_SHCXX_rv); - return NULL; -// splicer end function.return_const_struct_by_value -} - // ---------------------------------------- // Function: Cstruct1 * returnStructPtr1 +deref(pointer) // Exact: py_struct_result_numpy @@ -699,8 +630,6 @@ static PyMethodDef PY_methods[] = { METH_VARARGS|METH_KEYWORDS, PY_acceptStructInOutPtr__doc__}, {"returnStructByValue", (PyCFunction)PY_returnStructByValue, METH_VARARGS|METH_KEYWORDS, PY_returnStructByValue__doc__}, -{"returnConstStructByValue", (PyCFunction)PY_returnConstStructByValue, - METH_VARARGS|METH_KEYWORDS, PY_returnConstStructByValue__doc__}, {"returnStructPtr1", (PyCFunction)PY_returnStructPtr1, METH_VARARGS|METH_KEYWORDS, PY_returnStructPtr1__doc__}, {"returnStructPtr2", (PyCFunction)PY_returnStructPtr2, diff --git a/regression/reference/struct-numpy-c/pystructmodule.h b/regression/reference/struct-numpy-c/pystructmodule.h index 019eb5e26..c76d6f41f 100644 --- a/regression/reference/struct-numpy-c/pystructmodule.h +++ b/regression/reference/struct-numpy-c/pystructmodule.h @@ -1,5 +1,5 @@ // pystructmodule.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-numpy-c/pystructutil.c b/regression/reference/struct-numpy-c/pystructutil.c index 88eade222..631d07647 100644 --- a/regression/reference/struct-numpy-c/pystructutil.c +++ b/regression/reference/struct-numpy-c/pystructutil.c @@ -1,5 +1,5 @@ // pystructutil.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -40,19 +40,12 @@ static void PY_SHROUD_capsule_destructor_1(void *ptr) free(ptr); } -// 2 - c const Cstruct1 * -static void PY_SHROUD_capsule_destructor_2(void *ptr) -{ - free(ptr); -} - // Code used to release arrays for NumPy objects // via a Capsule base object with a destructor. // Context strings static PY_SHROUD_dtor_context PY_SHROUD_capsule_context[] = { {"--none--", PY_SHROUD_capsule_destructor_0}, {"c Cstruct1 *", PY_SHROUD_capsule_destructor_1}, - {"c const Cstruct1 *", PY_SHROUD_capsule_destructor_2}, {NULL, NULL}, }; diff --git a/regression/reference/struct-numpy-c/setup.py b/regression/reference/struct-numpy-c/setup.py index bf4b45621..a79111cd6 100644 --- a/regression/reference/struct-numpy-c/setup.py +++ b/regression/reference/struct-numpy-c/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-numpy-c/struct.json b/regression/reference/struct-numpy-c/struct.json index fed20c09d..c6c6fcaca 100644 --- a/regression/reference/struct-numpy-c/struct.json +++ b/regression/reference/struct-numpy-c/struct.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct1.c", "C_name_scope": "Cstruct1_", "C_type_name": "Cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_PyObject": "PY_Cstruct1", @@ -87,7 +87,7 @@ "C_impl_filename": "wrapCstruct_ptr.c", "C_name_scope": "Cstruct_ptr_", "C_type_name": "Cstruct_ptr", - "F_capsule_data_type": "SHROUD_cstruct_ptr_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_ptr_capsule", "F_derived_name": "cstruct_ptr", "F_name_scope": "cstruct_ptr_", "PY_PyObject": "PY_Cstruct_ptr", @@ -171,7 +171,7 @@ "C_impl_filename": "wrapCstruct_list.c", "C_name_scope": "Cstruct_list_", "C_type_name": "Cstruct_list", - "F_capsule_data_type": "SHROUD_cstruct_list_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_list_capsule", "F_derived_name": "cstruct_list", "F_name_scope": "cstruct_list_", "PY_PyObject": "PY_Cstruct_list", @@ -349,7 +349,7 @@ "C_impl_filename": "wrapCstruct_numpy.c", "C_name_scope": "Cstruct_numpy_", "C_type_name": "Cstruct_numpy", - "F_capsule_data_type": "SHROUD_cstruct_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_numpy_capsule", "F_derived_name": "cstruct_numpy", "F_name_scope": "cstruct_numpy_", "PY_PyObject": "PY_Cstruct_numpy", @@ -476,7 +476,7 @@ "C_impl_filename": "wrapArrays1.c", "C_name_scope": "Arrays1_", "C_type_name": "Arrays1", - "F_capsule_data_type": "SHROUD_arrays1_capsule", + "F_capsule_data_type": "STR_SHROUD_arrays1_capsule", "F_derived_name": "arrays1", "F_name_scope": "arrays1_", "PY_PyObject": "PY_Arrays1", @@ -1290,127 +1290,6 @@ }, "options": {} }, - { - "_fmtargs": { - "d": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "double", - "c_var": "d", - "ctor_expr": "d", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&d", - "cxx_type": "double", - "cxx_var": "d", - "data_var": "SHData_d", - "numpy_type": "NPY_DOUBLE", - "py_var": "SHPy_d", - "size_var": "SHSize_d", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_d" - } - }, - "i": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "int", - "c_var": "i", - "ctor_expr": "i", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&i", - "cxx_type": "int", - "cxx_var": "i", - "data_var": "SHData_i", - "numpy_type": "NPY_INT", - "py_var": "SHPy_i", - "size_var": "SHSize_i", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_i" - } - } - }, - "_fmtresult": { - "fmtpy": { - "PYN_descr": "PY_Cstruct1_array_descr", - "PY_to_object_idtor_func": "PP_Cstruct1_to_Object_idtor", - "PyObject": "PY_Cstruct1", - "PyTypeObject": "PY_Cstruct1_Type", - "c_deref": "*", - "c_var": "SHCXX_rv", - "capsule_order": "2", - "ctor_expr": "*SHCXX_rv", - "cxx_addr": "", - "cxx_alloc_decl": "Cstruct1 * SHCXX_rv", - "cxx_member": "->", - "cxx_nonconst_ptr": "(Cstruct1 *) &SHCXX_rv", - "cxx_type": "Cstruct1", - "cxx_var": "SHCXX_rv", - "data_var": "SHData_rv", - "numpy_type": null, - "py_capsule": "SHC_SHCXX_rv", - "py_var": "SHTPy_rv", - "size_var": "SHSize_rv", - "stmt0": "py_struct_result_numpy", - "stmt1": "py_struct_result_numpy", - "value_var": "SHValue_rv" - } - }, - "ast": { - "const": true, - "declarator": { - "name": "returnConstStructByValue", - "pointer": [] - }, - "params": [ - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "i", - "pointer": [] - }, - "specifier": [ - "int" - ], - "typemap_name": "int" - }, - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "d", - "pointer": [] - }, - "specifier": [ - "double" - ], - "typemap_name": "double" - } - ], - "specifier": [ - "Cstruct1" - ], - "typemap_name": "Cstruct1" - }, - "decl": "const Cstruct1 returnConstStructByValue(int i, double d);", - "declgen": "const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value)", - "fmtdict": { - "PY_name_impl": "PY_returnConstStructByValue", - "function_name": "returnConstStructByValue", - "underscore_name": "return_const_struct_by_value" - }, - "options": {} - }, { "_fmtargs": { "d": { diff --git a/regression/reference/struct-numpy-c/struct.log b/regression/reference/struct-numpy-c/struct.log index 8b91e4e2b..5e3688b19 100644 --- a/regression/reference/struct-numpy-c/struct.log +++ b/regression/reference/struct-numpy-c/struct.log @@ -7,7 +7,6 @@ Python function int acceptStructInPtr(Cstruct1 * arg +intent(in)) Python function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) Python function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) Python function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -Python function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) Python function Cstruct_list * get_global_struct_list() diff --git a/regression/reference/struct-numpy-c/struct_types.yaml b/regression/reference/struct-numpy-c/struct_types.yaml index a033ef2f5..34a3991ed 100644 --- a/regression/reference/struct-numpy-c/struct_types.yaml +++ b/regression/reference/struct-numpy-c/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-numpy-cxx/pystructmodule.cpp b/regression/reference/struct-numpy-cxx/pystructmodule.cpp index 5aa945dc4..3fcb51e54 100644 --- a/regression/reference/struct-numpy-cxx/pystructmodule.cpp +++ b/regression/reference/struct-numpy-cxx/pystructmodule.cpp @@ -1,5 +1,5 @@ // pystructmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -478,77 +478,6 @@ PY_returnStructByValue( // splicer end function.return_struct_by_value } -// ---------------------------------------- -// Function: const Cstruct1 returnConstStructByValue -// Exact: py_struct_result_numpy -// ---------------------------------------- -// Argument: int i +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -// ---------------------------------------- -// Argument: double d +intent(in)+value -// Requested: py_native_scalar_in -// Match: py_default -static char PY_returnConstStructByValue__doc__[] = -"documentation" -; - -static PyObject * -PY_returnConstStructByValue( - PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) -{ -// splicer begin function.return_const_struct_by_value - int i; - double d; - const char *SHT_kwlist[] = { - "i", - "d", - nullptr }; - Cstruct1 * SHCXX_rv = nullptr; - PyObject * SHTPy_rv = nullptr; - PyObject *SHC_SHCXX_rv = nullptr; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, - "id:returnConstStructByValue", const_cast(SHT_kwlist), - &i, &d)) - return nullptr; - - // result pre_call - SHCXX_rv = new Cstruct1; - if (SHCXX_rv == nullptr) { - PyErr_NoMemory(); - goto fail; - } - - *SHCXX_rv = returnConstStructByValue(i, d); - - // post_call - Py_INCREF(PY_Cstruct1_array_descr); - SHTPy_rv = PyArray_NewFromDescr(&PyArray_Type, - PY_Cstruct1_array_descr, 0, nullptr, - nullptr, SHCXX_rv, 0, nullptr); - if (SHTPy_rv == nullptr) goto fail; - SHC_SHCXX_rv = PyCapsule_New(SHCXX_rv, "PY_array_dtor", - PY_SHROUD_capsule_destructor); - if (SHC_SHCXX_rv == nullptr) goto fail; - PyCapsule_SetContext(SHC_SHCXX_rv, PY_SHROUD_fetch_context(2)); - if (PyArray_SetBaseObject(reinterpret_cast - (SHTPy_rv), SHC_SHCXX_rv) < 0) goto fail; - - return (PyObject *) SHTPy_rv; - -fail: - if (SHCXX_rv != nullptr) { - PY_SHROUD_release_memory(2, SHCXX_rv); - } - Py_XDECREF(SHTPy_rv); - Py_XDECREF(SHC_SHCXX_rv); - return nullptr; -// splicer end function.return_const_struct_by_value -} - // ---------------------------------------- // Function: Cstruct1 * returnStructPtr1 +deref(pointer) // Exact: py_struct_result_numpy @@ -714,8 +643,6 @@ static PyMethodDef PY_methods[] = { METH_VARARGS|METH_KEYWORDS, PY_acceptStructInOutPtr__doc__}, {"returnStructByValue", (PyCFunction)PY_returnStructByValue, METH_VARARGS|METH_KEYWORDS, PY_returnStructByValue__doc__}, -{"returnConstStructByValue", (PyCFunction)PY_returnConstStructByValue, - METH_VARARGS|METH_KEYWORDS, PY_returnConstStructByValue__doc__}, {"returnStructPtr1", (PyCFunction)PY_returnStructPtr1, METH_VARARGS|METH_KEYWORDS, PY_returnStructPtr1__doc__}, {"returnStructPtr2", (PyCFunction)PY_returnStructPtr2, diff --git a/regression/reference/struct-numpy-cxx/pystructmodule.hpp b/regression/reference/struct-numpy-cxx/pystructmodule.hpp index a472ba8f7..76df015ad 100644 --- a/regression/reference/struct-numpy-cxx/pystructmodule.hpp +++ b/regression/reference/struct-numpy-cxx/pystructmodule.hpp @@ -1,5 +1,5 @@ // pystructmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-numpy-cxx/pystructutil.cpp b/regression/reference/struct-numpy-cxx/pystructutil.cpp index ad6ef58b8..6c1b09ba4 100644 --- a/regression/reference/struct-numpy-cxx/pystructutil.cpp +++ b/regression/reference/struct-numpy-cxx/pystructutil.cpp @@ -1,5 +1,5 @@ // pystructutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -41,20 +41,12 @@ static void PY_SHROUD_capsule_destructor_1(void *ptr) delete cxx_ptr; } -// 2 - cxx const Cstruct1 * -static void PY_SHROUD_capsule_destructor_2(void *ptr) -{ - const Cstruct1 * cxx_ptr = static_cast(ptr); - delete cxx_ptr; -} - // Code used to release arrays for NumPy objects // via a Capsule base object with a destructor. // Context strings static PY_SHROUD_dtor_context PY_SHROUD_capsule_context[] = { {"--none--", PY_SHROUD_capsule_destructor_0}, {"cxx Cstruct1 *", PY_SHROUD_capsule_destructor_1}, - {"cxx const Cstruct1 *", PY_SHROUD_capsule_destructor_2}, {nullptr, nullptr}, }; diff --git a/regression/reference/struct-numpy-cxx/setup.py b/regression/reference/struct-numpy-cxx/setup.py index 08edba53d..3fe480e0c 100644 --- a/regression/reference/struct-numpy-cxx/setup.py +++ b/regression/reference/struct-numpy-cxx/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-numpy-cxx/struct.json b/regression/reference/struct-numpy-cxx/struct.json index 3a795501d..e67f97016 100644 --- a/regression/reference/struct-numpy-cxx/struct.json +++ b/regression/reference/struct-numpy-cxx/struct.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct1.cpp", "C_name_scope": "Cstruct1_", "C_type_name": "STR_cstruct1", - "F_capsule_data_type": "SHROUD_cstruct1_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct1_capsule", "F_derived_name": "cstruct1", "F_name_scope": "cstruct1_", "PY_PyObject": "PY_Cstruct1", @@ -87,7 +87,7 @@ "C_impl_filename": "wrapCstruct_ptr.cpp", "C_name_scope": "Cstruct_ptr_", "C_type_name": "STR_cstruct_ptr", - "F_capsule_data_type": "SHROUD_cstruct_ptr_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_ptr_capsule", "F_derived_name": "cstruct_ptr", "F_name_scope": "cstruct_ptr_", "PY_PyObject": "PY_Cstruct_ptr", @@ -171,7 +171,7 @@ "C_impl_filename": "wrapCstruct_list.cpp", "C_name_scope": "Cstruct_list_", "C_type_name": "STR_cstruct_list", - "F_capsule_data_type": "SHROUD_cstruct_list_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_list_capsule", "F_derived_name": "cstruct_list", "F_name_scope": "cstruct_list_", "PY_PyObject": "PY_Cstruct_list", @@ -349,7 +349,7 @@ "C_impl_filename": "wrapCstruct_numpy.cpp", "C_name_scope": "Cstruct_numpy_", "C_type_name": "STR_cstruct_numpy", - "F_capsule_data_type": "SHROUD_cstruct_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_numpy_capsule", "F_derived_name": "cstruct_numpy", "F_name_scope": "cstruct_numpy_", "PY_PyObject": "PY_Cstruct_numpy", @@ -476,7 +476,7 @@ "C_impl_filename": "wrapArrays1.cpp", "C_name_scope": "Arrays1_", "C_type_name": "STR_arrays1", - "F_capsule_data_type": "SHROUD_arrays1_capsule", + "F_capsule_data_type": "STR_SHROUD_arrays1_capsule", "F_derived_name": "arrays1", "F_name_scope": "arrays1_", "PY_PyObject": "PY_Arrays1", @@ -1290,127 +1290,6 @@ }, "options": {} }, - { - "_fmtargs": { - "d": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "double", - "c_var": "d", - "ctor_expr": "d", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&d", - "cxx_type": "double", - "cxx_var": "d", - "data_var": "SHData_d", - "numpy_type": "NPY_DOUBLE", - "py_var": "SHPy_d", - "size_var": "SHSize_d", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_d" - } - }, - "i": { - "fmtpy": { - "c_const": "", - "c_deref": "", - "c_type": "int", - "c_var": "i", - "ctor_expr": "i", - "cxx_addr": "&", - "cxx_member": ".", - "cxx_nonconst_ptr": "&i", - "cxx_type": "int", - "cxx_var": "i", - "data_var": "SHData_i", - "numpy_type": "NPY_INT", - "py_var": "SHPy_i", - "size_var": "SHSize_i", - "stmt0": "py_native_scalar_in", - "stmt1": "py_default", - "value_var": "SHValue_i" - } - } - }, - "_fmtresult": { - "fmtpy": { - "PYN_descr": "PY_Cstruct1_array_descr", - "PY_to_object_idtor_func": "PP_Cstruct1_to_Object_idtor", - "PyObject": "PY_Cstruct1", - "PyTypeObject": "PY_Cstruct1_Type", - "c_deref": "*", - "c_var": "SHCXX_rv", - "capsule_order": "2", - "ctor_expr": "*SHCXX_rv", - "cxx_addr": "", - "cxx_alloc_decl": "Cstruct1 * SHCXX_rv", - "cxx_member": "->", - "cxx_nonconst_ptr": "const_cast\t(&SHCXX_rv)", - "cxx_type": "Cstruct1", - "cxx_var": "SHCXX_rv", - "data_var": "SHData_rv", - "numpy_type": null, - "py_capsule": "SHC_SHCXX_rv", - "py_var": "SHTPy_rv", - "size_var": "SHSize_rv", - "stmt0": "py_struct_result_numpy", - "stmt1": "py_struct_result_numpy", - "value_var": "SHValue_rv" - } - }, - "ast": { - "const": true, - "declarator": { - "name": "returnConstStructByValue", - "pointer": [] - }, - "params": [ - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "i", - "pointer": [] - }, - "specifier": [ - "int" - ], - "typemap_name": "int" - }, - { - "attrs": { - "intent": "in", - "value": true - }, - "declarator": { - "name": "d", - "pointer": [] - }, - "specifier": [ - "double" - ], - "typemap_name": "double" - } - ], - "specifier": [ - "Cstruct1" - ], - "typemap_name": "Cstruct1" - }, - "decl": "const Cstruct1 returnConstStructByValue(int i, double d);", - "declgen": "const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value)", - "fmtdict": { - "PY_name_impl": "PY_returnConstStructByValue", - "function_name": "returnConstStructByValue", - "underscore_name": "return_const_struct_by_value" - }, - "options": {} - }, { "_fmtargs": { "d": { diff --git a/regression/reference/struct-numpy-cxx/struct.log b/regression/reference/struct-numpy-cxx/struct.log index d3483e3ec..56c9fd817 100644 --- a/regression/reference/struct-numpy-cxx/struct.log +++ b/regression/reference/struct-numpy-cxx/struct.log @@ -7,7 +7,6 @@ Python function int acceptStructInPtr(Cstruct1 * arg +intent(in)) Python function void acceptStructOutPtr(Cstruct1 * arg +intent(out), int i +intent(in)+value, double d +intent(in)+value) Python function void acceptStructInOutPtr(Cstruct1 * arg +intent(inout)) Python function Cstruct1 returnStructByValue(int i +intent(in)+value, double d +intent(in)+value) -Python function const Cstruct1 returnConstStructByValue(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr1(int i +intent(in)+value, double d +intent(in)+value) Python function Cstruct1 * returnStructPtr2(int i +intent(in)+value, double d +intent(in)+value, char * outbuf +charlen(LENOUTBUF)+intent(out)) Python function Cstruct_list * get_global_struct_list() diff --git a/regression/reference/struct-numpy-cxx/struct_types.yaml b/regression/reference/struct-numpy-cxx/struct_types.yaml index 573b2dbc3..2e659c47d 100644 --- a/regression/reference/struct-numpy-cxx/struct_types.yaml +++ b/regression/reference/struct-numpy-cxx/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-c/pyCstruct_as_classtype.c b/regression/reference/struct-py-c/pyCstruct_as_classtype.c index a08582207..ddc3688d1 100644 --- a/regression/reference/struct-py-c/pyCstruct_as_classtype.c +++ b/regression/reference/struct-py-c/pyCstruct_as_classtype.c @@ -1,5 +1,5 @@ // pyCstruct_as_classtype.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-c/pystructmodule.c b/regression/reference/struct-py-c/pystructmodule.c index 9231b662c..3d00fac97 100644 --- a/regression/reference/struct-py-c/pystructmodule.c +++ b/regression/reference/struct-py-c/pystructmodule.c @@ -1,5 +1,5 @@ // pystructmodule.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-c/pystructmodule.h b/regression/reference/struct-py-c/pystructmodule.h index a8e15e800..b44ca43e8 100644 --- a/regression/reference/struct-py-c/pystructmodule.h +++ b/regression/reference/struct-py-c/pystructmodule.h @@ -1,5 +1,5 @@ // pystructmodule.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-c/pystructutil.c b/regression/reference/struct-py-c/pystructutil.c index 58f7cb17f..7a5d428be 100644 --- a/regression/reference/struct-py-c/pystructutil.c +++ b/regression/reference/struct-py-c/pystructutil.c @@ -1,5 +1,5 @@ // pystructutil.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-c/setup.py b/regression/reference/struct-py-c/setup.py index 9932e9c1b..26fb31b8b 100644 --- a/regression/reference/struct-py-c/setup.py +++ b/regression/reference/struct-py-c/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-c/struct-py.json b/regression/reference/struct-py-c/struct-py.json index 3d525e104..33ceafc70 100644 --- a/regression/reference/struct-py-c/struct-py.json +++ b/regression/reference/struct-py-c/struct-py.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct_as_class.c", "C_name_scope": "Cstruct_as_class_", "C_type_name": "Cstruct_as_class", - "F_capsule_data_type": "SHROUD_cstruct_as_class_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_as_class_capsule", "F_derived_name": "cstruct_as_class", "F_name_scope": "cstruct_as_class_", "PY_PyObject": "PY_Cstruct_as_class", @@ -232,7 +232,7 @@ "C_impl_filename": "wrapCstruct_as_numpy.c", "C_name_scope": "Cstruct_as_numpy_", "C_type_name": "Cstruct_as_numpy", - "F_capsule_data_type": "SHROUD_cstruct_as_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_as_numpy_capsule", "F_derived_name": "cstruct_as_numpy", "F_name_scope": "cstruct_as_numpy_", "PY_PyObject": "PY_Cstruct_as_numpy", @@ -335,7 +335,7 @@ "cxx_var": "s1", "data_var": "SHData_s1", "numpy_type": null, - "py_type": "PY_Cstruct_as_class", + "py_object": "PY_Cstruct_as_class", "py_var": "SHPy_s1", "size_var": "SHSize_s1", "stmt0": "py_struct_*_in_class", diff --git a/regression/reference/struct-py-c/struct_types.yaml b/regression/reference/struct-py-c/struct_types.yaml index 70f983f46..b0f2eb5d3 100644 --- a/regression/reference/struct-py-c/struct_types.yaml +++ b/regression/reference/struct-py-c/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-cxx/pyCstruct_as_classtype.cpp b/regression/reference/struct-py-cxx/pyCstruct_as_classtype.cpp index f758c19e7..da4f33374 100644 --- a/regression/reference/struct-py-cxx/pyCstruct_as_classtype.cpp +++ b/regression/reference/struct-py-cxx/pyCstruct_as_classtype.cpp @@ -1,5 +1,5 @@ // pyCstruct_as_classtype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-cxx/pystructmodule.cpp b/regression/reference/struct-py-cxx/pystructmodule.cpp index 6e08e2c9e..2d255f734 100644 --- a/regression/reference/struct-py-cxx/pystructmodule.cpp +++ b/regression/reference/struct-py-cxx/pystructmodule.cpp @@ -1,5 +1,5 @@ // pystructmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-cxx/pystructmodule.hpp b/regression/reference/struct-py-cxx/pystructmodule.hpp index d4c17ee99..695adccef 100644 --- a/regression/reference/struct-py-cxx/pystructmodule.hpp +++ b/regression/reference/struct-py-cxx/pystructmodule.hpp @@ -1,5 +1,5 @@ // pystructmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-cxx/pystructutil.cpp b/regression/reference/struct-py-cxx/pystructutil.cpp index 52f37fd4b..06eefe891 100644 --- a/regression/reference/struct-py-cxx/pystructutil.cpp +++ b/regression/reference/struct-py-cxx/pystructutil.cpp @@ -1,5 +1,5 @@ // pystructutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-cxx/setup.py b/regression/reference/struct-py-cxx/setup.py index 9c756be2e..1825a5d9c 100644 --- a/regression/reference/struct-py-cxx/setup.py +++ b/regression/reference/struct-py-cxx/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/struct-py-cxx/struct-py.json b/regression/reference/struct-py-cxx/struct-py.json index f244fe330..325105490 100644 --- a/regression/reference/struct-py-cxx/struct-py.json +++ b/regression/reference/struct-py-cxx/struct-py.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapCstruct_as_class.cpp", "C_name_scope": "Cstruct_as_class_", "C_type_name": "STR_cstruct_as_class", - "F_capsule_data_type": "SHROUD_cstruct_as_class_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_as_class_capsule", "F_derived_name": "cstruct_as_class", "F_name_scope": "cstruct_as_class_", "PY_PyObject": "PY_Cstruct_as_class", @@ -232,7 +232,7 @@ "C_impl_filename": "wrapCstruct_as_numpy.cpp", "C_name_scope": "Cstruct_as_numpy_", "C_type_name": "STR_cstruct_as_numpy", - "F_capsule_data_type": "SHROUD_cstruct_as_numpy_capsule", + "F_capsule_data_type": "STR_SHROUD_cstruct_as_numpy_capsule", "F_derived_name": "cstruct_as_numpy", "F_name_scope": "cstruct_as_numpy_", "PY_PyObject": "PY_Cstruct_as_numpy", @@ -335,7 +335,7 @@ "cxx_var": "s1", "data_var": "SHData_s1", "numpy_type": null, - "py_type": "PY_Cstruct_as_class", + "py_object": "PY_Cstruct_as_class", "py_var": "SHPy_s1", "size_var": "SHSize_s1", "stmt0": "py_struct_*_in_class", diff --git a/regression/reference/struct-py-cxx/struct_types.yaml b/regression/reference/struct-py-cxx/struct_types.yaml index c53020a40..cc82bf786 100644 --- a/regression/reference/struct-py-cxx/struct_types.yaml +++ b/regression/reference/struct-py-cxx/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/structlist/pyArrays1type.c b/regression/reference/structlist/pyArrays1type.c index 678c1e9d4..a91d7cf5a 100644 --- a/regression/reference/structlist/pyArrays1type.c +++ b/regression/reference/structlist/pyArrays1type.c @@ -1,5 +1,5 @@ // pyArrays1type.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/structlist/pystructmodule.c b/regression/reference/structlist/pystructmodule.c index 900a6b9bf..013afed5e 100644 --- a/regression/reference/structlist/pystructmodule.c +++ b/regression/reference/structlist/pystructmodule.c @@ -1,5 +1,5 @@ // pystructmodule.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/structlist/pystructmodule.h b/regression/reference/structlist/pystructmodule.h index 8f1d01b37..052b96eb6 100644 --- a/regression/reference/structlist/pystructmodule.h +++ b/regression/reference/structlist/pystructmodule.h @@ -1,5 +1,5 @@ // pystructmodule.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/structlist/pystructutil.c b/regression/reference/structlist/pystructutil.c index 96990ad8b..4d5bed572 100644 --- a/regression/reference/structlist/pystructutil.c +++ b/regression/reference/structlist/pystructutil.c @@ -1,5 +1,5 @@ // pystructutil.c -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -111,11 +111,11 @@ int STR_SHROUD_fill_from_PyObject_char(PyObject *obj, const char *name, int STR_SHROUD_fill_from_PyObject_int_list(PyObject *obj, const char *name, int *in, Py_ssize_t insize) { - int value = PyInt_AsLong(obj); + int cvalue = PyInt_AsLong(obj); if (!PyErr_Occurred()) { // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) { - in[i] = value; + in[i] = cvalue; } return 0; } @@ -134,13 +134,14 @@ int STR_SHROUD_fill_from_PyObject_int_list(PyObject *obj, } for (Py_ssize_t i = 0; i < size; ++i) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in[i] = PyInt_AsLong(item); + cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_TypeError, "argument '%s', index %d must be int", name, (int) i); return -1; } + in[i] = cvalue; } Py_DECREF(seq); return 0; diff --git a/regression/reference/structlist/setup.py b/regression/reference/structlist/setup.py index dc49b7e0c..2a22cd8bc 100644 --- a/regression/reference/structlist/setup.py +++ b/regression/reference/structlist/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/structlist/struct_types.yaml b/regression/reference/structlist/struct_types.yaml index 03a0b9518..49b8eb295 100644 --- a/regression/reference/structlist/struct_types.yaml +++ b/regression/reference/structlist/struct_types.yaml @@ -1,5 +1,5 @@ # struct_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/structlist/structlist.json b/regression/reference/structlist/structlist.json index 2feec4dc7..c73caf087 100644 --- a/regression/reference/structlist/structlist.json +++ b/regression/reference/structlist/structlist.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapArrays1.c", "C_name_scope": "Arrays1_", "C_type_name": "Arrays1", - "F_capsule_data_type": "SHROUD_arrays1_capsule", + "F_capsule_data_type": "STR_SHROUD_arrays1_capsule", "F_derived_name": "arrays1", "F_name_scope": "arrays1_", "PY_PyObject": "PY_Arrays1", diff --git a/regression/reference/templates/pyWorkertype.cpp b/regression/reference/templates/pyWorkertype.cpp index 543b43359..a41decec2 100644 --- a/regression/reference/templates/pyWorkertype.cpp +++ b/regression/reference/templates/pyWorkertype.cpp @@ -1,5 +1,5 @@ // pyWorkertype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pyinternal_ImplWorker1type.cpp b/regression/reference/templates/pyinternal_ImplWorker1type.cpp index 79fde9e66..7cd17dfc9 100644 --- a/regression/reference/templates/pyinternal_ImplWorker1type.cpp +++ b/regression/reference/templates/pyinternal_ImplWorker1type.cpp @@ -1,5 +1,5 @@ // pyinternal_ImplWorker1type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pyinternal_ImplWorker2type.cpp b/regression/reference/templates/pyinternal_ImplWorker2type.cpp index 0a1111b77..9585c7d3f 100644 --- a/regression/reference/templates/pyinternal_ImplWorker2type.cpp +++ b/regression/reference/templates/pyinternal_ImplWorker2type.cpp @@ -1,5 +1,5 @@ // pyinternal_ImplWorker2type.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pystd_vector_doubletype.cpp b/regression/reference/templates/pystd_vector_doubletype.cpp index ad5c10d17..ed630162d 100644 --- a/regression/reference/templates/pystd_vector_doubletype.cpp +++ b/regression/reference/templates/pystd_vector_doubletype.cpp @@ -1,5 +1,5 @@ // pystd_vector_doubletype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pystd_vector_inttype.cpp b/regression/reference/templates/pystd_vector_inttype.cpp index d9b512f8f..b8dd20129 100644 --- a/regression/reference/templates/pystd_vector_inttype.cpp +++ b/regression/reference/templates/pystd_vector_inttype.cpp @@ -1,5 +1,5 @@ // pystd_vector_inttype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pytemplates_internalmodule.cpp b/regression/reference/templates/pytemplates_internalmodule.cpp index 8cf7c0765..5b8f921ee 100644 --- a/regression/reference/templates/pytemplates_internalmodule.cpp +++ b/regression/reference/templates/pytemplates_internalmodule.cpp @@ -1,5 +1,5 @@ // pytemplates_internalmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pytemplates_stdmodule.cpp b/regression/reference/templates/pytemplates_stdmodule.cpp index 9cdcecdec..ada5000c0 100644 --- a/regression/reference/templates/pytemplates_stdmodule.cpp +++ b/regression/reference/templates/pytemplates_stdmodule.cpp @@ -1,5 +1,5 @@ // pytemplates_stdmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pytemplatesmodule.cpp b/regression/reference/templates/pytemplatesmodule.cpp index 523fa98ab..9bcf96419 100644 --- a/regression/reference/templates/pytemplatesmodule.cpp +++ b/regression/reference/templates/pytemplatesmodule.cpp @@ -1,5 +1,5 @@ // pytemplatesmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pytemplatesmodule.hpp b/regression/reference/templates/pytemplatesmodule.hpp index 13fa52cd8..7fb57fcb2 100644 --- a/regression/reference/templates/pytemplatesmodule.hpp +++ b/regression/reference/templates/pytemplatesmodule.hpp @@ -1,5 +1,5 @@ // pytemplatesmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pytemplatesutil.cpp b/regression/reference/templates/pytemplatesutil.cpp index 2085cb1e3..a99f0c958 100644 --- a/regression/reference/templates/pytemplatesutil.cpp +++ b/regression/reference/templates/pytemplatesutil.cpp @@ -1,5 +1,5 @@ // pytemplatesutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/pyuser_inttype.cpp b/regression/reference/templates/pyuser_inttype.cpp index b3a84aaa6..eea7a8be6 100644 --- a/regression/reference/templates/pyuser_inttype.cpp +++ b/regression/reference/templates/pyuser_inttype.cpp @@ -1,5 +1,5 @@ // pyuser_inttype.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/setup.py b/regression/reference/templates/setup.py index 37b6dfcdd..07f2a1496 100644 --- a/regression/reference/templates/setup.py +++ b/regression/reference/templates/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/templates.json b/regression/reference/templates/templates.json index d9aa1d0d4..386242e75 100644 --- a/regression/reference/templates/templates.json +++ b/regression/reference/templates/templates.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "classes": [ { @@ -10,7 +10,7 @@ "C_impl_filename": "wrapWorker.cpp", "C_name_scope": "Worker_", "C_type_name": "TEM_Worker", - "F_capsule_data_type": "SHROUD_worker_capsule", + "F_capsule_data_type": "TEM_SHROUD_worker_capsule", "F_derived_name": "worker", "F_name_scope": "worker_", "PY_PyObject": "PY_Worker", @@ -39,7 +39,7 @@ "C_impl_filename": "wrapuser_int.cpp", "C_name_scope": "user_int_", "C_type_name": "TEM_user_int", - "F_capsule_data_type": "SHROUD_user_int_capsule", + "F_capsule_data_type": "TEM_SHROUD_user_int_capsule", "F_derived_name": "user_int", "F_name_scope": "user_int_", "PY_PyObject": "PY_user_int", @@ -1235,7 +1235,7 @@ "C_impl_filename": "wrapvectorforint.cpp", "C_name_scope": "vector_int_", "C_type_name": "TEM_vector_int", - "F_capsule_data_type": "SHROUD_vector_int_capsule", + "F_capsule_data_type": "TEM_SHROUD_vector_int_capsule", "F_derived_name": "vector_int", "F_name_scope": "vector_int_", "PY_PyObject": "PY_vector_int", @@ -1807,7 +1807,7 @@ "C_impl_filename": "wrapstd_vector_double.cpp", "C_name_scope": "vector_double_", "C_type_name": "TEM_vector_double", - "F_capsule_data_type": "SHROUD_vector_double_capsule", + "F_capsule_data_type": "TEM_SHROUD_vector_double_capsule", "F_derived_name": "vector_double", "F_name_scope": "vector_double_", "PY_PyObject": "PY_vector_double", @@ -2404,7 +2404,7 @@ "C_impl_filename": "wrapinternal_ImplWorker1.cpp", "C_name_scope": "internal_ImplWorker1_", "C_type_name": "TEM_internal_ImplWorker1", - "F_capsule_data_type": "SHROUD_implworker1_capsule", + "F_capsule_data_type": "TEM_SHROUD_implworker1_capsule", "F_derived_name": "implworker1", "F_name_scope": "implworker1_", "PY_PyObject": "PY_ImplWorker1", @@ -2437,7 +2437,7 @@ "C_impl_filename": "wrapinternal_ImplWorker2.cpp", "C_name_scope": "internal_ImplWorker2_", "C_type_name": "TEM_internal_ImplWorker2", - "F_capsule_data_type": "SHROUD_implworker2_capsule", + "F_capsule_data_type": "TEM_SHROUD_implworker2_capsule", "F_derived_name": "implworker2", "F_name_scope": "implworker2_", "PY_PyObject": "PY_ImplWorker2", diff --git a/regression/reference/templates/templates_types.yaml b/regression/reference/templates/templates_types.yaml index 87825ae5c..f439629d9 100644 --- a/regression/reference/templates/templates_types.yaml +++ b/regression/reference/templates/templates_types.yaml @@ -1,5 +1,5 @@ # templates_types.yaml -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. @@ -16,7 +16,7 @@ typemap: c_type: TEM_Worker f_module_name: templates_mod f_derived_type: worker - f_capsule_data_type: SHROUD_worker_capsule + f_capsule_data_type: TEM_SHROUD_worker_capsule f_to_c: "{f_var}%cxxmem" - namespace: internal declarations: internal @@ -28,7 +28,7 @@ typemap: c_type: TEM_internal_ImplWorker1 f_module_name: templates_internal_mod f_derived_type: implworker1 - f_capsule_data_type: SHROUD_implworker1_capsule + f_capsule_data_type: TEM_SHROUD_implworker1_capsule f_to_c: "{f_var}%cxxmem" - type: ImplWorker2 fields: @@ -38,7 +38,7 @@ typemap: c_type: TEM_internal_ImplWorker2 f_module_name: templates_internal_mod f_derived_type: implworker2 - f_capsule_data_type: SHROUD_implworker2_capsule + f_capsule_data_type: TEM_SHROUD_implworker2_capsule f_to_c: "{f_var}%cxxmem" - namespace: std declarations: std @@ -50,7 +50,7 @@ typemap: c_type: TEM_vector_double f_module_name: templates_std_mod f_derived_type: vector_double - f_capsule_data_type: SHROUD_vector_double_capsule + f_capsule_data_type: TEM_SHROUD_vector_double_capsule f_to_c: "{f_var}%cxxmem" - type: vector_int fields: @@ -60,7 +60,7 @@ typemap: c_type: TEM_vector_int f_module_name: templates_std_mod f_derived_type: vector_int - f_capsule_data_type: SHROUD_vector_int_capsule + f_capsule_data_type: TEM_SHROUD_vector_int_capsule f_to_c: "{f_var}%cxxmem" - type: user_int fields: @@ -70,5 +70,5 @@ typemap: c_type: TEM_user_int f_module_name: templates_mod f_derived_type: user_int - f_capsule_data_type: SHROUD_user_int_capsule + f_capsule_data_type: TEM_SHROUD_user_int_capsule f_to_c: "{f_var}%cxxmem" diff --git a/regression/reference/templates/typestemplates.h b/regression/reference/templates/typestemplates.h index 93edf8921..e3c14733f 100644 --- a/regression/reference/templates/typestemplates.h +++ b/regression/reference/templates/typestemplates.h @@ -1,5 +1,5 @@ // typestemplates.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wrapftemplates.f b/regression/reference/templates/wrapftemplates.f index 26607542b..5354be469 100644 --- a/regression/reference/templates/wrapftemplates.f +++ b/regression/reference/templates/wrapftemplates.f @@ -1,5 +1,5 @@ ! wrapftemplates.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -21,13 +21,13 @@ module templates_mod ! splicer begin module_top ! splicer end module_top - type, bind(C) :: SHROUD_worker_capsule + type, bind(C) :: TEM_SHROUD_worker_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_worker_capsule + end type TEM_SHROUD_worker_capsule type worker - type(SHROUD_worker_capsule) :: cxxmem + type(TEM_SHROUD_worker_capsule) :: cxxmem ! splicer begin class.Worker.component_part ! splicer end class.Worker.component_part contains @@ -38,13 +38,13 @@ module templates_mod ! splicer end class.Worker.type_bound_procedure_part end type worker - type, bind(C) :: SHROUD_user_int_capsule + type, bind(C) :: TEM_SHROUD_user_int_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_user_int_capsule + end type TEM_SHROUD_user_int_capsule type user_int - type(SHROUD_user_int_capsule) :: cxxmem + type(TEM_SHROUD_user_int_capsule) :: cxxmem ! splicer begin class.user_int.component_part ! splicer end class.user_int.component_part contains @@ -86,9 +86,9 @@ module templates_mod subroutine c_user_int_nested_double(self, arg1, arg2) & bind(C, name="TEM_user_int_nested_double") use iso_c_binding, only : C_DOUBLE, C_INT - import :: SHROUD_user_int_capsule + import :: TEM_SHROUD_user_int_capsule implicit none - type(SHROUD_user_int_capsule), intent(IN) :: self + type(TEM_SHROUD_user_int_capsule), intent(IN) :: self integer(C_INT), value, intent(IN) :: arg1 real(C_DOUBLE), value, intent(IN) :: arg2 end subroutine c_user_int_nested_double diff --git a/regression/reference/templates/wrapftemplates_internal.f b/regression/reference/templates/wrapftemplates_internal.f index 94942ec9d..8798e8a0f 100644 --- a/regression/reference/templates/wrapftemplates_internal.f +++ b/regression/reference/templates/wrapftemplates_internal.f @@ -1,5 +1,5 @@ ! wrapftemplates_internal.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wrapftemplates_std.f b/regression/reference/templates/wrapftemplates_std.f index edf6645be..a2a427aa8 100644 --- a/regression/reference/templates/wrapftemplates_std.f +++ b/regression/reference/templates/wrapftemplates_std.f @@ -1,5 +1,5 @@ ! wrapftemplates_std.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -21,13 +21,13 @@ module templates_std_mod ! splicer begin namespace.std.module_top ! splicer end namespace.std.module_top - type, bind(C) :: SHROUD_vector_int_capsule + type, bind(C) :: TEM_SHROUD_vector_int_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_vector_int_capsule + end type TEM_SHROUD_vector_int_capsule type vector_int - type(SHROUD_vector_int_capsule) :: cxxmem + type(TEM_SHROUD_vector_int_capsule) :: cxxmem ! splicer begin namespace.std.class.vector_int.component_part ! splicer end namespace.std.class.vector_int.component_part contains @@ -41,13 +41,13 @@ module templates_std_mod ! splicer end namespace.std.class.vector_int.type_bound_procedure_part end type vector_int - type, bind(C) :: SHROUD_vector_double_capsule + type, bind(C) :: TEM_SHROUD_vector_double_capsule type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_vector_double_capsule + end type TEM_SHROUD_vector_double_capsule type vector_double - type(SHROUD_vector_double_capsule) :: cxxmem + type(TEM_SHROUD_vector_double_capsule) :: cxxmem ! splicer begin namespace.std.class.vector_double.component_part ! splicer end namespace.std.class.vector_double.component_part contains @@ -80,9 +80,9 @@ function c_vector_int_ctor(SHT_crv) & result(SHT_rv) & bind(C, name="TEM_vector_int_ctor") use iso_c_binding, only : C_PTR - import :: SHROUD_vector_int_capsule + import :: TEM_SHROUD_vector_int_capsule implicit none - type(SHROUD_vector_int_capsule), intent(OUT) :: SHT_crv + type(TEM_SHROUD_vector_int_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_vector_int_ctor @@ -92,9 +92,9 @@ end function c_vector_int_ctor ! Match: c_default subroutine c_vector_int_dtor(self) & bind(C, name="TEM_vector_int_dtor") - import :: SHROUD_vector_int_capsule + import :: TEM_SHROUD_vector_int_capsule implicit none - type(SHROUD_vector_int_capsule), intent(IN) :: self + type(TEM_SHROUD_vector_int_capsule), intent(IN) :: self end subroutine c_vector_int_dtor ! ---------------------------------------- @@ -108,9 +108,9 @@ end subroutine c_vector_int_dtor subroutine c_vector_int_push_back(self, value) & bind(C, name="TEM_vector_int_push_back") use iso_c_binding, only : C_INT - import :: SHROUD_vector_int_capsule + import :: TEM_SHROUD_vector_int_capsule implicit none - type(SHROUD_vector_int_capsule), intent(IN) :: self + type(TEM_SHROUD_vector_int_capsule), intent(IN) :: self integer(C_INT), intent(IN) :: value end subroutine c_vector_int_push_back @@ -126,9 +126,9 @@ function c_vector_int_at(self, n) & result(SHT_rv) & bind(C, name="TEM_vector_int_at") use iso_c_binding, only : C_PTR, C_SIZE_T - import :: SHROUD_vector_int_capsule + import :: TEM_SHROUD_vector_int_capsule implicit none - type(SHROUD_vector_int_capsule), intent(IN) :: self + type(TEM_SHROUD_vector_int_capsule), intent(IN) :: self integer(C_SIZE_T), value, intent(IN) :: n type(C_PTR) SHT_rv end function c_vector_int_at @@ -143,9 +143,9 @@ function c_vector_double_ctor(SHT_crv) & result(SHT_rv) & bind(C, name="TEM_vector_double_ctor") use iso_c_binding, only : C_PTR - import :: SHROUD_vector_double_capsule + import :: TEM_SHROUD_vector_double_capsule implicit none - type(SHROUD_vector_double_capsule), intent(OUT) :: SHT_crv + type(TEM_SHROUD_vector_double_capsule), intent(OUT) :: SHT_crv type(C_PTR) SHT_rv end function c_vector_double_ctor @@ -155,9 +155,9 @@ end function c_vector_double_ctor ! Match: c_default subroutine c_vector_double_dtor(self) & bind(C, name="TEM_vector_double_dtor") - import :: SHROUD_vector_double_capsule + import :: TEM_SHROUD_vector_double_capsule implicit none - type(SHROUD_vector_double_capsule), intent(IN) :: self + type(TEM_SHROUD_vector_double_capsule), intent(IN) :: self end subroutine c_vector_double_dtor ! ---------------------------------------- @@ -171,9 +171,9 @@ end subroutine c_vector_double_dtor subroutine c_vector_double_push_back(self, value) & bind(C, name="TEM_vector_double_push_back") use iso_c_binding, only : C_DOUBLE - import :: SHROUD_vector_double_capsule + import :: TEM_SHROUD_vector_double_capsule implicit none - type(SHROUD_vector_double_capsule), intent(IN) :: self + type(TEM_SHROUD_vector_double_capsule), intent(IN) :: self real(C_DOUBLE), intent(IN) :: value end subroutine c_vector_double_push_back @@ -189,9 +189,9 @@ function c_vector_double_at(self, n) & result(SHT_rv) & bind(C, name="TEM_vector_double_at") use iso_c_binding, only : C_PTR, C_SIZE_T - import :: SHROUD_vector_double_capsule + import :: TEM_SHROUD_vector_double_capsule implicit none - type(SHROUD_vector_double_capsule), intent(IN) :: self + type(TEM_SHROUD_vector_double_capsule), intent(IN) :: self integer(C_SIZE_T), value, intent(IN) :: n type(C_PTR) SHT_rv end function c_vector_double_at diff --git a/regression/reference/templates/wrapstd_vector_double.cpp b/regression/reference/templates/wrapstd_vector_double.cpp index 0b4ca8d1f..b474d3ea8 100644 --- a/regression/reference/templates/wrapstd_vector_double.cpp +++ b/regression/reference/templates/wrapstd_vector_double.cpp @@ -1,5 +1,5 @@ // wrapstd_vector_double.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wrapstd_vector_double.h b/regression/reference/templates/wrapstd_vector_double.h index 155f7cdd9..268849458 100644 --- a/regression/reference/templates/wrapstd_vector_double.h +++ b/regression/reference/templates/wrapstd_vector_double.h @@ -1,5 +1,5 @@ // wrapstd_vector_double.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wrapstd_vector_int.h b/regression/reference/templates/wrapstd_vector_int.h index 3fc6417a0..aaeeffbe0 100644 --- a/regression/reference/templates/wrapstd_vector_int.h +++ b/regression/reference/templates/wrapstd_vector_int.h @@ -1,5 +1,5 @@ // wrapstd_vector_int.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wraptemplates.cpp b/regression/reference/templates/wraptemplates.cpp index f9915217a..9d36856fb 100644 --- a/regression/reference/templates/wraptemplates.cpp +++ b/regression/reference/templates/wraptemplates.cpp @@ -1,5 +1,5 @@ // wraptemplates.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wraptemplates.h b/regression/reference/templates/wraptemplates.h index 9d921ad46..c789711da 100644 --- a/regression/reference/templates/wraptemplates.h +++ b/regression/reference/templates/wraptemplates.h @@ -1,5 +1,5 @@ // wraptemplates.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wrapuser_int.cpp b/regression/reference/templates/wrapuser_int.cpp index afd2e3f38..477ca6c46 100644 --- a/regression/reference/templates/wrapuser_int.cpp +++ b/regression/reference/templates/wrapuser_int.cpp @@ -1,5 +1,5 @@ // wrapuser_int.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wrapuser_int.h b/regression/reference/templates/wrapuser_int.h index c2e3d4daa..dca828b39 100644 --- a/regression/reference/templates/wrapuser_int.h +++ b/regression/reference/templates/wrapuser_int.h @@ -1,5 +1,5 @@ // wrapuser_int.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/templates/wrapvectorforint.cpp b/regression/reference/templates/wrapvectorforint.cpp index adcb3062c..803dc12d0 100644 --- a/regression/reference/templates/wrapvectorforint.cpp +++ b/regression/reference/templates/wrapvectorforint.cpp @@ -1,5 +1,5 @@ // wrapvectorforint.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/luaTutorialmodule.cpp b/regression/reference/tutorial/luaTutorialmodule.cpp index 816aa5cf3..e1d5d0c8e 100644 --- a/regression/reference/tutorial/luaTutorialmodule.cpp +++ b/regression/reference/tutorial/luaTutorialmodule.cpp @@ -1,5 +1,5 @@ // luaTutorialmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/luaTutorialmodule.hpp b/regression/reference/tutorial/luaTutorialmodule.hpp index 160f1788e..a2279747f 100644 --- a/regression/reference/tutorial/luaTutorialmodule.hpp +++ b/regression/reference/tutorial/luaTutorialmodule.hpp @@ -1,5 +1,5 @@ // luaTutorialmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/pyTutorialmodule.cpp b/regression/reference/tutorial/pyTutorialmodule.cpp index 1ea0b9f62..786464566 100644 --- a/regression/reference/tutorial/pyTutorialmodule.cpp +++ b/regression/reference/tutorial/pyTutorialmodule.cpp @@ -1,5 +1,5 @@ // pyTutorialmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/pyTutorialmodule.hpp b/regression/reference/tutorial/pyTutorialmodule.hpp index d43a9e375..d04928034 100644 --- a/regression/reference/tutorial/pyTutorialmodule.hpp +++ b/regression/reference/tutorial/pyTutorialmodule.hpp @@ -1,5 +1,5 @@ // pyTutorialmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/setup.py b/regression/reference/tutorial/setup.py index 565608948..71cc4d33e 100644 --- a/regression/reference/tutorial/setup.py +++ b/regression/reference/tutorial/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/tutorial.json b/regression/reference/tutorial/tutorial.json index 5cbe40e0e..cdafdba03 100644 --- a/regression/reference/tutorial/tutorial.json +++ b/regression/reference/tutorial/tutorial.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -422,7 +422,7 @@ "f_var": "SHT_rv", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_scalar_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_scalar_result_allocatable", "stmtc0": "c_string_scalar_result_buf", "stmtc1": "c_string_scalar_result_buf" }, @@ -553,9 +553,10 @@ "f_intent": "OUT", "f_type": "character(*)", "f_var": "SHT_rv", + "hnamefunc0": "TUT_SHROUD_copy_string_and_free", "sh_type": "SH_TYPE_OTHER", "stmt0": "f_string_*_result_allocatable", - "stmt1": "f_string_result_allocatable", + "stmt1": "f_string_*_result_allocatable", "stmtc0": "c_string_*_result_buf_allocatable", "stmtc1": "c_string_result_buf_allocatable" } @@ -1053,7 +1054,7 @@ "cxx_var": "arg2", "data_var": "SHData_arg2", "numpy_type": "NPY_BOOL", - "py_type": "PyObject", + "py_object": "PyObject", "py_var": "SHPy_arg2", "size_var": "SHSize_arg2", "stmt0": "py_bool_scalar_in", diff --git a/regression/reference/tutorial/typesTutorial.h b/regression/reference/tutorial/typesTutorial.h index 5deafff17..7a9515e36 100644 --- a/regression/reference/tutorial/typesTutorial.h +++ b/regression/reference/tutorial/typesTutorial.h @@ -1,5 +1,5 @@ // typesTutorial.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/utilTutorial.cpp b/regression/reference/tutorial/utilTutorial.cpp index cf1930e2f..0ef1a0cc4 100644 --- a/regression/reference/tutorial/utilTutorial.cpp +++ b/regression/reference/tutorial/utilTutorial.cpp @@ -1,5 +1,5 @@ // utilTutorial.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/wrapTutorial.cpp b/regression/reference/tutorial/wrapTutorial.cpp index b21122bf3..824f30401 100644 --- a/regression/reference/tutorial/wrapTutorial.cpp +++ b/regression/reference/tutorial/wrapTutorial.cpp @@ -1,5 +1,5 @@ // wrapTutorial.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/wrapTutorial.h b/regression/reference/tutorial/wrapTutorial.h index 4e26c2f34..caf782cef 100644 --- a/regression/reference/tutorial/wrapTutorial.h +++ b/regression/reference/tutorial/wrapTutorial.h @@ -1,5 +1,5 @@ // wrapTutorial.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/tutorial/wrapftutorial.f b/regression/reference/tutorial/wrapftutorial.f index 758993b52..0c6047deb 100644 --- a/regression/reference/tutorial/wrapftutorial.f +++ b/regression/reference/tutorial/wrapftutorial.f @@ -1,5 +1,5 @@ ! wrapftutorial.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,16 +22,16 @@ module tutorial_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: TUT_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type TUT_SHROUD_capsule_data ! start array_context ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: TUT_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(TUT_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,7 +43,7 @@ module tutorial_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type TUT_SHROUD_array ! end array_context ! enum tutorial::Color @@ -120,13 +120,13 @@ subroutine c_concatenate_strings_bufferify(arg1, Larg1, arg2, & Larg2, DSHF_rv) & bind(C, name="TUT_concatenate_strings_bufferify") use iso_c_binding, only : C_CHAR, C_INT - import :: SHROUD_array + import :: TUT_SHROUD_array implicit none character(kind=C_CHAR), intent(IN) :: arg1(*) integer(C_INT), value, intent(IN) :: Larg1 character(kind=C_CHAR), intent(IN) :: arg2(*) integer(C_INT), value, intent(IN) :: Larg2 - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(TUT_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_concatenate_strings_bufferify end interface @@ -710,14 +710,14 @@ end subroutine all_test1 interface ! helper copy_string ! Copy the char* or std::string in context into c_var. - subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & + subroutine TUT_SHROUD_copy_string_and_free(context, c_var, c_var_size) & bind(c,name="TUT_ShroudCopyStringAndFree") use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import TUT_SHROUD_array + type(TUT_SHROUD_array), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_string_and_free + end subroutine TUT_SHROUD_copy_string_and_free end interface contains @@ -726,8 +726,7 @@ end subroutine SHROUD_copy_string_and_free ! ---------------------------------------- ! Function: const std::string ConcatenateStrings +deref(allocatable) ! const std::string ConcatenateStrings +deref(allocatable) - ! Requested: f_string_scalar_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_scalar_result_allocatable ! Function: void ConcatenateStrings ! Exact: c_string_scalar_result_buf ! ---------------------------------------- @@ -746,8 +745,7 @@ end subroutine SHROUD_copy_string_and_free ! Match: c_string_in_buf ! ---------------------------------------- ! Argument: const std::string * SHF_rv +context(DSHF_rv)+deref(allocatable)+intent(out) - ! Requested: f_string_*_result_allocatable - ! Match: f_string_result_allocatable + ! Exact: f_string_*_result_allocatable ! Requested: c_string_*_result_buf_allocatable ! Match: c_string_result_buf_allocatable !> @@ -759,14 +757,14 @@ function concatenate_strings(arg1, arg2) & use iso_c_binding, only : C_INT character(len=*), intent(IN) :: arg1 character(len=*), intent(IN) :: arg2 - type(SHROUD_array) :: DSHF_rv + type(TUT_SHROUD_array) :: DSHF_rv character(len=:), allocatable :: SHT_rv ! splicer begin function.concatenate_strings call c_concatenate_strings_bufferify(arg1, & len_trim(arg1, kind=C_INT), arg2, & len_trim(arg2, kind=C_INT), DSHF_rv) allocate(character(len=DSHF_rv%elem_len):: SHT_rv) - call SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) + call TUT_SHROUD_copy_string_and_free(DSHF_rv, SHT_rv, DSHF_rv%elem_len) ! splicer end function.concatenate_strings end function concatenate_strings diff --git a/regression/reference/types/pytypesmodule.cpp b/regression/reference/types/pytypesmodule.cpp index ef799f720..38a8a2a0a 100644 --- a/regression/reference/types/pytypesmodule.cpp +++ b/regression/reference/types/pytypesmodule.cpp @@ -1,5 +1,5 @@ // pytypesmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/types/pytypesmodule.hpp b/regression/reference/types/pytypesmodule.hpp index 132d2c588..8f547b9d3 100644 --- a/regression/reference/types/pytypesmodule.hpp +++ b/regression/reference/types/pytypesmodule.hpp @@ -1,5 +1,5 @@ // pytypesmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/types/setup.py b/regression/reference/types/setup.py index a7f8bc04c..36e152233 100644 --- a/regression/reference/types/setup.py +++ b/regression/reference/types/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/types/types.json b/regression/reference/types/types.json index 6a021f06f..ba0188c3f 100644 --- a/regression/reference/types/types.json +++ b/regression/reference/types/types.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -3278,7 +3278,7 @@ "cxx_var": "arg", "data_var": "SHData_arg", "numpy_type": "NPY_BOOL", - "py_type": "PyObject", + "py_object": "PyObject", "py_var": "SHPy_arg", "size_var": "SHSize_arg", "stmt0": "py_bool_scalar_in", diff --git a/regression/reference/types/typestypes.h b/regression/reference/types/typestypes.h index bfb16fd63..913c6bd42 100644 --- a/regression/reference/types/typestypes.h +++ b/regression/reference/types/typestypes.h @@ -1,5 +1,5 @@ // typestypes.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/types/wrapftypes.f b/regression/reference/types/wrapftypes.f index 9c5a932d3..bac331c24 100644 --- a/regression/reference/types/wrapftypes.f +++ b/regression/reference/types/wrapftypes.f @@ -1,5 +1,5 @@ ! wrapftypes.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. diff --git a/regression/reference/types/wraptypes.cpp b/regression/reference/types/wraptypes.cpp index 0f9414b33..111be9edd 100644 --- a/regression/reference/types/wraptypes.cpp +++ b/regression/reference/types/wraptypes.cpp @@ -1,5 +1,5 @@ // wraptypes.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/types/wraptypes.h b/regression/reference/types/wraptypes.h index 4139265d3..b4fc6e2ed 100644 --- a/regression/reference/types/wraptypes.h +++ b/regression/reference/types/wraptypes.h @@ -1,5 +1,5 @@ // wraptypes.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors-list/pyvectorsmodule.cpp b/regression/reference/vectors-list/pyvectorsmodule.cpp index 43423fad4..5676a1e1b 100644 --- a/regression/reference/vectors-list/pyvectorsmodule.cpp +++ b/regression/reference/vectors-list/pyvectorsmodule.cpp @@ -1,5 +1,5 @@ // pyvectorsmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. @@ -40,13 +40,14 @@ static int SHROUD_create_from_PyObject_vector_int(PyObject *obj, Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) { PyObject *item = PySequence_Fast_GET_ITEM(seq, i); - in.push_back(PyInt_AsLong(item)); + int cvalue = PyInt_AsLong(item); if (PyErr_Occurred()) { Py_DECREF(seq); PyErr_Format(PyExc_ValueError, "argument '%s', index %d must be int", name, (int) i); return -1; } + in.push_back(cvalue); } Py_DECREF(seq); return 0; diff --git a/regression/reference/vectors-list/pyvectorsmodule.hpp b/regression/reference/vectors-list/pyvectorsmodule.hpp index b777d5c2b..513130e5e 100644 --- a/regression/reference/vectors-list/pyvectorsmodule.hpp +++ b/regression/reference/vectors-list/pyvectorsmodule.hpp @@ -1,5 +1,5 @@ // pyvectorsmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors-list/setup.py b/regression/reference/vectors-list/setup.py index 8caa728a7..82b285054 100644 --- a/regression/reference/vectors-list/setup.py +++ b/regression/reference/vectors-list/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors-list/vectors.json b/regression/reference/vectors-list/vectors.json index f9b81f199..dd3785699 100644 --- a/regression/reference/vectors-list/vectors.json +++ b/regression/reference/vectors-list/vectors.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/vectors-numpy/pyvectorsmodule.cpp b/regression/reference/vectors-numpy/pyvectorsmodule.cpp index d2adfa150..b3534968b 100644 --- a/regression/reference/vectors-numpy/pyvectorsmodule.cpp +++ b/regression/reference/vectors-numpy/pyvectorsmodule.cpp @@ -1,5 +1,5 @@ // pyvectorsmodule.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors-numpy/pyvectorsmodule.hpp b/regression/reference/vectors-numpy/pyvectorsmodule.hpp index d73fbcd5e..a81089a99 100644 --- a/regression/reference/vectors-numpy/pyvectorsmodule.hpp +++ b/regression/reference/vectors-numpy/pyvectorsmodule.hpp @@ -1,5 +1,5 @@ // pyvectorsmodule.hpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors-numpy/pyvectorsutil.cpp b/regression/reference/vectors-numpy/pyvectorsutil.cpp index d993e0225..c1d3db6ca 100644 --- a/regression/reference/vectors-numpy/pyvectorsutil.cpp +++ b/regression/reference/vectors-numpy/pyvectorsutil.cpp @@ -1,5 +1,5 @@ // pyvectorsutil.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors-numpy/setup.py b/regression/reference/vectors-numpy/setup.py index 63162b188..5b49bce11 100644 --- a/regression/reference/vectors-numpy/setup.py +++ b/regression/reference/vectors-numpy/setup.py @@ -1,5 +1,5 @@ # setup.py -# This file is generated by Shroud 0.12.1. Do not edit. +# This file is generated by Shroud nowrite-version. Do not edit. # Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and # other Shroud Project Developers. # See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors-numpy/vectors.json b/regression/reference/vectors-numpy/vectors.json index 6f59dc798..e4f9ae70c 100644 --- a/regression/reference/vectors-numpy/vectors.json +++ b/regression/reference/vectors-numpy/vectors.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", diff --git a/regression/reference/vectors/typesvectors.h b/regression/reference/vectors/typesvectors.h index d0d12b9ab..d3176a3d9 100644 --- a/regression/reference/vectors/typesvectors.h +++ b/regression/reference/vectors/typesvectors.h @@ -1,5 +1,5 @@ // typesvectors.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors/utilvectors.cpp b/regression/reference/vectors/utilvectors.cpp index 439e9db93..68d384f1e 100644 --- a/regression/reference/vectors/utilvectors.cpp +++ b/regression/reference/vectors/utilvectors.cpp @@ -1,5 +1,5 @@ // utilvectors.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors/vectors.json b/regression/reference/vectors/vectors.json index f2673dcfc..76a865629 100644 --- a/regression/reference/vectors/vectors.json +++ b/regression/reference/vectors/vectors.json @@ -1,5 +1,5 @@ { - "__NOTICE__": "This file is generated by Shroud 0.12.1 and is useful for debugging.", + "__NOTICE__": "This file is generated by Shroud nowrite-version and is useful for debugging.", "library": { "copyright": [ "Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and", @@ -300,6 +300,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "arg", + "hnamefunc0": "VEC_SHROUD_copy_array_int", "rank": "1", "sh_type": "SH_TYPE_INT", "size": "size(arg)", @@ -497,6 +498,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "arg", + "hnamefunc0": "VEC_SHROUD_copy_array_int", "rank": "1", "sh_type": "SH_TYPE_INT", "size": "size(arg)", @@ -711,6 +713,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "arg", + "hnamefunc0": "VEC_SHROUD_copy_array_int", "rank": "1", "sh_type": "SH_TYPE_INT", "size": "size(arg)", @@ -901,6 +904,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "arg", + "hnamefunc0": "VEC_SHROUD_copy_array_int", "rank": "1", "sh_type": "SH_TYPE_INT", "size": "size(arg)", @@ -1077,6 +1081,7 @@ "f_intent": "INOUT", "f_type": "integer(C_INT)", "f_var": "arg", + "hnamefunc0": "VEC_SHROUD_copy_array_int", "rank": "1", "sh_type": "SH_TYPE_INT", "size": "size(arg)", @@ -1249,6 +1254,7 @@ "f_intent": "INOUT", "f_type": "integer(C_INT)", "f_var": "arg", + "hnamefunc0": "VEC_SHROUD_copy_array_int", "rank": "1", "sh_type": "SH_TYPE_INT", "size": "size(arg)", @@ -1416,6 +1422,7 @@ "f_intent": "OUT", "f_type": "real(C_DOUBLE)", "f_var": "arg", + "hnamefunc0": "VEC_SHROUD_copy_array_double", "rank": "1", "sh_type": "SH_TYPE_DOUBLE", "size": "size(arg)", @@ -1909,6 +1916,7 @@ "f_intent": "OUT", "f_type": "integer(C_INT)", "f_var": "SHT_rv", + "hnamefunc0": "VEC_SHROUD_copy_array_int", "rank": "1", "sh_type": "SH_TYPE_INT", "size": "size(SHT_rv)", diff --git a/regression/reference/vectors/wrapfvectors.f b/regression/reference/vectors/wrapfvectors.f index b000271a2..e9d05e9ef 100644 --- a/regression/reference/vectors/wrapfvectors.f +++ b/regression/reference/vectors/wrapfvectors.f @@ -1,5 +1,5 @@ ! wrapfvectors.f -! This file is generated by Shroud 0.12.1. Do not edit. +! This file is generated by Shroud nowrite-version. Do not edit. ! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and ! other Shroud Project Developers. ! See the top-level COPYRIGHT file for details. @@ -22,16 +22,16 @@ module vectors_mod ! splicer end module_top ! helper capsule_data_helper - type, bind(C) :: SHROUD_capsule_data + type, bind(C) :: VEC_SHROUD_capsule_data type(C_PTR) :: addr = C_NULL_PTR ! address of C++ memory integer(C_INT) :: idtor = 0 ! index of destructor - end type SHROUD_capsule_data + end type VEC_SHROUD_capsule_data ! start array_context ! helper array_context - type, bind(C) :: SHROUD_array + type, bind(C) :: VEC_SHROUD_array ! address of C++ memory - type(SHROUD_capsule_data) :: cxx + type(VEC_SHROUD_capsule_data) :: cxx ! address of data in cxx type(C_PTR) :: base_addr = C_NULL_PTR ! type of element @@ -43,7 +43,7 @@ module vectors_mod ! number of dimensions integer(C_INT) :: rank = -1 integer(C_LONG) :: shape(7) = 0 - end type SHROUD_array + end type VEC_SHROUD_array ! end array_context ! ---------------------------------------- @@ -80,9 +80,9 @@ end function c_vector_sum_bufferify interface subroutine c_vector_iota_out_bufferify(Darg) & bind(C, name="VEC_vector_iota_out_bufferify") - import :: SHROUD_array + import :: VEC_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Darg + type(VEC_SHROUD_array), intent(INOUT) :: Darg end subroutine c_vector_iota_out_bufferify end interface ! end c_vector_iota_out_bufferify @@ -101,9 +101,9 @@ function c_vector_iota_out_with_num_bufferify(Darg) & result(SHT_rv) & bind(C, name="VEC_vector_iota_out_with_num_bufferify") use iso_c_binding, only : C_LONG - import :: SHROUD_array + import :: VEC_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Darg + type(VEC_SHROUD_array), intent(INOUT) :: Darg integer(C_LONG) SHT_rv end function c_vector_iota_out_with_num_bufferify end interface @@ -121,9 +121,9 @@ end function c_vector_iota_out_with_num_bufferify interface subroutine c_vector_iota_out_with_num2_bufferify(Darg) & bind(C, name="VEC_vector_iota_out_with_num2_bufferify") - import :: SHROUD_array + import :: VEC_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Darg + type(VEC_SHROUD_array), intent(INOUT) :: Darg end subroutine c_vector_iota_out_with_num2_bufferify end interface ! end c_vector_iota_out_with_num2_bufferify @@ -140,9 +140,9 @@ end subroutine c_vector_iota_out_with_num2_bufferify interface subroutine c_vector_iota_out_alloc_bufferify(Darg) & bind(C, name="VEC_vector_iota_out_alloc_bufferify") - import :: SHROUD_array + import :: VEC_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Darg + type(VEC_SHROUD_array), intent(INOUT) :: Darg end subroutine c_vector_iota_out_alloc_bufferify end interface ! end c_vector_iota_out_alloc_bufferify @@ -160,11 +160,11 @@ end subroutine c_vector_iota_out_alloc_bufferify subroutine c_vector_iota_inout_alloc_bufferify(arg, Sarg, Darg) & bind(C, name="VEC_vector_iota_inout_alloc_bufferify") use iso_c_binding, only : C_INT, C_LONG - import :: SHROUD_array + import :: VEC_SHROUD_array implicit none integer(C_INT), intent(INOUT) :: arg(*) integer(C_LONG), value, intent(IN) :: Sarg - type(SHROUD_array), intent(INOUT) :: Darg + type(VEC_SHROUD_array), intent(INOUT) :: Darg end subroutine c_vector_iota_inout_alloc_bufferify end interface ! end c_vector_iota_inout_alloc_bufferify @@ -181,11 +181,11 @@ end subroutine c_vector_iota_inout_alloc_bufferify subroutine c_vector_increment_bufferify(arg, Sarg, Darg) & bind(C, name="VEC_vector_increment_bufferify") use iso_c_binding, only : C_INT, C_LONG - import :: SHROUD_array + import :: VEC_SHROUD_array implicit none integer(C_INT), intent(INOUT) :: arg(*) integer(C_LONG), value, intent(IN) :: Sarg - type(SHROUD_array), intent(INOUT) :: Darg + type(VEC_SHROUD_array), intent(INOUT) :: Darg end subroutine c_vector_increment_bufferify end interface @@ -200,9 +200,9 @@ end subroutine c_vector_increment_bufferify interface subroutine c_vector_iota_out_d_bufferify(Darg) & bind(C, name="VEC_vector_iota_out_d_bufferify") - import :: SHROUD_array + import :: VEC_SHROUD_array implicit none - type(SHROUD_array), intent(INOUT) :: Darg + type(VEC_SHROUD_array), intent(INOUT) :: Darg end subroutine c_vector_iota_out_d_bufferify end interface @@ -243,10 +243,10 @@ end function c_vector_string_count_bufferify subroutine c_return_vector_alloc_bufferify(n, DSHF_rv) & bind(C, name="VEC_return_vector_alloc_bufferify") use iso_c_binding, only : C_INT - import :: SHROUD_array + import :: VEC_SHROUD_array implicit none integer(C_INT), value, intent(IN) :: n - type(SHROUD_array), intent(OUT) :: DSHF_rv + type(VEC_SHROUD_array), intent(OUT) :: DSHF_rv end subroutine c_return_vector_alloc_bufferify end interface @@ -258,27 +258,27 @@ end subroutine c_return_vector_alloc_bufferify interface ! helper copy_array_double ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_double(context, c_var, c_var_size) & + subroutine VEC_SHROUD_copy_array_double(context, c_var, c_var_size) & bind(C, name="VEC_ShroudCopyArray") use iso_c_binding, only : C_DOUBLE, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import VEC_SHROUD_array + type(VEC_SHROUD_array), intent(IN) :: context real(C_DOUBLE), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_double + end subroutine VEC_SHROUD_copy_array_double end interface interface ! helper copy_array_int ! Copy contents of context into c_var. - subroutine SHROUD_copy_array_int(context, c_var, c_var_size) & + subroutine VEC_SHROUD_copy_array_int(context, c_var, c_var_size) & bind(C, name="VEC_ShroudCopyArray") use iso_c_binding, only : C_INT, C_SIZE_T - import SHROUD_array - type(SHROUD_array), intent(IN) :: context + import VEC_SHROUD_array + type(VEC_SHROUD_array), intent(IN) :: context integer(C_INT), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size - end subroutine SHROUD_copy_array_int + end subroutine VEC_SHROUD_copy_array_int end interface contains @@ -333,10 +333,11 @@ end function vector_sum subroutine vector_iota_out(arg) use iso_c_binding, only : C_INT, C_SIZE_T integer(C_INT), intent(OUT) :: arg(:) - type(SHROUD_array) :: Darg + type(VEC_SHROUD_array) :: Darg ! splicer begin function.vector_iota_out call c_vector_iota_out_bufferify(Darg) - call SHROUD_copy_array_int(Darg, arg, size(arg,kind=C_SIZE_T)) + call VEC_SHROUD_copy_array_int(Darg, arg, & + size(arg,kind=C_SIZE_T)) ! splicer end function.vector_iota_out end subroutine vector_iota_out ! end vector_iota_out @@ -368,11 +369,12 @@ function vector_iota_out_with_num(arg) & result(num) use iso_c_binding, only : C_INT, C_LONG, C_SIZE_T integer(C_INT), intent(OUT) :: arg(:) - type(SHROUD_array) :: Darg + type(VEC_SHROUD_array) :: Darg ! splicer begin function.vector_iota_out_with_num integer(C_LONG) :: num num = c_vector_iota_out_with_num_bufferify(Darg) - call SHROUD_copy_array_int(Darg, arg, size(arg,kind=C_SIZE_T)) + call VEC_SHROUD_copy_array_int(Darg, arg, & + size(arg,kind=C_SIZE_T)) ! splicer end function.vector_iota_out_with_num end function vector_iota_out_with_num ! end vector_iota_out_with_num @@ -404,11 +406,12 @@ function vector_iota_out_with_num2(arg) & result(num) use iso_c_binding, only : C_INT, C_LONG, C_SIZE_T integer(C_INT), intent(OUT) :: arg(:) - type(SHROUD_array) :: Darg + type(VEC_SHROUD_array) :: Darg ! splicer begin function.vector_iota_out_with_num2 integer(C_LONG) :: num call c_vector_iota_out_with_num2_bufferify(Darg) - call SHROUD_copy_array_int(Darg, arg, size(arg,kind=C_SIZE_T)) + call VEC_SHROUD_copy_array_int(Darg, arg, & + size(arg,kind=C_SIZE_T)) num = Darg%size ! splicer end function.vector_iota_out_with_num2 end function vector_iota_out_with_num2 @@ -437,11 +440,12 @@ end function vector_iota_out_with_num2 subroutine vector_iota_out_alloc(arg) use iso_c_binding, only : C_INT, C_SIZE_T integer(C_INT), intent(OUT), allocatable :: arg(:) - type(SHROUD_array) :: Darg + type(VEC_SHROUD_array) :: Darg ! splicer begin function.vector_iota_out_alloc call c_vector_iota_out_alloc_bufferify(Darg) allocate(arg(Darg%size)) - call SHROUD_copy_array_int(Darg, arg, size(arg,kind=C_SIZE_T)) + call VEC_SHROUD_copy_array_int(Darg, arg, & + size(arg,kind=C_SIZE_T)) ! splicer end function.vector_iota_out_alloc end subroutine vector_iota_out_alloc ! end vector_iota_out_alloc @@ -469,13 +473,14 @@ end subroutine vector_iota_out_alloc subroutine vector_iota_inout_alloc(arg) use iso_c_binding, only : C_INT, C_LONG, C_SIZE_T integer(C_INT), intent(INOUT), allocatable :: arg(:) - type(SHROUD_array) :: Darg + type(VEC_SHROUD_array) :: Darg ! splicer begin function.vector_iota_inout_alloc call c_vector_iota_inout_alloc_bufferify(arg, & size(arg, kind=C_LONG), Darg) if (allocated(arg)) deallocate(arg) allocate(arg(Darg%size)) - call SHROUD_copy_array_int(Darg, arg, size(arg,kind=C_SIZE_T)) + call VEC_SHROUD_copy_array_int(Darg, arg, & + size(arg,kind=C_SIZE_T)) ! splicer end function.vector_iota_inout_alloc end subroutine vector_iota_inout_alloc ! end vector_iota_inout_alloc @@ -498,11 +503,12 @@ end subroutine vector_iota_inout_alloc subroutine vector_increment(arg) use iso_c_binding, only : C_INT, C_LONG, C_SIZE_T integer(C_INT), intent(INOUT) :: arg(:) - type(SHROUD_array) :: Darg + type(VEC_SHROUD_array) :: Darg ! splicer begin function.vector_increment call c_vector_increment_bufferify(arg, size(arg, kind=C_LONG), & Darg) - call SHROUD_copy_array_int(Darg, arg, size(arg,kind=C_SIZE_T)) + call VEC_SHROUD_copy_array_int(Darg, arg, & + size(arg,kind=C_SIZE_T)) ! splicer end function.vector_increment end subroutine vector_increment @@ -528,10 +534,11 @@ end subroutine vector_increment subroutine vector_iota_out_d(arg) use iso_c_binding, only : C_DOUBLE, C_SIZE_T real(C_DOUBLE), intent(OUT) :: arg(:) - type(SHROUD_array) :: Darg + type(VEC_SHROUD_array) :: Darg ! splicer begin function.vector_iota_out_d call c_vector_iota_out_d_bufferify(Darg) - call SHROUD_copy_array_double(Darg, arg, size(arg,kind=C_SIZE_T)) + call VEC_SHROUD_copy_array_double(Darg, arg, & + size(arg,kind=C_SIZE_T)) ! splicer end function.vector_iota_out_d end subroutine vector_iota_out_d @@ -595,12 +602,13 @@ function return_vector_alloc(n) & result(SHT_rv) use iso_c_binding, only : C_INT, C_SIZE_T integer(C_INT), value, intent(IN) :: n - type(SHROUD_array) :: DSHF_rv + type(VEC_SHROUD_array) :: DSHF_rv integer(C_INT), allocatable :: SHT_rv(:) ! splicer begin function.return_vector_alloc call c_return_vector_alloc_bufferify(n, DSHF_rv) allocate(SHT_rv(DSHF_rv%size)) - call SHROUD_copy_array_int(DSHF_rv, SHT_rv, size(SHT_rv,kind=C_SIZE_T)) + call VEC_SHROUD_copy_array_int(DSHF_rv, SHT_rv, & + size(SHT_rv,kind=C_SIZE_T)) ! splicer end function.return_vector_alloc end function return_vector_alloc diff --git a/regression/reference/vectors/wrapvectors.cpp b/regression/reference/vectors/wrapvectors.cpp index 91f95aa87..6502dbd4b 100644 --- a/regression/reference/vectors/wrapvectors.cpp +++ b/regression/reference/vectors/wrapvectors.cpp @@ -1,5 +1,5 @@ // wrapvectors.cpp -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/reference/vectors/wrapvectors.h b/regression/reference/vectors/wrapvectors.h index 2358bc9dd..367370f92 100644 --- a/regression/reference/vectors/wrapvectors.h +++ b/regression/reference/vectors/wrapvectors.h @@ -1,5 +1,5 @@ // wrapvectors.h -// This file is generated by Shroud 0.12.1. Do not edit. +// This file is generated by Shroud nowrite-version. Do not edit. // Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Shroud Project Developers. // See the top-level COPYRIGHT file for details. diff --git a/regression/run/Makefile b/regression/run/Makefile index 8e08684cf..3701fab22 100644 --- a/regression/run/Makefile +++ b/regression/run/Makefile @@ -42,6 +42,7 @@ test-fortran : \ test-fortran-cdesc \ test-fortran-preprocess \ test-fortran-strings \ + test-fortran-ccomplex \ test-fortran-clibrary \ test-fortran-cxxlibrary \ test-fortran-ownership \ @@ -137,6 +138,7 @@ test-python : \ test-python-struct-py-c \ test-python-struct-py-cxx \ test-python-vectors-numpy \ + test-python-ccomplex \ test-python-clibrary \ test-python-cxxlibrary \ test-python-ownership \ @@ -190,6 +192,8 @@ phony_explicit: # Avoid deleting directories created to run tests. # They are created via pattern rules. .SECONDARY: \ + $(tempdir)/run/ccomplex/.. \ + $(tempdir)/run/ccomplex/python/.. \ $(tempdir)/run/cdesc/.. \ $(tempdir)/run/classes/.. \ $(tempdir)/run/classes/python/.. \ diff --git a/regression/run/ccomplex/Makefile b/regression/run/ccomplex/Makefile new file mode 100644 index 000000000..132edf076 --- /dev/null +++ b/regression/run/ccomplex/Makefile @@ -0,0 +1,34 @@ +# Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +# other Shroud Project Developers. +# See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (BSD-3-Clause) +# +# run/clibrary +# +include $(top)/regression/run/defaults.mk + +INCLUDE = \ + -I$(top)/regression/reference/ccomplex \ + -I$(top)/regression/run/ccomplex \ + -I$(top)/regression/run/fruit + +VPATH = \ + $(top)/regression/reference/ccomplex \ + $(top)/regression/run/ccomplex \ + $(top)/regression/run/fruit + +OBJS = \ + ccomplex.o \ + wrapfccomplex.o \ + wrapccomplex.o \ + fruit.o \ + main.o + +ccomplex : $(OBJS) + $(FC) $(FFLAGS) $^ -o $@ $(CLIBS) + +clean : + rm -f $(OBJS) *.mod ccomplex + +main.o : wrapfccomplex.o diff --git a/regression/run/ccomplex/ccomplex.c b/regression/run/ccomplex/ccomplex.c new file mode 100644 index 000000000..d1842c69e --- /dev/null +++ b/regression/run/ccomplex/ccomplex.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and + * other Shroud Project Developers. + * See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (BSD-3-Clause) + * + * clibrary.c + */ + +#include + +#define MAXLAST 50 +static char last_function_called[MAXLAST]; + +//---------------------------------------------------------------------- + +void acceptFloatComplexInoutPtr(float complex *arg1) +{ + *arg1 = 3.0 + 4.0 * I; +} +void acceptDoubleComplexInoutPtr(double complex *arg1) +{ + *arg1 = 3.0 + 4.0 * I; +} + +void acceptDoubleComplexOutPtr(double complex *arg1) +{ + *arg1 = 3.0 + 4.0 * I; +} + +// Return two values so Py_BuildValue is used. +void acceptDoubleComplexInoutPtrFlag(double complex *arg1, int *flag) +{ + *arg1 = 3.0 + 4.0 * I; + *flag = 0; +} +void acceptDoubleComplexOutPtrFlag(double complex *arg1, int *flag) +{ + *arg1 = 3.0 + 4.0 * I; + *flag = 0; +} + +//---------------------------------------------------------------------- + +void acceptDoubleComplexInoutArrayList(double complex *arg1, int narg) +{ + *arg1 = 3.0 + 4.0 * I; +} + +//---------------------------------------------------------------------- +const char *LastFunctionCalled(void) +{ + return last_function_called; +} diff --git a/regression/run/ccomplex/ccomplex.h b/regression/run/ccomplex/ccomplex.h new file mode 100644 index 000000000..2a49b7723 --- /dev/null +++ b/regression/run/ccomplex/ccomplex.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and + * other Shroud Project Developers. + * See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (BSD-3-Clause) + * + * ccomplex.h - wrapped routines + */ + +#ifndef CCOMPLEX_H +#define CCOMPLEX_H + +#include + +void acceptFloatComplexInoutPtr(float complex *arg1); + +void acceptDoubleComplexInoutPtr(double complex *arg1); +void acceptDoubleComplexOutPtr(double complex *arg1); + +void acceptDoubleComplexInoutPtrFlag(double complex *arg1, int *flag); +void acceptDoubleComplexOutPtrFlag(double complex *arg1, int *flag); + +//---------------------------------------------------------------------- + +void acceptDoubleComplexInoutArrayList(double complex *arg1, int narg); + +#endif // CCOMPLEX_H diff --git a/regression/run/ccomplex/main.f b/regression/run/ccomplex/main.f new file mode 100644 index 000000000..82caa4b24 --- /dev/null +++ b/regression/run/ccomplex/main.f @@ -0,0 +1,60 @@ +! Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +! other Shroud Project Developers. +! See the top-level COPYRIGHT file for details. +! +! SPDX-License-Identifier: (BSD-3-Clause) +! ####################################################################### +! +! Test Fortran API generated from ccomplex.yaml. +! + +program tester + use fruit + use iso_c_binding + use ccomplex_mod + implicit none + logical ok + + call init_fruit + + call test_complex + + call fruit_summary + call fruit_finalize + + call is_all_successful(ok) + if (.not. ok) then + call exit(1) + endif + +contains + + subroutine test_complex + integer(C_INT) flag + complex(C_FLOAT_COMPLEX) c4 + complex(C_DOUBLE_COMPLEX) c8 + + ! intent(INOUT) argument + c4 = (1.0, 2.0) + call accept_float_complex_inout_ptr(c4) + call assert_equals(3.0, real(c4), "acceptFloatComplexInoutPtr") + call assert_equals(4.0, imag(c4), "acceptFloatComplexInoutPtr") + + ! intent(INOUT) argument + c8 = (1.0d0, 2.0d0) + call accept_double_complex_inout_ptr(c8) + call assert_equals(3.0d0, real(c8), "acceptDoubleComplexInoutPtr") + call assert_equals(4.0d0, imag(c8), "acceptDoubleComplexInoutPtr") + + call accept_double_complex_out_ptr(c8) + call assert_equals(3.0d0, real(c8), "acceptDoubleComplexOutPtr") + call assert_equals(4.0d0, imag(c8), "acceptDoubleComplexOutPtr") + + call accept_double_complex_out_ptr_flag(c8, flag) + call assert_equals(3.0d0, real(c8), "acceptDoubleComplexOutPtr") + call assert_equals(4.0d0, imag(c8), "acceptDoubleComplexOutPtr") + call assert_equals(0, flag, "acceptDoubleComplexOutPtr") + + end subroutine test_complex + +end program tester diff --git a/regression/run/ccomplex/python/Makefile b/regression/run/ccomplex/python/Makefile new file mode 100644 index 000000000..d09685542 --- /dev/null +++ b/regression/run/ccomplex/python/Makefile @@ -0,0 +1,44 @@ +# Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +# other Shroud Project Developers. +# See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (BSD-3-Clause) +# +# Compile the python ccomplex module +# +include $(top)/regression/run/defaults.mk + +INCLUDE = \ + -I$(top)/regression/reference/ccomplex \ + -I$(top)/regression/run/ccomplex \ + $(PYTHON_INC) + +VPATH = \ + $(top)/regression/reference/ccomplex \ + $(top)/regression/run/ccomplex \ + $(top)/regression/run/ccomplex/python + +OBJS = \ + ccomplex.o \ + pyccomplexmodule.o + +CFLAGS += $(SHARED) + +all : ccomplex.so simple + +ccomplex.so : $(OBJS) + $(CXX) $(LD_SHARED) -o $@ $^ $(LIBS) + +simple : testpython.o $(OBJS) + $(CXX) -pthread -o $@ $^ $(PYTHON_LIB) +# g++ -pthread -o $@ $^ $(PYTHON_LIB) + +clean : + rm -f *.so *.o simple +.PHONY : clean + +print-debug: + @echo PYTHON=$(PYTHON) + @echo PYTHON_PREFIX=$(PYTHON_PREFIX) + @echo PYTHON_VER=$(PYTHON_VER) + diff --git a/regression/run/ccomplex/python/test.py b/regression/run/ccomplex/python/test.py new file mode 100644 index 000000000..a965ab495 --- /dev/null +++ b/regression/run/ccomplex/python/test.py @@ -0,0 +1,67 @@ +# Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and +# other Shroud Project Developers. +# See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (BSD-3-Clause) +# +# ####################################################################### +# +# Test Python API generated from ccomplex.yaml. +# +from __future__ import print_function + +import math +import unittest +import ccomplex + + +class NotTrue: + """Test bool arguments errors""" + def __bool__(self): + raise NotImplementedError + +class CComplex(unittest.TestCase): + """Test tutorial problem""" + + def XXsetUp(self): + """ Setting up for the test """ + print("FooTest:setUp_:begin") + ## do something... + print("FooTest:setUp_:end") + + def XXtearDown(self): + """Cleaning up after the test""" + print("FooTest:tearDown_:begin") + ## do something... + print("FooTest:tearDown_:end") + + def test_acceptDoubleComplexInoutPtr(self): + rv = ccomplex.acceptDoubleComplexInoutPtr(complex(1.0, 2.0)) + self.assertIsInstance(rv, complex) + self.assertEqual(complex(3., 4.), rv) + + def test_acceptDoubleComplexOutPtr(self): + rv = ccomplex.acceptDoubleComplexOutPtr() + self.assertIsInstance(rv, complex) + self.assertEqual(complex(3., 4.), rv) + + def test_acceptDoubleComplexInoutPtrFlag(self): + rv, flag = ccomplex.acceptDoubleComplexInoutPtrFlag(complex(1.0, 2.0)) + self.assertIsInstance(rv, complex) + self.assertEqual(complex(3., 4.), rv) + self.assertEqual(0, flag) + + def test_acceptDoubleComplexOutPtrFlag(self): + rv, flag = ccomplex.acceptDoubleComplexOutPtrFlag() + self.assertIsInstance(rv, complex) + self.assertEqual(complex(3., 4.), rv) + self.assertEqual(0, flag) + +# creating a new test suite +newSuite = unittest.TestSuite() + +# adding a test case +newSuite.addTest(unittest.makeSuite(CComplex)) + +if __name__ == "__main__": + unittest.main() diff --git a/regression/run/ccomplex/python/testpython.c b/regression/run/ccomplex/python/testpython.c new file mode 100644 index 000000000..701f62df0 --- /dev/null +++ b/regression/run/ccomplex/python/testpython.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and + * other Shroud Project Developers. + * See the top-level COPYRIGHT file for details. + * + * SPDX-License-Identifier: (BSD-3-Clause) + * ####################################################################### + */ +#include "Python.h" +//#include +#include + +#if PY_MAJOR_VERSION >= 3 +#define MODINIT PyInit_ccomplex +#else +#define MODINIT initccomplex +#endif +PyMODINIT_FUNC MODINIT(void); + +int main(int argc, char** argv) +{ + char filename[] = "test.py"; + FILE* fp; + + Py_Initialize(); + MODINIT(); + + fp = fopen(filename, "r"); + PyRun_SimpleFile(fp, filename); + fclose(fp); + Py_Exit(0); + return 0; +} diff --git a/regression/run/clibrary/clibrary.h b/regression/run/clibrary/clibrary.h index 5a8e29b08..7599ec00c 100644 --- a/regression/run/clibrary/clibrary.h +++ b/regression/run/clibrary/clibrary.h @@ -8,8 +8,8 @@ * clibrary.h - wrapped routines */ -#ifndef CLIBRARY_HPP -#define CLIBRARY_HPP +#ifndef CLIBRARY_H +#define CLIBRARY_H #include @@ -109,4 +109,4 @@ void increment(int *array, int size); void get_values(int *nvalues, int *values); -#endif // CLIBRARY_HPP +#endif // CLIBRARY_H diff --git a/regression/run/clibrary/python/test.py b/regression/run/clibrary/python/test.py index 823f83f6d..a7d0a9e57 100644 --- a/regression/run/clibrary/python/test.py +++ b/regression/run/clibrary/python/test.py @@ -20,7 +20,7 @@ class NotTrue: def __bool__(self): raise NotImplementedError -class Tutorial(unittest.TestCase): +class Clibrary(unittest.TestCase): """Test tutorial problem""" def XXsetUp(self): @@ -92,7 +92,7 @@ def testImpliedBoolFalse(self): newSuite = unittest.TestSuite() # adding a test case -newSuite.addTest(unittest.makeSuite(Tutorial)) +newSuite.addTest(unittest.makeSuite(Clibrary)) if __name__ == "__main__": unittest.main() diff --git a/regression/run/cxxlibrary/cxxlibrary.cpp b/regression/run/cxxlibrary/cxxlibrary.cpp index bb03820bd..e48c73e1f 100644 --- a/regression/run/cxxlibrary/cxxlibrary.cpp +++ b/regression/run/cxxlibrary/cxxlibrary.cpp @@ -80,3 +80,21 @@ bool defaultPtrIsNULL(double *data) return true; return false; } + +//---------------------------------------------------------------------- + +void defaultArgsInOut(int in1, int *out1, int *out2, bool flag) +{ + *out1 = 1; + if (flag) { + *out2 = 20; + } else { + *out2 = 2; + } +} + +//---------------------------------------------------------------------- + +void accept_complex(std::complex *arg1) +{ +} diff --git a/regression/run/cxxlibrary/cxxlibrary.hpp b/regression/run/cxxlibrary/cxxlibrary.hpp index e9b5f7ec0..7f0cf0a51 100644 --- a/regression/run/cxxlibrary/cxxlibrary.hpp +++ b/regression/run/cxxlibrary/cxxlibrary.hpp @@ -12,6 +12,8 @@ #ifndef CXXLIBRARY_H #define CXXLIBRARY_H +#include + struct Cstruct1 { int ifield; double dfield; @@ -40,5 +42,13 @@ void passStructByReferenceOutCls(Cstruct1_cls &arg); bool defaultPtrIsNULL(double *data = nullptr); +//---------------------------------------------------------------------- + +void defaultArgsInOut(int in1, int *out1, int *out2, bool flag = false); + +//---------------------------------------------------------------------- + +void accept_complex(std::complex *arg1); + #endif // CXXLIBRARY_H diff --git a/regression/run/cxxlibrary/main.f b/regression/run/cxxlibrary/main.f index 5b38a984e..8314bdad6 100644 --- a/regression/run/cxxlibrary/main.f +++ b/regression/run/cxxlibrary/main.f @@ -60,9 +60,18 @@ end subroutine test_struct subroutine test_default_args real(C_DOUBLE) :: some_var(2) + integer(C_INT) :: out1, out2 call assert_true(default_ptr_is_null()) call assert_false(default_ptr_is_null(some_var)) + + ! flag defaults to false + call default_args_in_out(1, out1, out2) + call assert_equals(1, out1, "defaultArgsInOut") + call assert_equals(2, out2, "defaultArgsInOut") + call default_args_in_out(1, out1, out2, .true.) + call assert_equals(1, out1, "defaultArgsInOut") + call assert_equals(20, out2, "defaultArgsInOut") end subroutine test_default_args diff --git a/regression/run/cxxlibrary/python/test.py b/regression/run/cxxlibrary/python/test.py index 8b598780d..0bbba3a15 100644 --- a/regression/run/cxxlibrary/python/test.py +++ b/regression/run/cxxlibrary/python/test.py @@ -72,6 +72,18 @@ def test_DefaultArgs(self): self.assertTrue(cxxlibrary.defaultPtrIsNULL()) self.assertFalse(cxxlibrary.defaultPtrIsNULL([1., 2.])) + def test_defaultArgsInOut(self): + out1, out2 = cxxlibrary.defaultArgsInOut(1) + self.assertEqual(1, out1) + self.assertEqual(2, out2) + out1, out2 = cxxlibrary.defaultArgsInOut(1, True) + self.assertEqual(1, out1) + self.assertEqual(20, out2) + + # XXX - this segfaults with Python3 +# cxxlibrary.defaultArgsInOut(1, True, 5) + + # creating a new test suite newSuite = unittest.TestSuite() diff --git a/regression/run/ownership/main.f b/regression/run/ownership/main.f index 28a77942c..f6ef048f6 100644 --- a/regression/run/ownership/main.f +++ b/regression/run/ownership/main.f @@ -40,7 +40,7 @@ subroutine test_pod integer(C_INT), allocatable :: inta1(:) ! integer(C_INT) :: lencptr ! type(C_PTR) cptr - type(SHROUD_capsule) cap + type(OWN_SHROUD_capsule) cap !---------------------------------------- ! return scalar diff --git a/regression/run/strings/main.f b/regression/run/strings/main.f index 7855ecf7f..93b004344 100644 --- a/regression/run/strings/main.f +++ b/regression/run/strings/main.f @@ -226,21 +226,34 @@ subroutine test_functions ! Fetch from global_str. call fetch_string_pointer(str) - call assert_true( str == "from Fortran") + call assert_true( str == "from Fortran", "fetchStringPointer") call fetch_string_pointer_len(str, nlen) - call assert_true( str == "from Fortran") - call assert_equals(len_trim(str), nlen) + call assert_true( str == "from Fortran", "FetchStringPointerLen") + call assert_equals(len_trim(str), nlen, "FetchStringPointerLen") + + ! Return length of string + nlen = accept_string_instance("from Fortran") + call assert_equals(12, nlen, "acceptStringInstance") + str = "from Fortran" + nlen = accept_string_instance(str) ! Returns trimmed length + call assert_equals(12, nlen, "acceptStringInstance") + ! argument is passed by value to C++ so changes will not effect argument. + call assert_equals("from Fortran", str) + + ! Call C++ function directly by adding trailing NULL. + nlen = c_accept_string_instance("from Fortran" // C_NULL_CHAR) + call assert_equals(12, nlen, "acceptStringInstance") ! append "dog". str = "bird" call accept_string_pointer(str) - call assert_true( str == "birddog") + call assert_true( str == "birddog", "acceptStringPointer") str = "bird" call accept_string_pointer_len(str, nlen) - call assert_true( str == "birddog") - call assert_equals(len_trim(str), nlen) + call assert_true( str == "birddog", "acceptStringPointerLen") + call assert_equals(len_trim(str), nlen, "acceptStringPointerLen") end subroutine test_functions diff --git a/regression/run/strings/python/test.py b/regression/run/strings/python/test.py index 5c75c3b37..a32100f5a 100644 --- a/regression/run/strings/python/test.py +++ b/regression/run/strings/python/test.py @@ -21,7 +21,7 @@ class NotTrue: def __bool__(self): raise NotImplementedError -class Tutorial(unittest.TestCase): +class Strings(unittest.TestCase): """Test tutorial problem""" def XXsetUp(self): @@ -111,6 +111,11 @@ def testacceptStringPointer(self): self.assertEqual('birddog', s) self.assertEqual(len(s), nlen) + def testacceptStringInstance(self): + s = "acceptStringInstance" + nlen = strings.acceptStringInstance(s) + self.assertEqual(len(s), nlen) + def testreturnStrings(self): self.assertEqual(('up', 'down'), strings.returnStrings()) @@ -127,7 +132,7 @@ def testCreturnChar(self): newSuite = unittest.TestSuite() # adding a test case -newSuite.addTest(unittest.makeSuite(Tutorial)) +newSuite.addTest(unittest.makeSuite(Strings)) if __name__ == "__main__": unittest.main() diff --git a/regression/run/strings/strings.cpp b/regression/run/strings/strings.cpp index 8c3ebf4fc..ebb989c9e 100644 --- a/regression/run/strings/strings.cpp +++ b/regression/run/strings/strings.cpp @@ -219,6 +219,13 @@ void fetchStringPointerLen(std::string * arg1, int *len) *len = arg1->size(); } +// Return length of string +int acceptStringInstance(std::string arg1) +{ + arg1[0] = 'X'; + return arg1.length(); +} + void returnStrings(std::string & arg1, std::string & arg2) { arg1 = "up"; diff --git a/regression/run/strings/strings.hpp b/regression/run/strings/strings.hpp index 052e6544b..ffd3009db 100644 --- a/regression/run/strings/strings.hpp +++ b/regression/run/strings/strings.hpp @@ -59,6 +59,8 @@ void acceptStringPointerLen(std::string * arg1, int *len); void fetchStringPointerLen(std::string * arg1, int *len); +int acceptStringInstance(std::string arg1); + void returnStrings(std::string & arg1, std::string & arg2); char returnMany(int * arg1); diff --git a/regression/run/struct-class-cxx/python/test.py b/regression/run/struct-class-cxx/python/test.py index fb9009014..2b103cfdb 100644 --- a/regression/run/struct-class-cxx/python/test.py +++ b/regression/run/struct-class-cxx/python/test.py @@ -86,12 +86,6 @@ def test_returnStructByValue(self): self.assertEqual(1, out.ifield) self.assertEqual(2.5, out.dfield) - def test_returnConstStructByValue(self): - out = cstruct.returnStructByValue(1, 2.5) - self.assertIsInstance(out, cstruct.Cstruct1) - self.assertEqual(1, out.ifield) - self.assertEqual(2.5, out.dfield) - def test_returnStructPtr1(self): out = cstruct.returnStructPtr1(33, 33.5) self.assertIsInstance(out, cstruct.Cstruct1) diff --git a/regression/run/struct-numpy-c/python/test.py b/regression/run/struct-numpy-c/python/test.py index 204eba9e0..d08cf7396 100644 --- a/regression/run/struct-numpy-c/python/test.py +++ b/regression/run/struct-numpy-c/python/test.py @@ -112,15 +112,6 @@ def test_returnStructByValue(self): self.assertEqual(1, out["ifield"]) self.assertEqual(2.5, out["dfield"]) - def test_returnConstStructByValue(self): - out = cstruct.returnConstStructByValue(1, 2.5) - self.assertIsInstance(out, np.ndarray) - self.assertIs(out.dtype, cstruct.Cstruct1_dtype) - self.assertEqual(0, out.ndim) - self.assertEqual(1, out.size) - self.assertEqual(1, out["ifield"]) - self.assertEqual(2.5, out["dfield"]) - def test_returnStructPtr1(self): out = cstruct.returnStructPtr1(33, 33.5) self.assertIsInstance(out, np.ndarray) diff --git a/regression/run/struct-numpy-cxx/python/test.py b/regression/run/struct-numpy-cxx/python/test.py index 824cbea9a..fbc212a74 100644 --- a/regression/run/struct-numpy-cxx/python/test.py +++ b/regression/run/struct-numpy-cxx/python/test.py @@ -112,15 +112,6 @@ def test_returnStructByValue(self): self.assertEqual(1, out["ifield"]) self.assertEqual(2.5, out["dfield"]) - def test_returnConstStructByValue(self): - out = cstruct.returnConstStructByValue(1, 2.5) - self.assertIsInstance(out, np.ndarray) - self.assertIs(out.dtype, cstruct.Cstruct1_dtype) - self.assertEqual(0, out.ndim) - self.assertEqual(1, out.size) - self.assertEqual(1, out["ifield"]) - self.assertEqual(2.5, out["dfield"]) - def test_returnStructPtr1(self): out = cstruct.returnStructPtr1(33, 33.5) self.assertIsInstance(out, np.ndarray) diff --git a/regression/run/struct/main.f b/regression/run/struct/main.f index df94f4d14..c40090f5a 100644 --- a/regression/run/struct/main.f +++ b/regression/run/struct/main.f @@ -90,10 +90,6 @@ subroutine test_struct2 call assert_equals(1_C_INT, str1%ifield, "returnStructByValue i field") call assert_equals(2.5_C_DOUBLE, str1%dfield, "returnStructByValue d field") - str1 = return_const_struct_by_value(10_C_INT, 20.5_C_DOUBLE) - call assert_equals(10_C_INT, str1%ifield, "return_constStructByValue i field") - call assert_equals(20.5_C_DOUBLE, str1%dfield, "return_constStructByValue d field") - nullify(str2) str2 => return_struct_ptr1(33, 33.5d0) call assert_true(associated(str2), "returnStructPtr1") diff --git a/regression/run/struct/struct.c b/regression/run/struct/struct.c index 013769a4a..323a582be 100644 --- a/regression/run/struct/struct.c +++ b/regression/run/struct/struct.c @@ -76,12 +76,6 @@ Cstruct1 returnStructByValue(int i, double d) return s; } -const Cstruct1 returnConstStructByValue(int i, double d) -{ - Cstruct1 s = {i, d}; - return s; -} - Cstruct1 *returnStructPtr1(int i, double d) { strncpy(last_function_called, "returnStructPtr1", MAXLAST); diff --git a/regression/run/struct/struct.h b/regression/run/struct/struct.h index 956c1826c..f3308e2b6 100644 --- a/regression/run/struct/struct.h +++ b/regression/run/struct/struct.h @@ -30,7 +30,6 @@ int acceptStructInPtr(Cstruct1 *arg); void acceptStructOutPtr(Cstruct1 *arg, int i, double d); void acceptStructInOutPtr(Cstruct1 *arg); Cstruct1 returnStructByValue(int i, double d); -const Cstruct1 returnConstStructByValue(int i, double d); Cstruct1 *returnStructPtr1(int i, double d); Cstruct1 *returnStructPtr2(int i, double d, char *outbuf); diff --git a/shroud/ast.py b/shroud/ast.py index a22a31b9d..1e667f7d5 100644 --- a/shroud/ast.py +++ b/shroud/ast.py @@ -466,7 +466,10 @@ def default_options(self): F_module_name_namespace_template="{file_scope}_mod", F_impl_filename_library_template="wrapf{library_lower}.{F_filename_suffix}", F_impl_filename_namespace_template="wrapf{file_scope}.{F_filename_suffix}", - F_capsule_data_type_class_template="SHROUD_{F_name_scope}capsule", + F_array_type_template="{C_prefix}SHROUD_array", + F_capsule_data_type_template="{C_prefix}SHROUD_capsule_data", + F_capsule_data_type_class_template="{C_prefix}SHROUD_{F_name_scope}capsule", + F_capsule_type_template="{C_prefix}SHROUD_capsule", F_abstract_interface_subprogram_template="{underscore_name}_{argname}", F_abstract_interface_argument_template="arg{index}", @@ -587,11 +590,8 @@ def default_format(self, fmtdict, kwargs): F_this="obj", C_string_result_as_arg="SHF_rv", F_string_result_as_arg="", - F_capsule_data_type="SHROUD_capsule_data", - F_capsule_type="SHROUD_capsule", F_capsule_final_function="SHROUD_capsule_final", F_capsule_delete_function="SHROUD_capsule_delete", - F_array_type="SHROUD_array", c_array_shape="", c_array_size="1", @@ -748,11 +748,14 @@ def default_format(self, fmtdict, kwargs): self.eval_template("C_memory_dtor_function") + self.eval_template("F_array_type") + self.eval_template("F_capsule_type") # All class/methods and functions may go into this file or # just functions. self.eval_template("F_module_name", "_library") fmt_library.F_module_name = fmt_library.F_module_name.lower() self.eval_template("F_impl_filename", "_library") + self.eval_template("F_capsule_data_type") # If user changes PY_module_name, reflect change in PY_module_scope. self.set_fmt_default( diff --git a/shroud/declast.py b/shroud/declast.py index 51cd6e0d3..7cccbe792 100644 --- a/shroud/declast.py +++ b/shroud/declast.py @@ -32,6 +32,7 @@ "double", "signed", "unsigned", + "complex", # C _Complex } type_qualifier = {"const", "volatile"} storage_class = {"auto", "register", "static", "extern", "typedef"} @@ -83,6 +84,8 @@ unsigned_long_long_int="unsigned_long_long", # implied 'int' unsigned="unsigned_int", + complex_double="double_complex", + complex_float="float_complex", ) def tokenize(s): diff --git a/shroud/generate.py b/shroud/generate.py index 56d6beab0..c975fae96 100644 --- a/shroud/generate.py +++ b/shroud/generate.py @@ -1204,12 +1204,14 @@ def arg_to_buffer(self, node, ordered_functions): has_buf_arg = False for arg in ast.params: arg_typemap = arg.typemap - if arg_typemap.base == "string": + if arg_typemap.sgroup == "string": + has_buf_arg = True + elif arg_typemap.sgroup == "char": if arg.ftrim_char_in: pass elif arg.is_indirect(): has_buf_arg = True - elif arg_typemap.base == "vector": + elif arg_typemap.sgroup == "vector": has_buf_arg = True elif (arg_typemap.sgroup == "native" and arg.attrs["intent"] == "out" and diff --git a/shroud/main.py b/shroud/main.py index deefc6ee8..da5f0235b 100644 --- a/shroud/main.py +++ b/shroud/main.py @@ -175,7 +175,7 @@ def dump_jsonfile(config, logdir, basename, newlibrary): out = dict( # This notice should sort to the top. __NOTICE__="This file is generated by Shroud {} " - "and is useful for debugging.".format(metadata.__version__), + "and is useful for debugging.".format(config.write_version), library=todict.to_dict(newlibrary), # yaml=all, ) @@ -195,6 +195,17 @@ def dump_jsonfile(config, logdir, basename, newlibrary): fp.close() +# https://thisdataguy.com/2017/07/03/no-options-with-argparse-and-python/ +class BooleanAction(argparse.Action): + def __init__(self, option_strings, dest, nargs=None, **kwargs): + super(BooleanAction, self).__init__( + option_strings, dest, nargs=0, **kwargs) + + def __call__(self, parser, namespace, values, option_string=None): + setattr(namespace, self.dest, + False if option_string.startswith('--no') else True) + + def main(): appname = "shroud" @@ -263,6 +274,13 @@ def main(): parser.add_argument( "--write-helpers", default="", help="Write a file with helper functions." ) + parser.add_argument( + "--write-version", "--nowrite-version", + dest="write_version", + action=BooleanAction, + default=True, + help="Write version into generated files. --nowrite-version to not write version" + ) parser.add_argument( "--yaml-types", default="", help="Write a YAML file with default types." ) @@ -368,6 +386,10 @@ def main_with_args(args): config.write_helpers = args.write_helpers config.yaml_types = args.yaml_types config.log = log + if args.write_version: + config.write_version = metadata.__version__ + else: + config.write_version = "nowrite-version" # config.cfiles = [] # list of C/C++ files created # config.ffiles = [] # list of Fortran files created # config.pyfiles = [] # list of Python module files created diff --git a/shroud/metadata.py b/shroud/metadata.py index 406ffed6a..96713a622 100644 --- a/shroud/metadata.py +++ b/shroud/metadata.py @@ -5,6 +5,6 @@ # SPDX-License-Identifier: (BSD-3-Clause) ######################################################################## -__version__ = "0.12.1" -__version_info__ = (0, 12, 1, "final", 0) +__version__ = "0.12.2" +__version_info__ = (0, 12, 2, "final", 0) # 'alpha', 'beta', 'candidate', or 'final'. diff --git a/shroud/typemap.py b/shroud/typemap.py index 13e7724ff..2d5b65626 100644 --- a/shroud/typemap.py +++ b/shroud/typemap.py @@ -96,6 +96,10 @@ class Typemap(object): # ex. PyFloat_FromDouble({c_deref}{c_var}) ("PY_get", None), # expression to create type from PyObject. # ex. PyFloat_AsDouble({py_var}) + ("py_ctype", None), # returned by Py_get ex. "Py_complex" + ("pytype_to_pyctor", None), # Used with py_ctype, passed to PY_ctor + ("pytype_to_cxx", None), # Used with py_ctype + ("cxx_to_pytype", None), # Used with py_ctype # Name of converter function with prototype (PyObject *, void *). ("PY_to_object", None), # PyBuild - object=converter(address) ( @@ -177,8 +181,11 @@ def compute_flat_name(self): such as after clone_as. cxx_type will not be set for template arguments. + Only set if None. Complex is set explicitly since + C and C++ have totally different names (double complex vs complex) """ - self.flat_name = flatten_name(self.cxx_type) + if self.flat_name is None: + self.flat_name = flatten_name(self.cxx_type) def _to_dict(self): """Convert instance to a dictionary for json. @@ -644,6 +651,62 @@ def initialize(): sgroup="native", sh_type="SH_TYPE_DOUBLE", ), + float_complex=Typemap( # _Complex + "float_complex", + c_type="float complex", + cxx_type="std::complex", + flat_name="float_complex", + c_header="", + cxx_header="", + f_cast="cmplx({f_var}, C_FLOAT_COMPLEX)", + f_type="complex(C_FLOAT_COMPLEX)", + f_kind="C_FLOAT_COMPLEX", + f_module=dict(iso_c_binding=["C_FLOAT_COMPLEX"]), + PY_format="D", + py_ctype="Py_complex", + pytype_to_pyctor="creal({ctor_expr}), cimag({ctor_expr})", + pytype_to_cxx="{work_var}.real + {work_var}.imag * I", + cxx_to_pytype="{py_var}.real = creal({cxx_var});\n{py_var}.imag = cimag({cxx_var});", + PY_ctor="PyComplex_FromDoubles(\t{ctor_expr})", + PY_get="PyComplex_AsCComplex({py_var})", + PY_build_arg="&{ctype_var}", + PYN_typenum="NPY_DOUBLE", + LUA_type="LUA_TNUMBER", + LUA_pop="lua_tonumber({LUA_state_var}, {LUA_index})", + LUA_push="lua_pushnumber({LUA_state_var}, {c_var})", + sgroup="native", + sh_type="SH_TYPE_FLOAT_COMPLEX", + ), + double_complex=Typemap( # _Complex + "double_complex", + c_type="double complex", + cxx_type="std::complex", + flat_name="double_complex", + c_header="", + cxx_header="", + f_cast="cmplx({f_var}, C_DOUBLE_COMPLEX)", + f_type="complex(C_DOUBLE_COMPLEX)", + f_kind="C_DOUBLE_COMPLEX", + f_module=dict(iso_c_binding=["C_DOUBLE_COMPLEX"]), + PY_format="D", + PY_get="PyComplex_AsCComplex({py_var})", + py_ctype="Py_complex", + pytype_to_pyctor="creal({ctor_expr}), cimag({ctor_expr})", + pytype_to_cxx="{work_var}.real + {work_var}.imag * I", + cxx_to_pytype="{ctype_var}.real = creal({cxx_var});\n{ctype_var}.imag = cimag({cxx_var});", + # fmt.work_ctor = "std::complex(\tcvalue.real, cvalue.imag)" + # creal(), cimag() + # std::real(), std::imag() + # xx.real(), xx.imag() + PY_ctor="PyComplex_FromDoubles(\t{ctor_expr})", # double real, double imag + PY_build_arg="&{ctype_var}", + PYN_typenum="NPY_DOUBLE", + LUA_type="LUA_TNUMBER", + LUA_pop="lua_tonumber({LUA_state_var}, {LUA_index})", + LUA_push="lua_pushnumber({LUA_state_var}, {c_var})", + sgroup="native", + sh_type="SH_TYPE_DOUBLE_COMPLEX", + ), bool=Typemap( "bool", c_type="bool", @@ -1659,8 +1722,7 @@ def __init__(self, post_call=[ # XXX - allocate scalar "allocate({f_var}({c_var_dimension}))", - "call SHROUD_copy_array_{cxx_type}" - "({c_var_context}, {f_var}, size({f_var}, kind=C_SIZE_T))", + "call {hnamefunc0}({c_var_context}, {f_var}, size({f_var}, kind=C_SIZE_T))", ], ), @@ -1887,8 +1949,7 @@ def __init__(self, ], post_call=[ "allocate(character(len={c_var_context}%elem_len):: {f_var})", - "call SHROUD_copy_string_and_free" - "({c_var_context}, {f_var}, {c_var_context}%elem_len)", + "call {hnamefunc0}({c_var_context}, {f_var}, {c_var_context}%elem_len)", ], ), dict( @@ -1983,6 +2044,43 @@ def __init__(self, "-}}", ], ), + + # std::string + dict( + name="c_string_scalar_in", + buf_args=["arg_decl"], + c_arg_decl=[ + # Argument is a pointer while std::string is a scalar. + # C++ compiler will convert to std::string when calling function. + "char *{c_var}", + ], + f_arg_decl=[ + # Remove VALUE added by c_default + "character(kind=C_CHAR), intent(IN) :: {c_var}(*)", + ], + f_module=dict(iso_c_binding=["C_CHAR"]), + ), + dict( + name="c_string_scalar_in_buf", + base="c_string_scalar_in", + buf_args=["arg_decl", "len_trim"], + cxx_local_var="scalar", + pre_call=[ + "std::string {cxx_var}({c_var}, {c_var_trim});", + ], + call=[ + "{cxx_var}", + ], + ), + dict( + name="f_string_scalar_in", # pairs with c_string_scalar_in_buf + need_wrapper=True, + buf_args=["arg", "len"], + arg_decl=[ + # Remove VALUE added by f_default + "character(len=*), intent(IN) :: {f_var}", + ], + ), # Uses a two part call to copy results of std::string into a # allocatable Fortran array. @@ -2041,9 +2139,9 @@ def __init__(self, ], ), - # similar to f_char_result_allocatable + # similar to f_char_scalar_result_allocatable dict( - name="f_string_result_allocatable", + name="f_string_scalar_result_allocatable", need_wrapper=True, c_helper="copy_string", f_helper="copy_string", @@ -2052,10 +2150,17 @@ def __init__(self, ], post_call=[ "allocate(character(len={c_var_context}%elem_len):: {f_var})", - "call SHROUD_copy_string_and_free(" - "{c_var_context}, {f_var}, {c_var_context}%elem_len)", + "call {hnamefunc0}({c_var_context}, {f_var}, {c_var_context}%elem_len)", ], ), + dict( + name="f_string_*_result_allocatable", + base="f_string_scalar_result_allocatable", + ), + dict( + name="f_string_&_result_allocatable", + base="f_string_scalar_result_allocatable", + ), dict( @@ -2269,8 +2374,7 @@ def __init__(self, f_helper="copy_array_{cxx_T}", f_module=dict(iso_c_binding=["C_SIZE_T"]), post_call=[ - "call SHROUD_copy_array_{cxx_T}({c_var_context}, " - "{f_var}, size({f_var},kind=C_SIZE_T))" + "call {hnamefunc0}(\t{c_var_context},\t {f_var},\t size({f_var},kind=C_SIZE_T))", ], ), dict( @@ -2279,8 +2383,7 @@ def __init__(self, f_helper="copy_array_{cxx_T}", f_module=dict(iso_c_binding=["C_SIZE_T"]), post_call=[ - "call SHROUD_copy_array_{cxx_T}({c_var_context}, " - "{f_var}, size({f_var},kind=C_SIZE_T))" + "call {hnamefunc0}(\t{c_var_context},\t {f_var},\t size({f_var},kind=C_SIZE_T))", ], ), dict( @@ -2289,8 +2392,7 @@ def __init__(self, f_helper="copy_array_{cxx_T}", f_module=dict(iso_c_binding=["C_SIZE_T"]), post_call=[ - "call SHROUD_copy_array_{cxx_T}({c_var_context}, " - "{f_var}, size({f_var},kind=C_SIZE_T))" + "call {hnamefunc0}(\t{c_var_context},\t {f_var},\t size({f_var},kind=C_SIZE_T))" ], ), # copy into allocated array @@ -2301,8 +2403,7 @@ def __init__(self, f_module=dict(iso_c_binding=["C_SIZE_T"]), post_call=[ "allocate({f_var}({c_var_context}%size))", - "call SHROUD_copy_array_{cxx_T}({c_var_context}, " - "{f_var}, size({f_var},kind=C_SIZE_T))", + "call {hnamefunc0}(\t{c_var_context},\t {f_var},\t size({f_var},kind=C_SIZE_T))", ], ), dict( @@ -2313,8 +2414,7 @@ def __init__(self, post_call=[ "if (allocated({f_var})) deallocate({f_var})", "allocate({f_var}({c_var_context}%size))", - "call SHROUD_copy_array_{cxx_T}({c_var_context}, " - "{f_var}, size({f_var},kind=C_SIZE_T))", + "call {hnamefunc0}(\t{c_var_context},\t {f_var},\t size({f_var},kind=C_SIZE_T))", ], ), # Similar to f_vector_out_allocatable but must declare result variable. @@ -2326,8 +2426,7 @@ def __init__(self, f_module=dict(iso_c_binding=["C_SIZE_T"]), post_call=[ "allocate({f_var}({c_var_context}%size))", - "call SHROUD_copy_array_{cxx_T}({c_var_context}, " - "{f_var}, size({f_var},kind=C_SIZE_T))", + "call {hnamefunc0}(\t{c_var_context},\t {f_var},\t size({f_var},kind=C_SIZE_T))", ], ), diff --git a/shroud/util.py b/shroud/util.py index df7e94d60..f7ba11ed2 100644 --- a/shroud/util.py +++ b/shroud/util.py @@ -11,8 +11,6 @@ import os import string -from . import metadata - fmt = string.Formatter() def wformat(template, dct): @@ -448,7 +446,7 @@ def write_output_file(self, fname, directory, output, spaces=" "): fp = open(os.path.join(directory, fname), "w") fp.write("%s %s\n" % (self.comment, fname)) fp.write("{} This file is generated by Shroud {}. Do not edit.\n". - format(self.comment, metadata.__version__)) + format(self.comment, self.config.write_version)) self.write_copyright(fp) self.indent = 0 self.write_lines(fp, output, spaces) diff --git a/shroud/whelpers.py b/shroud/whelpers.py index f36a316bb..bba9bc2e7 100644 --- a/shroud/whelpers.py +++ b/shroud/whelpers.py @@ -60,6 +60,22 @@ """ +# Note about PRIVATE Fortran helpers +# If a single subroutine uses multiple modules created by Shroud +# some compilers will rightly complain that they each define this function. +# "Procedure shroud_copy_string_and_free has more than one interface accessible +# by use association. The interfaces are assumed to be the same." +# It should be marked PRIVATE to prevent users from calling it directly. +# However, gfortran does not like that. +# "Symbol 'shroud_copy_string_and_free' at (1) is marked PRIVATE but has been given +# the binding label 'ShroudCopyStringAndFree'" +# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49111 +# Instead, mangle the name with C_prefix. +# See FHelpers copy_string +# +# This also applies to derived types which are bind(C). + + from . import typemap from . import util @@ -115,18 +131,20 @@ def add_external_helpers(): ######################################## name = "capsule_dtor" fmt.hname = name + fmt.hnamefunc = wformat("{C_prefix}SHROUD_capsule_dtor", fmt) FHelpers[name] = dict( dependent_helpers=["capsule_data_helper"], + name=fmt.hnamefunc, interface=wformat( """ interface+ ! helper {hname} ! Delete memory in a capsule. -subroutine SHROUD_capsule_dtor(ptr)\tbind(C, name="{C_memory_dtor_function}")+ +subroutine {hnamefunc}(ptr)\tbind(C, name="{C_memory_dtor_function}")+ import {F_capsule_data_type} implicit none type({F_capsule_data_type}), intent(INOUT) :: ptr --end subroutine SHROUD_capsule_dtor +-end subroutine {hnamefunc} -end interface""", fmt, ), @@ -195,21 +213,23 @@ def add_external_helpers(): # Fortran interface for above function. # Deal with allocatable character + fmt.hnamefunc = wformat("{C_prefix}SHROUD_copy_string_and_free", fmt) FHelpers[name] = dict( dependent_helpers=["array_context"], + name=fmt.hnamefunc, interface=wformat( """ interface+ ! helper {hname} ! Copy the char* or std::string in context into c_var. -subroutine SHROUD_copy_string_and_free(context, c_var, c_var_size) & +subroutine {hnamefunc}(context, c_var, c_var_size) & bind(c,name="{C_prefix}ShroudCopyStringAndFree")+ use, intrinsic :: iso_c_binding, only : C_CHAR, C_SIZE_T import {F_array_type} type({F_array_type}), intent(IN) :: context character(kind=C_CHAR), intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size --end subroutine SHROUD_copy_string_and_free +-end subroutine {hnamefunc} -end interface""", fmt, ), @@ -535,13 +555,14 @@ def add_capsule_helper(): ######################################## name = "capsule_helper" fmt.hname = name + fmt.__helper = FHelpers["capsule_dtor"]["name"] # XXX split helper into to parts, one for each derived type helper = dict( dependent_helpers=["capsule_data_helper", "capsule_dtor"], derived_type=wformat( """ ! helper {hname} -type {F_capsule_type}+ +type :: {F_capsule_type}+ private type({F_capsule_data_type}) :: mem -contains @@ -557,12 +578,12 @@ def add_capsule_helper(): ! finalize a static {F_capsule_data_type} subroutine {F_capsule_final_function}(cap)+ type({F_capsule_type}), intent(INOUT) :: cap -call SHROUD_capsule_dtor(cap%mem) +call {__helper}(cap%mem) -end subroutine {F_capsule_final_function} subroutine {F_capsule_delete_function}(cap)+ class({F_capsule_type}) :: cap -call SHROUD_capsule_dtor(cap%mem) +call {__helper}(cap%mem) -end subroutine {F_capsule_delete_function}""", fmt, ), @@ -641,6 +662,7 @@ def add_copy_array_helper(fmt, ntypemap): """Create Fortran interface to helper function which copies an array based on c_type. Each interface calls the same C helper. + Used with sgroup="native" types. The function has C_prefix in the name since it is not file static. This allows multiple wrapped libraries to coexist. @@ -656,23 +678,24 @@ def add_copy_array_helper(fmt, ntypemap): name = wformat("copy_array_{flat_name}", fmt) fmt.hname = name - fmt.hnamefunc = name + fmt.hnamefunc = wformat("{C_prefix}SHROUD_{hname}", fmt) helper = dict( # XXX when f_kind == C_SIZE_T dependent_helpers=["array_context"], + name=fmt.hnamefunc, interface=wformat( """ interface+ ! helper {hname} ! Copy contents of context into c_var. -subroutine SHROUD_{hnamefunc}(context, c_var, c_var_size) &+ +subroutine {hnamefunc}(context, c_var, c_var_size) &+ bind(C, name="{C_prefix}ShroudCopyArray") use iso_c_binding, only : {f_kind}, C_SIZE_T import {F_array_type} type({F_array_type}), intent(IN) :: context {f_type}, intent(OUT) :: c_var(*) integer(C_SIZE_T), value :: c_var_size --end subroutine SHROUD_{hnamefunc} +-end subroutine {hnamefunc} -end interface""", fmt, ), @@ -683,9 +706,10 @@ def add_copy_array_helper(fmt, ntypemap): def add_to_PyList_helper(fmt, ntypemap): """Add helpers to work with Python lists. Several helpers are created based on the type of arg. + Used with sgroup="native" types. Args: - fmt - util.Scope + fmt - util.Scope, parent is newlibrary ntypemap - typemap.Typemap """ flat_name = ntypemap.flat_name @@ -698,7 +722,10 @@ def add_to_PyList_helper(fmt, ntypemap): if ntypemap.PY_ctor is not None: fmt.hname = name fmt.fcn_suffix = flat_name - fmt.Py_ctor = ntypemap.PY_ctor.format(ctor_expr="in[i]") + ctor_expr = "in[i]" + if ntypemap.py_ctype is not None: + ctor_expr = ntypemap.pytype_to_pyctor.format(ctor_expr=ctor_expr) + fmt.Py_ctor = ntypemap.PY_ctor.format(ctor_expr=ctor_expr) fmt.c_const="const " helper = create_to_PyList(fmt) CHelpers[name] = create_to_PyList(fmt) @@ -707,7 +734,10 @@ def add_to_PyList_helper(fmt, ntypemap): # Used with intent(inout) name = "update_PyList_" + flat_name if ntypemap.PY_ctor is not None: - fmt.Py_ctor = ntypemap.PY_ctor.format(ctor_expr="in[i]") + ctor_expr = "in[i]" + if ntypemap.py_ctype is not None: + ctor_expr = ntypemap.pytype_to_pyctor.format(ctor_expr=ctor_expr) + fmt.Py_ctor = ntypemap.PY_ctor.format(ctor_expr=ctor_expr) fmt.hname = name fmt.hnameproto = wformat( "void {PY_helper_prefix}{hname}\t(PyObject *out, {c_type} *in, size_t size)", fmt) @@ -739,6 +769,11 @@ def add_to_PyList_helper(fmt, ntypemap): fmt.hname = name fmt.flat_name = flat_name fmt.fcn_type = ntypemap.c_type + fmt.py_ctype = fmt.c_type + fmt.work_ctor = "cvalue" + if ntypemap.py_ctype is not None: + fmt.py_ctype = ntypemap.py_ctype + fmt.work_ctor = ntypemap.pytype_to_cxx.format(work_var=fmt.work_ctor) fmt.Py_get_obj = ntypemap.PY_get.format(py_var="obj") fmt.Py_get = ntypemap.PY_get.format(py_var="item") CHelpers[name] = fill_from_PyObject_list(fmt) @@ -801,7 +836,8 @@ def fill_from_PyObject_list(fmt): fmt.hnamefunc = wformat( "{PY_helper_prefix}fill_from_PyObject_{flat_name}_list", fmt) fmt.hnameproto = wformat( - "int {hnamefunc}\t(PyObject *obj,\t const char *name,\t {c_type} *in,\t Py_ssize_t insize)", fmt) + "int {hnamefunc}\t(PyObject *obj,\t const char *name,\t " + "{c_type} *in,\t Py_ssize_t insize)", fmt) helper = dict( name=fmt.hnamefunc, proto=fmt.hnameproto + ";", @@ -813,11 +849,11 @@ def fill_from_PyObject_list(fmt): // Return 0 on success, -1 on error. {PY_helper_static}{hnameproto} {{+ -{c_type} value = {Py_get_obj}; +{py_ctype} cvalue = {Py_get_obj}; if (!PyErr_Occurred()) {{+ // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) {{+ -in[i] = value; +in[i] = {work_ctor}; -}} return 0; -}} @@ -835,12 +871,13 @@ def fill_from_PyObject_list(fmt): -}} for (Py_ssize_t i = 0; i < size; ++i) {{+ PyObject *item = PySequence_Fast_GET_ITEM(seq, i); -in[i] = {Py_get}; +cvalue = {Py_get}; if (PyErr_Occurred()) {{+ Py_DECREF(seq); PyErr_Format(PyExc_TypeError,\t "argument '%s', index %d must be {fcn_type}",\t name,\t (int) i); return -1; -}} +in[i] = {work_ctor}; -}} Py_DECREF(seq); return 0; @@ -871,11 +908,11 @@ def fill_from_PyObject_numpy(fmt): // Return 0 on success, -1 on error. {PY_helper_static}{hnameproto} {{+ -{c_type} value = {Py_get_obj}; +{py_ctype} cvalue = {Py_get_obj}; if (!PyErr_Occurred()) {{+ // Broadcast scalar. for (Py_ssize_t i = 0; i < insize; ++i) {{+ -in[i] = value; +in[i] = {work_ctor}; -}} return 0; -}} @@ -963,13 +1000,14 @@ def create_get_from_object_list(fmt): {c_type} *in = {cast_static}{c_type} *{cast1}{stdlib}malloc(size * sizeof({c_type})){cast2}; for (Py_ssize_t i = 0; i < size; i++) {{+ PyObject *item = PySequence_Fast_GET_ITEM(seq, i); -in[i] = {Py_get}; +{c_type} cvalue = {Py_get}; if (PyErr_Occurred()) {{+ {stdlib}free(in); Py_DECREF(seq); PyErr_Format(PyExc_TypeError,\t "argument '%s', index %d must be {fcn_type}",\t value->name,\t (int) i); return 0; -}} +in[i] = {work_ctor}; -}} Py_DECREF(seq); @@ -1073,6 +1111,7 @@ def create_get_from_object_list_charptr(fmt): def add_to_PyList_helper_vector(fmt, ntypemap): """Add helpers to work with Python lists. Several helpers are created based on the type of arg. + Used with sgroup="native" types. Args: fmt - util.Scope @@ -1080,13 +1119,17 @@ def add_to_PyList_helper_vector(fmt, ntypemap): """ flat_name = ntypemap.flat_name fmt.c_type = ntypemap.c_type + fmt.cxx_type = ntypemap.cxx_type # Used with intent(out) name = "to_PyList_vector_" + flat_name ctor = ntypemap.PY_ctor if ctor is None: ctor = "XXXPy_ctor" - fmt.Py_ctor = ctor.format(ctor_expr="in[i]") + ctor_expr = "in[i]" + if ntypemap.py_ctype is not None: + ctor_expr = ntypemap.pytype_to_pyctor.format(ctor_expr=ctor_expr) + fmt.Py_ctor = ctor.format(ctor_expr=ctor_expr) fmt.hname = name fmt.hnamefunc = wformat("{PY_helper_prefix}{hname}", fmt) fmt.hnameproto = wformat("PyObject *{hnamefunc}\t(std::vector<{c_type}> & in)", fmt) @@ -1115,7 +1158,10 @@ def add_to_PyList_helper_vector(fmt, ntypemap): ctor = ntypemap.PY_ctor if ctor is None: ctor = "XXXPy_ctor" - fmt.Py_ctor = ctor.format(ctor_expr="in[i]") + ctor_expr = "in[i]" + if ntypemap.py_ctype is not None: + ctor_expr = ntypemap.pytype_to_pyctor.format(ctor_expr=ctor_expr) + fmt.Py_ctor = ctor.format(ctor_expr=ctor_expr) fmt.hname = name fmt.hnamefunc = wformat( "{PY_helper_prefix}{hname}", fmt) @@ -1151,12 +1197,18 @@ def add_to_PyList_helper_vector(fmt, ntypemap): get = ntypemap.PY_get if get is None: get = "XXXPy_get" - fmt.Py_get = get.format(py_var="item") + py_var = "item" + fmt.Py_get = get.format(py_var=py_var) + fmt.py_ctype = fmt.c_type; + fmt.work_ctor = "cvalue" + if ntypemap.py_ctype is not None: + fmt.py_ctype = ntypemap.py_ctype + fmt.work_ctor = ntypemap.pytype_to_cxx.format(work_var=fmt.work_ctor) fmt.hname = name fmt.hnamefunc= wformat( "{PY_helper_prefix}{hname}", fmt) fmt.hnameproto = wformat( - "int {hnamefunc}\t(PyObject *obj,\t const char *name,\t std::vector<{c_type}> & in)", fmt) + "int {hnamefunc}\t(PyObject *obj,\t const char *name,\t std::vector<{cxx_type}> & in)", fmt) helper = dict( name=fmt.hnamefunc, ##- cxx_include="", # malloc/free @@ -1164,7 +1216,7 @@ def add_to_PyList_helper_vector(fmt, ntypemap): cxx_source=wformat( """ // helper {hname} -// Convert obj into an array of type {c_type} +// Convert obj into an array of type {cxx_type} // Return -1 on error. {PY_helper_static}{hnameproto} {{+ @@ -1176,12 +1228,13 @@ def add_to_PyList_helper_vector(fmt, ntypemap): Py_ssize_t size = PySequence_Fast_GET_SIZE(seq); for (Py_ssize_t i = 0; i < size; i++) {{+ PyObject *item = PySequence_Fast_GET_ITEM(seq, i); -in.push_back({Py_get}); +{py_ctype} cvalue = {Py_get}; if (PyErr_Occurred()) {{+ Py_DECREF(seq); PyErr_Format(PyExc_ValueError,\t "argument '%s', index %d must be {c_type}",\t name,\t (int) i); return -1; -}} +in.push_back({work_ctor}); -}} Py_DECREF(seq); return 0; diff --git a/shroud/wrapc.py b/shroud/wrapc.py index 8a328a140..f1ed34505 100644 --- a/shroud/wrapc.py +++ b/shroud/wrapc.py @@ -735,9 +735,9 @@ def set_fmt_fields(self, cls, fcn, ast, ntypemap, fmt, is_func): Args: cls - ast.ClassNode or None of enclosing class. fcn - ast.FunctionNode of calling function. - ast - - ntypemap - - fmt - + ast - declast.Declaration + ntypemap - typemap.Typemap + fmt - scope.Util is_func - True if function. """ diff --git a/shroud/wrapf.py b/shroud/wrapf.py index eca0c2915..16001f478 100644 --- a/shroud/wrapf.py +++ b/shroud/wrapf.py @@ -1349,6 +1349,11 @@ def add_code_from_statements( """ self.update_f_module(modules, imports, intent_blk.f_module) + if intent_blk.c_helper: + fileinfo.add_c_helper(intent_blk.c_helper, fmt) + if intent_blk.f_helper: + fileinfo.add_f_helper(intent_blk.f_helper, fmt) + if declare is not None and intent_blk.declare: need_wrapper = True for line in intent_blk.declare: @@ -1364,10 +1369,9 @@ def add_code_from_statements( for line in intent_blk.post_call: append_format(post_call, line, fmt) - if intent_blk.c_helper: - fileinfo.add_c_helper(intent_blk.c_helper, fmt) - if intent_blk.f_helper: - fileinfo.add_f_helper(intent_blk.f_helper, fmt) + # this catches stuff like a bool to logical conversion which + # requires the wrapper + need_wrapper = need_wrapper or intent_blk.need_wrapper return need_wrapper def set_fmt_fields(self, cls, fcn, f_ast, c_ast, fmt, modules, fileinfo, @@ -1549,10 +1553,6 @@ def wrap_function_impl(self, cls, node, fileinfo): fmt_func.F_result = f_result_blk.result fmt_func.F_result_clause = "\fresult(%s)" % fmt_func.F_result - # this catches stuff like a bool to logical conversion which - # requires the wrapper - need_wrapper = need_wrapper or f_result_blk.need_wrapper - if cls: need_wrapper = True is_static = "static" in ast.storage @@ -2322,8 +2322,13 @@ def add_c_helper(self, helpers, fmt): self.c_helper[helper] = True def add_f_helper(self, helpers, fmt): - """Add a list of Fortran helpers.""" + """Add a list of Fortran helpers. + Add fmt.hnamefuncX for use by pre_call and post_call. + """ f_helper = wformat(helpers, fmt) - for helper in f_helper.split(): + for i, helper in enumerate(f_helper.split()): self.f_helper[helper] = True + setattr(fmt, "hnamefunc" + str(i), + whelpers.FHelpers[helper].get("name", helper)) + diff --git a/shroud/wrapp.py b/shroud/wrapp.py index 051c4e47a..0d54de882 100644 --- a/shroud/wrapp.py +++ b/shroud/wrapp.py @@ -14,6 +14,8 @@ Variables prefixes used by generated code: SH_ C or C++ version of argument SHPy_ Python object which corresponds to the argument {py_var} +SHCPy_ Python API variable which corresponds to the argument's py_ctype {ctype_var} + Used with Py_complex. SHTPy_ A temporary object, usually from PyArg_Parse to be converted to SHPy_ object. {pytmp_var} SHData_ Data of NumPy object (fmt.data_var} - intermediate variable @@ -48,12 +50,15 @@ # If multiple values are returned, save up into to build a tuple to return. # else build value from ctor, then return ctorvar. -# The value may be built earlier (bool, array), if so ctor will be None. -# format - Format arg to PyBuild_Tuple -# vargs - Variable for PyBuild_Tuple -# ctor - Code to construct a Python object -# ctorvar - Variable created by ctor -BuildTuple = collections.namedtuple("BuildTuple", "format vargs blk ctorvar") +# The value may be built earlier (bool, array), if so blk0 will be None. +# format - Format arg to PyBuild_Tuple. +# vargs - Variable for PyBuild_Tuple. +# blk0 - PyStmts when there is only one return value. +# blk - PyStmts when there are more than one return value. +# ctorvar - Variable created by blk0. +# This may not be the function return value but may be +# from a single intent(out) argument. +BuildTuple = collections.namedtuple("BuildTuple", "format vargs blk0 blk ctorvar") # type_object_creation - code to add variables to module. ModuleTuple = collections.namedtuple( @@ -144,6 +149,7 @@ def wrap_library(self): fmt_library.PY_used_param_kwds = False fmt_library.PY_member_object = "XXXPY_member_object" fmt_library.PY_member_data = "XXXPY_member_data" + fmt_library.py_ctype = None fmt_library.npy_rank = "0" # number of dimensions fmt_library.npy_dims_var = fmt_library.nullptr # shape variable @@ -986,41 +992,62 @@ def intent_out(self, typemap, intent_blk, fmt): intent_blk - fmt - format dictionary - NumPy intent(OUT) arguments will create a Python object as part of pre-call. + Create code to return out argument as a PyObject. + If there are multiple out arguments, then Py_BuildValue + will be used to create a tuple of values, so the + code in blk may not be used in the wrapper. + Return a BuildTuple instance. """ + blk = None + if intent_blk.object_created: # Explicit code exists to create object. + # For example, NumPy intent(OUT) arguments as part of pre-call. # If post_call is None, the Object has already been created build_format = "O" vargs = fmt.py_var - blk = None - ctorvar = fmt.py_var + blk0 = None else: # Decide values for Py_BuildValue build_format = typemap.PY_build_format or typemap.PY_format vargs = typemap.PY_build_arg if not vargs: vargs = "{cxx_var}" - vargs = wformat(vargs, fmt) if typemap.PY_ctor: - declare = "{PyObject} * {py_var} = {nullptr};" - post_call = "{py_var} = " + typemap.PY_ctor + ";" - ctorvar = fmt.py_var + if typemap.py_ctype: + fmt.ctor_expr = typemap.pytype_to_pyctor.format(ctor_expr=fmt.ctor_expr) + if fmt.py_ctype is None: + # Declare variable unless already declared by intent(inout) + fmt.py_ctype = typemap.py_ctype + fmt.ctype_var = "SHCPY_" + fmt.c_var + declare = [wformat("{py_ctype} {ctype_var};", fmt)] + else: + declare = [] + blk = PyStmts( + declare=declare, + post_call=[ + wformat(typemap.cxx_to_pytype, fmt), + ] + ) + vargs = wformat(vargs, fmt) + ctor = typemap.PY_ctor.format(ctor_expr=fmt.ctor_expr) + declare0 = "{PyObject} * {py_var} = {nullptr};" + post_call0 = "{py_var} = " + ctor + ";" else: # ex. long long does not define PY_ctor. + vargs = wformat(vargs, fmt) fmt.PY_build_format = build_format fmt.vargs = vargs - declare = "{PyObject} * {py_var} = {nullptr};" - post_call = '{py_var} = Py_BuildValue("{PY_build_format}", {vargs});' - ctorvar = fmt.py_var - blk = PyStmts( - declare=[wformat(declare, fmt)], - post_call=[wformat(post_call, fmt)], + declare0 = "{PyObject} * {py_var} = {nullptr};" + post_call0 = '{py_var} = Py_BuildValue("{PY_build_format}", {vargs});' + blk0 = PyStmts( + declare=[wformat(declare0, fmt)], + post_call=[wformat(post_call0, fmt)], ) - return BuildTuple(build_format, vargs, blk, ctorvar) + return BuildTuple(build_format, vargs, blk0, blk, fmt.py_var) def wrap_functions(self, cls, functions, fileinfo): """Wrap functions for a library or class. @@ -1195,10 +1222,11 @@ def wrap_function(self, cls, node, fileinfo): goto_fail = False args = ast.params - arg_names = [] + arg_names = [] # Arguments to function, intent in or inout. arg_offsets = [] arg_implied = [] # Collect implied arguments offset = 0 + npyargs = 0 # Number of intent in or inout arguments. for arg in args: arg_name = arg.name fmt_arg0 = fmtargs.setdefault(arg_name, {}) @@ -1369,6 +1397,8 @@ def wrap_function(self, cls, node, fileinfo): parse_format.append("|") # add once found_optional = True found_default = True + # Since this argument is optional, save current state + # so we can process without this argument. # Cleanup should always do Py_XDECREF instead of # Py_DECREF since PyObject pointers may be NULL due # to different paths of execution in switch statement. @@ -1376,13 +1406,14 @@ def wrap_function(self, cls, node, fileinfo): # call for default arguments (num args, arg string) default_calls.append( ( - len(cxx_call_list), + npyargs, len(post_declare_code), len(post_parse_code), len(pre_call_code), ",\t ".join(cxx_call_list), ) ) + npyargs = npyargs + 1 # Declare C variable - may be PyObject. # add argument to call to PyArg_ParseTypleAndKeywords @@ -1396,8 +1427,8 @@ def wrap_function(self, cls, node, fileinfo): elif arg_typemap.PY_PyTypeObject: # Expect object of given type # cxx_var is declared by py_statements.intent_out.post_parse. - fmt_arg.py_type = arg_typemap.PY_PyObject or "PyObject" - append_format(declare_code, "{py_type} * {py_var};", fmt_arg) + fmt_arg.py_object = arg_typemap.PY_PyObject or "PyObject" + append_format(declare_code, "{py_object} * {py_var};", fmt_arg) pass_var = fmt_arg.cxx_var parse_format.append(arg_typemap.PY_format) parse_format.append("!") @@ -1415,6 +1446,16 @@ def wrap_function(self, cls, node, fileinfo): parse_format.append("&") parse_vargs.append(arg_typemap.PY_from_object) parse_vargs.append("&" + fmt_arg.cxx_var) + elif arg_typemap.py_ctype: + # Python object uses a API type for contents (ex. Py_complex) + fmt_arg.py_ctype = arg_typemap.py_ctype + fmt_arg.ctype_var = "SHCPY_" + fmt_arg.c_var + append_format(declare_code, "{py_ctype} {ctype_var};", fmt_arg) + parse_format.append(arg_typemap.PY_format) + parse_vargs.append("&" + fmt_arg.ctype_var) + fmt_arg.ctype_expr = arg_typemap.pytype_to_cxx.format( + work_var=fmt_arg.ctype_var) + append_format(post_parse_code, "{c_var} = {ctype_expr};", fmt_arg) else: parse_format.append(arg_typemap.PY_format) parse_vargs.append("&" + fmt_arg.c_var) @@ -1489,7 +1530,7 @@ def wrap_function(self, cls, node, fileinfo): # call with all arguments default_calls.append( ( - len(cxx_call_list), + npyargs, len(post_declare_code), len(post_parse_code), len(pre_call_code), @@ -1534,9 +1575,9 @@ def wrap_function(self, cls, node, fileinfo): PY_code.append("switch (SH_nargs) {") # build up code for a function - for nargs, post_declare_len, post_parse_len, pre_call_len, call_list in default_calls: + for npyargs, post_declare_len, post_parse_len, pre_call_len, call_list in default_calls: if found_default: - PY_code.append("case %d:" % nargs) + PY_code.append("case %d:" % npyargs) PY_code.append(1) need_blank = False if post_declare_len or post_parse_len or pre_call_len: @@ -1650,17 +1691,24 @@ def wrap_function(self, cls, node, fileinfo): elif not build_tuples: return_code = "Py_RETURN_NONE;" elif len(build_tuples) == 1: - # return a single object already created in build_stmts - blk = build_tuples[0].blk - if blk is not None: - declare_code.extend(blk.declare) - post_call_code.extend(blk.post_call) + # Return a single object already created in build_tuples + blk0 = build_tuples[0].blk0 + if blk0 is not None: + # Format variables are already expanded in intent_out. + declare_code.extend(blk0.declare) + post_call_code.extend(blk0.post_call) fmt.py_var = build_tuples[0].ctorvar return_code = wformat("return (PyObject *) {py_var};", fmt) else: # fmt=format for function. Do not use fmt_result here. # There may be no return value, only intent(OUT) arguments. # create tuple object + for blk in build_tuples: + if blk.blk is None: + continue + # Format variables are already expanded in intent_out. + declare_code.extend(blk.blk.declare) + post_call_code.extend(blk.blk.post_call) fmt.PyBuild_format = "".join([ttt.format for ttt in build_tuples]) fmt.PyBuild_vargs = ",\t ".join([ttt.vargs for ttt in build_tuples]) rv_blk = PyStmts( @@ -4158,6 +4206,10 @@ def to_dict(self): dict( name="py_string_scalar_in", cxx_local_var="scalar", + arg_declare=[ + # std::string defaults to making this scalar. Make sure it is pointer. + "char * {c_var};", + ], post_declare=["{c_const}std::string {cxx_var}({c_var});"], fmtdict=dict( ctor_expr="{cxx_var}{cxx_member}data(),\t {cxx_var}{cxx_member}size()",