45
43
SWIG_Python_NewPointerObj(p, type, flags)
46
44
#define SWIG_MustGetPtr(p, type, argnum, flags) \
47
45
SWIG_Python_MustGetPtr(p, type, argnum, flags)
49
47
/* Python-specific SWIG API */
50
48
#define SWIG_newvarlink() \
51
49
SWIG_Python_newvarlink()
58
56
#define SWIG_InstallConstants(d, constants) \
59
57
SWIG_Python_InstallConstants(d, constants)
59
typedef double (*py_objasdbl_conv)(PyObject *obj);
61
61
#ifdef SWIG_NOINCLUDE
63
63
SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int);
69
69
SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *);
70
70
SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]);
74
76
/* -----------------------------------------------------------------------------
75
77
* global variable support code.
76
78
* ----------------------------------------------------------------------------- */
135
137
statichere PyTypeObject varlinktype = {
136
138
PyObject_HEAD_INIT(0)
138
(char *)"swigvarlink", /* Type name */
139
sizeof(swig_varlinkobject), /* Basic size */
142
(printfunc) swig_varlink_print, /* Print */
143
(getattrfunc) swig_varlink_getattr, /* get attr */
144
(setattrfunc) swig_varlink_setattr, /* Set attr */
146
(reprfunc) swig_varlink_repr, /* tp_repr */
139
0, /* Number of items in variable part (ob_size) */
140
(char *)"swigvarlink", /* Type name (tp_name) */
141
sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
142
0, /* Itemsize (tp_itemsize) */
143
0, /* Deallocator (tp_dealloc) */
144
(printfunc) swig_varlink_print, /* Print (tp_print) */
145
(getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
146
(setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
148
(reprfunc) swig_varlink_repr, /* tp_repr */
147
149
0, /* tp_as_number */
148
0, /* tp_as_mapping*/
150
0, /* tp_as_sequence */
151
0, /* tp_as_mapping */
157
0, /* tp_as_buffer */
162
0, /* tp_richcompare */
163
0, /* tp_weaklistoffset */
164
#if PY_VERSION_HEX >= 0x02020000
172
0, /* tp_descr_get */
173
0, /* tp_descr_set */
174
0, /* tp_dictoffset */
183
0, /* tp_subclasses */
186
#if PY_VERSION_HEX >= 0x02030200
190
/* these must be last */
152
198
/* Create a variable linking object for use later */
250
296
if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
251
PyObject *zero = PyInt_FromLong(0);
252
PyObject_SetAttrString(pyobj,(char*)"thisown",zero);
297
PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False);
258
303
if (flags & SWIG_POINTER_EXCEPTION) {
260
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
261
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
262
PyErr_SetString(PyExc_TypeError, temp);
305
PyErr_Format(PyExc_TypeError,
306
"Type error. Got %s, expected %s",
265
309
PyErr_SetString(PyExc_TypeError,"Expected a pointer");
285
329
if ((!obj) || (!PyString_Check(obj))) goto type_error;
286
c = PyString_AsString(obj);
330
c = PyString_AS_STRING(obj);
287
331
/* Pointer values must start with leading underscore */
288
332
if (*c != '_') goto type_error;
301
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
302
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
303
PyErr_SetString(PyExc_TypeError, temp);
345
PyErr_Format(PyExc_TypeError,
346
"Type error. Got %s, expected %s",
306
349
PyErr_SetString(PyExc_TypeError,"Expected a pointer");
341
PyObject *n = PyInt_FromLong(1);
342
PyObject_SetAttrString(inst,(char*)"thisown",n);
384
PyObject_SetAttrString(inst,(char*)"thisown",Py_True);
373
414
obj = PyFloat_FromDouble(constants[i].dvalue);
375
416
case SWIG_PY_STRING:
376
obj = PyString_FromString((char *) constants[i].pvalue);
417
if (constants[i].pvalue) {
418
obj = PyString_FromString((char *) constants[i].pvalue);
378
424
case SWIG_PY_POINTER:
379
425
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);