SWIG code which must appear before the LAL headers.
- Author
- Karl Wette
Standard output/error redirection
The swig_redirect_standard_output_error() function turns on/off standard output/error redirection for all LAL libraries. It returns whether redirection was previously turned on/off. The swig_lal_do_redirect_stdouterr
variable is defined in SWIGSharedVars.c
. See SWIGCommon.i
for further information.
%inline %{
return old_swig_lal_do_redirect_stdouterr;
}
%}
unsigned char BOOLEAN
Boolean logical type, see Headers LAL(Atomic)Datatypes.h for more details.
int swig_lal_do_redirect_stdouterr
The swig_lal_do_redirect_stdouterr variable turns on standard output/error redirection for all LAL li...
Error handling
Custom LAL/GSL error handlers which raise XLAL errors, so that they will be caught by the SWIG %exception
handler (instead of aborting, which will crash the user's scripting language session).
-
Print the supplied error message, then raise an XLAL error.
static int swig_lal_raise_hook(int sig, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
(void) vfprintf(stderr, fmt, ap);
va_end(ap);
(void)
fprintf(stderr,
"LALRaise: %s\n", strsignal(sig));
return 0;
}
int XLALSetErrno(int errnum)
Sets the XLAL error number to errnum, returns the new value.
@ XLAL_EFAILED
Generic failure.
-
Print the supplied error message, then raise an XLAL error.
static void swig_lal_abort_hook(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
(void) vfprintf(stderr, fmt, ap);
va_end(ap);
}
-
Print the supplied error message, then raise an XLAL error.
static void swig_lal_gsl_error_handler(
const char *reason,
const char *
file,
int line,
int errnum) {
XLALPrintError(
"GSL function failed: %s (errnum=%i)\n", reason, errnum);
}
int XLALPrintError(const char *fmt,...)
void XLALError(const char *func, const char *file, int line, int errnum)
Routine to set the XLAL error number and invoke the XLAL error handler.
Use nice custom error handlers by default.
%header %{
static int swig_set_error_handler_messages = 0;
%}
%init %{
swig_set_nice_error_handlers();
swig_set_error_handler_messages = 1;
%}
Set nice custom error handlers: replace default XLAL/LAL/GSL error handler with nice custom handlers, and ensure default XLAL error handler is used.
%inline %{
void swig_set_nice_error_handlers(void) {
if (swig_set_error_handler_messages) {
fprintf(stderr,
"*** WARNING: XLAL/LAL/GSL functions will now raise XLAL errors ***\n");
}
gsl_set_error_handler(swig_lal_gsl_error_handler);
}
%}
int(* lalRaiseHook)(int, const char *,...)
void(* lalAbortHook)(const char *,...)
XLALErrorHandlerType * XLALSetErrorHandler(XLALErrorHandlerType *newHandler)
Sets the error handler to a new handler and returns the old handler.
void XLALDefaultErrorHandler(const char *func, const char *file, int line, int errnum)
The default XLAL error handler.
Set nasty custom error handlers: use abort()
error handlers in XLAL/LAL/GSL, which can be useful when running scripting language interpreter under a debugger.
%inline %{
void swig_set_nasty_error_handlers(void) {
if (swig_set_error_handler_messages) {
fprintf(stderr,
"*** WARNING: XLAL/LAL/GSL functions will now abort() on error ***\n");
}
gsl_set_error_handler(NULL);
}
%}
int LALRaise(int sig, const char *fmt,...)
void LALAbort(const char *fmt,...)
void XLALAbortErrorHandler(const char *func, const char *file, int line, int errnum)
The XLAL error handler that raises SIGABRT.
GSL vectors and matrices
This macro create wrapping structs for GSL vectors and matrices.
-
GSL vector of type NAME
.
typedef struct {
%extend {
gsl_vector##NAME(const size_t n) {
return gsl_vector##NAME##_calloc(n);
}
gsl_vector##NAME(gsl_vector##NAME *v0) {
gsl_vector##NAME *v = gsl_vector##NAME##_alloc(v0->size);
gsl_vector##NAME##_memcpy(v, v0);
return v;
}
~gsl_vector##NAME() {
%swiglal_struct_call_dtor(gsl_vector##NAME##_free, $self);
}
}
%swiglal_array_dynamic_size(size_t, size);
%swiglal_array_dynamic_1D(gsl_vector##NAME,
TYPE,
size_t, data, arg1->size, arg1->stride);
} gsl_vector##NAME;
-
Typemap which attempts to view pointers to const
GSL vector.
%typemap(in, noblock=1) const gsl_vector##NAME* (void *argp = 0, int res = 0, gsl_vector##NAME##_view temp, void *temp_data = 0, size_t dims[1] = {0}, int elemalloc = 0) %{
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
if (!SWIG_IsOK(res)) {
if (!($disown)) {
void *data = NULL;
res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&data),
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (!SWIG_IsOK(res)) {
temp_data = data = %swiglal_new_array(dims[0],
TYPE);
size_t strides[1] = {1};
res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(data), &elemalloc,
sizeof(
TYPE), 1, dims, strides,
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (!SWIG_IsOK(res)) {
%argument_fail(res, "$type", $symname, $argnum);
} else {
temp = gsl_vector##NAME##_view_array(%reinterpret_cast(data,
BASETYPE*), dims[0]);
argp = &temp.vector;
}
} else {
temp = gsl_vector##NAME##_view_array(%reinterpret_cast(data,
BASETYPE*), dims[0]);
argp = &temp.vector;
}
} else {
%argument_fail(res, "$type", $symname, $argnum);
}
}
$1 = %reinterpret_cast(argp, $ltype);
%}
%typemap(freearg, match="in", noblock=1) const gsl_vector##NAME* %{
if (temp_data$argnum) {
}
%}
-
Typemap which attempts to view pointers to non-const
GSL vector.
%typemap(in, noblock=1) gsl_vector##NAME* SWIGLAL_VIEWIN_ARRAY (void *argp = 0, int res = 0, gsl_vector##NAME##_view temp) %{
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
if (!SWIG_IsOK(res)) {
if (!($disown)) {
size_t dims[1] = {0};
void *data = NULL;
res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&data),
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (!SWIG_IsOK(res)) {
%argument_fail(res, "$type", $symname, $argnum);
} else {
temp = gsl_vector##NAME##_view_array(%reinterpret_cast(data,
BASETYPE*), dims[0]);
argp = &temp.vector;
}
} else {
%argument_fail(res, "$type", $symname, $argnum);
}
}
$1 = %reinterpret_cast(argp, $ltype);
%}
-
Typemap which treats pointers to non-const
GSL vector as input-output arguments. The type of the output argument should always match that of the input argument, so:
- If the input argument is a SWIG-wrapped
NAME*
, just unwrap it and return a reference.
- If the input argument is a native scripting-language array, make an internal copy of it, use the copy, and return a native scripting-language array copy of the internal copy.
%typemap(in, noblock=1) gsl_vector##NAME* SWIGLAL_COPYINOUT_ARRAY (void *argp = 0, int res = 0, gsl_vector##NAME##_view temp, SWIG_Object input_ref, void *temp_data = 0, size_t dims[1] = {0}, int elemalloc = 0) %{
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
if (!SWIG_IsOK(res)) {
if (!($disown)) {
res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_data),
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (dims[0] > 0) {
temp_data = %swiglal_new_array(dims[0],
TYPE);
size_t strides[1] = {1};
res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_data), &elemalloc,
sizeof(
TYPE), 1, dims, strides,
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (!SWIG_IsOK(res)) {
%argument_fail(res, "$type", $symname, $argnum);
} else {
temp = gsl_vector##NAME##_view_array(%reinterpret_cast(temp_data,
BASETYPE*), dims[0]);
argp = &temp.vector;
}
} else {
%argument_fail(res, "$type", $symname, $argnum);
}
}
} else {
input_ref = $input;
}
$1 = %reinterpret_cast(argp, $ltype);
%}
%typemap(argout, match="in", noblock=1) gsl_vector##NAME* SWIGLAL_COPYINOUT_ARRAY %{
if (temp_data$argnum) {
const size_t dims[1] = {temp$argnum.vector.size};
const size_t strides[1] = {1};
%append_output(%swiglal_array_copyout(
TYPE*)(swiglal_no_self(), %as_voidptr(temp_data$argnum),
sizeof(
TYPE), 1, dims, strides,
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
SWIG_POINTER_OWN | %newpointer_flags));
} else {
%append_output(swiglal_get_reference(input_ref$argnum));
}
%}
%typemap(freearg, match="in", noblock=1) gsl_vector##NAME* SWIGLAL_COPYINOUT_ARRAY %{
if (temp_data$argnum) {
}
%}
-
GSL matrix of type NAME
.
typedef struct {
%extend {
gsl_matrix##NAME(const size_t n1, const size_t n2) {
return gsl_matrix##NAME##_calloc(n1, n2);
}
gsl_matrix##NAME(gsl_matrix##NAME *m0) {
gsl_matrix##NAME *
m = gsl_matrix##NAME##_alloc(m0->size1, m0->size2);
gsl_matrix##NAME##_memcpy(
m, m0);
}
~gsl_matrix##NAME() {
%swiglal_struct_call_dtor(gsl_matrix##NAME##_free, $self);
}
}
%swiglal_array_dynamic_size(size_t, size1);
%swiglal_array_dynamic_size(size_t, size2);
%swiglal_array_dynamic_2D(gsl_matrix##NAME,
TYPE,
size_t, data, arg1->size1, arg1->size2, arg1->tda, 1);
} gsl_matrix##NAME;
-
Typemap which attempts to view pointers to const
GSL matrix.
%typemap(in, noblock=1) const gsl_matrix##NAME* (void *argp = 0, int res = 0, gsl_matrix##NAME##_view temp, void *temp_data = 0, size_t dims[2] = {0, 0}, int elemalloc = 0) %{
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
if (!SWIG_IsOK(res)) {
if (!($disown)) {
void *data = NULL;
res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&data),
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (!SWIG_IsOK(res)) {
temp_data = data = %swiglal_new_array(dims[0] * dims[1],
TYPE);
size_t strides[2] = {dims[1], 1};
res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(data), &elemalloc,
sizeof(
TYPE), 2, dims, strides,
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (!SWIG_IsOK(res)) {
%argument_fail(res, "$type", $symname, $argnum);
} else {
temp = gsl_matrix##NAME##_view_array(%reinterpret_cast(data,
BASETYPE*), dims[0], dims[1]);
argp = &temp.matrix;
}
} else {
temp = gsl_matrix##NAME##_view_array(%reinterpret_cast(data,
BASETYPE*), dims[0], dims[1]);
argp = &temp.matrix;
}
} else {
%argument_fail(res, "$type", $symname, $argnum);
}
}
$1 = %reinterpret_cast(argp, $ltype);
%}
%typemap(freearg, match="in", noblock=1) const gsl_matrix##NAME* %{
if (temp_data$argnum) {
}
%}
-
Typemap which attempts to view pointers to non-const
GSL matrix.
%typemap(in, noblock=1) gsl_matrix##NAME* SWIGLAL_VIEWIN_ARRAY (void *argp = 0, int res = 0, gsl_matrix##NAME##_view temp) %{
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
if (!SWIG_IsOK(res)) {
if (!($disown)) {
size_t dims[2] = {0, 0};
void *data = NULL;
res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&data),
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (!SWIG_IsOK(res)) {
%argument_fail(res, "$type", $symname, $argnum);
} else {
temp = gsl_matrix##NAME##_view_array(%reinterpret_cast(data,
BASETYPE*), dims[0], dims[1]);
argp = &temp.matrix;
}
} else {
%argument_fail(res, "$type", $symname, $argnum);
}
}
$1 = %reinterpret_cast(argp, $ltype);
%}
-
Typemap which treats pointers to non-const
GSL matrix as input-output arguments. The type of the output argument should always match that of the input argument, so:
- If the input argument is a SWIG-wrapped
NAME*
, just unwrap it and return a reference.
- If the input argument is a native scripting-language array, make an internal copy of it, use the copy, and return a native scripting-language array copy of the internal copy.
%typemap(in, noblock=1) gsl_matrix##NAME* SWIGLAL_COPYINOUT_ARRAY (void *argp = 0, int res = 0, gsl_matrix##NAME##_view temp, SWIG_Object input_ref, void *temp_data = 0, size_t dims[2] = {0, 0}, int elemalloc = 0) %{
res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 | %convertptr_flags);
if (!SWIG_IsOK(res)) {
if (!($disown)) {
res = %swiglal_array_viewin(
TYPE*)(swiglal_no_self(), $input, %as_voidptrptr(&temp_data),
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (dims[0] * dims[1] > 0) {
temp_data = %swiglal_new_array(dims[0] * dims[1],
TYPE);
size_t strides[2] = {dims[1], 1};
res = %swiglal_array_copyin(
TYPE*)(swiglal_no_self(), $input, %as_voidptr(temp_data), &elemalloc,
sizeof(
TYPE), 2, dims, strides,
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
$disown | %convertptr_flags);
if (!SWIG_IsOK(res)) {
%argument_fail(res, "$type", $symname, $argnum);
} else {
temp = gsl_matrix##NAME##_view_array(%reinterpret_cast(temp_data,
BASETYPE*), dims[0], dims[1]);
argp = &temp.matrix;
}
} else {
%argument_fail(res, "$type", $symname, $argnum);
}
}
} else {
input_ref = $input;
}
$1 = %reinterpret_cast(argp, $ltype);
%}
%typemap(argout, match="in", noblock=1) gsl_matrix##NAME* SWIGLAL_COPYINOUT_ARRAY %{
if (temp_data$argnum) {
const size_t dims[2] = {temp$argnum.matrix.size1, temp$argnum.matrix.size2};
const size_t strides[2] = {dims[1], 1};
%append_output(%swiglal_array_copyout(
TYPE*)(swiglal_no_self(), %as_voidptr(temp_data$argnum),
sizeof(
TYPE), 2, dims, strides,
$typemap(swiglal_dynarr_isptr,
TYPE), $typemap(swiglal_dynarr_tinfo,
TYPE),
SWIG_POINTER_OWN | %newpointer_flags));
} else {
%append_output(swiglal_get_reference(input_ref$argnum));
}
%}
%typemap(freearg, match="in", noblock=1) gsl_matrix##NAME* SWIGLAL_COPYINOUT_ARRAY %{
if (temp_data$argnum) {
}
%}
GSL integer vectors and matrices.
%swig_lal_gsl_vector_matrix(short, short, _short);
%swig_lal_gsl_vector_matrix(unsigned short, unsigned short, _ushort);
%swig_lal_gsl_vector_matrix(int, int, _int);
%swig_lal_gsl_vector_matrix(unsigned int, unsigned int, _uint);
%swig_lal_gsl_vector_matrix(long, long, _long);
%swig_lal_gsl_vector_matrix(unsigned long, unsigned long, _ulong);
GSL real and complex vectors and matrices.
%swig_lal_gsl_vector_matrix(float, float, _float);
%swig_lal_gsl_vector_matrix(double, double, );
%swig_lal_gsl_vector_matrix(float, gsl_complex_float, _complex_float);
%swig_lal_gsl_vector_matrix(double, gsl_complex, _complex);
Specialised typemaps for <tt>LIGOTimeGPS</tt>
Allow arbitrary attributes to be attached to the LIGOTimeGPS
class in Python.
#if defined(SWIGPYTHON)
%pythondynamic tagLIGOTimeGPS;
#endif
Specialised input typemaps for LIGOTimeGPS
structs. Accepts a SWIG-wrapped LIGOTimeGPS
or a double as input; in Python, also accepts any object with .gpsSeconds and .gpsNanoSeconds attributes.
%fragment("swiglal_specialised_tagLIGOTimeGPS", "header", fragment=SWIG_AsVal_frag(double), fragment=SWIG_AsVal_frag(int32_t)) {
int swiglal_specialised_tagLIGOTimeGPS(SWIG_Object in,
LIGOTimeGPS *out) {
double val = 0;
int res = SWIG_AsVal(double)(in, &val);
if (!SWIG_IsOK(res)) {
#ifdef SWIGPYTHON
if (PyObject_HasAttrString(in, "gpsSeconds") && PyObject_HasAttrString(in, "gpsNanoSeconds")) {
res = SWIG_AsVal(int32_t)(PyObject_GetAttrString(in,
"gpsSeconds"), &
gpsSeconds);
if (!SWIG_IsOK(res)) {
return res;
}
res = SWIG_AsVal(int32_t)(PyObject_GetAttrString(in,
"gpsNanoSeconds"), &
gpsNanoSeconds);
if (!SWIG_IsOK(res)) {
return res;
}
return SWIG_OK;
}
#endif
return res;
}
return SWIG_OK;
}
}
%swiglal_specialised_typemaps(tagLIGOTimeGPS, "swiglal_specialised_tagLIGOTimeGPS");
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
Sets GPS time given GPS seconds as a REAL8.
LIGOTimeGPS * XLALGPSSet(LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan)
Sets GPS time given GPS integer seconds and residual nanoseconds.
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
Specialised typemaps for <tt>LALUnit</tt>
Specialised input typemaps for LALUnit
structs. Accepts a SWIG-wrapped LALUnit
, a unit string, or a dimensionless power-of-10 double as input.
%fragment("swiglal_specialised_tagLALUnit", "header",
fragment="SWIG_AsCharPtr",
fragment=SWIG_AsVal_frag(double)
)
{
int swiglal_specialised_tagLALUnit(SWIG_Object in,
LALUnit *out) {
char *str = 0;
int alloc = 0;
int res = SWIG_AsCharPtr(in, &str, &alloc);
if (SWIG_IsOK(res)) {
res = SWIG_ValueError;
}
}
if (alloc == SWIG_NEWOBJ) {
%delete_array(str);
}
if (SWIG_IsOK(res)) {
return res;
}
double val = 0;
res = SWIG_AsVal(double)(in, &val);
if (!SWIG_IsOK(res)) {
return res;
}
if (val <= 0) {
return SWIG_ValueError;
}
double pow10 = 0;
if (modf(log10(val), &pow10) != 0) {
return SWIG_ValueError;
}
if (pow10 < INT16_MIN || INT16_MAX < pow10) {
return SWIG_ValueError;
}
return SWIG_OK;
}
}
%swiglal_specialised_typemaps(tagLALUnit, "swiglal_specialised_tagLALUnit");
int16_t INT2
Two-byte signed integer.
LALUnit * XLALParseUnitString(LALUnit *output, const char *string)
Returns the pointer output upon return or a pointer to newly allocated memory if output was NULL; on ...
const LALUnit lalDimensionlessUnit
dimensionless units
This structure stores units in the mksA system (plus Kelvin, Strain, and ADC Count).
INT2 powerOfTen
Overall power-of-ten scaling is 10^powerOfTen.
Specialised typemaps for <tt>LALDict</tt>
Specialised input typemaps for LALDict
. Accepts a SWIG-wrapped LALDict
, or:
- For Python, a native dictionary with keys of the form
"key[:type]"
, where "type"
specifies the type of the LALDict
entry: "[U]INT{2,4,8}"
for integer values, "REAL{4,8}"
for real values, and "COMPLEX{8,16}"
for complex values. If "type"
is absent, the entry is assumed to be a string.
%fragment("swiglal_specialised_ptr_tagLALDict", "header",
fragment="SWIG_AsCharPtr",
fragment=SWIG_AsVal_frag(uint16_t),
fragment=SWIG_AsVal_frag(int16_t),
fragment=SWIG_AsVal_frag(uint32_t),
fragment=SWIG_AsVal_frag(int32_t),
fragment=SWIG_AsVal_frag(uint64_t),
fragment=SWIG_AsVal_frag(int64_t),
fragment=SWIG_AsVal_frag(float),
fragment=SWIG_AsVal_frag(double),
)
{
int swiglal_specialised_ptr_tagLALDict(SWIG_Object in, LALDict **out) {
int res = SWIG_ValueError;
char *keyname, *valuestr = 0;
int keyalloc, valuealloc = 0;
if (*out == NULL) {
goto fail;
}
#ifdef SWIGPYTHON
if (!PyDict_Check(in)) {
return SWIG_ValueError;
}
PyObject *key, *value;
Py_ssize_t pos = 0;
while (PyDict_Next(in, &pos, &key, &value)) {
if (!SWIG_IsOK(SWIG_AsCharPtr(key, &keyname, &keyalloc))) {
break;
}
char *keytype = strrchr(keyname, ':');
if (keytype == NULL) {
keytype = keyname + strlen(keyname);
} else {
*keytype = 0;
++keytype;
}
do {
#define SWIGLAL_LALDICT_HANDLE_TYPE(LALTYPESTR, LALTYPE, CTYPE, FMT, ...) \
if (XLALStringCaseCompare(keytype, LALTYPESTR) == 0) { \
CTYPE v = 0; \
if (SWIG_IsOK(SWIG_AsVal(CTYPE)(value, &v))) { \
if (XLALDictInsert##LALTYPE##Value(*out, keyname, v) != XLAL_SUCCESS) { \
goto fail; \
} \
XLALPrintInfo("%s: dict=%p, key=%s, type=%s, value=" FMT "\n", __func__, in, keyname, keytype, __VA_ARGS__); \
break; \
} \
}
#undef SWIGLAL_LALDICT_GIVEN_TYPE
if (SWIG_IsOK(SWIG_AsCharPtr(value, &valuestr, &valuealloc))) {
goto fail;
}
XLALPrintInfo(
"%s: dict=%p, key=%s, type=string, value='%s'\n", __func__, in, keyname, valuestr);
if (valuealloc == SWIG_NEWOBJ) {
%delete_array(valuestr);
valuealloc = 0;
}
} else {
XLALPrintInfo(
"%s: dict=%p, key=%s, type=unknown\n", __func__, in, keyname);
goto fail;
}
} while(0);
if (keyalloc == SWIG_NEWOBJ) {
%delete_array(keyname);
keyalloc = 0;
}
}
res = SWIG_OK;
#endif
fail:
if (!SWIG_IsOK(res)) {
*out = NULL;
}
if (keyalloc == SWIG_NEWOBJ) {
%delete_array(keyname);
}
if (valuealloc == SWIG_NEWOBJ) {
%delete_array(valuestr);
}
return res;
}
void swiglal_specialised_ptr_tagLALDict_destroy(LALDict *tmp) {
}
}
%swiglal_specialised_ptr_typemaps(
tagLALDict,
"swiglal_specialised_ptr_tagLALDict");
void XLALDestroyDict(LALDict *dict)
LALDict * XLALCreateDict(void)
int XLALDictInsertStringValue(LALDict *dict, const char *key, const char *string)
int XLALPrintInfo(const char *fmt,...)
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)
double REAL8
Double precision real floating-point number (8 bytes).
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
uint16_t UINT2
Two-byte unsigned integer.
uint32_t UINT4
Four-byte unsigned integer.
float complex COMPLEX8
Single-precision floating-point complex number (8 bytes total)
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
@ XLAL_SUCCESS
Success return value (not an error number)