{ PyObject *iid_ob = Py_nsIID::PyObjectFromIID(NS_GET_IID(nsIComponentManagerObsolete)); PyDict_SetItemString(dict, "IID_nsIComponentManager", iid_ob); Py_DECREF(iid_ob); }
init_xpcom() {	PyObject *oModule;	// ensure the framework has valid state to work with.	if (!PyXPCOM_Globals_Ensure())		return;	// Must force Python to start using thread locks	PyEval_InitThreads();	// Create the module and add the functions	oModule = Py_InitModule("_xpcom", xpcom_methods);	PyObject *dict = PyModule_GetDict(oModule);	PyObject *pycom_Error = PyXPCOM_Error;	if (pycom_Error == NULL || PyDict_SetItemString(dict, "error", pycom_Error) != 0)	{		PyErr_SetString(PyExc_MemoryError, "can't define error");		return;	}	PyDict_SetItemString(dict, "IIDType", (PyObject *)&Py_nsIID::type);	// register our entry point.	PyObject *obFuncPtr = PyLong_FromVoidPtr((void *)&PyXPCOM_NSGetModule);	if (obFuncPtr)		PyDict_SetItemString(dict, 		                             "_NSGetModule_FuncPtr", 		                             obFuncPtr);	Py_XDECREF(obFuncPtr);	REGISTER_IID(nsISupports);	REGISTER_IID(nsISupportsString);	REGISTER_IID(nsIModule);	REGISTER_IID(nsIFactory);	REGISTER_IID(nsIWeakReference);	REGISTER_IID(nsISupportsWeakReference);	REGISTER_IID(nsIClassInfo);	REGISTER_IID(nsIServiceManager);	// Register our custom interfaces.	Py_nsISupports::InitType();	Py_nsIComponentManager::InitType(dict);	Py_nsIInterfaceInfoManager::InitType(dict);	Py_nsIEnumerator::InitType(dict);	Py_nsISimpleEnumerator::InitType(dict);	Py_nsIInterfaceInfo::InitType(dict);	Py_nsIInputStream::InitType(dict);	Py_nsIClassInfo::InitType(dict);        // We have special support for proxies - may as well add their constants!    REGISTER_INT(PROXY_SYNC);    REGISTER_INT(PROXY_ASYNC);    REGISTER_INT(PROXY_ALWAYS);}