mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-08-26 07:01:46 +02:00
Handle some strings
This commit is contained in:
parent
b34532d7d9
commit
ec98c3f19f
@ -11,25 +11,22 @@
|
|||||||
/* Include stdint to recognize types from stdint.h */
|
/* Include stdint to recognize types from stdint.h */
|
||||||
%include <stdint.i>
|
%include <stdint.i>
|
||||||
|
|
||||||
|
/* Include typemaps to play with input/output re-casting (e.g. C pointers) */
|
||||||
/* Include typemaps to play with input/output re-casting
|
|
||||||
Useful when working with C pointers
|
|
||||||
*/
|
|
||||||
%include typemaps.i
|
%include typemaps.i
|
||||||
|
|
||||||
/* Return TREXIO exit code from trexio_open as part of the output tuple */
|
|
||||||
%apply int *OUTPUT { qmckl_exit_code *exit_code};
|
%apply int *OUTPUT { qmckl_exit_code *exit_code};
|
||||||
|
|
||||||
/* This enables access to trexio_[...]_read_dset_str_low set of functions
|
/* Avoid passing file_name length as an additiona argument */
|
||||||
in order to return one long string with TREXIO_DELIM delimeter as 2-nd argument of output tuple
|
%apply (char *STRING, int LENGTH) { (const char* file_name, const int64_t size_max) };
|
||||||
*/
|
|
||||||
|
/* For functions that return strings */
|
||||||
%include <cstring.i>
|
%include <cstring.i>
|
||||||
|
|
||||||
|
%cstring_bounded_output(char* function_name, 1024);
|
||||||
|
%cstring_bounded_output(char* message, 1024);
|
||||||
|
|
||||||
/* This block is needed make SWIG treat (double * dset_out|_in, int64_t dim_out|_in) pattern
|
/* This block is needed make SWIG convert NumPy arrays to/from from the C pointer and size_max argument.
|
||||||
as a special case in order to return the NumPy array to Python from C pointer to array
|
NOTE: `numpy.i` interface file is not part of SWIG but it is included in the numpy distribution (under numpy/tools/swig/numpy.i)
|
||||||
provided by trexio_read_safe_[dset_num] function.
|
|
||||||
NOTE: numpy.i is currently not part of SWIG but included in the numpy distribution (under numpy/tools/swig/numpy.i)
|
|
||||||
*/
|
*/
|
||||||
%include "numpy.i"
|
%include "numpy.i"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user