Commits

Ronald Oussoren committed 88808e9

Updates news
FILE* support

Comments (0)

Files changed (2)

Modules/objc/pointer-support.m

 	return 0;
 }
 
+static int dontClose(FILE* fp __attribute__((__unused__)))
+{
+	return 0;
+}
+static PyObject*
+FILE_New(void *obj)
+{
+	FILE* fp = (FILE*)obj;
+	char* mode = "r";
+
+#if defined(__SRW) 
+	/* This is a hack, but allows us to pass the right file mode into
+	 * Python.
+	 */
+	if (fp->_flags & __SWR) {
+		mode = "w";
+	} else if (fp->_flags & __SRW) {
+		mode = "w+";
+	}
+#endif
+	return PyFile_FromFile(fp, "<objc-file>", mode, dontClose);
+}
+
+static int
+FILE_Convert(PyObject* obj, void* pObj)
+{
+	*(FILE**)pObj = PyFile_AsFile(obj);
+	if (*(FILE**)pObj == NULL) {
+		return 1;
+	}
+
+	return 0;
+}
+
 #ifdef MACOSX
 /*
  * Generic CF type support 
 		PyObjectPtr_New, PyObjectPtr_Convert);
 	if (r == -1) return -1;
 
+	r = PyObjCPointerWrapper_Register(@encode(FILE*),
+		FILE_New, FILE_Convert);
+	if (r == -1) return -1;
+
 	return 0;
 }
 Version 1.3.8 (????-??-??)
 --------------------------
 
+- Introduction of a GUI tool to manage custom method signatures 
+  (``Tools/Signatures``). This replaces the ``find-raw-pointers.py`` script.
+
+- Fixed memory leak in ``OC_PythonObject``, this was due to bad reference 
+  counting.
+
+- ``NSMutableArray.sort`` now has the same API as ``list.sort``. Due to 
+  implementation constraints the ``key`` argument results in slower sorting
+  than you'd see with ``list.sort``.
+
+- Selectors now have a read-only property 'native_signature' that contains
+  the untampered signature for the method. This is for use by tools.
+
+  TODO: unittests
+
+- 'void*' arguments are treated like unsigned integers, they are almost always
+  opaque cookies.
+
 - Make it possible to override the KVO methods, like ``setValue:forKey:`` and
   ``valueForKey:`` in Python for all levels in the inheritance hierarchie.
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.