Commit f7916f2f authored by Jim Fulton's avatar Jim Fulton

Added PER_USE macro.

parent 2fb67efd
/* /*
$Id: cPersistence.h,v 1.7 1997/07/18 14:15:39 jim Exp $ $Id: cPersistence.h,v 1.8 1997/12/10 22:19:24 jim Exp $
Definitions to facilitate making cPersistent subclasses in C. Definitions to facilitate making cPersistent subclasses in C.
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
$Log: cPersistence.h,v $ $Log: cPersistence.h,v $
Revision 1.8 1997/12/10 22:19:24 jim
Added PER_USE macro.
Revision 1.7 1997/07/18 14:15:39 jim Revision 1.7 1997/07/18 14:15:39 jim
Added PER_DEL so that subclasses can handle deallocation correctly. Added PER_DEL so that subclasses can handle deallocation correctly.
...@@ -122,9 +125,12 @@ typedef struct { ...@@ -122,9 +125,12 @@ typedef struct {
static cPersistenceCAPIstruct *cPersistenceCAPI; static cPersistenceCAPIstruct *cPersistenceCAPI;
#define PER_USE_OR_RETURN(O,R) \ #define PER_USE_OR_RETURN(O,R) \
if(cPersistenceCAPI->setstate((PyObject*)(O)) < 0) return (R) if(cPersistenceCAPI->setstate((PyObject*)(O)) < 0) return (R)
#define PER_USE(O) (cPersistenceCAPI->setstate((PyObject*)(O)))
#define PER_CHANGED(O) (cPersistenceCAPI->changed((PyObject*)(O))) #define PER_CHANGED(O) (cPersistenceCAPI->changed((PyObject*)(O)))
#define PER_PREVENT_DEACTIVATION(O) ((O)->atime=(time_t)1); #define PER_PREVENT_DEACTIVATION(O) ((O)->atime=(time_t)1);
......
/* /*
$Id: cPersistence.h,v 1.7 1997/07/18 14:15:39 jim Exp $ $Id: cPersistence.h,v 1.8 1997/12/10 22:19:24 jim Exp $
Definitions to facilitate making cPersistent subclasses in C. Definitions to facilitate making cPersistent subclasses in C.
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
$Log: cPersistence.h,v $ $Log: cPersistence.h,v $
Revision 1.8 1997/12/10 22:19:24 jim
Added PER_USE macro.
Revision 1.7 1997/07/18 14:15:39 jim Revision 1.7 1997/07/18 14:15:39 jim
Added PER_DEL so that subclasses can handle deallocation correctly. Added PER_DEL so that subclasses can handle deallocation correctly.
...@@ -122,9 +125,12 @@ typedef struct { ...@@ -122,9 +125,12 @@ typedef struct {
static cPersistenceCAPIstruct *cPersistenceCAPI; static cPersistenceCAPIstruct *cPersistenceCAPI;
#define PER_USE_OR_RETURN(O,R) \ #define PER_USE_OR_RETURN(O,R) \
if(cPersistenceCAPI->setstate((PyObject*)(O)) < 0) return (R) if(cPersistenceCAPI->setstate((PyObject*)(O)) < 0) return (R)
#define PER_USE(O) (cPersistenceCAPI->setstate((PyObject*)(O)))
#define PER_CHANGED(O) (cPersistenceCAPI->changed((PyObject*)(O))) #define PER_CHANGED(O) (cPersistenceCAPI->changed((PyObject*)(O)))
#define PER_PREVENT_DEACTIVATION(O) ((O)->atime=(time_t)1); #define PER_PREVENT_DEACTIVATION(O) ((O)->atime=(time_t)1);
......
/* /*
$Id: cPersistence.h,v 1.7 1997/07/18 14:15:39 jim Exp $ $Id: cPersistence.h,v 1.8 1997/12/10 22:19:24 jim Exp $
Definitions to facilitate making cPersistent subclasses in C. Definitions to facilitate making cPersistent subclasses in C.
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
$Log: cPersistence.h,v $ $Log: cPersistence.h,v $
Revision 1.8 1997/12/10 22:19:24 jim
Added PER_USE macro.
Revision 1.7 1997/07/18 14:15:39 jim Revision 1.7 1997/07/18 14:15:39 jim
Added PER_DEL so that subclasses can handle deallocation correctly. Added PER_DEL so that subclasses can handle deallocation correctly.
...@@ -122,9 +125,12 @@ typedef struct { ...@@ -122,9 +125,12 @@ typedef struct {
static cPersistenceCAPIstruct *cPersistenceCAPI; static cPersistenceCAPIstruct *cPersistenceCAPI;
#define PER_USE_OR_RETURN(O,R) \ #define PER_USE_OR_RETURN(O,R) \
if(cPersistenceCAPI->setstate((PyObject*)(O)) < 0) return (R) if(cPersistenceCAPI->setstate((PyObject*)(O)) < 0) return (R)
#define PER_USE(O) (cPersistenceCAPI->setstate((PyObject*)(O)))
#define PER_CHANGED(O) (cPersistenceCAPI->changed((PyObject*)(O))) #define PER_CHANGED(O) (cPersistenceCAPI->changed((PyObject*)(O)))
#define PER_PREVENT_DEACTIVATION(O) ((O)->atime=(time_t)1); #define PER_PREVENT_DEACTIVATION(O) ((O)->atime=(time_t)1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment