[Zope3-checkins] CVS: Zope3/src/zope/app/container - _zope_app_container_contained.c:1.2.10.1

Jim Fulton jim at zope.com
Fri Jan 9 17:24:19 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/container
In directory cvs.zope.org:/tmp/cvs-serv25080/src/zope/app/container

Modified Files:
      Tag: zope3-zodb3-devel-branch
	_zope_app_container_contained.c 
Log Message:
Checkpointing to the branch after beginning the process of removing
zodb 4 code. 

Lots of things are now broken. :)




=== Zope3/src/zope/app/container/_zope_app_container_contained.c 1.2 => 1.2.10.1 ===
--- Zope3/src/zope/app/container/_zope_app_container_contained.c:1.2	Sun Sep 21 13:31:28 2003
+++ Zope3/src/zope/app/container/_zope_app_container_contained.c	Fri Jan  9 17:23:48 2004
@@ -13,11 +13,10 @@
 ############################################################################*/
 
 #include "Python.h"
-#include "persistence/persistence.h"
-#include "persistence/persistenceAPI.h"
+#include "persistent/cPersistence.h"
 
 typedef struct {
-  PyPersist_HEAD                 
+  cPersistent_HEAD               
   PyObject *po_serial;            
   PyObject *po_weaklist;          
   PyObject *proxy_object;
@@ -72,7 +71,7 @@
 
   if (SPECIAL(cname))
     /* delegate to persistent */
-    return PyPersist_TYPE->tp_getattro(self, name);
+    return cPersistenceType->tp_getattro(self, name);
 
   /* Use the wrapper version to delegate */
   return wrap_getattro(self, name);
@@ -89,7 +88,7 @@
 
   if (SPECIAL(cname))
     /* delegate to persistent */
-    return PyPersist_TYPE->tp_setattro(self, name, v);
+    return cPersistenceType->tp_setattro(self, name, v);
 
   /* Use the wrapper version to delegate */
   return wrap_setattro(self, name, v);
@@ -161,8 +160,8 @@
 	}
     }
 
-    if (self->po_dm && self->po_oid) {
-	ghostify = self->po_state == UPTODATE;
+    if (self->jar && self->oid) {
+	ghostify = self->state == cPersistent_UPTODATE_STATE;
 	if (!ghostify && force) {
 	    if (PyObject_IsTrue(force))
 		ghostify = 1;
@@ -175,7 +174,7 @@
             Py_XDECREF(self->__name__);
             self->__name__ = NULL;
 
-	    self->po_state = GHOST;
+	    self->state = cPersistent_GHOST_STATE;
 	}
     }
 
@@ -216,7 +215,7 @@
 static int
 CP_traverse(ProxyObject *self, visitproc visit, void *arg)
 {
-  if (PyPersist_TYPE->tp_traverse((PyObject *)self, visit, arg) < 0)
+  if (cPersistenceType->tp_traverse((PyObject *)self, visit, arg) < 0)
     return -1;
   if (self->po_serial != NULL && visit(self->po_serial, arg) < 0)
     return -1;
@@ -241,7 +240,8 @@
      collector will call this method if it detects that this
      object is involved in a reference cycle.
   */
-  PyPersist_TYPE->tp_clear((PyObject*)self);
+  if (cPersistenceType->tp_clear != NULL)
+    cPersistenceType->tp_clear((PyObject*)self);
 
   Py_XDECREF(self->po_serial);
   self->po_serial = NULL;
@@ -286,14 +286,13 @@
     empty_tuple = PyTuple_New(0);
 
   /* Initialize the PyPersist_C_API and the type objects. */
-  PyPersist_C_API = PyCObject_Import("persistence._persistence", "C_API");
-  if (PyPersist_C_API == NULL)
+  cPersistenceCAPI = PyCObject_Import("persistent.cPersistence", "CAPI");
+  if (cPersistenceCAPI == NULL)
     return;
 
-  
   ProxyType.tp_name = "zope.app.container.contained.ContainedProxyBase";
   ProxyType.ob_type = &PyType_Type;
-  ProxyType.tp_base = PyPersist_TYPE;
+  ProxyType.tp_base = cPersistenceType;
   ProxyType.tp_getattro = CP_getattro;
   ProxyType.tp_setattro = CP_setattro;
   ProxyType.tp_members = CP_members;




More information about the Zope3-Checkins mailing list