1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
8 * From the ideas of Luigi Ballabio
9 * ----------------------------------------------------------------------------- */
13 /* defining basic methods */
14 %fragment("SWIG_AsValFilePtr","header") {
16 SWIG_AsValFilePtr(PyObject *obj, FILE **val) {
17 static swig_type_info* desc = 0;
19 if (!desc) desc = SWIG_TypeQuery("FILE *");
20 if ((SWIG_ConvertPtr(obj, &vptr, desc, 0)) == SWIG_OK) {
21 if (val) *val = (FILE *)vptr;
24 %#if PY_VERSION_HEX < 0x03000000
25 if (PyFile_Check(obj)) {
26 if (val) *val = PyFile_AsFile(obj);
30 return SWIG_TypeError;
35 %fragment("SWIG_AsFilePtr","header",fragment="SWIG_AsValFilePtr") {
36 SWIGINTERNINLINE FILE*
37 SWIG_AsFilePtr(PyObject *obj) {
39 SWIG_AsValFilePtr(obj, &val);
44 /* defining the typemaps */
45 %typemaps_asval(%checkcode(POINTER), SWIG_AsValFilePtr, "SWIG_AsValFilePtr", FILE*);