Commits

Ronald Oussoren committed 881625c

More renaming of public functions and minor changes to layout.

Comments (0)

Files changed (12)

pyobjc/Modules/objc/class-builder.m

 			PyErr_Clear();
 			continue;
 		}
-		if (!ObjCInformalProtocol_Check(p)) continue;
+		if (!PyObjCInformalProtocol_Check(p)) continue;
 
-		info = ObjCIPFindInfo(p, selector);
+		info = PyObjCInformalProtocol_FindSelector(p, selector);
 		if (info != NULL) {
 			return ObjCSelector_Signature(info);
 		}
 			goto error_cleanup;
 		}
 
-		if (ObjCIvar_Check(value)) {
+		if (PyObjCInstanceVariable_Check(value)) {
 			if (class_getInstanceVariable(super_class, 
-					((ObjCIvar*)value)->name) != NULL) {
+			    ((PyObjCInstanceVariable*)value)->name) != NULL) {
 				ObjCErr_Set(ObjCExc_error,
 					"Cannot replace instance variable %s",
-					((ObjCIvar*)value)->name);
+					((PyObjCInstanceVariable*)value)->name);
 				goto error_cleanup;
 			}
 
 			ivar_count ++;
-			item_size = objc_sizeof_type(((ObjCIvar*)value)->type);
+			item_size = objc_sizeof_type(((PyObjCInstanceVariable*)value)->type);
 			if (item_size == -1) goto error_cleanup;
 			ivar_size += item_size;
 
 			goto error_cleanup;
 		}
 
-		if (ObjCIvar_Check(value)) {
+		if (PyObjCInstanceVariable_Check(value)) {
 			IVAR var;
 
 			var = ivar_list->ivar_list + ivar_list->ivar_count;
 			ivar_list->ivar_count++;
 
-			var->ivar_name = ((ObjCIvar*)value)->name;
-			var->ivar_type = ((ObjCIvar*)value)->type;
+			var->ivar_name = ((PyObjCInstanceVariable*)value)->name;
+			var->ivar_type = ((PyObjCInstanceVariable*)value)->type;
 			var->ivar_offset = ivar_size;
 
 			item_size = objc_sizeof_type(var->ivar_type);

pyobjc/Modules/objc/class-list.m

 	/* Implementation for MacOS X */
 
 PyObject*
-ObjC_GetClassList(void)
+PyObjC_GetClassList(void)
 {
 	PyObject* 	result = NULL;
 	Class*		buffer = NULL;
 	 */
 
 PyObject*
-ObjC_GetClassList(void)
+PyObjC_GetClassList(void)
 {
 	PyObject* 	result = NULL;
 	Class		classid;

pyobjc/Modules/objc/informal-protocol.m

 
 	PyObject* name;
 	PyObject* selectors;
-} ObjCInformalProtocol;
+} PyObjCInformalProtocol;
 
 
 
 static void
 proto_dealloc(PyObject* object)
 {
-	ObjCInformalProtocol* self = (ObjCInformalProtocol*)object;	
+	PyObjCInformalProtocol* self = (PyObjCInformalProtocol*)object;	
 
 	Py_XDECREF(self->selectors);
 	object->ob_type->tp_free(object);
 {
 	char buf[1024];
 
-	ObjCInformalProtocol* self = (ObjCInformalProtocol*)object;	
+	PyObjCInformalProtocol* self = (PyObjCInformalProtocol*)object;	
 
 	snprintf(buf, sizeof(buf), "<%s %s at %p>",
 		self->ob_type->tp_name, PyString_AsString(self->name),
 proto_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
 {
 static	char*	keywords[] = { "name", "selectors", NULL };
-	ObjCInformalProtocol* result;
+	PyObjCInformalProtocol* result;
 	PyObject* name;
 	PyObject* selectors;
 
 		return NULL;
 	}
 
-	result = (ObjCInformalProtocol*)PyObject_New(
-			ObjCInformalProtocol, &ObjCInformalProtocol_Type);
+	result = (PyObjCInformalProtocol*)PyObject_New(
+			PyObjCInformalProtocol, &PyObjCInformalProtocol_Type);
 
 	result->name = name;
 	result->selectors = selectors;
 	return (PyObject*)result;
 }
 
-static int proto_traverse(PyObject* self, visitproc visit, void* handle)
+static int 
+proto_traverse(PyObject* self, visitproc visit, void* handle)
 {
-	ObjCInformalProtocol* me = (ObjCInformalProtocol*)self;	
+	PyObjCInformalProtocol* me = (PyObjCInformalProtocol*)self;	
 	int                   err;
 
 	err = visit(me->name, handle);
 	{
 		"__name__",
 		T_OBJECT,
-		offsetof(ObjCInformalProtocol, name),
+		offsetof(PyObjCInformalProtocol, name),
 		READONLY,
 		NULL
 	},
 	{
 		"selectors",
 		T_OBJECT,
-		offsetof(ObjCInformalProtocol, selectors),
+		offsetof(PyObjCInformalProtocol, selectors),
 		READONLY,
 		NULL
 	},
 	{ 0, 0, 0, 0, 0 }
 };
 
-PyTypeObject ObjCInformalProtocol_Type = {
+PyTypeObject PyObjCInformalProtocol_Type = {
 	PyObject_HEAD_INIT(&PyType_Type)
 	0,					/* ob_size */
 	"objc.informal_protocol",		/* tp_name */
-	sizeof(ObjCInformalProtocol),		/* tp_basicsize */
+	sizeof(PyObjCInformalProtocol),		/* tp_basicsize */
 	0,					/* tp_itemsize */
 	/* methods */
 	proto_dealloc,	 			/* tp_dealloc */
  * Return NULL if no information can be found, but does not set an
  * exception.
  */
-PyObject* ObjCIPFindInfo(PyObject* obj, SEL selector)
+PyObject* 
+PyObjCInformalProtocol_FindSelector(PyObject* obj, SEL selector)
 {
-	ObjCInformalProtocol* self = (ObjCInformalProtocol*)obj;	
+	PyObjCInformalProtocol* self = (PyObjCInformalProtocol*)obj;	
 	int i, len;
 	PyObject* cur;
 
-	if (!ObjCInformalProtocol_Check(obj)) {
+	if (!PyObjCInformalProtocol_Check(obj)) {
 		ObjCErr_Set(PyExc_TypeError, 
 			"First argument is not an objc.informal_protocol");
 		return 0;
 /*
  * Verify that 'cls' conforms to the informal protocol
  */
-int	ObjCIPVerify(PyObject* obj, PyObject* cls)
+int	
+PyObjCInformalProtocol_CheckClass(PyObject* obj, PyObject* cls)
 {
-	ObjCInformalProtocol* self = (ObjCInformalProtocol*)obj;	
+	PyObjCInformalProtocol* self = (PyObjCInformalProtocol*)obj;	
 	int i, len;
 	PyObject* cur;
 
-	if (!ObjCInformalProtocol_Check(obj)) {
+	if (!PyObjCInformalProtocol_Check(obj)) {
 		ObjCErr_Set(PyExc_TypeError, 
 			"First argument is not an objc.informal_protocol");
 		return 0;

pyobjc/Modules/objc/instance-var.h

 	PyObject_HEAD
 	char* name;	/* Name of the instance variable */
 	char  type[2];	/* Type of the instance variable for definition only */
-} ObjCIvar;
+} PyObjCInstanceVariable;
 
 
-extern PyTypeObject ObjCIvar_Type;
-#define ObjCIvar_Check(obj) PyObject_TypeCheck((obj), &ObjCIvar_Type)
+extern PyTypeObject PyObjCInstanceVariable_Type;
+#define PyObjCInstanceVariable_Check(obj) PyObject_TypeCheck((obj), &PyObjCInstanceVariable_Type)
 
-PyObject* ObjCInstanceVar_New(char* name);
+PyObject* PyObjCInstanceVariable_New(char* name);
 
 #endif /* OBJC_INSTANCE_VAR */

pyobjc/Modules/objc/instance-var.m

 #include <Python.h>
-//#include <Foundation/Foundation.h>
 #include "pyobjc.h"
 #include "objc_support.h"
 
  */
 
 static void
-ivar_dealloc(ObjCIvar* ivar)
+ivar_dealloc(PyObjCInstanceVariable* ivar)
 {
 	PyMem_Free(ivar->name);
 	ivar->ob_type->tp_free((PyObject*)ivar);
 }
 
 static PyObject*
-ivar_repr(ObjCIvar* self)
+ivar_repr(PyObjCInstanceVariable* self)
 {
 	char buf[256];
 
 }
 
 static PyObject*
-ivar_descr_get(ObjCIvar* self, PyObject* obj, PyObject* type)
+ivar_descr_get(PyObjCInstanceVariable* self, PyObject* obj, PyObject* type)
 {
 	IVAR var;
 	id   objc;
 }
 
 static int
-ivar_descr_set(ObjCIvar* self, PyObject* obj, PyObject* value)
+ivar_descr_set(PyObjCInstanceVariable* self, PyObject* obj, PyObject* value)
 {
 	IVAR var;
 	id   objc;
 }
 
 static int
-ivar_init(ObjCIvar* self, PyObject* args, PyObject* kwds)
+ivar_init(PyObjCInstanceVariable* self, PyObject* args, PyObject* kwds)
 {
 static  char* keywords[] = { "name", "type", NULL };
 	char* name = NULL;
 "'type' is optional and should be a 1 character signature string.\n"
 );
 
-PyTypeObject ObjCIvar_Type = {
+PyTypeObject PyObjCInstanceVariable_Type = {
 	PyObject_HEAD_INIT(&PyType_Type)             
 	0,                                           
 	"objc_ivar",                             
-	sizeof(ObjCIvar),                       
+	sizeof(PyObjCInstanceVariable),                       
 	0,                                           
 	(destructor)ivar_dealloc,               /* tp_dealloc */
 	0,                                      /* tp_print */
 	0,                           		/* tp_free */
 };
 
-PyObject* ObjCInstanceVar_New(char* name)
+PyObject* 
+PyObjCInstanceVariable_New(char* name)
 {
 	PyObject* result;
 
-	result = ObjCIvar_Type.tp_alloc(&ObjCIvar_Type, 0);
+	result = PyObjCInstanceVariable_Type.tp_alloc(&PyObjCInstanceVariable_Type, 0);
 	if (result == NULL) {
 		return NULL;
 	}
-	((ObjCIvar*)result)->name = strdup(name);
-	((ObjCIvar*)result)->type[0] = '\0';
+	((PyObjCInstanceVariable*)result)->name = strdup(name);
+	((PyObjCInstanceVariable*)result)->type[0] = '\0';
 	return result;
 }

pyobjc/Modules/objc/method-accessor.m

 				char* name;
 
 				meth = mlist->method_list + i;
-				name = pythonify_selector(meth->method_name, 
+				name = PyObjC_SELToPythonName(meth->method_name, 
 					buf, sizeof(buf));
 				
 				v = PyObject_GetAttrString(self, name);

pyobjc/Modules/objc/module.m

 #endif
 
 
-PyDoc_STRVAR(objc_recycle_autorelease_pool_doc,
+PyDoc_STRVAR(recycle_autorelease_pool_doc,
   "recycle_autorelease_pool()\n"
   "\n"
   "This 'releases' the global autorelease pool and creates a new one.\n"
   "This method is for system use only\n");
 static PyObject*
-objc_recycle_autorelease_pool(PyObject* self, PyObject* args, PyObject* kwds)
+recycle_autorelease_pool(PyObject* self, PyObject* args, PyObject* kwds)
 {
 static	char* keywords[] = { NULL };
 
 	return Py_None;
 }
 
-PyDoc_STRVAR(objc_set_class_extender_doc,
+PyDoc_STRVAR(set_class_extender_doc,
 	"set_class_extender(func) -> None\n"
 	"\n"
 	"Register a function that will be called to update the class\n"
 	"  this dictionary.\n"
 	"");
 static PyObject*
-objc_set_class_extender(PyObject* self, PyObject* args, PyObject* kwds)
+set_class_extender(PyObject* self, PyObject* args, PyObject* kwds)
 {
 static 	char* keywords[] = { "callback", NULL };
 	PyObject* callback;
   "\n"
   "Return a list with all Objective-C classes known to the runtime.\n"
 );
-
 static PyObject* 
 getClassList(PyObject* self)
 {
-	return ObjC_GetClassList();
+	return PyObjC_GetClassList();
 }
 
 PyDoc_STRVAR(set_signature_for_selector_doc,
 	"can be used to provide a more exact signature for a method.\n"
 	"");
 static PyObject* 
-objc_set_signature_for_selector(PyObject* self, PyObject* args, PyObject* kwds)
+set_signature_for_selector(PyObject* self, PyObject* args, PyObject* kwds)
 {
 static 	char* keywords[] = { "class_name", "selector", "signature", NULL };
 	char* class_name;
 	return Py_None;
 }
 
-PyDoc_STRVAR(func_setVerbose_doc,
+PyDoc_STRVAR(setVerbose_doc,
 	"setVerbose(bool) -> None\n"
 	"\n"
 	"Set verbosity to the new value."
 );
 static PyObject* 
-func_setVerbose(PyObject* self, PyObject* args, PyObject* kwds)
+setVerbose(PyObject* self, PyObject* args, PyObject* kwds)
 {
 static 	char* keywords[] = { "level", NULL };
 	PyObject* o;
 	return Py_None;
 }
 
-PyDoc_STRVAR(func_getVerbose_doc,
+PyDoc_STRVAR(getVerbose_doc,
 	"getVerbose() -> bool\n"
 	"\n"
 	"Return the verbosity value."
 );
 static PyObject* 
-func_getVerbose(PyObject* self, PyObject* args, PyObject* kwds)
+getVerbose(PyObject* self, PyObject* args, PyObject* kwds)
 {
 static 	char* keywords[] = { NULL };
 
 }
 
 
-PyDoc_STRVAR(func_allocateBuffer_doc,
+PyDoc_STRVAR(allocateBuffer_doc,
 	     "allocateBuffer(size) -> <r/w buffer>\n"
 	     "\n"
 	     "Allocate a buffer of memory of size. Buffer is \n"
 	     "read/write."
 	     );
+PyObject*
+allocateBuffer(PyObject* self, PyObject* args, PyObject* kwds)
+{
+	int length;
 
-PyObject*
-func_allocateBuffer(PyObject* self, PyObject* args, PyObject* kwds)
-{
-  int length;
+	if (!PyArg_ParseTuple(args, "i", &length)) {
+		return NULL;
+	}
 
-  if (!PyArg_ParseTuple(args, "i", &length)) {
-      return NULL;
-  }
+	if (length <= 0 ) {
+		PyErr_SetString(PyExc_ValueError, 
+			"Length must be greater than 0.");
+		return NULL;
+	}
 
-  if (length <= 0 ) {
-    PyErr_SetString(PyExc_ValueError, "Length must be greater than 0.");
-    return NULL;
-  }
-
-  return PyBuffer_New(length);
+	return PyBuffer_New(length);
 }
 
 
-PyDoc_STRVAR(objc_loadBundle_doc,
+PyDoc_STRVAR(loadBundle_doc,
 	"loadBundle(bundle, module_name, module_globals) -> None\n"
 	"\n"
 	"Find all classes defined in the 'bundle', set their __module__ to\n"
 	"'module_name' and load them into 'module_globals'"
 );
 PyObject*
-objc_loadBundle(PyObject* self, PyObject* args, PyObject* kwds)
+loadBundle(PyObject* self, PyObject* args, PyObject* kwds)
 {
 static  char* keywords[] = { "module_name", "module_globals", "bundle_path", "bundle_identifier", NULL };
 	id        bundle;
 		[bundle load];
 	}
 
-	class_list = ObjC_GetClassList();
+	class_list = PyObjC_GetClassList();
 	if (class_list == NULL) {	
 		return NULL;
 	}
 	},
 #endif
 	{ "getClassList", (PyCFunction)getClassList, METH_NOARGS, getClassList_doc },
-	{ "set_class_extender", (PyCFunction)objc_set_class_extender, METH_VARARGS|METH_KEYWORDS, objc_set_class_extender_doc  },
-	{ "set_signature_for_selector", (PyCFunction)objc_set_signature_for_selector, METH_VARARGS|METH_KEYWORDS, set_signature_for_selector_doc },
-	{ "recycle_autorelease_pool", (PyCFunction)objc_recycle_autorelease_pool, METH_VARARGS|METH_KEYWORDS, objc_recycle_autorelease_pool_doc },
-	{ "setVerbose", (PyCFunction)func_setVerbose, METH_VARARGS|METH_KEYWORDS, func_setVerbose_doc },
-	{ "getVerbose", (PyCFunction)func_getVerbose, METH_VARARGS|METH_KEYWORDS, func_getVerbose_doc },
-	{ "loadBundle", (PyCFunction)objc_loadBundle, METH_VARARGS|METH_KEYWORDS, objc_loadBundle_doc },
-	{ "allocateBuffer", (PyCFunction)func_allocateBuffer, METH_VARARGS|METH_KEYWORDS, func_allocateBuffer_doc },
+	{ "set_class_extender", (PyCFunction)set_class_extender, METH_VARARGS|METH_KEYWORDS, set_class_extender_doc  },
+	{ "set_signature_for_selector", (PyCFunction)set_signature_for_selector, METH_VARARGS|METH_KEYWORDS, set_signature_for_selector_doc },
+	{ "recycle_autorelease_pool", (PyCFunction)recycle_autorelease_pool, METH_VARARGS|METH_KEYWORDS, recycle_autorelease_pool_doc },
+	{ "setVerbose", (PyCFunction)setVerbose, METH_VARARGS|METH_KEYWORDS, setVerbose_doc },
+	{ "getVerbose", (PyCFunction)getVerbose, METH_VARARGS|METH_KEYWORDS, getVerbose_doc },
+	{ "loadBundle", (PyCFunction)loadBundle, METH_VARARGS|METH_KEYWORDS, loadBundle_doc },
+	{ "allocateBuffer", (PyCFunction)allocateBuffer, METH_VARARGS|METH_KEYWORDS, allocateBuffer_doc },
 	{ 0, 0, 0, 0 } /* sentinel */
 };
 
 	PyType_Ready(&ObjCSelector_Type); 
 	PyType_Ready(&ObjCNativeSelector_Type);
 	PyType_Ready(&ObjCPythonSelector_Type);
-	PyType_Ready(&ObjCIvar_Type);
-	PyType_Ready(&ObjCInformalProtocol_Type);
-	PyType_Ready(&ObjCUnicode_Type);
+	PyType_Ready(&PyObjCInstanceVariable_Type);
+	PyType_Ready(&PyObjCInformalProtocol_Type);
+	PyType_Ready(&PyObjCUnicode_Type);
 
 	m = Py_InitModule4("_objc", meta_methods, NULL,
 			NULL, PYTHON_API_VERSION);
 	PyDict_SetItemString(d, "objc_class", (PyObject*)&PyObjCClass_Type);
 	PyDict_SetItemString(d, "objc_object", (PyObject*)&PyObjCObject_Type);
 	PyDict_SetItemString(d, "selector", (PyObject*)&ObjCSelector_Type);
-	PyDict_SetItemString(d, "ivar", (PyObject*)&ObjCIvar_Type);
-	PyDict_SetItemString(d, "informal_protocol", (PyObject*)&ObjCInformalProtocol_Type);
+	PyDict_SetItemString(d, "ivar", (PyObject*)&PyObjCInstanceVariable_Type);
+	PyDict_SetItemString(d, "informal_protocol", (PyObject*)&PyObjCInformalProtocol_Type);
 	PyDict_SetItemString(d, "YES", PyObjCBool_FromLong(1));
 	PyDict_SetItemString(d, "NO", PyObjCBool_FromLong(0));
 

pyobjc/Modules/objc/objc-class.m

 			PyErr_SetString(PyExc_TypeError, 
 					"multiple objective-C bases");
 			return NULL;
-		} else if (ObjCInformalProtocol_Check(v)) {
+		} else if (PyObjCInformalProtocol_Check(v)) {
 			PyList_Append(protocols, v);
 		} else {
 			PyList_Append(real_bases, v);
 			continue;
 		}
 
-		if (ObjCInformalProtocol_Check(p)) {
-			if (!ObjCIPVerify(p, res)) {
+		if (PyObjCInformalProtocol_Check(p)) {
+			if (!PyObjCInformalProtocol_CheckClass(p, res)) {
 				Py_DECREF(res);
 				Py_DECREF(protocols);
 				PyObjCClass_UnbuildClass(objc_class);
 
 /* FIXME: objc_support.[hm] also has version of this function! */
 char*
-pythonify_selector(SEL sel, char* buf, size_t buflen)
+PyObjC_SELToPythonName(SEL sel, char* buf, size_t buflen)
 {
 	size_t res = snprintf(buf, buflen, SELNAME(sel));
 	char* cur;
 
 			meth = mlist->method_list + i;
 
-			name = (char*)pythonify_selector(
+			name = (char*)PyObjC_SELToPythonName(
 						meth->method_name, 
 						selbuf, 
 						sizeof(selbuf));
 		for (i = 0; i < mlist->method_count; i++) {
 			meth = mlist->method_list + i;
 
-			pythonify_selector(
+			PyObjC_SELToPythonName(
 				meth->method_name, 
 				selbuf, 
 				sizeof(selbuf));
 				continue;
 			}
 
-			descr = ObjCInstanceVar_New(var->ivar_name);
+			descr = PyObjCInstanceVariable_New(var->ivar_name);
 			if (descr == NULL) {
 				return -1;
 			}
  * - this looks a lot like PyObjCClass_Type.tp_new, but it is _not_ the
  *   same!
  */
-PyObject* PyObjCClass_New(Class objc_class)
+PyObject* 
+PyObjCClass_New(Class objc_class)
 {
 	PyObject* args;
 	PyObject* dict;
 }
 
 
-Class PyObjCClass_GetClass(PyObject* cls)
+Class 
+PyObjCClass_GetClass(PyObject* cls)
 {
 	PyObjC_class_info* info;
 
 	return info->class;
 }
 
-PyObject* PyObjCClass_FindSelector(PyObject* cls, SEL selector)
+PyObject* 
+PyObjCClass_FindSelector(PyObject* cls, SEL selector)
 {
 	PyObjC_class_info* info;
 	PyObject*          result;

pyobjc/Modules/objc/objc-object.m

 #include <stddef.h>
 #include <objc/Object.h>
 
-#import <Foundation/NSString.h> /*XXX*/
-
 /*
  * We use weakreferences to make sure that every objective-C object has 
  * at most one python proxy. This allows users to use the 'is' operator
 	void* 	  key;
 };
 
-static PyObject* unregister_proxy_func(PyObject* self, PyObject* args)
+static PyObject* 
+unregister_proxy_func(PyObject* self, PyObject* args)
 {
 	PyObject* weakref = NULL;
 	struct unregister_data* data;
 		objc_obj = PyObjCObject_GetObject(proxy_obj);
 	} else if (PyObjCClass_Check(proxy_obj)) {
 		objc_obj = PyObjCClass_GetClass(proxy_obj);
-	} else if (ObjCUnicode_Check(proxy_obj)) {
-		objc_obj = ObjCUnicode_Extract(proxy_obj);
+	} else if (PyObjCUnicode_Check(proxy_obj)) {
+		objc_obj = PyObjCUnicode_Extract(proxy_obj);
 	} else {
 		PyErr_SetString(PyExc_TypeError, 
 			"bad argument for register_proxy");
 
 
 
-PyObject* PyObjCObject_New(id objc_object)
+PyObject* 
+PyObjCObject_New(id objc_object)
 {
 	Class cls = GETISA(objc_object);
 	PyTypeObject* cls_type;
 	return res;
 }
 
-PyObject* PyObjCObject_FindSelector(PyObject* object, SEL selector)
+PyObject* 
+PyObjCObject_FindSelector(PyObject* object, SEL selector)
 {
 	PyObject* meth;
 	
 	}	
 }
 
-id        (PyObjCObject_GetObject)(PyObject* object)
+id        
+(PyObjCObject_GetObject)(PyObject* object)
 {
 	if (!PyObjCObject_Check(object)) {
 		ObjCErr_Set(PyExc_TypeError,
 	return PyObjCObject_GetObject(object);
 }
 
-void        PyObjCObject_ClearObject(PyObject* object)
+void        
+PyObjCObject_ClearObject(PyObject* object)
 {
 	if (!PyObjCObject_Check(object)) {
 		ObjCErr_Set(PyExc_TypeError,

pyobjc/Modules/objc/objc_support.m

 
 -(PyObject*)__pyobjc_PythonObject__
 {
-	return ObjCUnicode_New(self);
+	return PyObjCUnicode_New(self);
 }
 
 @end /* NSString (PyObjCSupport) */
 					"to encode unicode string to UTF8");
 				return -1;
 			}
-		} else if (ObjCUnicode_Check(argument)) {
-			*(id*) datum = ObjCUnicode_Extract(argument);
+		} else if (PyObjCUnicode_Check(argument)) {
+			*(id*) datum = PyObjCUnicode_Extract(argument);
 		} else if (PyUnicode_Check(argument)) {
 			PyObject* utf8 = PyUnicode_AsUTF8String(argument);
 

pyobjc/Modules/objc/pyobjc.h

 #include "ObjCPointer.h"
 
 /* From 'class-list.m' */
-PyObject* ObjC_GetClassList(void);
+PyObject* PyObjC_GetClassList(void);
 
 
 int ObjC_register_methods(void);
 #include "pyobjc-api.h"
 
 
-extern PyTypeObject ObjCInformalProtocol_Type;
-#define ObjCInformalProtocol_Check(obj) PyObject_TypeCheck(obj, &ObjCInformalProtocol_Type)
+extern PyTypeObject PyObjCInformalProtocol_Type;
+#define PyObjCInformalProtocol_Check(obj) PyObject_TypeCheck(obj, &PyObjCInformalProtocol_Type)
 
-int     ObjCIPVerify(PyObject* obj, PyObject* cls);
-PyObject* ObjCIPFindInfo(PyObject* obj, SEL selector);
+int     PyObjCInformalProtocol_CheckClass(PyObject* obj, PyObject* cls);
+PyObject* PyObjCInformalProtocol_FindSelector(PyObject* obj, SEL selector);
 
 /* See alloc_hack.m */
 int PyObjC_InstallAllocHack(void);
 extern PyObject* ObjCMethodAccessor_New(PyObject* base, int class_method);
 
 /* Needed by method-accessor, name will be changed soon */
-char* pythonify_selector(SEL, char*, size_t);
+char* PyObjC_SELToPythonName(SEL, char*, size_t);
 
 /* unicode-object.m */
-extern PyTypeObject ObjCUnicode_Type;
-#define ObjCUnicode_Check(obj) PyObject_TypeCheck(obj, &ObjCUnicode_Type)
-PyObject* ObjCUnicode_New(NSString* value);
-NSString* ObjCUnicode_Extract(PyObject* value);
+extern PyTypeObject PyObjCUnicode_Type;
+#define PyObjCUnicode_Check(obj) PyObject_TypeCheck(obj, &PyObjCUnicode_Type)
+PyObject* PyObjCUnicode_New(NSString* value);
+NSString* PyObjCUnicode_Extract(PyObject* value);
 
 #endif /* META_H */

pyobjc/Modules/objc/unicode-object.m

 	PyUnicodeObject	base;
 	PyObject*	weakrefs;
 	id		nsstr;
-} ObjCUnicodeObject;
+} PyObjCUnicodeObject;
 
 PyDoc_STRVAR(class_doc,
 	"objc.pyobjc_unicode\n"
 static void
 class_dealloc(PyObject* obj)
 {
-	id nsstr = ((ObjCUnicodeObject*)obj)->nsstr;
-	PyObject* weakrefs = ((ObjCUnicodeObject*)obj)->weakrefs;
+	id nsstr = ((PyObjCUnicodeObject*)obj)->nsstr;
+	PyObject* weakrefs = ((PyObjCUnicodeObject*)obj)->weakrefs;
 
 	[nsstr release];
 
 	PyUnicode_Type.tp_dealloc(obj);
 }
 
-static PyObject* ObjCUnicode_pyobjc_NSString(PyObject* self)
+static PyObject* 
+meth_nsstring(PyObject* self)
 {
-	return PyObjCObject_New(((ObjCUnicodeObject*)self)->nsstr);
+	return PyObjCObject_New(((PyObjCUnicodeObject*)self)->nsstr);
 }
 
-static PyObject* ObjCUnicode_syncNSString(ObjCUnicodeObject* self)
+static PyObject* 
+meth_syncNSString(PyObjCUnicodeObject* self)
 {
 	PyUnicodeObject  dummy;
 	const char* utf8 = [self->nsstr UTF8String];
 static PyMethodDef class_methods[] = {
 	{
 	  "nsstring",
-	  (PyCFunction)ObjCUnicode_pyobjc_NSString,
+	  (PyCFunction)meth_nsstring,
 	  METH_NOARGS,
 	  "directly access NSString instance"
 	},
 	{
 	  "syncFromNSString",
-	  (PyCFunction)ObjCUnicode_syncNSString,
+	  (PyCFunction)meth_syncNSString,
 	  METH_NOARGS,
 	  "Copy contents of the NSString to the unicode object"
 	},
 	return NULL;
 }
 
-PyTypeObject ObjCUnicode_Type = {
+PyTypeObject PyObjCUnicode_Type = {
 	PyObject_HEAD_INIT(&PyType_Type)
 	0,					/* ob_size */
 	"objc.pyobjc_unicode",			/* tp_name */
-	sizeof(ObjCUnicodeObject),		/* tp_basicsize */
+	sizeof(PyObjCUnicodeObject),		/* tp_basicsize */
 	0,			 		/* tp_itemsize */
 	/* methods */
 	class_dealloc,	 			/* tp_dealloc */
  	0,					/* tp_traverse */
  	0,					/* tp_clear */
 	0,					/* tp_richcompare */
-	offsetof(ObjCUnicodeObject, weakrefs),	/* tp_weaklistoffset */
+	offsetof(PyObjCUnicodeObject, weakrefs),	/* tp_weaklistoffset */
 	0,					/* tp_iter */
 	0,					/* tp_iternext */
 	class_methods,				/* tp_methods */
 	0,		        		/* tp_free */
 };
 
-/* TODO: Use proper access macros to access UnicodeObject fields */
-PyObject* ObjCUnicode_New(NSString* value)
+PyObject* 
+PyObjCUnicode_New(NSString* value)
 {
 	const char* utf8 = [value UTF8String];
 	PyUnicodeObject* tmp = (PyUnicodeObject*)PyUnicode_DecodeUTF8(utf8, strlen(utf8), "strict");
-	ObjCUnicodeObject* result;
+	PyObjCUnicodeObject* result;
 
 	if (tmp == NULL) return NULL;
 
-	result = PyObject_New(ObjCUnicodeObject, &ObjCUnicode_Type);
+	result = PyObject_New(PyObjCUnicodeObject, &PyObjCUnicode_Type);
 	PyUnicode_AS_UNICODE(result) = PyMem_NEW(Py_UNICODE,
 		PyUnicode_GET_SIZE(tmp));
 	if (PyUnicode_AS_UNICODE(result) == NULL) {
 	return (PyObject*)result;
 }
 
-NSString* ObjCUnicode_Extract(PyObject* value)
+NSString*
+PyObjCUnicode_Extract(PyObject* value)
 {
-	if (!ObjCUnicode_Check(value)) {
+	if (!PyObjCUnicode_Check(value)) {
 		PyErr_BadInternalCall();
 		return NULL;
 	}
 
-	return ((ObjCUnicodeObject*)value)->nsstr;
+	return ((PyObjCUnicodeObject*)value)->nsstr;
 }