Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: swig/Lib/python/file.i

Issue 553095: Checkin swig binaries for win, linux and Mac... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « swig/Lib/python/factory.i ('k') | swig/Lib/python/implicit.i » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: swig/Lib/python/file.i
===================================================================
--- swig/Lib/python/file.i (revision 0)
+++ swig/Lib/python/file.i (revision 0)
@@ -0,0 +1,45 @@
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * file.i
+ *
+ * Typemaps for FILE*
+ * From the ideas of Luigi Ballabio
+ * ----------------------------------------------------------------------------- */
+
+%types(FILE *);
+
+/* defining basic methods */
+%fragment("SWIG_AsValFilePtr","header") {
+SWIGINTERN int
+SWIG_AsValFilePtr(PyObject *obj, FILE **val) {
+ static swig_type_info* desc = 0;
+ void *vptr = 0;
+ if (!desc) desc = SWIG_TypeQuery("FILE *");
+ if ((SWIG_ConvertPtr(obj, &vptr, desc, 0)) == SWIG_OK) {
+ if (val) *val = (FILE *)vptr;
+ return SWIG_OK;
+ }
+%#if PY_VERSION_HEX < 0x03000000
+ if (PyFile_Check(obj)) {
+ if (val) *val = PyFile_AsFile(obj);
+ return SWIG_OK;
+ }
+%#endif
+ return SWIG_TypeError;
+}
+}
+
+
+%fragment("SWIG_AsFilePtr","header",fragment="SWIG_AsValFilePtr") {
+SWIGINTERNINLINE FILE*
+SWIG_AsFilePtr(PyObject *obj) {
+ FILE *val = 0;
+ SWIG_AsValFilePtr(obj, &val);
+ return val;
+}
+}
+
+/* defining the typemaps */
+%typemaps_asval(%checkcode(POINTER), SWIG_AsValFilePtr, "SWIG_AsValFilePtr", FILE*);
« no previous file with comments | « swig/Lib/python/factory.i ('k') | swig/Lib/python/implicit.i » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698