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;
302static int swiglal_save_stdout_fd, swiglal_save_stderr_fd;
303static FILE *swiglal_tmp_stdout, *swiglal_tmp_stderr;
305SWIGINTERN
int swiglal_redirect_stdouterr(
void);
306SWIGINTERN
int swiglal_restore_stdouterr(
void);
307SWIGINTERN
int swiglal_output_stdouterr(
void);
309#define SWIGLAL_REDIRECT_STDOUTERR \
311 const int local_swig_lal_do_redirect_stdouterr = swig_lal_has_stdouterr_been_redirected ? 0 : swig_lal_do_redirect_stdouterr; \
312 if (local_swig_lal_do_redirect_stdouterr) { \
313 swig_lal_has_stdouterr_been_redirected = 1; \
314 if (!swiglal_redirect_stdouterr()) { \
315 SWIG_exception(SWIG_RuntimeError, "swiglal_redirect_stdouterr() failed"); \
318#define SWIGLAL_RESTORE_OUTPUT_STDOUTERR \
319 if (local_swig_lal_do_redirect_stdouterr) { \
320 if (!swiglal_restore_stdouterr()) {\
321 SWIG_exception(SWIG_RuntimeError, "swiglal_restore_stdouterr() failed"); \
323 if (!swiglal_output_stdouterr()) { \
324 SWIG_exception(SWIG_RuntimeError, "swiglal_output_stdouterr() failed"); \
326 swig_lal_has_stdouterr_been_redirected = 0; \
330SWIGINTERN
int swiglal_redirect_stdouterr(
void) {
334 fsync(STDOUT_FILENO);
336 fsync(STDERR_FILENO);
339 swiglal_save_stdout_fd = dup(STDOUT_FILENO);
340 swiglal_save_stderr_fd = dup(STDERR_FILENO);
341 if (swiglal_save_stdout_fd < 0 || swiglal_save_stderr_fd < 0) {
342 const char msg[] =
"redirect_stdouterr(): dup(STD{OUT|ERR}_FILENO) failed\n";
343 write(STDERR_FILENO, msg,
sizeof(msg));
344 fsync(STDERR_FILENO);
349 swiglal_tmp_stdout = tmpfile();
350 swiglal_tmp_stderr = tmpfile();
351 if (swiglal_tmp_stdout == NULL || swiglal_tmp_stderr == NULL) {
352 const char msg[] =
"redirect_stdouterr(): tmpfile() failed\n";
353 write(STDERR_FILENO, msg,
sizeof(msg));
354 fsync(STDERR_FILENO);
355 close(swiglal_save_stdout_fd);
356 close(swiglal_save_stderr_fd);
357 if (swiglal_tmp_stdout != NULL) {
358 fclose(swiglal_tmp_stdout);
360 if (swiglal_tmp_stderr != NULL) {
361 fclose(swiglal_tmp_stderr);
367 int swiglal_tmp_stdout_fd = fileno(swiglal_tmp_stdout);
368 int swiglal_tmp_stderr_fd = fileno(swiglal_tmp_stderr);
369 if (swiglal_tmp_stdout_fd < 0 || swiglal_tmp_stderr_fd < 0) {
370 const char msg[] =
"redirect_stdouterr(): fileno(tmp_std{out|err}) failed\n";
371 write(STDERR_FILENO, msg,
sizeof(msg));
372 fsync(STDERR_FILENO);
373 close(swiglal_save_stdout_fd);
374 close(swiglal_save_stderr_fd);
375 fclose(swiglal_tmp_stdout);
376 fclose(swiglal_tmp_stderr);
381 if (dup2(swiglal_tmp_stdout_fd, STDOUT_FILENO) < 0) {
382 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_tmp_stdout_fd, STDOUT_FILENO) failed\n";
383 write(STDERR_FILENO, msg,
sizeof(msg));
384 fsync(STDERR_FILENO);
385 close(swiglal_save_stdout_fd);
386 close(swiglal_save_stderr_fd);
387 fclose(swiglal_tmp_stdout);
388 fclose(swiglal_tmp_stderr);
391 if (dup2(swiglal_tmp_stderr_fd, STDERR_FILENO) < 0) {
392 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_tmp_stderr_fd, STDERR_FILENO) failed\n";
393 write(STDERR_FILENO, msg,
sizeof(msg));
394 fsync(STDERR_FILENO);
395 if (dup2(swiglal_save_stdout_fd, STDOUT_FILENO) < 0) {
396 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_save_stdout_fd, STDOUT_FILENO) failed\n";
397 write(STDERR_FILENO, msg,
sizeof(msg));
398 fsync(STDERR_FILENO);
400 close(swiglal_save_stdout_fd);
401 close(swiglal_save_stderr_fd);
402 fclose(swiglal_tmp_stdout);
403 fclose(swiglal_tmp_stderr);
411SWIGINTERN
int swiglal_restore_stdouterr(
void) {
415 fsync(STDOUT_FILENO);
417 fsync(STDERR_FILENO);
420 if (dup2(swiglal_save_stdout_fd, STDOUT_FILENO) < 0) {
421 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_save_stdout_fd, STDOUT_FILENO) failed\n";
422 write(swiglal_save_stderr_fd, msg,
sizeof(msg));
423 fsync(swiglal_save_stderr_fd);
426 if (dup2(swiglal_save_stderr_fd, STDERR_FILENO) < 0) {
427 const char msg[] =
"redirect_stdouterr(): dup2(swiglal_save_stderr_fd, STDERR_FILENO) failed\n";
428 write(swiglal_save_stderr_fd, msg,
sizeof(msg));
429 fsync(swiglal_save_stderr_fd);
434 close(swiglal_save_stdout_fd);
435 close(swiglal_save_stderr_fd);
460static const LALStatus swiglal_empty_LALStatus = {0, NULL, NULL, NULL, NULL, 0, NULL, 0};
461#undef swiglal_check_LALStatus
463%typemap(in, noblock=1, numinputs=0)
LALStatus* {
464 LALStatus lalstatus = swiglal_empty_LALStatus;
466%#define swiglal_check_LALStatus
470 SWIGLAL_REDIRECT_STDOUTERR
472 SWIGLAL_RESTORE_OUTPUT_STDOUTERR
473#ifdef swiglal_check_LALStatus
474 if (lalstatus.statusCode) {
476 SWIG_exception(SWIG_RuntimeError, lalstatus.statusDescription);
483#undef swiglal_check_LALStatus
493%fragment(
"swiglal_empty_frag",
"header") {}
501%fragment(
"swiglal_from_SWIGTYPE",
"header") {
502 SWIGINTERNINLINE SWIG_Object swiglal_from_SWIGTYPE(SWIG_Object self,
bool copyobj,
void *ptr,
size_t len,
bool isptr, swig_type_info *tinfo,
int tflags) {
503 void *vptr = isptr ? *((
void**)ptr) : ptr;
506 tflags |= SWIG_POINTER_OWN;
507 }
else if (vptr != NULL && swiglal_not_empty(self)) {
508 swiglal_store_parent(vptr, self);
509 tflags |= SWIG_POINTER_OWN;
511 return SWIG_NewPointerObj(vptr, tinfo, tflags);
514%fragment(
"swiglal_as_SWIGTYPE",
"header") {
515 SWIGINTERN
int swiglal_as_SWIGTYPE(SWIG_Object self, SWIG_Object obj,
void *ptr,
size_t len,
bool isptr, swig_type_info *tinfo,
int tflags) {
517 int res = SWIG_ConvertPtr(obj, &vptr, tinfo, tflags);
518 if (!SWIG_IsOK(res)) {
521 memcpy(ptr, isptr ? &vptr : vptr, len);
541%define %swiglal_struct_call_dtor(DTORFUNC, PTR)
542if (swiglal_release_parent(PTR)) {
551%define %swiglal_struct_extend(TAGNAME, OPAQUE, DTORFUNC)
564 return %swiglal_new_instance(
struct TAGNAME);
566 TAGNAME(
const struct TAGNAME *
src) {
567 return %swiglal_new_copy(*
src,
struct TAGNAME);
579 %swiglal_struct_call_dtor(
XLALFree, $self);
585 %swiglal_struct_call_dtor(%arg(DTORFUNC), $self);
593%swiglal_struct_extend_specific(TAGNAME, OPAQUE, DTORFUNC)
606%typemap(swiglal_fixarr_ltype) SWIGTYPE
"$ltype";
607%typemap(swiglal_fixarr_ltype) SWIGTYPE[ANY]
"$typemap(swiglal_fixarr_ltype, $*type)";
608%typemap(swiglal_fixarr_ltype) SWIGTYPE[ANY][ANY]
"$typemap(swiglal_fixarr_ltype, $*type)";
610%typemap(swiglal_fixarr_tinfo) SWIGTYPE
"$&descriptor";
611%typemap(swiglal_fixarr_tinfo) SWIGTYPE *
"$descriptor";
612%typemap(swiglal_fixarr_tinfo) SWIGTYPE *
const "$descriptor";
613%typemap(swiglal_fixarr_tinfo) SWIGTYPE[ANY]
"$typemap(swiglal_fixarr_tinfo, $*type)";
614%typemap(swiglal_fixarr_tinfo) SWIGTYPE[ANY][ANY]
"$typemap(swiglal_fixarr_tinfo, $*type)";
616%typemap(swiglal_fixarr_isptr) SWIGTYPE
"false";
617%typemap(swiglal_fixarr_isptr) SWIGTYPE *
"true";
618%typemap(swiglal_fixarr_isptr) SWIGTYPE *
const "true";
619%typemap(swiglal_fixarr_isptr) SWIGTYPE[ANY]
"$typemap(swiglal_fixarr_isptr, $*type)";
620%typemap(swiglal_fixarr_isptr) SWIGTYPE[ANY][ANY]
"$typemap(swiglal_fixarr_isptr, $*type)";
665#define %swiglal_array_copyin_func(ACFTYPE) swiglal_array_copyin_##ACFTYPE
666#define %swiglal_array_copyout_func(ACFTYPE) swiglal_array_copyout_##ACFTYPE
667#define %swiglal_array_viewin_func(ACFTYPE) swiglal_array_viewin_##ACFTYPE
668#define %swiglal_array_viewout_func(ACFTYPE) swiglal_array_viewout_##ACFTYPE
673#define %swiglal_array_copyin_frag(ACFTYPE) "swiglal_array_copyin_" %str(ACFTYPE)
674#define %swiglal_array_copyout_frag(ACFTYPE) "swiglal_array_copyout_" %str(ACFTYPE)
675#define %swiglal_array_viewin_frag(ACFTYPE) "swiglal_array_viewin_" %str(ACFTYPE)
676#define %swiglal_array_viewout_frag(ACFTYPE) "swiglal_array_viewout_" %str(ACFTYPE)
681%fragment(
"swiglal_array_elemfree",
"header")
683 SWIGINTERN
void swiglal_array_elemfree(
void* ptr,
691 if (!(*pelemalloc)) {
697 for (
size_t i = 0; i < ndims; ++i) {
702 for (
size_t i = 0; i < numel; ++i) {
703 void **elemptr = %reinterpret_cast(%reinterpret_cast(ptr,
char*) + i*esize,
void**);
715%define %_swiglal_array_type(ACFTYPE,
TYPE)
716%fragment(
"swiglal_array_frags_" %str(ACFTYPE),
"header",
717 fragment=%swiglal_array_copyin_frag(ACFTYPE),
718 fragment=%swiglal_array_copyout_frag(ACFTYPE),
719 fragment=%swiglal_array_viewin_frag(ACFTYPE),
720 fragment=%swiglal_array_viewout_frag(ACFTYPE),
721 fragment=
"swiglal_array_elemfree") {};
722%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
TYPE* %str(ACFTYPE);
723%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
const TYPE* %str(ACFTYPE);
724%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
TYPE[ANY] %str(ACFTYPE);
725%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
TYPE[ANY][ANY] %str(ACFTYPE);
726%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
const TYPE[ANY] %str(ACFTYPE);
727%typemap(swiglal_array_typeid, fragment=
"swiglal_array_frags_" %str(ACFTYPE))
const TYPE[ANY][ANY] %str(ACFTYPE);
729%define %swiglal_array_type(ACFTYPE, ...)
730%swiglal_map_a(%_swiglal_array_type, ACFTYPE, __VA_ARGS__);
736%swiglal_array_type(SWIGTYPE, SWIGTYPE);
737%swiglal_array_type(LALchar,
char*);
738%swiglal_array_type(int8_t,
char,
signed char, int8_t);
739%swiglal_array_type(uint8_t,
unsigned char, uint8_t);
740%swiglal_array_type(int16_t,
short, int16_t);
741%swiglal_array_type(uint16_t,
unsigned short, uint16_t);
742%swiglal_array_type(int32_t,
int, int32_t,
enum SWIGTYPE);
743%swiglal_array_type(uint32_t,
unsigned int, uint32_t);
744%swiglal_array_type(int64_t,
long long, int64_t);
745%swiglal_array_type(uint64_t,
unsigned long long, uint64_t);
746%swiglal_array_type(
float,
float);
747%swiglal_array_type(
double,
double);
748%swiglal_array_type(gsl_complex_float, gsl_complex_float);
749%swiglal_array_type(gsl_complex, gsl_complex);
756%swiglal_array_type(int32or64_t,
long);
757%swiglal_array_type(uint32or64_t,
unsigned long);
758%define %swiglal_array_int32or64_frags(FRAG,
FUNC, INT)
759%fragment(FRAG(INT##32or64_t),
"header") {
760%#
if LONG_MAX > INT_MAX
761%#define
FUNC(INT##32or64_t)
FUNC(INT##64_t)
763%#define
FUNC(INT##32or64_t)
FUNC(INT##32_t)
767%swiglal_array_int32or64_frags(%swiglal_array_copyin_frag, %swiglal_array_copyin_func,
int);
768%swiglal_array_int32or64_frags(%swiglal_array_copyout_frag, %swiglal_array_copyout_func,
int);
769%swiglal_array_int32or64_frags(%swiglal_array_viewin_frag, %swiglal_array_viewin_func,
int);
770%swiglal_array_int32or64_frags(%swiglal_array_viewout_frag, %swiglal_array_viewout_func,
int);
771%swiglal_array_int32or64_frags(%swiglal_array_copyin_frag, %swiglal_array_copyin_func, uint);
772%swiglal_array_int32or64_frags(%swiglal_array_copyout_frag, %swiglal_array_copyout_func, uint);
773%swiglal_array_int32or64_frags(%swiglal_array_viewin_frag, %swiglal_array_viewin_func, uint);
774%swiglal_array_int32or64_frags(%swiglal_array_viewout_frag, %swiglal_array_viewout_func, uint);
779#define %swiglal_array_copyin(TYPE) %swiglal_array_copyin_func($typemap(swiglal_array_typeid, TYPE))
780#define %swiglal_array_copyout(TYPE) %swiglal_array_copyout_func($typemap(swiglal_array_typeid, TYPE))
781#define %swiglal_array_viewin(TYPE) %swiglal_array_viewin_func($typemap(swiglal_array_typeid, TYPE))
782#define %swiglal_array_viewout(TYPE) %swiglal_array_viewout_func($typemap(swiglal_array_typeid, TYPE))
791%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE[ANY] {
792 $typemap(swiglal_fixarr_ltype, $1_type) temp_array[$1_dim0];
793 const size_t dims[1] = {$1_dim0};
794 const size_t strides[1] = {1};
796 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr(&temp_array[0]), NULL,
797 sizeof(temp_array[0]), 1, dims, strides,
798 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
800 $1 = SWIG_CheckState(res);
802%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE[ANY][ANY] {
803 $typemap(swiglal_fixarr_ltype, $1_type) temp_array[$1_dim0][$1_dim1];
804 const size_t dims[2] = {$1_dim0, $1_dim1};
805 const size_t strides[2] = {$1_dim1, 1};
807 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr(&temp_array[0]), NULL,
808 sizeof(temp_array[0][0]), 2, dims, strides,
809 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
811 $1 = SWIG_CheckState(res);
817%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) {
818 $typemap(swiglal_fixarr_ltype, $1_type) temp_array$argnum[$1_dim0];
819 $1 = &temp_array$argnum[0];
822 const size_t strides[1] = {1};
824 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr($1), &elemalloc,
825 sizeof($1[0]), 1, dims, strides,
826 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
827 $disown | %convertptr_flags);
828 if (!SWIG_IsOK(res)) {
829 %argument_fail(res,
"$type", $symname, $argnum);
833%typemap(freearg, match=
"in", noblock=1) SWIGTYPE[ANY], SWIGTYPE INOUT[ANY] {
834 swiglal_array_elemfree(arg$argnum, &elemalloc$argnum,
sizeof($typemap(swiglal_fixarr_ltype, $1_type)), 1, dims$argnum);
836%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) {
837 $typemap(swiglal_fixarr_ltype, $1_type) temp_array$argnum[$1_dim0][$1_dim1];
838 $1 = &temp_array$argnum[0];
840 dims[0] = $1_dim0; dims[1] = $1_dim1;
841 const size_t strides[2] = {$1_dim1, 1};
843 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr($1), &elemalloc,
844 sizeof($1[0][0]), 2, dims, strides,
845 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
846 $disown | %convertptr_flags);
847 if (!SWIG_IsOK(res)) {
848 %argument_fail(res,
"$type", $symname, $argnum);
852%typemap(freearg, match=
"in", noblock=1) SWIGTYPE[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] {
853 swiglal_array_elemfree(arg$argnum, &elemalloc$argnum,
sizeof($typemap(swiglal_fixarr_ltype, $1_type)), 2, dims$argnum);
859%typemap(varin) SWIGTYPE[ANY] {
861 const size_t dims[1] = {$1_dim0};
862 const size_t strides[1] = {1};
864 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr($1), &elemalloc,
865 sizeof($1[0]), 1, dims, strides,
866 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
868 if (!SWIG_IsOK(res)) {
869 %variable_fail(res,
"$type", $symname);
872%typemap(varin) SWIGTYPE[ANY][ANY] {
874 const size_t dims[2] = {$1_dim0, $1_dim1};
875 const size_t strides[2] = {$1_dim1, 1};
877 int res = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as_voidptr($1), &elemalloc,
878 sizeof($1[0][0]), 2, dims, strides,
879 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
881 if (!SWIG_IsOK(res)) {
882 %variable_fail(res,
"$type", $symname);
889%typemap(out) SWIGTYPE[ANY] {
890 const size_t dims[1] = {$1_dim0};
891 const size_t strides[1] = {1};
893%#
if $owner & SWIG_POINTER_OWN
894 %set_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidptr($1),
895 sizeof($1[0]), 1, dims, strides,
896 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
897 $owner | %newpointer_flags));
899 %set_output(%swiglal_array_viewout($1_type)(swiglal_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));
905%typemap(out) SWIGTYPE[ANY][ANY] {
906 const size_t dims[2] = {$1_dim0, $1_dim1};
907 const size_t strides[2] = {$1_dim1, 1};
909%#
if $owner & SWIG_POINTER_OWN
910 %set_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidptr($1),
911 sizeof($1[0][0]), 2, dims, strides,
912 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
913 $owner | %newpointer_flags));
915 %set_output(%swiglal_array_viewout($1_type)(swiglal_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));
925%typemap(varout) SWIGTYPE[ANY] {
926 const size_t dims[1] = {$1_dim0};
927 const size_t strides[1] = {1};
929 %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidptr($1),
930 sizeof($1[0]), 1, dims, strides,
931 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
934%typemap(varout) SWIGTYPE[ANY][ANY] {
935 const size_t dims[2] = {$1_dim0, $1_dim1};
936 const size_t strides[2] = {$1_dim1, 1};
938 %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidptr($1),
939 sizeof($1[0][0]), 2, dims, strides,
940 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
947%typemap(in, noblock=1, numinputs=0) SWIGTYPE OUTPUT[ANY] {
948 $typemap(swiglal_fixarr_ltype, $1_type) temp_array$argnum[$1_dim0];
949 $1 = &temp_array$argnum[0];
951%typemap(argout) SWIGTYPE OUTPUT[ANY], SWIGTYPE INOUT[ANY] {
952 const size_t dims[1] = {$1_dim0};
953 const size_t strides[1] = {1};
955 %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidptr($1),
956 sizeof($1[0]), 1, dims, strides,
957 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
958 SWIG_POINTER_OWN | %newpointer_flags));
960%typemap(in, noblock=1, numinputs=0) SWIGTYPE OUTPUT[ANY][ANY] {
961 $typemap(swiglal_fixarr_ltype, $1_type) temp_array$argnum[$1_dim0][$1_dim1];
962 $1 = &temp_array$argnum[0];
964%typemap(argout) SWIGTYPE OUTPUT[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] {
965 const size_t dims[2] = {$1_dim0, $1_dim1};
966 const size_t strides[2] = {$1_dim1, 1};
968 %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voidptr($1),
969 sizeof($1[0][0]), 2, dims, strides,
970 $typemap(swiglal_fixarr_isptr, $1_type), $typemap(swiglal_fixarr_tinfo, $1_type),
971 SWIG_POINTER_OWN | %newpointer_flags));
978%define %swiglal_public_OUTPUT_ARRAY_1D(
TYPE, ...)
979%swiglal_map_ab(%swiglal_apply, SWIGTYPE OUTPUT[ANY],
TYPE, __VA_ARGS__);
981%define %swiglal_public_clear_OUTPUT_ARRAY_1D(
TYPE, ...)
982%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
984%define %swiglal_public_OUTPUT_ARRAY_2D(
TYPE, ...)
985%swiglal_map_ab(%swiglal_apply, SWIGTYPE OUTPUT[ANY][ANY],
TYPE, __VA_ARGS__);
987%define %swiglal_public_clear_OUTPUT_ARRAY_2D(
TYPE, ...)
988%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
991%define %swiglal_public_INOUT_ARRAY_1D(
TYPE, ...)
992%swiglal_map_ab(%swiglal_apply, SWIGTYPE INOUT[ANY],
TYPE, __VA_ARGS__);
994%define %swiglal_public_clear_INOUT_ARRAY_1D(
TYPE, ...)
995%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
997%define %swiglal_public_INOUT_ARRAY_2D(
TYPE, ...)
998%swiglal_map_ab(%swiglal_apply, SWIGTYPE INOUT[ANY][ANY],
TYPE, __VA_ARGS__);
1000%define %swiglal_public_clear_INOUT_ARRAY_2D(
TYPE, ...)
1001%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1014%typemap(swiglal_dynarr_tinfo) SWIGTYPE
"$&descriptor";
1015%typemap(swiglal_dynarr_tinfo) SWIGTYPE*
"$descriptor";
1017%typemap(swiglal_dynarr_isptr) SWIGTYPE
"false";
1018%typemap(swiglal_dynarr_isptr) SWIGTYPE*
"true";
1024%define %swiglal_array_dynamic_size(SIZET, NI)
1025%feature(
"action") NI {
1026 result = %static_cast(arg1->NI, SIZET);
1031%feature(
"action",
"") NI;
1037%define %swiglal_array_dynamic_check_strides(NAME,
DATA, I)
1038if (strides[I-1] == 0) {
1039 SWIG_exception_fail(SWIG_IndexError,
"Stride of dimension "#I
" of "#NAME
"."#
DATA" is zero");
1053%define %swiglal_array_dynamic_1D(NAME,
TYPE, SIZET,
DATA, NI, SI)
1057%typemap(in, noblock=1)
TYPE*
DATA (
size_t dims[1] = {0},
int elemalloc = 0) {
1059 dims[0] = %static_cast(NI,
size_t);
1060 const size_t strides[1] = {%static_cast(SI,
size_t)};
1061 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1062 $1 = %reinterpret_cast(arg1->DATA,
TYPE*);
1064 int res = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %as_voidptr($1), &elemalloc,
1065 sizeof(
TYPE), 1, dims, strides,
1066 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1067 $disown | %convertptr_flags);
1068 if (!SWIG_IsOK(res)) {
1069 %argument_fail(res,
"$type", $symname, $argnum);
1073%typemap(freearg, noblock=1)
TYPE*
DATA {
1074 swiglal_array_elemfree(%as_voidptr(arg1->DATA), &elemalloc$argnum,
sizeof(
TYPE), 1, dims$argnum);
1076%typemap(out, noblock=1)
TYPE*
DATA {
1078 const size_t dims[1] = {%static_cast(NI,
size_t)};
1079 const size_t strides[1] = {%static_cast(SI,
size_t)};
1080 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1081 $1 = %reinterpret_cast(arg1->DATA,
TYPE*);
1083 %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
1084 sizeof(
TYPE), 1, dims, strides,
1085 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1086 $owner | %newpointer_flags));
1093%typemap(memberin, noblock=1)
TYPE*
DATA "";
1094%typemap(argout, noblock=1)
TYPE*
DATA "";
1095%typemap(freearg, noblock=1)
TYPE*
DATA "";
1096%feature("action")
DATA "";
1097%feature("except")
DATA "";
1109%feature(
"action",
"")
DATA;
1110%feature("except", "")
DATA;
1119%define %swiglal_array_dynamic_1d_ptr_1d(NAME,
TYPE, SIZET,
DATA, NI, NJ, SJ)
1123%typemap(out, noblock=1)
TYPE*
DATA {
1125 const size_t dims[1] = {%static_cast(NJ,
size_t)};
1126 const size_t strides[1] = {%static_cast(SJ,
size_t)};
1127 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1128 if (((uint64_t)arg2) >= ((uint64_t)NI)) {
1129 SWIG_exception_fail(SWIG_IndexError,
"Index to "#NAME
"."#
DATA" is outside of range [0,"#NI
"]");
1131 $1 = %reinterpret_cast(arg1->DATA,
TYPE*)[arg2];
1133 %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
1134 sizeof(
TYPE), 1, dims, strides,
1135 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1136 $owner | %newpointer_flags));
1143%typemap(memberin, noblock=1)
TYPE*
DATA "";
1144%typemap(argout, noblock=1)
TYPE*
DATA "";
1145%typemap(freearg, noblock=1)
TYPE*
DATA "";
1146%feature("action")
DATA "";
1147%feature("except")
DATA "";
1159%feature(
"action",
"")
DATA;
1160%feature("except", "")
DATA;
1168%define %swiglal_array_dynamic_2D(NAME,
TYPE, SIZET,
DATA, NI, NJ, SI, SJ)
1172%typemap(in, noblock=1)
TYPE*
DATA (
size_t dims[2] = {0, 0},
int elemalloc = 0) {
1174 dims[0] = %static_cast(NI,
size_t); dims[1] = %static_cast(NJ,
size_t);
1175 const size_t strides[2] = {%static_cast(SI,
size_t), %static_cast(SJ,
size_t)};
1176 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1177 %swiglal_array_dynamic_check_strides(NAME,
DATA, 2);
1178 $1 = %reinterpret_cast(arg1->DATA,
TYPE*);
1180 int res = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %as_voidptr($1), &elemalloc,
1181 sizeof(
TYPE), 2, dims, strides,
1182 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1183 $disown | %convertptr_flags);
1184 if (!SWIG_IsOK(res)) {
1185 %argument_fail(res,
"$type", $symname, $argnum);
1189%typemap(freearg, noblock=1)
TYPE*
DATA {
1190 swiglal_array_elemfree(%as_voidptr(arg1->DATA), &elemalloc$argnum,
sizeof(
TYPE), 2, dims$argnum);
1192%typemap(out, noblock=1)
TYPE*
DATA {
1194 const size_t dims[2] = {%static_cast(NI,
size_t), %static_cast(NJ,
size_t)};
1195 const size_t strides[2] = {%static_cast(SI,
size_t), %static_cast(SJ,
size_t)};
1196 %swiglal_array_dynamic_check_strides(NAME,
DATA, 1);
1197 %swiglal_array_dynamic_check_strides(NAME,
DATA, 2);
1198 $1 = %reinterpret_cast(arg1->DATA,
TYPE*);
1200 %set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
1201 sizeof(
TYPE), 2, dims, strides,
1202 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1203 $owner | %newpointer_flags));
1210%typemap(memberin, noblock=1)
TYPE*
DATA "";
1211%typemap(argout, noblock=1)
TYPE*
DATA "";
1212%typemap(freearg, noblock=1)
TYPE*
DATA "";
1213%feature("action")
DATA "";
1214%feature("except")
DATA "";
1226%feature(
"action",
"")
DATA;
1227%feature("except", "")
DATA;
1253%define %swiglal_array_struct_1D(NAME,
TYPE, SIZET,
DATA, NI)
1257%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) %{
1258 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1259 if (!SWIG_IsOK(res)) {
1260 typedef struct { SIZET NI;
TYPE*
DATA; } sizchk_t;
1261 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1262 temp_struct.DATA = NULL;
1264 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_struct.DATA),
1265 sizeof(
TYPE), 1, dims,
1266 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1267 $disown | %convertptr_flags);
1268 if (!SWIG_IsOK(res)) {
1269 temp_data = temp_struct.DATA = %swiglal_new_array(dims[0],
TYPE);
1270 size_t strides[1] = {1};
1271 res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_struct.DATA), &elemalloc,
1272 sizeof(
TYPE), 1, dims, strides,
1273 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1274 $disown | %convertptr_flags);
1275 if (!SWIG_IsOK(res)) {
1276 %argument_fail(res,
"$type", $symname, $argnum);
1278 temp_struct.NI = %static_cast(dims[0], SIZET);
1279 argp = &temp_struct;
1282 temp_struct.NI = %static_cast(dims[0], SIZET);
1283 argp = &temp_struct;
1286 %argument_fail(res,
"$type", $symname, $argnum);
1289 $1 = %reinterpret_cast(argp, $ltype);
1291%typemap(freearg, match=
"in", noblock=1) const NAME* %{
1292 if (temp_data$argnum) {
1293 swiglal_array_elemfree(%as_voidptr(temp_data$argnum), &elemalloc$argnum,
sizeof(
TYPE), 1, dims$argnum);
1301%typemap(in, noblock=1) NAME* SWIGLAL_VIEWIN_ARRAY (
void *argp = 0,
int res = 0, NAME temp_struct) %{
1302 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1303 if (!SWIG_IsOK(res)) {
1304 typedef struct { SIZET NI;
TYPE*
DATA; } sizchk_t;
1305 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1306 size_t dims[1] = {0};
1307 temp_struct.DATA = NULL;
1309 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_struct.DATA),
1310 sizeof(
TYPE), 1, dims,
1311 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1312 $disown | %convertptr_flags);
1313 if (!SWIG_IsOK(res)) {
1314 %argument_fail(res,
"$type", $symname, $argnum);
1316 temp_struct.NI = %static_cast(dims[0], SIZET);
1317 argp = &temp_struct;
1320 %argument_fail(res,
"$type", $symname, $argnum);
1323 $1 = %reinterpret_cast(argp, $ltype);
1333%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) %{
1334 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1335 if (!SWIG_IsOK(res)) {
1336 typedef struct { SIZET NI;
TYPE*
DATA; } sizchk_t;
1337 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1339 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_data),
1340 sizeof(
TYPE), 1, dims,
1341 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1342 $disown | %convertptr_flags);
1344 temp_data = temp_struct.DATA = %swiglal_new_array(dims[0],
TYPE);
1345 size_t strides[1] = {1};
1346 res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_data), &elemalloc,
1347 sizeof(
TYPE), 1, dims, strides,
1348 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1349 $disown | %convertptr_flags);
1350 if (!SWIG_IsOK(res)) {
1351 %argument_fail(res,
"$type", $symname, $argnum);
1353 temp_struct.NI = %static_cast(dims[0], SIZET);
1354 argp = &temp_struct;
1357 %argument_fail(res,
"$type", $symname, $argnum);
1360 %argument_fail(res,
"$type", $symname, $argnum);
1365 $1 = %reinterpret_cast(argp, $ltype);
1367%typemap(argout, match=
"in", noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY %{
1368 if (temp_data$argnum) {
1369 const size_t dims[1] = {%static_cast(temp_struct$argnum.NI,
size_t)};
1370 const size_t strides[1] = {1};
1372 %append_output(%swiglal_array_copyout(
TYPE*)(swiglal_no_self(), %as_voidptr(temp_data$argnum),
1373 sizeof(
TYPE), 1, dims, strides,
1374 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1375 SWIG_POINTER_OWN | %newpointer_flags));
1377 %append_output(swiglal_get_reference(input_ref$argnum));
1380%typemap(freearg, match=
"in", noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY %{
1381 if (temp_data$argnum) {
1382 swiglal_array_elemfree(%as_voidptr(temp_data$argnum), &elemalloc$argnum,
sizeof(
TYPE), 1, dims$argnum);
1392%define %swiglal_array_struct_2D(NAME,
TYPE, SIZET,
DATA, NI, NJ)
1396%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) %{
1397 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1398 if (!SWIG_IsOK(res)) {
1399 typedef struct { SIZET NI; SIZET NJ;
TYPE*
DATA; } sizchk_t;
1400 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1401 temp_struct.DATA = NULL;
1403 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_struct.DATA),
1404 sizeof(
TYPE), 2, dims,
1405 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1406 $disown | %convertptr_flags);
1407 if (!SWIG_IsOK(res)) {
1408 temp_data = temp_struct.DATA = %swiglal_new_array(dims[0] * dims[1],
TYPE);
1409 size_t strides[2] = {dims[1], 1};
1410 res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_struct.DATA), &elemalloc,
1411 sizeof(
TYPE), 2, dims, strides,
1412 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1413 $disown | %convertptr_flags);
1414 if (!SWIG_IsOK(res)) {
1415 %argument_fail(res,
"$type", $symname, $argnum);
1417 temp_struct.NI = %static_cast(dims[0], SIZET);
1418 temp_struct.NJ = %static_cast(dims[1], SIZET);
1419 argp = &temp_struct;
1422 temp_struct.NI = %static_cast(dims[0], SIZET);
1423 temp_struct.NJ = %static_cast(dims[1], SIZET);
1424 argp = &temp_struct;
1427 %argument_fail(res,
"$type", $symname, $argnum);
1430 $1 = %reinterpret_cast(argp, $ltype);
1432%typemap(freearg, match=
"in", noblock=1) const NAME* %{
1433 if (temp_data$argnum) {
1434 swiglal_array_elemfree(%as_voidptr(temp_data$argnum), &elemalloc$argnum,
sizeof(
TYPE), 2, dims$argnum);
1442%typemap(in, noblock=1) NAME* SWIGLAL_VIEWIN_ARRAY (
void *argp = 0,
int res = 0, NAME temp_struct) %{
1443 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1444 if (!SWIG_IsOK(res)) {
1445 typedef struct { SIZET NI; SIZET NJ;
TYPE*
DATA; } sizchk_t;
1446 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1447 size_t dims[2] = {0, 0};
1448 temp_struct.DATA = NULL;
1450 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_struct.DATA),
1451 sizeof(
TYPE), 2, dims,
1452 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1453 $disown | %convertptr_flags);
1454 if (!SWIG_IsOK(res)) {
1455 %argument_fail(res,
"$type", $symname, $argnum);
1457 temp_struct.NI = %static_cast(dims[0], SIZET);
1458 temp_struct.NJ = %static_cast(dims[1], SIZET);
1459 argp = &temp_struct;
1462 %argument_fail(res,
"$type", $symname, $argnum);
1465 $1 = %reinterpret_cast(argp, $ltype);
1475%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) %{
1476 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1477 if (!SWIG_IsOK(res)) {
1478 typedef struct { SIZET NI; SIZET NJ;
TYPE*
DATA; } sizchk_t;
1479 if (!($disown) &&
sizeof(sizchk_t) ==
sizeof(NAME)) {
1481 res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_data),
1482 sizeof(
TYPE), 2, dims,
1483 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1484 $disown | %convertptr_flags);
1485 if (dims[0] * dims[1] > 0) {
1486 temp_data = temp_struct.DATA = %swiglal_new_array(dims[0] * dims[1],
TYPE);
1487 size_t strides[2] = {dims[1], 1};
1488 res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_data), &elemalloc,
1489 sizeof(
TYPE), 2, dims, strides,
1490 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1491 $disown | %convertptr_flags);
1492 if (!SWIG_IsOK(res)) {
1493 %argument_fail(res,
"$type", $symname, $argnum);
1495 temp_struct.NI = %static_cast(dims[0], SIZET);
1496 temp_struct.NJ = %static_cast(dims[1], SIZET);
1497 argp = &temp_struct;
1500 %argument_fail(res,
"$type", $symname, $argnum);
1503 %argument_fail(res,
"$type", $symname, $argnum);
1508 $1 = %reinterpret_cast(argp, $ltype);
1510%typemap(argout, match=
"in", noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY %{
1511 if (temp_data$argnum) {
1512 const size_t dims[2] = {%static_cast(temp_struct$argnum.NI,
size_t), %static_cast(temp_struct$argnum.NJ,
size_t)};
1513 const size_t strides[2] = {dims[1], 1};
1515 %append_output(%swiglal_array_copyout(
TYPE*)(swiglal_no_self(), %as_voidptr(temp_data$argnum),
1516 sizeof(
TYPE), 2, dims, strides,
1517 $typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
1518 SWIG_POINTER_OWN | %newpointer_flags));
1520 %append_output(swiglal_get_reference(input_ref$argnum));
1523%typemap(freearg, match=
"in", noblock=1) NAME* SWIGLAL_COPYINOUT_ARRAY %{
1524 if (temp_data$argnum) {
1525 swiglal_array_elemfree(%as_voidptr(temp_data$argnum), &elemalloc$argnum,
sizeof(
TYPE), 2, dims$argnum);
1540%define %swiglal_public_VIEWIN_ARRAYS(NAME, ...)
1541%swiglal_map_ab(%swiglal_apply, NAME* SWIGLAL_VIEWIN_ARRAY, NAME*, __VA_ARGS__);
1543%define %swiglal_public_clear_VIEWIN_ARRAYS(NAME, ...)
1544%swiglal_map_a(%swiglal_clear, NAME*, __VA_ARGS__);
1552%define %swiglal_public_COPYINOUT_ARRAYS(NAME, ...)
1553%swiglal_map_ab(%swiglal_apply, NAME* SWIGLAL_COPYINOUT_ARRAY, NAME*, __VA_ARGS__);
1555%define %swiglal_public_clear_COPYINOUT_ARRAYS(NAME, ...)
1556%swiglal_map_a(%swiglal_clear, NAME*, __VA_ARGS__);
1564%define %swiglal_public_ARRAY_1D(NAME,
TYPE,
DATA, SIZET, NI)
1565%swiglal_array_dynamic_size(SIZET, NI);
1566%swiglal_array_dynamic_1D(NAME,
TYPE, SIZET,
DATA, arg1->NI, 1);
1570#define %swiglal_public_clear_ARRAY_1D(NAME, TYPE, DATA, SIZET, NI)
1573%define %swiglal_public_ARRAY_STRUCT_1D(NAME,
TYPE,
DATA, SIZET, NI)
1574%swiglal_public_ARRAY_1D(NAME,
TYPE,
DATA, SIZET, NI)
1575%swiglal_array_struct_1D(NAME,
TYPE, SIZET,
DATA, NI);
1577#define %swiglal_public_clear_ARRAY_STRUCT_1D(NAME, TYPE, DATA, SIZET, NI)
1581%define %swiglal_public_ARRAY_1D_PTR_1D(NAME,
TYPE,
DATA, SIZET, NI, NJ)
1582%swiglal_array_dynamic_size(SIZET, NI);
1583%swiglal_array_dynamic_size(SIZET, NJ);
1584%swiglal_array_dynamic_1d_ptr_1d(NAME,
TYPE, SIZET,
DATA, arg1->NI, arg1->NJ, 1);
1588#define %swiglal_public_clear_ARRAY_1D_PTR_1D(NAME, TYPE, DATA, SIZET, NI, NJ)
1591%define %swiglal_public_ARRAY_2D(NAME,
TYPE,
DATA, SIZET, NI, NJ)
1592%swiglal_array_dynamic_size(SIZET, NI);
1593%swiglal_array_dynamic_size(SIZET, NJ);
1594%swiglal_array_dynamic_2D(NAME,
TYPE, SIZET,
DATA, arg1->NI, arg1->NJ, arg1->NJ, 1);
1599#define %swiglal_public_clear_ARRAY_2D(NAME, TYPE, DATA, SIZET, NI, NJ)
1602%define %swiglal_public_ARRAY_STRUCT_2D(NAME,
TYPE,
DATA, SIZET, NI, NJ)
1603%swiglal_public_ARRAY_2D(NAME,
TYPE,
DATA, SIZET, NI, NJ)
1604%swiglal_array_struct_2D(NAME,
TYPE, SIZET,
DATA, NI, NJ);
1606#define %swiglal_public_clear_ARRAY_2D(NAME, TYPE, DATA, SIZET, NI, NJ)
1609%define %swiglal_public_ARRAY_2D_FIXED(NAME, ETYPE,
ATYPE,
DATA, SIZET, NI)
1610%swiglal_array_dynamic_size(SIZET, NI);
1611%swiglal_array_dynamic_2D(NAME, ETYPE, SIZET,
DATA, arg1->NI, (
sizeof(
ATYPE)/
sizeof(ETYPE)), (
sizeof(
ATYPE)/
sizeof(ETYPE)), 1);
1615#define %swiglal_public_clear_ARRAY_2D_FIXED(NAME, ETYPE, ATYPE, DATA, SIZET, NI)
1624%define %swiglal_public_ARRAY_MULTIPLE_LENGTHS(TAGNAME, ...)
1625%swiglal_map_ab(%swiglal_warnfilter_nspace, SWIGWARN_PARSE_REDEFINED, TAGNAME, __VA_ARGS__);
1627#define %swiglal_public_clear_ARRAY_MULTIPLE_LENGTHS(TAGNAME, ...)
1632#if defined(SWIGOCTAVE)
1633%include <
lal/SWIGOctave.i>
1634#elif defined(SWIGPYTHON)
1635%include <
lal/SWIGPython.i>
1637#error Unrecognised scripting language
1656%typemap(newfree, noblock=1) int SWIGLAL_MAYBE_RETURN_INT {
1657 swiglal_maybe_return_int();
1669%define %swiglal_public_EMPTY_ARGUMENT(
TYPE, ...)
1670%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT,
TYPE, __VA_ARGS__);
1672%define %swiglal_public_clear_EMPTY_ARGUMENT(
TYPE, ...)
1673%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1675%typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT ($*ltype emptyarg) {
1676 memset(&emptyarg, 0,
sizeof($*type));
1679%#define swiglal_no_1starg
1682%typemap(freearg, noblock=1) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT {
1683%#undef swiglal_no_1starg
1685%define %swiglal_public_NEW_EMPTY_ARGUMENT(
TYPE, ...)
1686%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT,
TYPE, __VA_ARGS__);
1688%define %swiglal_public_clear_NEW_EMPTY_ARGUMENT(
TYPE, ...)
1689%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1691%typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT {
1692 $1 = %swiglal_new_instance($*type);
1694%#define swiglal_no_1starg
1697%typemap(freearg, noblock=1) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT {
1698%#undef swiglal_no_1starg
1705%define %swiglal_numeric_typedef(CHECKCODE,
BASETYPE,
TYPE)
1707%numeric_type_asval(
TYPE,
BASETYPE,
"swiglal_empty_frag",
false);
1708%typemaps_primitive(%checkcode(CHECKCODE),
TYPE);
1710%swiglal_numeric_typedef(
INT8,
signed char, int8_t);
1711%swiglal_numeric_typedef(
UINT8,
unsigned char, uint8_t);
1712%swiglal_numeric_typedef(INT16,
short, int16_t);
1713%swiglal_numeric_typedef(
UINT16,
unsigned short, uint16_t);
1714%swiglal_numeric_typedef(INT32,
int, int32_t);
1715%swiglal_numeric_typedef(UINT32,
unsigned int, uint32_t);
1716%swiglal_numeric_typedef(INT64,
long long, int64_t);
1717%swiglal_numeric_typedef(UINT64,
unsigned long long, uint64_t);
1724%fragment(SWIG_From_frag(
BOOLEAN),
"header", fragment=SWIG_From_frag(
bool)) {
1725 SWIGINTERNINLINE SWIG_Object SWIG_From_dec(
BOOLEAN)(
BOOLEAN value) {
1726 return SWIG_From(
bool)(value ? true :
false);
1729%fragment(SWIG_AsVal_frag(
BOOLEAN),
"header", fragment=SWIG_AsVal_frag(
bool)) {
1730 SWIGINTERN
int SWIG_AsVal_dec(
BOOLEAN)(SWIG_Object obj,
BOOLEAN *val) {
1732 int res = SWIG_AsVal(
bool)(obj, val ? &v : 0);
1733 if (!SWIG_IsOK(res)) {
1734 return SWIG_TypeError;
1742%typemaps_primitive(%checkcode(BOOL),
BOOLEAN);
1750%fragment(
"SWIG_FromLALcharPtrAndSize",
"header", fragment=
"SWIG_FromCharPtrAndSize") {
1751 SWIGINTERNINLINE SWIG_Object SWIG_FromLALcharPtrAndSize(
const char *str,
size_t size) {
1752 return SWIG_FromCharPtrAndSize(str, size);
1755%fragment(
"SWIG_AsLALcharPtrAndSize",
"header", fragment=
"SWIG_AsCharPtrAndSize") {
1756 SWIGINTERN
int SWIG_AsLALcharPtrAndSize(SWIG_Object obj,
char **pstr,
size_t *psize,
int *alloc) {
1761 if (swiglal_null_ptr(obj)) {
1769 int res = SWIG_AsCharPtrAndSize(obj, &slstr, &slsize, &slalloc);
1770 if (!SWIG_IsOK(res)) {
1771 return SWIG_TypeError;
1781 *pstr = %swiglal_new_copy_array(slstr, slsize,
char);
1782 *alloc = SWIG_NEWOBJ;
1785 return SWIG_TypeError;
1793 if (slalloc == SWIG_NEWOBJ) {
1794 %delete_array(slstr);
1799#if SWIG_VERSION >= 0x040100
1800%typemaps_string_alloc(%checkcode(
STRING), %checkcode(
char),
1801 SWIGWARN_TYPEMAP_CHARLEAK_MSG,
char, LALchar,
1802 SWIG_AsLALcharPtrAndSize, SWIG_FromLALcharPtrAndSize,
1803 strlen, SWIG_strnlen, %swiglal_new_copy_array,
XLALFree,
1804 "<limits.h>", CHAR_MIN, CHAR_MAX);
1806%typemaps_string_alloc(%checkcode(
STRING), %checkcode(
char),
char, LALchar,
1807 SWIG_AsLALcharPtrAndSize, SWIG_FromLALcharPtrAndSize,
1808 strlen, SWIG_strnlen, %swiglal_new_copy_array,
XLALFree,
1809 "<limits.h>", CHAR_MIN, CHAR_MAX);
1819%typemap(in, noblock=1, numinputs=0) char ** (
char *str = NULL,
int alloc = 0) {
1820 $1 = %reinterpret_cast(&str, $ltype);
1823%typemap(in, noblock=1, fragment=
"SWIG_AsLALcharPtrAndSize") char ** INOUT (
char *str = NULL,
int alloc = 0,
int res = 0) {
1824 res = SWIG_AsLALcharPtr($input, &str, &alloc);
1825 if (!SWIG_IsOK(res)) {
1826 %argument_fail(res,
"$type", $symname, $argnum);
1828 $1 = %reinterpret_cast(&str, $ltype);
1830%typemap(argout, noblock=1) char ** {
1831 %append_output(SWIG_FromLALcharPtr(str$argnum));
1833%typemap(freearg, match=
"in") char ** {
1834 if (SWIG_IsNewObj(alloc$argnum)) {
1838%define %swiglal_public_INOUT_STRINGS(...)
1839%swiglal_map_ab(%swiglal_apply,
char ** INOUT,
char **, __VA_ARGS__);
1841%define %swiglal_public_clear_INOUT_STRINGS(...)
1842%swiglal_map_a(%swiglal_clear,
char **, __VA_ARGS__);
1848%typemap(newfree, noblock=1) const
char* "";
1857%typemap(in, noblock=1) const SWIGTYPE * (
void *argp = 0,
int res = 0) {
1858 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
1859 if (!SWIG_IsOK(res)) {
1860 %argument_fail(res,
"$type", $symname, $argnum);
1862 $1 = %reinterpret_cast(argp, $ltype);
1864%typemap(freearg)
const SWIGTYPE *
"";
1871%typemap(memberin, noblock=1) const SWIGTYPE * {
1872 if (arg1) *($type*)&(arg1)->$name = ($type)arg2;
1886%define %swiglal_store_parent(PTR, OWNER, SELF)
1887%#
if !(OWNER & SWIG_POINTER_OWN)
1888 if (%as_voidptr(PTR) != NULL) {
1889 swiglal_store_parent(%as_voidptr(PTR), SELF);
1906%define %swiglal_set_output(NAME, OBJ)
1907%#
if defined(swiglal_return_1starg_##NAME) && !defined(swiglal_no_1starg)
1908 if (result != NULL && result == arg1) {
1909 %set_output(swiglal_get_reference(swiglal_1starg()));
1917%typemap(out, noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] {
1918 %swiglal_store_parent($1, $owner, swiglal_self());
1919 %swiglal_set_output($1_name, SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
1921%typemap(out, noblock=1) const SWIGTYPE *, const SWIGTYPE &, const SWIGTYPE[] {
1922 %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %newpointer_flags) & ~SWIG_POINTER_OWN));
1924%typemap(out, noblock=1) SWIGTYPE *const& {
1925 %swiglal_store_parent(*$1, $owner, swiglal_self());
1926 %swiglal_set_output($1_name, SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
1928%typemap(out, noblock=1) const SWIGTYPE *const& {
1929 %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner | %newpointer_flags) & ~SWIG_POINTER_OWN));
1931%typemap(out, noblock=1) SWIGTYPE (
void* copy = NULL) {
1932 copy = %swiglal_new_copy($1, $ltype);
1933 %swiglal_store_parent(copy, SWIG_POINTER_OWN, swiglal_self());
1934 %set_output(SWIG_NewPointerObj(copy, $&descriptor, (%newpointer_flags) | SWIG_POINTER_OWN));
1936%typemap(varout, noblock=1) SWIGTYPE *, SWIGTYPE [] {
1937 %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, (%newpointer_flags) & ~SWIG_POINTER_OWN));
1939%typemap(varout, noblock=1) SWIGTYPE & {
1940 %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, (%newpointer_flags) & ~SWIG_POINTER_OWN));
1942%typemap(varout, noblock=1) SWIGTYPE {
1943 %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, (%newpointer_flags) & ~SWIG_POINTER_OWN));
1950%apply
bool* OUTPUT {
bool* };
1952%apply
int* OUTPUT {
enum SWIGTYPE* };
1953%apply
short* OUTPUT {
short* };
1954%apply
unsigned short* OUTPUT {
unsigned short* };
1955%apply
int* OUTPUT {
int* };
1956%apply
unsigned int* OUTPUT {
unsigned int* };
1957%apply
long* OUTPUT {
long* };
1958%apply
unsigned long* OUTPUT {
unsigned long* };
1959%apply
long long* OUTPUT {
long long* };
1960%apply
unsigned long long* OUTPUT {
unsigned long long* };
1961%apply
float* OUTPUT {
float* };
1962%apply
double* OUTPUT {
double* };
1963%apply int8_t* OUTPUT { int8_t* };
1964%apply uint8_t* OUTPUT { uint8_t* };
1965%apply int16_t* OUTPUT { int16_t* };
1966%apply uint16_t* OUTPUT { uint16_t* };
1967%apply int32_t* OUTPUT { int32_t* };
1968%apply uint32_t* OUTPUT { uint32_t* };
1969%apply int64_t* OUTPUT { int64_t* };
1970%apply uint64_t* OUTPUT { uint64_t* };
1971%apply gsl_complex_float* OUTPUT { gsl_complex_float* };
1972%apply gsl_complex* OUTPUT { gsl_complex* };
1979%define %swiglal_public_INOUT_SCALARS(
TYPE, ...)
1980%swiglal_map_ab(%swiglal_apply,
TYPE INOUT,
TYPE, __VA_ARGS__);
1982%define %swiglal_public_clear_INOUT_SCALARS(
TYPE, ...)
1983%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
1989%typemap(argout, noblock=1) SWIGTYPE* SWIGLAL_INPUT_SCALAR "";
1990%define %swiglal_public_INPUT_SCALARS(
TYPE, ...)
1991%swiglal_map_ab(%swiglal_apply,
TYPE INPUT,
TYPE, __VA_ARGS__);
1992%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_INPUT_SCALAR,
TYPE, __VA_ARGS__);
1994%define %swiglal_public_clear_INPUT_SCALARS(
TYPE, ...)
1995%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2016%typemap(in, noblock=1, numinputs=0) SWIGTYPE ** (
void *argp = NULL) {
2017 $1 = %reinterpret_cast(&argp, $ltype);
2019%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(
int)) SWIGTYPE ** INOUT (SWIG_Object inobj,
void *inarg = NULL,
void *inoutarg = NULL,
int res = 0) {
2021 res = SWIG_ConvertPtr(inobj, &inarg, $*descriptor, ($disown | %convertptr_flags) & ~SWIG_POINTER_DISOWN);
2022 if (!SWIG_IsOK(res)) {
2024 res = SWIG_AsVal(
int)(inobj, &val);
2025 if (!SWIG_IsOK(res) || val != 0) {
2026 %argument_fail(res,
"$type", $symname, $argnum);
2028 inoutarg = inarg = NULL;
2029 $1 = %reinterpret_cast(&inoutarg, $ltype);
2033 if (inoutarg == NULL) {
2036 $1 = %reinterpret_cast(&inoutarg, $ltype);
2040%typemap(argout, noblock=1) SWIGTYPE ** {
2041 %append_output(SWIG_NewPointerObj($1 != NULL ? %as_voidptr(*$1) : NULL, $*descriptor, %newpointer_flags | SWIG_POINTER_OWN));
2043%typemap(argout, noblock=1) SWIGTYPE ** INOUT {
2044 if ($1 != NULL && *$1 != NULL && *$1 == inarg$argnum) {
2045 %append_output(swiglal_get_reference(inobj$argnum));
2047 %append_output(SWIG_NewPointerObj($1 != NULL ? %as_voidptr(*$1) : NULL, $*descriptor, %newpointer_flags | SWIG_POINTER_OWN));
2050%typemap(freearg) SWIGTYPE **
"";
2051%define %swiglal_public_INOUT_STRUCTS(
TYPE, ...)
2052%swiglal_map_ab(%swiglal_apply, SWIGTYPE ** INOUT,
TYPE, __VA_ARGS__);
2054%define %swiglal_public_clear_INOUT_STRUCTS(
TYPE, ...)
2055%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2063%typemap(in, fragment=
"SWIG_AsLALcharPtrAndSize") (
const char *SWIGLAL_PRINTF_FORMAT, ...)
2064(
char fmt[] =
"%s",
char *str = 0,
int alloc = 0)
2067 int res = SWIG_AsLALcharPtr($input, &str, &alloc);
2068 if (!SWIG_IsOK(res)) {
2069 %argument_fail(res,
"$type", $symname, $argnum);
2073%typemap(freearg, match=
"in") (
const char *format, ...) {
2074 if (SWIG_IsNewObj(alloc$argnum)) {
2078%apply (
const char *SWIGLAL_PRINTF_FORMAT, ...) {
2079 (
const char *format, ...), (
const char *fmt, ...)
2090%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(
int)) FILE* (
void *argp = 0,
int res = 0) {
2091 res = SWIG_ConvertPtr($input, &argp, $descriptor, $disown | %convertptr_flags);
2092 if (!SWIG_IsOK(res)) {
2094 res = SWIG_AsVal(
int)($input, &val);
2095 if (!SWIG_IsOK(res)) {
2096 %argument_fail(res,
"$type", $symname, $argnum);
2109 %argument_fail(SWIG_ValueError,
"$type", $symname, $argnum);
2113 $1 = %reinterpret_cast(argp, $ltype);
2116%typemap(freearg) FILE*
"";
2128%define %swiglal_specialised_typemaps(TAGNAME, FRAGMENT)
2129%typemap(in, noblock=1, fragment=FRAGMENT)
2130 struct TAGNAME (void *argp = 0,
int res = 0),
2131 const struct TAGNAME (
void *argp = 0,
int res = 0)
2133 res = SWIG_ConvertPtr($input, &argp, $&descriptor, $disown | %convertptr_flags);
2134 if (!SWIG_IsOK(res)) {
2135 res = swiglal_specialised_##TAGNAME($input, &$1);
2136 if (!SWIG_IsOK(res)) {
2137 %argument_fail(res,
"$type", $symname, $argnum);
2141 %argument_nullref(
"$type", $symname, $argnum);
2143 $<ype temp_ptr = %reinterpret_cast(argp, $<ype);
2145 if (SWIG_IsNewObj(res)) {
2151%typemap(freearg)
struct TAGNAME, const struct TAGNAME "";
2152%typemap(in, noblock=1, fragment=FRAGMENT)
2153 struct TAGNAME* (
struct TAGNAME temp_struct, void *argp = 0,
int res = 0),
2154 const struct TAGNAME* (
struct TAGNAME temp_struct,
void *argp = 0,
int res = 0)
2156 res = SWIG_ConvertPtr($input, &argp, $descriptor, $disown | %convertptr_flags);
2157 if (!SWIG_IsOK(res)) {
2158 res = swiglal_specialised_##TAGNAME($input, &temp_struct);
2159 if (!SWIG_IsOK(res)) {
2160 %argument_fail(res,
"$type", $symname, $argnum);
2162 $1 = %reinterpret_cast(&temp_struct, $ltype);
2165 $1 = %reinterpret_cast(argp, $ltype);
2168%typemap(freearg)
struct TAGNAME*,
const struct TAGNAME*
"";
2169%typemap(typecheck, fragment=FRAGMENT, precedence=SWIG_TYPECHECK_SWIGOBJECT)
struct TAGNAME, const struct TAGNAME {
2171 int res = SWIG_ConvertPtr($input, &argp, $&descriptor, 0);
2172 $1 = SWIG_CheckState(res);
2174 struct TAGNAME temp_struct;
2175 res = swiglal_specialised_##TAGNAME($input, &temp_struct);
2176 $1 = SWIG_CheckState(res);
2179%typemap(typecheck, fragment=FRAGMENT, precedence=SWIG_TYPECHECK_SWIGOBJECT)
struct TAGNAME*,
const struct TAGNAME* {
2181 int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0);
2182 $1 = SWIG_CheckState(res);
2184 struct TAGNAME temp_struct;
2185 res = swiglal_specialised_##TAGNAME($input, &temp_struct);
2186 $1 = SWIG_CheckState(res);
2190%define %swiglal_specialised_ptr_typemaps(TAGNAME, FRAGMENT)
2191%typemap(in, noblock=1, fragment=FRAGMENT)
2192 struct TAGNAME* (
struct TAGNAME* temp_ptr = 0,
void *argp = 0,
int res = 0),
2193 const struct TAGNAME* (
struct TAGNAME* temp_ptr = 0,
void *argp = 0,
int res = 0)
2195 res = SWIG_ConvertPtr($input, &argp, $descriptor, $disown | %convertptr_flags);
2196 if (!SWIG_IsOK(res)) {
2197 res = swiglal_specialised_ptr_##TAGNAME($input, &temp_ptr);
2198 if (!SWIG_IsOK(res)) {
2199 %argument_fail(res,
"$type", $symname, $argnum);
2201 $1 = %reinterpret_cast(temp_ptr, $ltype);
2204 $1 = %reinterpret_cast(argp, $ltype);
2207%typemap(freearg)
struct TAGNAME*,
const struct TAGNAME* {
2208 if (temp_ptr$argnum) {
2209 swiglal_specialised_ptr_##TAGNAME##_destroy(temp_ptr$argnum);
2212%typemap(typecheck, fragment=FRAGMENT, precedence=SWIG_TYPECHECK_SWIGOBJECT)
struct TAGNAME*,
const struct TAGNAME* {
2214 int res = SWIG_ConvertPtr($input, &argp, $descriptor, 0);
2215 $1 = SWIG_CheckState(res);
2217 struct TAGNAME* temp_ptr;
2218 res = swiglal_specialised_##TAGNAME($input, &temp_ptr);
2219 $1 = SWIG_CheckState(res);
2220 swiglal_specialised_ptr_##TAGNAME##_destroy(temp_ptr);
2233%define %swiglal_public_RETURN_VOID(
TYPE, ...)
2234%swiglal_map_ab(%swiglal_apply, SWIGTYPE SWIGLAL_RETURN_VOID,
TYPE, __VA_ARGS__);
2236%define %swiglal_public_clear_RETURN_VOID(
TYPE, ...)
2237%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2239%typemap(out, noblock=1) SWIGTYPE SWIGLAL_RETURN_VOID {
2240 %set_output(VOID_Object);
2248%define %swiglal_public_RETURN_VALUE(
TYPE, ...)
2249%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2251#define %swiglal_public_clear_RETURN_VALUE(TYPE, ...)
2257%define %swiglal_public_DISABLE_EXCEPTIONS(...)
2258%swiglal_map_ab(%swiglal_feature,
"except",
"$action", __VA_ARGS__);
2260#define %swiglal_public_clear_DISABLE_EXCEPTIONS(...)
2266%define %swiglal_public_FUNCTION_POINTER(...)
2267%swiglal_map_ab(%swiglal_feature,
"callback",
"%sPtr", __VA_ARGS__);
2269#define %swiglal_public_clear_FUNCTION_POINTER(...)
2279%define %swiglal_public_VARIABLE_ARGUMENT_LIST(FUNCTION,
TYPE, ENDVALUE)
2280%feature(
"kwargs", 0) FUNCTION;
2281%feature("compactdefaultargs") FUNCTION;
2282%varargs(11,
TYPE arg = ENDVALUE) FUNCTION;
2288#define %swiglal_public_clear_VARIABLE_ARGUMENT_LIST(FUNCTION, TYPE, ENDVALUE)
2298%define %swiglal_public_RETURN_OWNED_BY_1ST_ARG(
TYPE, ...)
2299%swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_RETURN_OWNED_BY_1ST_ARG,
TYPE, __VA_ARGS__);
2301%define %swiglal_public_clear_RETURN_OWNED_BY_1ST_ARG(
TYPE, ...)
2302%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2304%typemap(out, noblock=1) SWIGTYPE* SWIGLAL_RETURN_OWNED_BY_1ST_ARG {
2305%#ifndef swiglal_no_1starg
2306 %swiglal_store_parent($1, 0, swiglal_1starg());
2308 %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
2319%define %swiglal_public_OUTPUT_OWNED_BY_1ST_ARG(
TYPE, ...)
2320%swiglal_map_ab(%swiglal_apply, SWIGTYPE** SWIGLAL_OUTPUT_OWNED_BY_1ST_ARG,
TYPE, __VA_ARGS__);
2322%define %swiglal_public_clear_OUTPUT_OWNED_BY_1ST_ARG(
TYPE, ...)
2323%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2325%typemap(argout, noblock=1) SWIGTYPE** SWIGLAL_OUTPUT_OWNED_BY_1ST_ARG {
2326%#ifndef swiglal_no_1starg
2327 %swiglal_store_parent(*$1, 0, swiglal_1starg());
2329 %append_output(SWIG_NewPointerObj($1 != NULL ? %as_voidptr(*$1) : NULL, $*descriptor, %newpointer_flags | SWIG_POINTER_OWN));
2337%typemap(swiglal_owns_this_arg_is_char) SWIGTYPE
"0";
2338%typemap(swiglal_owns_this_arg_is_char)
char *
"1";
2339%typemap(swiglal_owns_this_arg_is_char)
const char *
"1";
2340%typemap(in, noblock=1) SWIGTYPE SWIGLAL_OWNS_THIS_ARG (
int res = 0) {
2341%#
if $typemap(swiglal_owns_this_arg_is_char, $1_type)
2345 res = SWIG_AsLALcharPtr($input, &str, &alloc);
2346 if (!SWIG_IsOK(res)) {
2347 %argument_fail(res,
"$type",$symname, $argnum);
2349 $1 = %reinterpret_cast(str, $1_ltype);
2352 res = SWIG_ConvertPtr($input, %as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags);
2353 if (!SWIG_IsOK(res)) {
2354 %argument_fail(res,
"$type", $symname, $argnum);
2358%define %swiglal_public_OWNS_THIS_ARG(
TYPE, ...)
2359%swiglal_map_ab(%swiglal_apply, SWIGTYPE SWIGLAL_OWNS_THIS_ARG,
TYPE, __VA_ARGS__);
2361%define %swiglal_public_clear_OWNS_THIS_ARG(
TYPE, ...)
2362%swiglal_map_a(%swiglal_clear,
TYPE, __VA_ARGS__);
2369%typemap(in, noblock=1) SWIGTYPE * SWIGLAL_NO_OWN_ON_ASSIGNMENT (
void *argp = 0,
int res = 0) {
2370 res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
2371 if (!SWIG_IsOK(res)) {
2372 %argument_fail(res,
"$type", $symname, $argnum);
2374 $1 = %reinterpret_cast(argp, $ltype);
2376%define %swiglal_public_NO_OWN_ON_ASSIGNMENT(...)
2377%swiglal_map_ab(%swiglal_apply, SWIGTYPE * SWIGLAL_NO_OWN_ON_ASSIGNMENT, SWIGTYPE *, __VA_ARGS__);
2379%define %swiglal_public_clear_NO_OWN_ON_ASSIGNMENT(
TYPE, ...)
2380%swiglal_map_a(%swiglal_clear, SWIGTYPE *, __VA_ARGS__);
2387%define %swiglal_public_EXTERNAL_STRUCT(NAME, DTORFUNC)
2388typedef struct {} NAME;
2392 (void)DTORFUNC($self);
2396#define %swiglal_public_clear_EXTERNAL_STRUCT(NAME, DTORFUNC)
2413%typemap(out, noblock=1) SWIGTYPE* SWIGLAL_RETURNS_SELF {
2414%#ifndef swiglal_no_1starg
2415 %swiglal_store_parent($1, 0, swiglal_self());
2417 %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN));
2419%define %swiglal_cast_struct(TOTYPE)
2421 %apply SWIGTYPE* SWIGLAL_RETURNS_SELF { TOTYPE* cast2##TOTYPE() };
2422 TOTYPE* cast2##TOTYPE() {
2423 return (TOTYPE*) $self;
2427%define %swiglal_public_CAST_STRUCT_TO(...)
2428%swiglal_map(%swiglal_cast_struct, __VA_ARGS__);
2430#define %swiglal_public_clear_CAST_STRUCT_TO(...)
2436%define %swiglal_public_IMMUTABLE_MEMBERS(TAGNAME, ...)
2437%swiglal_map_abc(%swiglal_feature_nspace,
"immutable",
"1", TAGNAME, __VA_ARGS__);
2439#define %swiglal_public_clear_IMMUTABLE_MEMBERS(...)
2445%define %swiglal_public_IGNORE_MEMBERS(TAGNAME, ...)
2446%swiglal_map_a(%swiglal_ignore_nspace, TAGNAME, __VA_ARGS__);
2448#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.