35#define SWIG_TYPE_TABLE swiglal
47%feature(
"autodoc", 1);
57#define INT64_C(c) c ## LL
58#define UINT64_C(c) c ## ULL
70#define SWIGLAL(...) %swiglal_public_##__VA_ARGS__
71#define SWIGLAL_CLEAR(...) %swiglal_public_clear_##__VA_ARGS__
80%define %swiglal_define2(NAME1, NAME2)
81%define NAME1##
_##NAME2 %enddef
88%define %_swiglal_map(MACRO, X, ...)
91%_swiglal_map(MACRO, __VA_ARGS__);
94%define %swiglal_map(MACRO, ...)
95%_swiglal_map(MACRO, __VA_ARGS__, );
102%define %_swiglal_map_a(MACRO, A, X, ...)
105%_swiglal_map_a(MACRO, A, __VA_ARGS__);
108%define %swiglal_map_a(MACRO, A, ...)
109%_swiglal_map_a(MACRO, A, __VA_ARGS__, );
116%define %_swiglal_map_ab(MACRO, A, B, X, ...)
119%_swiglal_map_ab(MACRO, A, B, __VA_ARGS__);
122%define %swiglal_map_ab(MACRO, A, B, ...)
123%_swiglal_map_ab(MACRO, A, B, __VA_ARGS__, );
130%define %_swiglal_map_abc(MACRO, A, B, C, X, ...)
133%_swiglal_map_abc(MACRO, A, B, C, __VA_ARGS__);
136%define %swiglal_map_abc(MACRO, A, B, C, ...)
137%_swiglal_map_abc(MACRO, A, B, C, __VA_ARGS__, );
143%define %swiglal_apply(TYPEMAP,
TYPE, NAME)
144%apply TYPEMAP {
TYPE NAME };
146%define %swiglal_clear(
TYPE, NAME)
153%define %swiglal_feature(FEATURE, VALUE, NAME)
154%feature(FEATURE, VALUE) NAME;
156%define %swiglal_feature_nspace(FEATURE, VALUE, NSPACE, NAME)
157%feature(FEATURE, VALUE) NSPACE::NAME;
163%define %swiglal_warnfilter(WARNING, NAME)
164%warnfilter(WARNING) NAME;
166%define %swiglal_warnfilter_nspace(WARNING, NSPACE, NAME)
167%warnfilter(WARNING) NSPACE::NAME;
173%define %swiglal_ignore_nspace(NSPACE, NAME)
181#define %swiglal_new_instance(TYPE...) %reinterpret_cast(XLALCalloc(1, sizeof(TYPE)), TYPE*)
182#define %swiglal_new_copy(VAL, TYPE...) %reinterpret_cast(memcpy(%swiglal_new_instance(TYPE), &(VAL), sizeof(TYPE)), TYPE*)
183#define %swiglal_new_array(SIZE, TYPE...) %reinterpret_cast(XLALCalloc(SIZE, sizeof(TYPE)), TYPE*)
184#define %swiglal_new_copy_array(PTR, SIZE, TYPE...) %reinterpret_cast(memcpy(%swiglal_new_array(SIZE, TYPE), PTR, sizeof(TYPE)*(SIZE)), TYPE*)
217%rename(
"$ignore", regexmatch$name=
"^SWIGLAL_")
"";
218%include <swiglal_config.h>
220#include <swiglal_config.h>
226#ifdef SWIGLAL_HAVE_LIBGSL
228#include <gsl/gsl_errno.h>
229#include <gsl/gsl_math.h>
230#include <gsl/gsl_complex_math.h>
231#include <gsl/gsl_vector.h>
232#include <gsl/gsl_matrix.h>
233#include <gsl/gsl_rng.h>
240#ifdef SWIGLAL_HAVE_LIBGSL
242SWIGINTERNINLINE gsl_complex_float gsl_complex_float_rect(
float x,
float y) {
244 GSL_SET_COMPLEX(&z,
x,
y);
254%include <
lal/LALStddef.h>
260#include <lal/LALDatatypes.h>
261#include <lal/LALMalloc.h>
262#include <lal/LALString.h>
263#include <lal/XLALError.h>
270%constant
int swig_version = SWIG_VERSION;
275%constant
const char *
const swig_runtime_version = SWIG_RUNTIME_VERSION;
307static int swiglal_save_stdout_fd, swiglal_save_stderr_fd;
308static FILE *swiglal_tmp_stdout, *swiglal_tmp_stderr;
310SWIGINTERN
int swiglal_redirect_stdouterr(
void);
311SWIGINTERN
int swiglal_restore_stdouterr(
void);
312SWIGINTERN
int swiglal_output_stdouterr(
void);
314#define SWIGLAL_REDIRECT_STDOUTERR \
316 const int local_swig_lal_do_redirect_stdouterr = swig_lal_has_stdouterr_been_redirected ? 0 : swig_lal_do_redirect_stdouterr; \
317 if (local_swig_lal_do_redirect_stdouterr) { \
318 swig_lal_has_stdouterr_been_redirected = 1; \
319 if (!swiglal_redirect_stdouterr()) { \
320 SWIG_exception(SWIG_RuntimeError, "swiglal_redirect_stdouterr() failed"); \
323#define SWIGLAL_RESTORE_OUTPUT_STDOUTERR \
324 if (local_swig_lal_do_redirect_stdouterr) { \
325 if (!swiglal_restore_stdouterr()) {\
326 SWIG_exception(SWIG_RuntimeError, "swiglal_restore_stdouterr() failed"); \
328 if (!swiglal_output_stdouterr()) { \
329 SWIG_exception(SWIG_RuntimeError, "swiglal_output_stdouterr() failed"); \
331 swig_lal_has_stdouterr_been_redirected = 0; \
335SWIGINTERN
int swiglal_redirect_stdouterr(
void) {
339 fsync(STDOUT_FILENO);
341 fsync(STDERR_FILENO);
344 swiglal_save_stdout_fd = dup(STDOUT_FILENO);
345 swiglal_save_stderr_fd = dup(STDERR_FILENO);
346 if (swiglal_save_stdout_fd < 0 || swiglal_save_stderr_fd < 0) {
347 const char msg[] =
"redirect_stdouterr(): dup(STD{OUT|ERR}_FILENO) failed\n";
348 write(STDERR_FILENO, msg,
sizeof(msg));
349 fsync(STDERR_FILENO);
354 swiglal_tmp_stdout = tmpfile();
355 swiglal_tmp_stderr = tmpfile();
356 if (swiglal_tmp_stdout == NULL || swiglal_tmp_stderr == NULL) {
357 const char msg[] =
"redirect_stdouterr(): tmpfile() failed\n";
358 write(STDERR_FILENO, msg,
sizeof(msg));
359 fsync(STDERR_FILENO);
360 close(swiglal_save_stdout_fd);
361 close(swiglal_save_stderr_fd);
362 if (swiglal_tmp_stdout != NULL) {
363 fclose(swiglal_tmp_stdout);
365 if (swiglal_tmp_stderr != NULL) {
366 fclose(swiglal_tmp_stderr);
372 int swiglal_tmp_stdout_fd = fileno(swiglal_tmp_stdout);
373 int swiglal_tmp_stderr_fd = fileno(swiglal_tmp_stderr);
374 if (swiglal_tmp_stdout_fd < 0 || swiglal_tmp_stderr_fd < 0) {
375 const char msg[] =
"redirect_stdouterr(): fileno(tmp_std{out|err}) failed\n";
376 write(STDERR_FILENO, msg,
sizeof(msg));
377 fsync(STDERR_FILENO);
378 close(swiglal_save_stdout_fd);
379 close(swiglal_save_stderr_fd);
380 fclose(swiglal_tmp_stdout);
381 fclose(swiglal_tmp_stderr);
386 if (dup2(swiglal_tmp_stdout_fd, STDOUT_FILENO) < 0) {
387 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_tmp_stdout_fd, STDOUT_FILENO) failed\n";
388 write(STDERR_FILENO, msg,
sizeof(msg));
389 fsync(STDERR_FILENO);
390 close(swiglal_save_stdout_fd);
391 close(swiglal_save_stderr_fd);
392 fclose(swiglal_tmp_stdout);
393 fclose(swiglal_tmp_stderr);
396 if (dup2(swiglal_tmp_stderr_fd, STDERR_FILENO) < 0) {
397 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_tmp_stderr_fd, STDERR_FILENO) failed\n";
398 write(STDERR_FILENO, msg,
sizeof(msg));
399 fsync(STDERR_FILENO);
400 if (dup2(swiglal_save_stdout_fd, STDOUT_FILENO) < 0) {
401 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_save_stdout_fd, STDOUT_FILENO) failed\n";
402 write(STDERR_FILENO, msg,
sizeof(msg));
403 fsync(STDERR_FILENO);
405 close(swiglal_save_stdout_fd);
406 close(swiglal_save_stderr_fd);
407 fclose(swiglal_tmp_stdout);
408 fclose(swiglal_tmp_stderr);
416SWIGINTERN
int swiglal_restore_stdouterr(
void) {
420 fsync(STDOUT_FILENO);
422 fsync(STDERR_FILENO);
425 if (dup2(swiglal_save_stdout_fd, STDOUT_FILENO) < 0) {
426 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_save_stdout_fd, STDOUT_FILENO) failed\n";
427 write(swiglal_save_stderr_fd, msg,
sizeof(msg));
428 fsync(swiglal_save_stderr_fd);
431 if (dup2(swiglal_save_stderr_fd, STDERR_FILENO) < 0) {
432 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_save_stderr_fd, STDERR_FILENO) failed\n";
433 write(swiglal_save_stderr_fd, msg,
sizeof(msg));
434 fsync(swiglal_save_stderr_fd);
439 close(swiglal_save_stdout_fd);
440 close(swiglal_save_stderr_fd);
465static const LALStatus swiglal_empty_LALStatus = {0, NULL, NULL, NULL, NULL, 0, NULL, 0};
466#undef swiglal_check_LALStatus
468%typemap(in, noblock=1, numinputs=0)
LALStatus* {
469 LALStatus lalstatus = swiglal_empty_LALStatus;
471%#define swiglal_check_LALStatus
475 SWIGLAL_REDIRECT_STDOUTERR
477 SWIGLAL_RESTORE_OUTPUT_STDOUTERR
478#ifdef swiglal_check_LALStatus
479 if (lalstatus.statusCode) {
481 SWIG_exception(SWIG_RuntimeError, lalstatus.statusDescription);
488#undef swiglal_check_LALStatus
498%fragment(
"swiglal_empty_frag",
"header") {}
506%fragment(
"swiglal_from_SWIGTYPE",
"header") {
507 SWIGINTERNINLINE SWIG_Object swiglal_from_SWIGTYPE(SWIG_Object self,
bool copyobj,
void *ptr,
size_t len,
bool isptr, swig_type_info *tinfo,
int tflags) {
508 void *vptr = isptr ? *((
void**)ptr) : ptr;
511 tflags |= SWIG_POINTER_OWN;
512 }
else if (vptr != NULL && swiglal_not_empty(self)) {
513 swiglal_store_parent(vptr, self);
514 tflags |= SWIG_POINTER_OWN;
516 return SWIG_NewPointerObj(vptr, tinfo, tflags);
519%fragment(
"swiglal_as_SWIGTYPE",
"header") {
520 SWIGINTERN
int swiglal_as_SWIGTYPE(SWIG_Object self, SWIG_Object obj,
void *ptr,
size_t len,
bool isptr, swig_type_info *tinfo,
int tflags) {
522 int res = SWIG_ConvertPtr(obj, &vptr, tinfo, tflags);
523 if (!SWIG_IsOK(res)) {
526 memcpy(ptr, isptr ? &vptr : vptr, len);
546%define %swiglal_struct_call_dtor(DTORFUNC, PTR)
547if (swiglal_release_parent(PTR)) {
556%define %swiglal_struct_extend(TAGNAME, OPAQUE, DTORFUNC)
569 return %swiglal_new_instance(
struct TAGNAME);
571 TAGNAME(
const struct TAGNAME *
src) {
572 return %swiglal_new_copy(*
src,
struct TAGNAME);
584 %swiglal_struct_call_dtor(
XLALFree, $self);
590 %swiglal_struct_call_dtor(%arg(DTORFUNC), $self);
598%swiglal_struct_extend_specific(TAGNAME, OPAQUE, DTORFUNC)
611%typemap(swiglal_fixarr_ltype) SWIGTYPE
"$ltype";
612%typemap(swiglal_fixarr_ltype) SWIGTYPE[ANY]
"$typemap(swiglal_fixarr_ltype, $*type)";
613%typemap(swiglal_fixarr_ltype) SWIGTYPE[ANY][ANY]
"$typemap(swiglal_fixarr_ltype, $*type)";
615%typemap(swiglal_fixarr_tinfo) SWIGTYPE
"$&descriptor";
616%typemap(swiglal_fixarr_tinfo) SWIGTYPE *
"$descriptor";
617%typemap(swiglal_fixarr_tinfo) SWIGTYPE *
const "$descriptor";
618%typemap(swiglal_fixarr_tinfo) SWIGTYPE[ANY]
"$typemap(swiglal_fixarr_tinfo, $*type)";
619%typemap(swiglal_fixarr_tinfo) SWIGTYPE[ANY][ANY]
"$typemap(swiglal_fixarr_tinfo, $*type)";
621%typemap(swiglal_fixarr_isptr) SWIGTYPE
"false";
622%typemap(swiglal_fixarr_isptr) SWIGTYPE *
"true";
623%typemap(swiglal_fixarr_isptr) SWIGTYPE *
const "true";
624%typemap(swiglal_fixarr_isptr) SWIGTYPE[ANY]
"$typemap(swiglal_fixarr_isptr, $*type)";
625%typemap(swiglal_fixarr_isptr) SWIGTYPE[ANY][ANY]
"$typemap(swiglal_fixarr_isptr, $*type)";
670#define %swiglal_array_copyin_func(ACFTYPE) swiglal_array_copyin_##ACFTYPE
671#define %swiglal_array_copyout_func(ACFTYPE) swiglal_array_copyout_##ACFTYPE
672#define %swiglal_array_viewin_func(ACFTYPE) swiglal_array_viewin_##ACFTYPE
673#define %swiglal_array_viewout_func(ACFTYPE) swiglal_array_viewout_##ACFTYPE
678#define %swiglal_array_copyin_frag(ACFTYPE) "swiglal_array_copyin_" %str(ACFTYPE)
679#define %swiglal_array_copyout_frag(ACFTYPE) "swiglal_array_copyout_" %str(ACFTYPE)
680#define %swiglal_array_viewin_frag(ACFTYPE) "swiglal_array_viewin_" %str(ACFTYPE)
681#define %swiglal_array_viewout_frag(ACFTYPE) "swiglal_array_viewout_" %str(ACFTYPE)
686%fragment(
"swiglal_array_elemfree",
"header")
688 SWIGINTERN
void swiglal_array_elemfree(
void* ptr,
696 if (!(*pelemalloc)) {
702 for (
size_t i = 0; i < ndims; ++i) {
707 for (
size_t i = 0; i < numel; ++i) {
708 void **elemptr = %reinterpret_cast(%reinterpret_cast(ptr,
char*) + i*esize,
void**);
720%define %_swiglal_array_type(ACFTYPE,
TYPE)
721%fragment(
"swiglal_array_frags_" %str(ACFTYPE),
"header",
722 fragment=%swiglal_array_copyin_frag(ACFTYPE),
723 fragment=%swiglal_array_copyout_frag(ACFTYPE),
724 fragment=%swiglal_array_viewin_frag(ACFTYPE),
725 fragment=%swiglal_array_viewout_frag(ACFTYPE),
726 fragment=
"swiglal_array_elemfree") {};
727%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
TYPE* %str(ACFTYPE);
728%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
const TYPE* %str(ACFTYPE);
729%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
TYPE[ANY] %str(ACFTYPE);
730%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
TYPE[ANY][ANY] %str(ACFTYPE);
731%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
const TYPE[ANY] %str(ACFTYPE);
732%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
const TYPE[ANY][ANY] %str(ACFTYPE);
734%define %swiglal_array_type(ACFTYPE, ...)
735%swiglal_map_a(%_swiglal_array_type, ACFTYPE, __VA_ARGS__);
741%swiglal_array_type(SWIGTYPE, SWIGTYPE);
742%swiglal_array_type(LALchar,
char*);
743%swiglal_array_type(int8_t,
char,
signed char, int8_t);
744%swiglal_array_type(uint8_t,
unsigned char, uint8_t);
745%swiglal_array_type(int16_t,
short, int16_t);
746%swiglal_array_type(uint16_t,
unsigned short, uint16_t);
747%swiglal_array_type(int32_t,
int, int32_t,
enum SWIGTYPE);
748%swiglal_array_type(uint32_t,
unsigned int, uint32_t);
749%swiglal_array_type(int64_t,
long long, int64_t);
750%swiglal_array_type(uint64_t,
unsigned long long, uint64_t);
751%swiglal_array_type(
float,
float);
752%swiglal_array_type(
double,
double);
753%swiglal_array_type(gsl_complex_float, gsl_complex_float);
754%swiglal_array_type(gsl_complex, gsl_complex);
761%swiglal_array_type(int32or64_t,
long);
762%swiglal_array_type(uint32or64_t,
unsigned long);
763%define %swiglal_array_int32or64_frags(FRAG,
FUNC, INT)
764%fragment(FRAG(INT##32or64_t),
"header") {
765%#
if LONG_MAX > INT_MAX
766%#define
FUNC(INT##32or64_t)
FUNC(INT##64_t)
768%#define
FUNC(INT##32or64_t)
FUNC(INT##32_t)
772%swiglal_array_int32or64_frags(%swiglal_array_copyin_frag, %swiglal_array_copyin_func,
int);
773%swiglal_array_int32or64_frags(%swiglal_array_copyout_frag, %swiglal_array_copyout_func,
int);
774%swiglal_array_int32or64_frags(%swiglal_array_viewin_frag, %swiglal_array_viewin_func,
int);
775%swiglal_array_int32or64_frags(%swiglal_array_viewout_frag, %swiglal_array_viewout_func,
int);
776%swiglal_array_int32or64_frags(%swiglal_array_copyin_frag, %swiglal_array_copyin_func, uint);
777%swiglal_array_int32or64_frags(%swiglal_array_copyout_frag, %swiglal_array_copyout_func, uint);
778%swiglal_array_int32or64_frags(%swiglal_array_viewin_frag, %swiglal_array_viewin_func, uint);
779%swiglal_array_int32or64_frags(%swiglal_array_viewout_frag, %swiglal_array_viewout_func, uint);
784#define %swiglal_array_copyin(TYPE) %swiglal_array_copyin_func($typemap(swiglal_array_typeid, TYPE))
785#define %swiglal_array_copyout(TYPE) %swiglal_array_copyout_func($typemap(swiglal_array_typeid, TYPE))
786#define %swiglal_array_viewin(TYPE) %swiglal_array_viewin_func($typemap(swiglal_array_typeid, TYPE))
787#define %swiglal_array_viewout(TYPE) %swiglal_array_viewout_func($typemap(swiglal_array_typeid, TYPE))
796%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE[ANY] {
797 $typemap(swiglal_fixarr_ltype, $1_type) temp_array[$1_dim0];
798 const size_t dims[1] = {$1_dim0};
799 const size_t strides[1] = {1};
801 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr(&temp_array[0]), NULL,
802 sizeof(temp_array[0]), 1, dims, strides,
803 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
805 $1 = SWIG_CheckState(res);
807%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE[ANY][ANY] {
808 $typemap(swiglal_fixarr_ltype, $1_type) temp_array[$1_dim0][$1_dim1];
809 const size_t dims[2] = {$1_dim0, $1_dim1};
810 const size_t strides[2] = {$1_dim1, 1};
812 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr(&temp_array[0]), NULL,
813 sizeof(temp_array[0][0]), 2, dims, strides,
814 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
816 $1 = SWIG_CheckState(res);
822%typemap(in, noblock=1) SWIGTYPE[ANY] (
size_t dims[1] = {0},
int elemalloc = 0), SWIGTYPE INOUT[ANY] (
size_t dims[1] = {0},
int elemalloc = 0) {
823 $typemap(swiglal_fixarr_ltype, $1_type) temp_array$argnum[$1_dim0];
824 $1 = &temp_array$argnum[0];
827 const size_t strides[1] = {1};
829 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr($1), &elemalloc,
830 sizeof($1[0]), 1, dims, strides,
831 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
832 $disown | %convertptr_flags);
833 if (!SWIG_IsOK(res)) {
834 %argument_fail(res,
"$type", $symname, $argnum);
838%typemap(freearg, match=
"in", noblock=1) SWIGTYPE[ANY], SWIGTYPE INOUT[ANY] {
839 swiglal_array_elemfree(arg$argnum, &elemalloc$argnum,
sizeof($typemap(swiglal_fixarr_ltype, $1_type)), 1, dims$argnum);
841%typemap(in, noblock=1) SWIGTYPE[ANY][ANY] (
size_t dims[2] = {0, 0},
int elemalloc = 0), SWIGTYPE INOUT[ANY][ANY] (
size_t dims[2] = {0, 0},
int elemalloc = 0) {
842 $typemap(swiglal_fixarr_ltype, $1_type) temp_array$argnum[$1_dim0][$1_dim1];
843 $1 = &temp_array$argnum[0];
845 dims[0] = $1_dim0; dims[1] = $1_dim1;
846 const size_t strides[2] = {$1_dim1, 1};
848 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr($1), &elemalloc,
849 sizeof($1[0][0]), 2, dims, strides,
850 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
851 $disown | %convertptr_flags);
852 if (!SWIG_IsOK(res)) {
853 %argument_fail(res,
"$type", $symname, $argnum);
857%typemap(freearg, match=
"in", noblock=1) SWIGTYPE[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] {
858 swiglal_array_elemfree(arg$argnum, &elemalloc$argnum,
sizeof($typemap(swiglal_fixarr_ltype, $1_type)), 2, dims$argnum);
864%typemap(varin) SWIGTYPE[ANY] {
866 const size_t dims[1] = {$1_dim0};
867 const size_t strides[1] = {1};
869 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr($1), &elemalloc,
870 sizeof($1[0]), 1, dims, strides,
871 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
873 if (!SWIG_IsOK(res)) {
874 %variable_fail(res,
"$type", $symname);
877%typemap(varin) SWIGTYPE[ANY][ANY] {
879 const size_t dims[2] = {$1_dim0, $1_dim1};
880 const size_t strides[2] = {$1_dim1, 1};
882 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr($1), &elemalloc,
883 sizeof($1[0][0]), 2, dims, strides,
884 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
886 if (!SWIG_IsOK(res)) {
887 %variable_fail(res,
"$type", $symname);
894%typemap(out) SWIGTYPE[ANY] {
895 const size_t dims[1] = {$1_dim0};
896 const size_t strides[1] = {1};
898%#
if $owner & SWIG_POINTER_OWN
899 %set_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidptr($1),
900 sizeof($1[0]), 1, dims, strides,
901 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
902 $owner | %newpointer_flags));
904 %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
905 sizeof($1[0]), 1, dims, strides,
906 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
907 $owner | %newpointer_flags));
910%typemap(out) SWIGTYPE[ANY][ANY] {
911 const size_t dims[2] = {$1_dim0, $1_dim1};
912 const size_t strides[2] = {$1_dim1, 1};
914%#
if $owner & SWIG_POINTER_OWN
915 %set_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidptr($1),
916 sizeof($1[0][0]), 2, dims, strides,
917 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
918 $owner | %newpointer_flags));
920 %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
921 sizeof($1[0][0]), 2, dims, strides,
922 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
923 $owner | %newpointer_flags));
930%typemap(varout) SWIGTYPE[ANY] {
931 const size_t dims[1] = {$1_dim0};
932 const size_t strides[1] = {1};
934 %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidptr($1),
935 sizeof($1[0]), 1, dims, strides,
936 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
939%typemap(varout) SWIGTYPE[ANY][ANY] {
940 const size_t dims[2] = {$1_dim0, $1_dim1};
941 const size_t strides[2] = {$1_dim1, 1};
943 %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidptr($1),
944 sizeof($1[0][0]), 2, dims, strides,
945 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
952%typemap(in, noblock=1, numinputs=0) SWIGTYPE OUTPUT[ANY] {
953 $typemap(swiglal_fixarr_ltype, $1_type) temp_array$argnum[$1_dim0];
954 $1 = &temp_array$argnum[0];
956%typemap(argout) SWIGTYPE OUTPUT[ANY], SWIGTYPE INOUT[ANY] {
957 const size_t dims[1] = {$1_dim0};
958 const size_t strides[1] = {1};
960 %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidptr($1),
961 sizeof($1[0]), 1, dims, strides,
962 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
963 SWIG_POINTER_OWN | %newpointer_flags));
965%typemap(in, noblock=1, numinputs=0) SWIGTYPE OUTPUT[ANY][ANY] {
966 $typemap(swiglal_fixarr_ltype, $1_type) temp_array$argnum[$1_dim0][$1_dim1];
967 $1 = &temp_array$argnum[0];
969%typemap(argout) SWIGTYPE OUTPUT[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] {
970 const size_t dims[2] = {$1_dim0, $1_dim1};
971 const size_t strides[2] = {$1_dim1, 1};
973 %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidptr($1),
974 sizeof($1[0][0]), 2, dims, strides,
975 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
976 SWIG_POINTER_OWN | %newpointer_flags));
983%define %swiglal_public_OUTPUT_ARRAY_1D(
TYPE, ...)
984%swiglal_map_ab(%swiglal_apply, SWIGTYPE OUTPUT[ANY],
TYPE, __VA_ARGS__);
986%define %swiglal_public_clear_OUTPUT_ARRAY_1D(
TYPE, ...)
987%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
989%define %swiglal_public_OUTPUT_ARRAY_2D(
TYPE, ...)
990%swiglal_map_ab(%swiglal_apply, SWIGTYPE OUTPUT[ANY][ANY],
TYPE, __VA_ARGS__);
992%define %swiglal_public_clear_OUTPUT_ARRAY_2D(
TYPE, ...)
993%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
996%define %swiglal_public_INOUT_ARRAY_1D(
TYPE, ...)
997%swiglal_map_ab(%swiglal_apply, SWIGTYPE INOUT[ANY],
TYPE, __VA_ARGS__);
999%define %swiglal_public_clear_INOUT_ARRAY_1D(
TYPE, ...)
1000%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1002%define %swiglal_public_INOUT_ARRAY_2D(
TYPE, ...)
1003%swiglal_map_ab(%swiglal_apply, SWIGTYPE INOUT[ANY][ANY],
TYPE, __VA_ARGS__);
1005%define %swiglal_public_clear_INOUT_ARRAY_2D(
TYPE, ...)
1006%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1019%typemap(swiglal_dynarr_tinfo) SWIGTYPE
"$&descriptor";
1020%typemap(swiglal_dynarr_tinfo) SWIGTYPE*
"$descriptor";
1022%typemap(swiglal_dynarr_isptr) SWIGTYPE
"false";
1023%typemap(swiglal_dynarr_isptr) SWIGTYPE*
"true";
1029%define %swiglal_array_dynamic_size(SIZET, NI)
1030%feature(
"action") NI {
1031 result = %static_cast(arg1->NI, SIZET);
1036%feature(
"action",
"") NI;
1042%define %swiglal_array_dynamic_check_strides(NAME,
DATA, I)
1043if (strides[I-1] == 0) {
1044 SWIG_exception_fail(SWIG_IndexError,
"Stride of dimension "#I
" of "#NAME
"."#
DATA" is zero");
1058%define %swiglal_array_dynamic_1D(NAME,
TYPE, SIZET,
DATA, NI, SI)
1062%typemap(in, noblock=1)
TYPE*
DATA (
size_t dims[1] = {0},
int elemalloc = 0) {
1064 dims[0] = %static_cast(NI,
size_t);
1065 const size_t strides[1] = {%static_cast(SI,
size_t)};
1066 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1067 $1 = %reinterpret_cast(arg1->DATA,
TYPE*);
1069 int res = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %as_voidptr($1), &elemalloc,
1070 sizeof(
TYPE), 1, dims, strides,
1071 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1072 $disown | %convertptr_flags);
1073 if (!SWIG_IsOK(res)) {
1074 %argument_fail(res,
"$type", $symname, $argnum);
1078%typemap(freearg, noblock=1)
TYPE*
DATA {
1079 swiglal_array_elemfree(%as_voidptr(arg1->DATA), &elemalloc$argnum,
sizeof(
TYPE), 1, dims$argnum);
1081%typemap(out, noblock=1)
TYPE*
DATA {
1083 const size_t dims[1] = {%static_cast(NI,
size_t)};
1084 const size_t strides[1] = {%static_cast(SI,
size_t)};
1085 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1086 $1 = %reinterpret_cast(arg1->DATA,
TYPE*);
1088 %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
1089 sizeof(
TYPE), 1, dims, strides,
1090 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1091 $owner | %newpointer_flags));
1098%typemap(memberin, noblock=1)
TYPE*
DATA "";
1099%typemap(argout, noblock=1)
TYPE*
DATA "";
1100%typemap(freearg, noblock=1)
TYPE*
DATA "";
1101%feature("action")
DATA "";
1102%feature("except")
DATA "";
1114%feature(
"action",
"")
DATA;
1115%feature("except", "")
DATA;
1124%define %swiglal_array_dynamic_1d_ptr_1d(NAME,
TYPE, SIZET,
DATA, NI, NJ, SJ)
1128%typemap(out, noblock=1)
TYPE*
DATA {
1130 const size_t dims[1] = {%static_cast(NJ,
size_t)};
1131 const size_t strides[1] = {%static_cast(SJ,
size_t)};
1132 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1133 if (((uint64_t)arg2) >= ((uint64_t)NI)) {
1134 SWIG_exception_fail(SWIG_IndexError,
"Index to "#NAME
"."#
DATA" is outside of range [0,"#NI
"]");
1136 $1 = %reinterpret_cast(arg1->DATA,
TYPE*)[arg2];
1138 %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
1139 sizeof(
TYPE), 1, dims, strides,
1140 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1141 $owner | %newpointer_flags));
1148%typemap(memberin, noblock=1)
TYPE*
DATA "";
1149%typemap(argout, noblock=1)
TYPE*
DATA "";
1150%typemap(freearg, noblock=1)
TYPE*
DATA "";
1151%feature("action")
DATA "";
1152%feature("except")
DATA "";
1164%feature(
"action",
"")
DATA;
1165%feature("except", "")
DATA;
1173%define %swiglal_array_dynamic_2D(NAME,
TYPE, SIZET,
DATA, NI, NJ, SI, SJ)
1177%typemap(in, noblock=1)
TYPE*
DATA (
size_t dims[2] = {0, 0},
int elemalloc = 0) {
1179 dims[0] = %static_cast(NI,
size_t); dims[1] = %static_cast(NJ,
size_t);
1180 const size_t strides[2] = {%static_cast(SI,
size_t), %static_cast(SJ,
size_t)};
1181 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1182 %swiglal_array_dynamic_check_strides(NAME,
DATA, 2);
1183 $1 = %reinterpret_cast(arg1->DATA,
TYPE*);
1185 int res = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %as_voidptr($1), &elemalloc,
1186 sizeof(
TYPE), 2, dims, strides,
1187 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1188 $disown | %convertptr_flags);
1189 if (!SWIG_IsOK(res)) {
1190 %argument_fail(res,
"$type", $symname, $argnum);
1194%typemap(freearg, noblock=1)
TYPE*
DATA {
1195 swiglal_array_elemfree(%as_voidptr(arg1->DATA), &elemalloc$argnum,
sizeof(
TYPE), 2, dims$argnum);
1197%typemap(out, noblock=1)
TYPE*
DATA {
1199 const size_t dims[2] = {%static_cast(NI,
size_t), %static_cast(NJ,
size_t)};
1200 const size_t strides[2] = {%static_cast(SI,
size_t), %static_cast(SJ,
size_t)};
1201 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1202 %swiglal_array_dynamic_check_strides(NAME,
DATA, 2);
1203 $1 = %reinterpret_cast(arg1->DATA,
TYPE*);
1205 %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
1206 sizeof(
TYPE), 2, dims, strides,
1207 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1208 $owner | %newpointer_flags));
1215%typemap(memberin, noblock=1)
TYPE*
DATA "";
1216%typemap(argout, noblock=1)
TYPE*
DATA "";
1217%typemap(freearg, noblock=1)
TYPE*
DATA "";
1218%feature("action")
DATA "";
1219%feature("except")
DATA "";
1231%feature(
"action",
"")
DATA;
1232%feature("except", "")
DATA;
1258%define %swiglal_array_struct_1D(NAME,
TYPE, SIZET,
DATA, NI)
1262%typemap(in, noblock=1) const NAME* (
void *argp = 0,
int res = 0, NAME temp_struct,
void *temp_data = 0,
size_t dims[1] = {0},
int elemalloc = 0) %{
1263 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1264 if (!SWIG_IsOK(res)) {
1265 typedef struct { SIZET NI;
TYPE*
DATA; } sizchk_t;
1266 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1267 temp_struct.DATA = NULL;
1269 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_struct.DATA),
1270 sizeof(
TYPE), 1, dims,
1271 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1272 $disown | %convertptr_flags);
1273 if (!SWIG_IsOK(res)) {
1274 temp_data = temp_struct.DATA = %swiglal_new_array(dims[0],
TYPE);
1275 size_t strides[1] = {1};
1276 res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_struct.DATA), &elemalloc,
1277 sizeof(
TYPE), 1, dims, strides,
1278 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1279 $disown | %convertptr_flags);
1280 if (!SWIG_IsOK(res)) {
1281 %argument_fail(res,
"$type", $symname, $argnum);
1283 temp_struct.NI = %static_cast(dims[0], SIZET);
1284 argp = &temp_struct;
1287 temp_struct.NI = %static_cast(dims[0], SIZET);
1288 argp = &temp_struct;
1291 %argument_fail(res,
"$type", $symname, $argnum);
1294 $1 = %reinterpret_cast(argp, $ltype);
1296%typemap(freearg, match=
"in", noblock=1) const NAME* %{
1297 if (temp_data$argnum) {
1298 swiglal_array_elemfree(%as_voidptr(temp_data$argnum), &elemalloc$argnum,
sizeof(
TYPE), 1, dims$argnum);
1306%typemap(in, noblock=1) NAME* SWIGLAL_VIEWIN_ARRAY (
void *argp = 0,
int res = 0, NAME temp_struct) %{
1307 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1308 if (!SWIG_IsOK(res)) {
1309 typedef struct { SIZET NI;
TYPE*
DATA; } sizchk_t;
1310 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1311 size_t dims[1] = {0};
1312 temp_struct.DATA = NULL;
1314 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_struct.DATA),
1315 sizeof(
TYPE), 1, dims,
1316 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1317 $disown | %convertptr_flags);
1318 if (!SWIG_IsOK(res)) {
1319 %argument_fail(res,
"$type", $symname, $argnum);
1321 temp_struct.NI = %static_cast(dims[0], SIZET);
1322 argp = &temp_struct;
1325 %argument_fail(res,
"$type", $symname, $argnum);
1328 $1 = %reinterpret_cast(argp, $ltype);
1338%typemap(in, noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY (
void *argp = 0,
int res = 0, NAME temp_struct, SWIG_Object input_ref,
void *temp_data = 0,
size_t dims[1] = {0},
int elemalloc = 0) %{
1339 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1340 if (!SWIG_IsOK(res)) {
1341 typedef struct { SIZET NI;
TYPE*
DATA; } sizchk_t;
1342 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1344 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_data),
1345 sizeof(
TYPE), 1, dims,
1346 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1347 $disown | %convertptr_flags);
1349 temp_data = temp_struct.DATA = %swiglal_new_array(dims[0],
TYPE);
1350 size_t strides[1] = {1};
1351 res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_data), &elemalloc,
1352 sizeof(
TYPE), 1, dims, strides,
1353 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1354 $disown | %convertptr_flags);
1355 if (!SWIG_IsOK(res)) {
1356 %argument_fail(res,
"$type", $symname, $argnum);
1358 temp_struct.NI = %static_cast(dims[0], SIZET);
1359 argp = &temp_struct;
1362 %argument_fail(res,
"$type", $symname, $argnum);
1365 %argument_fail(res,
"$type", $symname, $argnum);
1370 $1 = %reinterpret_cast(argp, $ltype);
1372%typemap(argout, match=
"in", noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY %{
1373 if (temp_data$argnum) {
1374 const size_t dims[1] = {%static_cast(temp_struct$argnum.NI,
size_t)};
1375 const size_t strides[1] = {1};
1377 %append_output(%swiglal_array_copyout(
TYPE*)(swiglal_no_self(), %as_voidptr(temp_data$argnum),
1378 sizeof(
TYPE), 1, dims, strides,
1379 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1380 SWIG_POINTER_OWN | %newpointer_flags));
1382 %append_output(swiglal_get_reference(input_ref$argnum));
1385%typemap(freearg, match=
"in", noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY %{
1386 if (temp_data$argnum) {
1387 swiglal_array_elemfree(%as_voidptr(temp_data$argnum), &elemalloc$argnum,
sizeof(
TYPE), 1, dims$argnum);
1397%define %swiglal_array_struct_2D(NAME,
TYPE, SIZET,
DATA, NI, NJ)
1401%typemap(in, noblock=1) const NAME* (
void *argp = 0,
int res = 0, NAME temp_struct,
void *temp_data = 0,
size_t dims[2] = {0, 0},
int elemalloc = 0) %{
1402 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1403 if (!SWIG_IsOK(res)) {
1404 typedef struct { SIZET NI; SIZET NJ;
TYPE*
DATA; } sizchk_t;
1405 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1406 temp_struct.DATA = NULL;
1408 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_struct.DATA),
1409 sizeof(
TYPE), 2, dims,
1410 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1411 $disown | %convertptr_flags);
1412 if (!SWIG_IsOK(res)) {
1413 temp_data = temp_struct.DATA = %swiglal_new_array(dims[0] * dims[1],
TYPE);
1414 size_t strides[2] = {dims[1], 1};
1415 res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_struct.DATA), &elemalloc,
1416 sizeof(
TYPE), 2, dims, strides,
1417 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1418 $disown | %convertptr_flags);
1419 if (!SWIG_IsOK(res)) {
1420 %argument_fail(res,
"$type", $symname, $argnum);
1422 temp_struct.NI = %static_cast(dims[0], SIZET);
1423 temp_struct.NJ = %static_cast(dims[1], SIZET);
1424 argp = &temp_struct;
1427 temp_struct.NI = %static_cast(dims[0], SIZET);
1428 temp_struct.NJ = %static_cast(dims[1], SIZET);
1429 argp = &temp_struct;
1432 %argument_fail(res,
"$type", $symname, $argnum);
1435 $1 = %reinterpret_cast(argp, $ltype);
1437%typemap(freearg, match=
"in", noblock=1) const NAME* %{
1438 if (temp_data$argnum) {
1439 swiglal_array_elemfree(%as_voidptr(temp_data$argnum), &elemalloc$argnum,
sizeof(
TYPE), 2, dims$argnum);
1447%typemap(in, noblock=1) NAME* SWIGLAL_VIEWIN_ARRAY (
void *argp = 0,
int res = 0, NAME temp_struct) %{
1448 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1449 if (!SWIG_IsOK(res)) {
1450 typedef struct { SIZET NI; SIZET NJ;
TYPE*
DATA; } sizchk_t;
1451 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1452 size_t dims[2] = {0, 0};
1453 temp_struct.DATA = NULL;
1455 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_struct.DATA),
1456 sizeof(
TYPE), 2, dims,
1457 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1458 $disown | %convertptr_flags);
1459 if (!SWIG_IsOK(res)) {
1460 %argument_fail(res,
"$type", $symname, $argnum);
1462 temp_struct.NI = %static_cast(dims[0], SIZET);
1463 temp_struct.NJ = %static_cast(dims[1], SIZET);
1464 argp = &temp_struct;
1467 %argument_fail(res,
"$type", $symname, $argnum);
1470 $1 = %reinterpret_cast(argp, $ltype);
1480%typemap(in, noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY (
void *argp = 0,
int res = 0, NAME temp_struct, SWIG_Object input_ref,
void *temp_data = 0,
size_t dims[2] = {0, 0},
int elemalloc = 0) %{
1481 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1482 if (!SWIG_IsOK(res)) {
1483 typedef struct { SIZET NI; SIZET NJ;
TYPE*
DATA; } sizchk_t;
1484 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1486 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_data),
1487 sizeof(
TYPE), 2, dims,
1488 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1489 $disown | %convertptr_flags);
1490 if (dims[0] * dims[1] > 0) {
1491 temp_data = temp_struct.DATA = %swiglal_new_array(dims[0] * dims[1],
TYPE);
1492 size_t strides[2] = {dims[1], 1};
1493 res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_data), &elemalloc,
1494 sizeof(
TYPE), 2, dims, strides,
1495 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1496 $disown | %convertptr_flags);
1497 if (!SWIG_IsOK(res)) {
1498 %argument_fail(res,
"$type", $symname, $argnum);
1500 temp_struct.NI = %static_cast(dims[0], SIZET);
1501 temp_struct.NJ = %static_cast(dims[1], SIZET);
1502 argp = &temp_struct;
1505 %argument_fail(res,
"$type", $symname, $argnum);
1508 %argument_fail(res,
"$type", $symname, $argnum);
1513 $1 = %reinterpret_cast(argp, $ltype);
1515%typemap(argout, match=
"in", noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY %{
1516 if (temp_data$argnum) {
1517 const size_t dims[2] = {%static_cast(temp_struct$argnum.NI,
size_t), %static_cast(temp_struct$argnum.NJ,
size_t)};
1518 const size_t strides[2] = {dims[1], 1};
1520 %append_output(%swiglal_array_copyout(
TYPE*)(swiglal_no_self(), %as_voidptr(temp_data$argnum),
1521 sizeof(
TYPE), 2, dims, strides,
1522 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1523 SWIG_POINTER_OWN | %newpointer_flags));
1525 %append_output(swiglal_get_reference(input_ref$argnum));
1528%typemap(freearg, match=
"in", noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY %{
1529 if (temp_data$argnum) {
1530 swiglal_array_elemfree(%as_voidptr(temp_data$argnum), &elemalloc$argnum,
sizeof(
TYPE), 2, dims$argnum);
1545%define %swiglal_public_VIEWIN_ARRAYS(NAME, ...)
1546%swiglal_map_ab(%swiglal_apply, NAME* SWIGLAL_VIEWIN_ARRAY, NAME*, __VA_ARGS__);
1548%define %swiglal_public_clear_VIEWIN_ARRAYS(NAME, ...)
1549%swiglal_map_a(%swiglal_clear, NAME*, __VA_ARGS__);
1557%define %swiglal_public_COPYINOUT_ARRAYS(NAME, ...)
1558%swiglal_map_ab(%swiglal_apply, NAME* SWIGLAL_COPYINOUT_ARRAY, NAME*, __VA_ARGS__);
1560%define %swiglal_public_clear_COPYINOUT_ARRAYS(NAME, ...)
1561%swiglal_map_a(%swiglal_clear, NAME*, __VA_ARGS__);
1569%define %swiglal_public_ARRAY_1D(NAME,
TYPE,
DATA, SIZET, NI)
1570%swiglal_array_dynamic_size(SIZET, NI);
1571%swiglal_array_dynamic_1D(NAME,
TYPE, SIZET,
DATA, arg1->NI, 1);
1575#define %swiglal_public_clear_ARRAY_1D(NAME, TYPE, DATA, SIZET, NI)
1578%define %swiglal_public_ARRAY_STRUCT_1D(NAME,
TYPE,
DATA, SIZET, NI)
1579%swiglal_public_ARRAY_1D(NAME,
TYPE,
DATA, SIZET, NI)
1580%swiglal_array_struct_1D(NAME,
TYPE, SIZET,
DATA, NI);
1582#define %swiglal_public_clear_ARRAY_STRUCT_1D(NAME, TYPE, DATA, SIZET, NI)
1586%define %swiglal_public_ARRAY_1D_PTR_1D(NAME,
TYPE,
DATA, SIZET, NI, NJ)
1587%swiglal_array_dynamic_size(SIZET, NI);
1588%swiglal_array_dynamic_size(SIZET, NJ);
1589%swiglal_array_dynamic_1d_ptr_1d(NAME,
TYPE, SIZET,
DATA, arg1->NI, arg1->NJ, 1);
1593#define %swiglal_public_clear_ARRAY_1D_PTR_1D(NAME, TYPE, DATA, SIZET, NI, NJ)
1596%define %swiglal_public_ARRAY_2D(NAME,
TYPE,
DATA, SIZET, NI, NJ)
1597%swiglal_array_dynamic_size(SIZET, NI);
1598%swiglal_array_dynamic_size(SIZET, NJ);
1599%swiglal_array_dynamic_2D(NAME,
TYPE, SIZET,
DATA, arg1->NI, arg1->NJ, arg1->NJ, 1);
1604#define %swiglal_public_clear_ARRAY_2D(NAME, TYPE, DATA, SIZET, NI, NJ)
1607%define %swiglal_public_ARRAY_STRUCT_2D(NAME,
TYPE,
DATA, SIZET, NI, NJ)
1608%swiglal_public_ARRAY_2D(NAME,
TYPE,
DATA, SIZET, NI, NJ)
1609%swiglal_array_struct_2D(NAME,
TYPE, SIZET,
DATA, NI, NJ);
1611#define %swiglal_public_clear_ARRAY_2D(NAME, TYPE, DATA, SIZET, NI, NJ)
1614%define %swiglal_public_ARRAY_2D_FIXED(NAME, ETYPE,
ATYPE,
DATA, SIZET, NI)
1615%swiglal_array_dynamic_size(SIZET, NI);
1616%swiglal_array_dynamic_2D(NAME, ETYPE, SIZET,
DATA, arg1->NI, (
sizeof(
ATYPE)/
sizeof(ETYPE)), (
sizeof(
ATYPE)/
sizeof(ETYPE)), 1);
1620#define %swiglal_public_clear_ARRAY_2D_FIXED(NAME, ETYPE, ATYPE, DATA, SIZET, NI)
1629%define %swiglal_public_ARRAY_MULTIPLE_LENGTHS(TAGNAME, ...)
1630%swiglal_map_ab(%swiglal_warnfilter_nspace, SWIGWARN_PARSE_REDEFINED, TAGNAME, __VA_ARGS__);
1632#define %swiglal_public_clear_ARRAY_MULTIPLE_LENGTHS(TAGNAME, ...)
1637#if defined(SWIGOCTAVE)
1638%include <
lal/SWIGOctave.i>
1639#elif defined(SWIGPYTHON)
1640%include <
lal/SWIGPython.i>
1642#error Unrecognised scripting language
1661%typemap(newfree, noblock=1) int SWIGLAL_MAYBE_RETURN_INT {
1662 swiglal_maybe_return_int();
1674%define %swiglal_public_EMPTY_ARGUMENT(
TYPE, ...)
1675%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT,
TYPE, __VA_ARGS__);
1677%define %swiglal_public_clear_EMPTY_ARGUMENT(
TYPE, ...)
1678%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1680%typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT ($*ltype emptyarg) {
1681 memset(&emptyarg, 0,
sizeof($*type));
1684%#define swiglal_no_1starg
1687%typemap(freearg, noblock=1) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT {
1688%#undef swiglal_no_1starg
1690%define %swiglal_public_NEW_EMPTY_ARGUMENT(
TYPE, ...)
1691%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT,
TYPE, __VA_ARGS__);
1693%define %swiglal_public_clear_NEW_EMPTY_ARGUMENT(
TYPE, ...)
1694%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1696%typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT {
1697 $1 = %swiglal_new_instance($*type);
1699%#define swiglal_no_1starg
1702%typemap(freearg, noblock=1) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT {
1703%#undef swiglal_no_1starg
1710%define %swiglal_numeric_typedef(CHECKCODE, BASETYPE,
TYPE)
1711%numeric_type_from(
TYPE, BASETYPE);
1712%numeric_type_asval(
TYPE, BASETYPE,
"swiglal_empty_frag",
false);
1713%typemaps_primitive(%checkcode(CHECKCODE),
TYPE);
1715%swiglal_numeric_typedef(
INT8,
signed char, int8_t);
1716%swiglal_numeric_typedef(
UINT8,
unsigned char, uint8_t);
1717%swiglal_numeric_typedef(INT16,
short, int16_t);
1718%swiglal_numeric_typedef(
UINT16,
unsigned short, uint16_t);
1719%swiglal_numeric_typedef(INT32,
int, int32_t);
1720%swiglal_numeric_typedef(UINT32,
unsigned int, uint32_t);
1721%swiglal_numeric_typedef(INT64,
long long, int64_t);
1722%swiglal_numeric_typedef(UINT64,
unsigned long long, uint64_t);
1729%fragment(SWIG_From_frag(
BOOLEAN),
"header", fragment=SWIG_From_frag(
bool)) {
1730 SWIGINTERNINLINE SWIG_Object SWIG_From_dec(
BOOLEAN)(
BOOLEAN value) {
1731 return SWIG_From(
bool)(value ? true :
false);
1734%fragment(SWIG_AsVal_frag(
BOOLEAN),
"header", fragment=SWIG_AsVal_frag(
bool)) {
1735 SWIGINTERN
int SWIG_AsVal_dec(
BOOLEAN)(SWIG_Object obj,
BOOLEAN *val) {
1737 int res = SWIG_AsVal(
bool)(obj, val ? &v : 0);
1738 if (!SWIG_IsOK(res)) {
1739 return SWIG_TypeError;
1747%typemaps_primitive(%checkcode(BOOL),
BOOLEAN);
1755%fragment(
"SWIG_FromLALcharPtrAndSize",
"header", fragment=
"SWIG_FromCharPtrAndSize") {
1756 SWIGINTERNINLINE SWIG_Object SWIG_FromLALcharPtrAndSize(
const char *str,
size_t size) {
1757 return SWIG_FromCharPtrAndSize(str, size);
1760%fragment(
"SWIG_AsLALcharPtrAndSize",
"header", fragment=
"SWIG_AsCharPtrAndSize") {
1761 SWIGINTERN
int SWIG_AsLALcharPtrAndSize(SWIG_Object obj,
char **pstr,
size_t *psize,
int *alloc) {
1766 if (swiglal_null_ptr(obj)) {
1774 int res = SWIG_AsCharPtrAndSize(obj, &slstr, &slsize, &slalloc);
1775 if (!SWIG_IsOK(res)) {
1776 return SWIG_TypeError;
1786 *pstr = %swiglal_new_copy_array(slstr, slsize,
char);
1787 *alloc = SWIG_NEWOBJ;
1790 return SWIG_TypeError;
1798 if (slalloc == SWIG_NEWOBJ) {
1799 %delete_array(slstr);
1804#if SWIG_VERSION >= 0x040100
1805%typemaps_string_alloc(%checkcode(
STRING), %checkcode(
char),
1806 SWIGWARN_TYPEMAP_CHARLEAK_MSG,
char, LALchar,
1807 SWIG_AsLALcharPtrAndSize, SWIG_FromLALcharPtrAndSize,
1808 strlen, SWIG_strnlen, %swiglal_new_copy_array,
XLALFree,
1809 "<limits.h>", CHAR_MIN, CHAR_MAX);
1811%typemaps_string_alloc(%checkcode(
STRING), %checkcode(
char),
char, LALchar,
1812 SWIG_AsLALcharPtrAndSize, SWIG_FromLALcharPtrAndSize,
1813 strlen, SWIG_strnlen, %swiglal_new_copy_array,
XLALFree,
1814 "<limits.h>", CHAR_MIN, CHAR_MAX);
1824%typemap(in, noblock=1, numinputs=0) char ** (
char *str = NULL,
int alloc = 0) {
1825 $1 = %reinterpret_cast(&str, $ltype);
1828%typemap(in, noblock=1, fragment=
"SWIG_AsLALcharPtrAndSize") char ** INOUT (
char *str = NULL,
int alloc = 0,
int res = 0) {
1829 res = SWIG_AsLALcharPtr($input, &str, &alloc);
1830 if (!SWIG_IsOK(res)) {
1831 %argument_fail(res,
"$type", $symname, $argnum);
1833 $1 = %reinterpret_cast(&str, $ltype);
1835%typemap(argout, noblock=1) char ** {
1836 %append_output(SWIG_FromLALcharPtr(str$argnum));
1838%typemap(freearg, match=
"in") char ** {
1839 if (SWIG_IsNewObj(alloc$argnum)) {
1843%define %swiglal_public_INOUT_STRINGS(...)
1844%swiglal_map_ab(%swiglal_apply,
char ** INOUT,
char **, __VA_ARGS__);
1846%define %swiglal_public_clear_INOUT_STRINGS(...)
1847%swiglal_map_a(%swiglal_clear,
char **, __VA_ARGS__);
1853%typemap(newfree, noblock=1) const
char* "";
1862%typemap(in, noblock=1) const SWIGTYPE * (
void *argp = 0,
int res = 0) {
1863 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1864 if (!SWIG_IsOK(res)) {
1865 %argument_fail(res,
"$type", $symname, $argnum);
1867 $1 = %reinterpret_cast(argp, $ltype);
1869%typemap(freearg)
const SWIGTYPE *
"";
1876%typemap(memberin, noblock=1) const SWIGTYPE * {
1877 if (arg1) *($type*)&(arg1)->$name = ($type)arg2;
1891%define %swiglal_store_parent(PTR, OWNER, SELF)
1892%#
if !(OWNER & SWIG_POINTER_OWN)
1893 if (%as_voidptr(PTR) != NULL) {
1894 swiglal_store_parent(%as_voidptr(PTR), SELF);
1911%define %swiglal_set_output(NAME, OBJ)
1912%#
if defined(swiglal_return_1starg_##NAME) && !defined(swiglal_no_1starg)
1913 if (result != NULL && result == arg1) {
1914 %set_output(swiglal_get_reference(swiglal_1starg()));
1922%typemap(out, noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] {
1923 %swiglal_store_parent($1, $owner, swiglal_self());
1924 %swiglal_set_output($1_name, SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
1926%typemap(out, noblock=1) const SWIGTYPE *, const SWIGTYPE &, const SWIGTYPE[] {
1927 %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %newpointer_flags) & ~SWIG_POINTER_OWN));
1929%typemap(out, noblock=1) SWIGTYPE *const& {
1930 %swiglal_store_parent(*$1, $owner, swiglal_self());
1931 %swiglal_set_output($1_name, SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
1933%typemap(out, noblock=1) const SWIGTYPE *const& {
1934 %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner | %newpointer_flags) & ~SWIG_POINTER_OWN));
1936%typemap(out, noblock=1) SWIGTYPE (
void* copy = NULL) {
1937 copy = %swiglal_new_copy($1, $ltype);
1938 %swiglal_store_parent(copy, SWIG_POINTER_OWN, swiglal_self());
1939 %set_output(SWIG_NewPointerObj(copy, $&descriptor, (%newpointer_flags) | SWIG_POINTER_OWN));
1941%typemap(varout, noblock=1) SWIGTYPE *, SWIGTYPE [] {
1942 %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, (%newpointer_flags) & ~SWIG_POINTER_OWN));
1944%typemap(varout, noblock=1) SWIGTYPE & {
1945 %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, (%newpointer_flags) & ~SWIG_POINTER_OWN));
1947%typemap(varout, noblock=1) SWIGTYPE {
1948 %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, (%newpointer_flags) & ~SWIG_POINTER_OWN));
1955%apply
bool* OUTPUT {
bool* };
1957%apply
int* OUTPUT {
enum SWIGTYPE* };
1958%apply
short* OUTPUT {
short* };
1959%apply
unsigned short* OUTPUT {
unsigned short* };
1960%apply
int* OUTPUT {
int* };
1961%apply
unsigned int* OUTPUT {
unsigned int* };
1962%apply
long* OUTPUT {
long* };
1963%apply
unsigned long* OUTPUT {
unsigned long* };
1964%apply
long long* OUTPUT {
long long* };
1965%apply
unsigned long long* OUTPUT {
unsigned long long* };
1966%apply
float* OUTPUT {
float* };
1967%apply
double* OUTPUT {
double* };
1968%apply int8_t* OUTPUT { int8_t* };
1969%apply uint8_t* OUTPUT { uint8_t* };
1970%apply int16_t* OUTPUT { int16_t* };
1971%apply uint16_t* OUTPUT { uint16_t* };
1972%apply int32_t* OUTPUT { int32_t* };
1973%apply uint32_t* OUTPUT { uint32_t* };
1974%apply int64_t* OUTPUT { int64_t* };
1975%apply uint64_t* OUTPUT { uint64_t* };
1976%apply gsl_complex_float* OUTPUT { gsl_complex_float* };
1977%apply gsl_complex* OUTPUT { gsl_complex* };
1984%define %swiglal_public_INOUT_SCALARS(
TYPE, ...)
1985%swiglal_map_ab(%swiglal_apply,
TYPE INOUT,
TYPE, __VA_ARGS__);
1987%define %swiglal_public_clear_INOUT_SCALARS(
TYPE, ...)
1988%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1994%typemap(argout, noblock=1) SWIGTYPE* SWIGLAL_INPUT_SCALAR "";
1995%define %swiglal_public_INPUT_SCALARS(
TYPE, ...)
1996%swiglal_map_ab(%swiglal_apply,
TYPE INPUT,
TYPE, __VA_ARGS__);
1997%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_INPUT_SCALAR,
TYPE, __VA_ARGS__);
1999%define %swiglal_public_clear_INPUT_SCALARS(
TYPE, ...)
2000%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2021%typemap(in, noblock=1, numinputs=0) SWIGTYPE ** (
void *argp = NULL) {
2022 $1 = %reinterpret_cast(&argp, $ltype);
2024%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(
int)) SWIGTYPE ** INOUT (SWIG_Object inobj,
void *inarg = NULL,
void *inoutarg = NULL,
int res = 0) {
2026 res = SWIG_ConvertPtr(inobj, &inarg, $*descriptor, ($disown | %convertptr_flags) & ~SWIG_POINTER_DISOWN);
2027 if (!SWIG_IsOK(res)) {
2029 res = SWIG_AsVal(
int)(inobj, &val);
2030 if (!SWIG_IsOK(res) || val != 0) {
2031 %argument_fail(res,
"$type", $symname, $argnum);
2033 inoutarg = inarg = NULL;
2034 $1 = %reinterpret_cast(&inoutarg, $ltype);
2038 if (inoutarg == NULL) {
2041 $1 = %reinterpret_cast(&inoutarg, $ltype);
2045%typemap(argout, noblock=1) SWIGTYPE ** {
2046 %append_output(SWIG_NewPointerObj($1 != NULL ? %as_voidptr(*$1) : NULL, $*descriptor, %newpointer_flags | SWIG_POINTER_OWN));
2048%typemap(argout, noblock=1) SWIGTYPE ** INOUT {
2049 if ($1 != NULL && *$1 != NULL && *$1 == inarg$argnum) {
2050 %append_output(swiglal_get_reference(inobj$argnum));
2052 %append_output(SWIG_NewPointerObj($1 != NULL ? %as_voidptr(*$1) : NULL, $*descriptor, %newpointer_flags | SWIG_POINTER_OWN));
2055%typemap(freearg) SWIGTYPE **
"";
2056%define %swiglal_public_INOUT_STRUCTS(
TYPE, ...)
2057%swiglal_map_ab(%swiglal_apply, SWIGTYPE ** INOUT,
TYPE, __VA_ARGS__);
2059%define %swiglal_public_clear_INOUT_STRUCTS(
TYPE, ...)
2060%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2068%typemap(in, fragment=
"SWIG_AsLALcharPtrAndSize") (
const char *SWIGLAL_PRINTF_FORMAT, ...)
2069(
char fmt[] =
"%s",
char *str = 0,
int alloc = 0)
2072 int res = SWIG_AsLALcharPtr($input, &str, &alloc);
2073 if (!SWIG_IsOK(res)) {
2074 %argument_fail(res,
"$type", $symname, $argnum);
2078%typemap(freearg, match=
"in") (
const char *format, ...) {
2079 if (SWIG_IsNewObj(alloc$argnum)) {
2083%apply (
const char *SWIGLAL_PRINTF_FORMAT, ...) {
2084 (
const char *format, ...), (
const char *fmt, ...)
2095%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(
int)) FILE* (
void *argp = 0,
int res = 0) {
2096 res = SWIG_ConvertPtr($input, &argp, $descriptor, $disown | %convertptr_flags);
2097 if (!SWIG_IsOK(res)) {
2099 res = SWIG_AsVal(
int)($input, &val);
2100 if (!SWIG_IsOK(res)) {
2101 %argument_fail(res,
"$type", $symname, $argnum);
2114 %argument_fail(SWIG_ValueError,
"$type", $symname, $argnum);
2118 $1 = %reinterpret_cast(argp, $ltype);
2121%typemap(freearg) FILE*
"";
2133%define %swiglal_specialised_typemaps(TAGNAME, FRAGMENT)
2134%typemap(in, noblock=1, fragment=FRAGMENT)
2135 struct TAGNAME (void *argp = 0,
int res = 0),
2136 const struct TAGNAME (
void *argp = 0,
int res = 0)
2138 res = SWIG_ConvertPtr($input, &argp, $&descriptor, $disown | %convertptr_flags);
2139 if (!SWIG_IsOK(res)) {
2140 res = swiglal_specialised_##TAGNAME($input, &$1);
2141 if (!SWIG_IsOK(res)) {
2142 %argument_fail(res,
"$type", $symname, $argnum);
2146 %argument_nullref(
"$type", $symname, $argnum);
2148 $<ype temp_ptr = %reinterpret_cast(argp, $<ype);
2150 if (SWIG_IsNewObj(res)) {
2156%typemap(freearg)
struct TAGNAME, const struct TAGNAME "";
2157%typemap(in, noblock=1, fragment=FRAGMENT)
2158 struct TAGNAME* (
struct TAGNAME temp_struct, void *argp = 0,
int res = 0),
2159 const struct TAGNAME* (
struct TAGNAME temp_struct,
void *argp = 0,
int res = 0)
2161 res = SWIG_ConvertPtr($input, &argp, $descriptor, $disown | %convertptr_flags);
2162 if (!SWIG_IsOK(res)) {
2163 res = swiglal_specialised_##TAGNAME($input, &temp_struct);
2164 if (!SWIG_IsOK(res)) {
2165 %argument_fail(res,
"$type", $symname, $argnum);
2167 $1 = %reinterpret_cast(&temp_struct, $ltype);
2170 $1 = %reinterpret_cast(argp, $ltype);
2173%typemap(freearg)
struct TAGNAME*,
const struct TAGNAME*
"";
2174%typemap(typecheck, fragment=FRAGMENT, precedence=SWIG_TYPECHECK_SWIGOBJECT)
struct TAGNAME, const struct TAGNAME {
2176 int res = SWIG_ConvertPtr($input, &argp, $&descriptor, 0);
2177 $1 = SWIG_CheckState(res);
2179 struct TAGNAME temp_struct;
2180 res = swiglal_specialised_##TAGNAME($input, &temp_struct);
2181 $1 = SWIG_CheckState(res);
2184%typemap(typecheck, fragment=FRAGMENT, precedence=SWIG_TYPECHECK_SWIGOBJECT)
struct TAGNAME*,
const struct TAGNAME* {
2186 int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0);
2187 $1 = SWIG_CheckState(res);
2189 struct TAGNAME temp_struct;
2190 res = swiglal_specialised_##TAGNAME($input, &temp_struct);
2191 $1 = SWIG_CheckState(res);
2195%define %swiglal_specialised_ptr_typemaps(TAGNAME, FRAGMENT)
2196%typemap(in, noblock=1, fragment=FRAGMENT)
2197 struct TAGNAME* (
struct TAGNAME* temp_ptr = 0,
void *argp = 0,
int res = 0),
2198 const struct TAGNAME* (
struct TAGNAME* temp_ptr = 0,
void *argp = 0,
int res = 0)
2200 res = SWIG_ConvertPtr($input, &argp, $descriptor, $disown | %convertptr_flags);
2201 if (!SWIG_IsOK(res)) {
2202 res = swiglal_specialised_ptr_##TAGNAME($input, &temp_ptr);
2203 if (!SWIG_IsOK(res)) {
2204 %argument_fail(res,
"$type", $symname, $argnum);
2206 $1 = %reinterpret_cast(temp_ptr, $ltype);
2209 $1 = %reinterpret_cast(argp, $ltype);
2212%typemap(freearg)
struct TAGNAME*,
const struct TAGNAME* {
2213 if (temp_ptr$argnum) {
2214 swiglal_specialised_ptr_##TAGNAME##_destroy(temp_ptr$argnum);
2217%typemap(typecheck, fragment=FRAGMENT, precedence=SWIG_TYPECHECK_SWIGOBJECT)
struct TAGNAME*,
const struct TAGNAME* {
2219 int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0);
2220 $1 = SWIG_CheckState(res);
2222 struct TAGNAME* temp_ptr;
2223 res = swiglal_specialised_##TAGNAME($input, &temp_ptr);
2224 $1 = SWIG_CheckState(res);
2225 swiglal_specialised_ptr_##TAGNAME##_destroy(temp_ptr);
2238%define %swiglal_public_RETURN_VOID(
TYPE, ...)
2239%swiglal_map_ab(%swiglal_apply, SWIGTYPE SWIGLAL_RETURN_VOID,
TYPE, __VA_ARGS__);
2241%define %swiglal_public_clear_RETURN_VOID(
TYPE, ...)
2242%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2244%typemap(out, noblock=1) SWIGTYPE SWIGLAL_RETURN_VOID {
2245 %set_output(VOID_Object);
2253%define %swiglal_public_RETURN_VALUE(
TYPE, ...)
2254%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2256#define %swiglal_public_clear_RETURN_VALUE(TYPE, ...)
2262%define %swiglal_public_DISABLE_EXCEPTIONS(...)
2263%swiglal_map_ab(%swiglal_feature,
"except",
"$action", __VA_ARGS__);
2265#define %swiglal_public_clear_DISABLE_EXCEPTIONS(...)
2271%define %swiglal_public_FUNCTION_POINTER(...)
2272%swiglal_map_ab(%swiglal_feature,
"callback",
"%sPtr", __VA_ARGS__);
2274#define %swiglal_public_clear_FUNCTION_POINTER(...)
2284%define %swiglal_public_VARIABLE_ARGUMENT_LIST(FUNCTION,
TYPE, ENDVALUE)
2285%feature(
"kwargs", 0) FUNCTION;
2286%feature("compactdefaultargs") FUNCTION;
2287%varargs(11,
TYPE arg = ENDVALUE) FUNCTION;
2293#define %swiglal_public_clear_VARIABLE_ARGUMENT_LIST(FUNCTION, TYPE, ENDVALUE)
2303%define %swiglal_public_RETURN_OWNED_BY_1ST_ARG(
TYPE, ...)
2304%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_RETURN_OWNED_BY_1ST_ARG,
TYPE, __VA_ARGS__);
2306%define %swiglal_public_clear_RETURN_OWNED_BY_1ST_ARG(
TYPE, ...)
2307%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2309%typemap(out, noblock=1) SWIGTYPE* SWIGLAL_RETURN_OWNED_BY_1ST_ARG {
2310%#ifndef swiglal_no_1starg
2311 %swiglal_store_parent($1, 0, swiglal_1starg());
2313 %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
2324%define %swiglal_public_OUTPUT_OWNED_BY_1ST_ARG(
TYPE, ...)
2325%swiglal_map_ab(%swiglal_apply, SWIGTYPE** SWIGLAL_OUTPUT_OWNED_BY_1ST_ARG,
TYPE, __VA_ARGS__);
2327%define %swiglal_public_clear_OUTPUT_OWNED_BY_1ST_ARG(
TYPE, ...)
2328%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2330%typemap(argout, noblock=1) SWIGTYPE** SWIGLAL_OUTPUT_OWNED_BY_1ST_ARG {
2331%#ifndef swiglal_no_1starg
2332 %swiglal_store_parent(*$1, 0, swiglal_1starg());
2334 %append_output(SWIG_NewPointerObj($1 != NULL ? %as_voidptr(*$1) : NULL, $*descriptor, %newpointer_flags | SWIG_POINTER_OWN));
2342%typemap(swiglal_owns_this_arg_is_char) SWIGTYPE
"0";
2343%typemap(swiglal_owns_this_arg_is_char)
char *
"1";
2344%typemap(swiglal_owns_this_arg_is_char)
const char *
"1";
2345%typemap(in, noblock=1) SWIGTYPE SWIGLAL_OWNS_THIS_ARG (
int res = 0) {
2346%#
if $typemap(swiglal_owns_this_arg_is_char, $1_type)
2350 res = SWIG_AsLALcharPtr($input, &str, &alloc);
2351 if (!SWIG_IsOK(res)) {
2352 %argument_fail(res,
"$type",$symname, $argnum);
2354 $1 = %reinterpret_cast(str, $1_ltype);
2357 res = SWIG_ConvertPtr($input, %as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags);
2358 if (!SWIG_IsOK(res)) {
2359 %argument_fail(res,
"$type", $symname, $argnum);
2363%define %swiglal_public_OWNS_THIS_ARG(
TYPE, ...)
2364%swiglal_map_ab(%swiglal_apply, SWIGTYPE SWIGLAL_OWNS_THIS_ARG,
TYPE, __VA_ARGS__);
2366%define %swiglal_public_clear_OWNS_THIS_ARG(
TYPE, ...)
2367%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2374%typemap(in, noblock=1) SWIGTYPE * SWIGLAL_NO_OWN_ON_ASSIGNMENT (
void *argp = 0,
int res = 0) {
2375 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
2376 if (!SWIG_IsOK(res)) {
2377 %argument_fail(res,
"$type", $symname, $argnum);
2379 $1 = %reinterpret_cast(argp, $ltype);
2381%define %swiglal_public_NO_OWN_ON_ASSIGNMENT(...)
2382%swiglal_map_ab(%swiglal_apply, SWIGTYPE * SWIGLAL_NO_OWN_ON_ASSIGNMENT, SWIGTYPE *, __VA_ARGS__);
2384%define %swiglal_public_clear_NO_OWN_ON_ASSIGNMENT(
TYPE, ...)
2385%swiglal_map_a(%swiglal_clear, SWIGTYPE *, __VA_ARGS__);
2392%define %swiglal_public_EXTERNAL_STRUCT(NAME, DTORFUNC)
2393typedef struct {} NAME;
2397 (void)DTORFUNC($self);
2401#define %swiglal_public_clear_EXTERNAL_STRUCT(NAME, DTORFUNC)
2418%typemap(out, noblock=1) SWIGTYPE* SWIGLAL_RETURNS_SELF {
2419%#ifndef swiglal_no_1starg
2420 %swiglal_store_parent($1, 0, swiglal_self());
2422 %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
2424%define %swiglal_cast_struct(TOTYPE)
2426 %apply SWIGTYPE* SWIGLAL_RETURNS_SELF { TOTYPE* cast2##TOTYPE() };
2427 TOTYPE* cast2##TOTYPE() {
2428 return (TOTYPE*) $self;
2432%define %swiglal_public_CAST_STRUCT_TO(...)
2433%swiglal_map(%swiglal_cast_struct, __VA_ARGS__);
2435#define %swiglal_public_clear_CAST_STRUCT_TO(...)
2441%define %swiglal_public_IMMUTABLE_MEMBERS(TAGNAME, ...)
2442%swiglal_map_abc(%swiglal_feature_nspace,
"immutable",
"1", TAGNAME, __VA_ARGS__);
2444#define %swiglal_public_clear_IMMUTABLE_MEMBERS(...)
2450%define %swiglal_public_IGNORE_MEMBERS(TAGNAME, ...)
2451%swiglal_map_a(%swiglal_ignore_nspace, TAGNAME, __VA_ARGS__);
2453#define %swiglal_public_clear_IGNORE_MEMBERS(...)
unsigned char BOOLEAN
Boolean logical type, see Headers LAL(Atomic)Datatypes.h for more details.
uint64_t UINT8
Eight-byte unsigned integer; on some platforms this is equivalent to unsigned long int instead.
double complex COMPLEX16
Double-precision floating-point complex number (16 bytes total)
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
float complex COMPLEX8
Single-precision floating-point complex number (8 bytes total)
int swig_lal_has_stdouterr_been_redirected
int swig_lal_do_redirect_stdouterr
The swig_lal_do_redirect_stdouterr variable turns on standard output/error redirection for all LAL li...
const char * XLALErrorString(int code)
Returns the error message associated with an error number.
#define xlalErrno
Modifiable lvalue containing the XLAL error number.
int XLALSetErrno(int errnum)
Sets the XLAL error number to errnum, returns the new value.
int XLALClearErrno(void)
Clears the XLAL error number, returns the old value.
@ XLAL_EFAILED
Generic failure.
LAL status structure, see The LALStatus structure for more details.