[Zodb-checkins] CVS: Zope2/lib/python/ZODB - cPersistence.h:1.19

Jim Fulton jim@digicool.com
Wed, 28 Mar 2001 10:42:06 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/ZODB
In directory korak:/tmp/cvs-serv32196

Modified Files:
	cPersistence.h 
Log Message:
Added some handy macros worked out in BTrees.



--- Updated File cPersistence.h in package Zope2/lib/python/ZODB --
--- cPersistence.h	2001/03/28 14:35:42	1.18
+++ cPersistence.h	2001/03/28 15:42:05	1.19
@@ -136,6 +136,14 @@
 
 #define PER_DEL(O) Py_XDECREF((O)->jar); Py_XDECREF((O)->oid);
 
+#define PER_USE(O) \
+(((O)->state != cPersistent_GHOST_STATE \
+  || (cPersistenceCAPI->setstate((PyObject*)(O)) >= 0)) \
+ ? (((O)->state==cPersistent_UPTODATE_STATE) \
+    ? ((O)->state=cPersistent_STICKY_STATE) : 1) : 0)
+
+#define PER_ACCESSED(O) ((O)->atime=((long)(time(NULL)/3))%65536) 
+
 #endif