Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
107c0b17
Commit
107c0b17
authored
Apr 27, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added to the CAPI to support subtypes (like Record) that want to
extend attr functions.
parent
80a36e58
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
27 deletions
+93
-27
src/Persistence/cPersistence.c
src/Persistence/cPersistence.c
+22
-8
src/Persistence/cPersistence.h
src/Persistence/cPersistence.h
+9
-1
src/ZODB/cPersistence.c
src/ZODB/cPersistence.c
+22
-8
src/ZODB/cPersistence.h
src/ZODB/cPersistence.h
+9
-1
src/persistent/cPersistence.c
src/persistent/cPersistence.c
+22
-8
src/persistent/cPersistence.h
src/persistent/cPersistence.h
+9
-1
No files found.
src/Persistence/cPersistence.c
View file @
107c0b17
/*
$Id: cPersistence.c,v 1.1
2 1997/04/24 12:48:48
jim Exp $
$Id: cPersistence.c,v 1.1
3 1997/04/27 09:18:01
jim Exp $
C Persistence Module
...
...
@@ -56,7 +56,7 @@
*****************************************************************************/
static
char
*
what_string
=
"$Id: cPersistence.c,v 1.1
2 1997/04/24 12:48:48
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPersistence.c,v 1.1
3 1997/04/27 09:18:01
jim Exp $"
;
#include <time.h>
#include "cPersistence.h"
...
...
@@ -650,7 +650,8 @@ Per_atime(cPersistentObject *self)
}
static
PyObject
*
Per_getattr
(
cPersistentObject
*
self
,
PyObject
*
oname
,
char
*
name
)
Per_getattr
(
cPersistentObject
*
self
,
PyObject
*
oname
,
char
*
name
,
PyObject
*
(
*
getattrf
)(
PyObject
*
,
PyObject
*
))
{
char
*
n
=
name
;
...
...
@@ -729,7 +730,7 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name)
Per_set_atime
(
self
);
}
return
Py_FindAttr
((
PyObject
*
)
self
,
oname
);
return
getattrf
((
PyObject
*
)
self
,
oname
);
}
static
PyObject
*
...
...
@@ -738,7 +739,7 @@ Per_getattro(cPersistentObject *self, PyObject *name)
char
*
s
;
UNLESS
(
s
=
PyString_AsString
(
name
))
return
NULL
;
return
Per_getattr
(
self
,
name
,
s
);
return
Per_getattr
(
self
,
name
,
s
,
PyExtensionClassCAPI
->
getattro
);
}
static
int
...
...
@@ -753,7 +754,8 @@ changed(PyObject *self)
}
static
int
Per_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
)
_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
,
int
(
*
setattrf
)(
PyObject
*
,
PyObject
*
,
PyObject
*
))
{
char
*
name
=
""
;
...
...
@@ -810,7 +812,13 @@ Per_setattro(cPersistentObject *self, PyObject *oname, PyObject *v)
if
(
changed
((
PyObject
*
)
self
)
<
0
)
return
-
1
;
}
return
PyEC_SetAttr
((
PyObject
*
)
self
,
oname
,
v
);
return
setattrf
((
PyObject
*
)
self
,
oname
,
v
);
}
static
int
Per_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
)
{
return
_setattro
(
self
,
oname
,
v
,
PyExtensionClassCAPI
->
setattro
);
}
static
char
Pertype__doc__
[]
=
...
...
@@ -899,13 +907,15 @@ truecPersistenceCAPI = {
(
setattrofunc
)
Per_setattro
,
/*tp_setattr with object key*/
changed
,
(
intfunctionwithpythonarg
)
Per_setstate
,
Per_getattr
,
_setattro
,
};
void
initcPersistence
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.1
2
$"
;
char
*
rev
=
"$Revision: 1.1
3
$"
;
PATimeType
.
ob_type
=&
PyType_Type
;
...
...
@@ -932,6 +942,10 @@ initcPersistence()
/****************************************************************************
$Log: cPersistence.c,v $
Revision 1.13 1997/04/27 09:18:01 jim
Added to the CAPI to support subtypes (like Record) that want to
extend attr functions.
Revision 1.12 1997/04/24 12:48:48 jim
Fixed bug in reinit
...
...
src/Persistence/cPersistence.h
View file @
107c0b17
/*
$Id: cPersistence.h,v 1.
2 1997/04/22 02:40:28
jim Exp $
$Id: cPersistence.h,v 1.
3 1997/04/27 09:18:23
jim Exp $
Definitions to facilitate making cPersistent subclasses in C.
...
...
@@ -56,6 +56,10 @@
$Log: cPersistence.h,v $
Revision 1.3 1997/04/27 09:18:23 jim
Added to the CAPI to support subtypes (like Record) that want to
extend attr functions.
Revision 1.2 1997/04/22 02:40:28 jim
Changed object header layout.
...
...
@@ -90,6 +94,8 @@ typedef struct {
cPersistentObject
*
object
;
}
PATimeobject
;
typedef
int
(
*
persetattr
)(
PyObject
*
,
PyObject
*
,
PyObject
*
,
setattrofunc
);
typedef
PyObject
*
(
*
pergetattr
)(
PyObject
*
,
PyObject
*
,
char
*
,
getattrofunc
);
typedef
struct
{
PyMethodChain
*
methods
;
...
...
@@ -97,6 +103,8 @@ typedef struct {
setattrofunc
setattro
;
int
(
*
changed
)(
PyObject
*
);
int
(
*
setstate
)(
PyObject
*
);
pergetattr
pergetattro
;
persetattr
persetattro
;
}
cPersistenceCAPIstruct
;
static
cPersistenceCAPIstruct
*
cPersistenceCAPI
;
...
...
src/ZODB/cPersistence.c
View file @
107c0b17
/*
$Id: cPersistence.c,v 1.1
2 1997/04/24 12:48:48
jim Exp $
$Id: cPersistence.c,v 1.1
3 1997/04/27 09:18:01
jim Exp $
C Persistence Module
...
...
@@ -56,7 +56,7 @@
*****************************************************************************/
static
char
*
what_string
=
"$Id: cPersistence.c,v 1.1
2 1997/04/24 12:48:48
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPersistence.c,v 1.1
3 1997/04/27 09:18:01
jim Exp $"
;
#include <time.h>
#include "cPersistence.h"
...
...
@@ -650,7 +650,8 @@ Per_atime(cPersistentObject *self)
}
static
PyObject
*
Per_getattr
(
cPersistentObject
*
self
,
PyObject
*
oname
,
char
*
name
)
Per_getattr
(
cPersistentObject
*
self
,
PyObject
*
oname
,
char
*
name
,
PyObject
*
(
*
getattrf
)(
PyObject
*
,
PyObject
*
))
{
char
*
n
=
name
;
...
...
@@ -729,7 +730,7 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name)
Per_set_atime
(
self
);
}
return
Py_FindAttr
((
PyObject
*
)
self
,
oname
);
return
getattrf
((
PyObject
*
)
self
,
oname
);
}
static
PyObject
*
...
...
@@ -738,7 +739,7 @@ Per_getattro(cPersistentObject *self, PyObject *name)
char
*
s
;
UNLESS
(
s
=
PyString_AsString
(
name
))
return
NULL
;
return
Per_getattr
(
self
,
name
,
s
);
return
Per_getattr
(
self
,
name
,
s
,
PyExtensionClassCAPI
->
getattro
);
}
static
int
...
...
@@ -753,7 +754,8 @@ changed(PyObject *self)
}
static
int
Per_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
)
_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
,
int
(
*
setattrf
)(
PyObject
*
,
PyObject
*
,
PyObject
*
))
{
char
*
name
=
""
;
...
...
@@ -810,7 +812,13 @@ Per_setattro(cPersistentObject *self, PyObject *oname, PyObject *v)
if
(
changed
((
PyObject
*
)
self
)
<
0
)
return
-
1
;
}
return
PyEC_SetAttr
((
PyObject
*
)
self
,
oname
,
v
);
return
setattrf
((
PyObject
*
)
self
,
oname
,
v
);
}
static
int
Per_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
)
{
return
_setattro
(
self
,
oname
,
v
,
PyExtensionClassCAPI
->
setattro
);
}
static
char
Pertype__doc__
[]
=
...
...
@@ -899,13 +907,15 @@ truecPersistenceCAPI = {
(
setattrofunc
)
Per_setattro
,
/*tp_setattr with object key*/
changed
,
(
intfunctionwithpythonarg
)
Per_setstate
,
Per_getattr
,
_setattro
,
};
void
initcPersistence
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.1
2
$"
;
char
*
rev
=
"$Revision: 1.1
3
$"
;
PATimeType
.
ob_type
=&
PyType_Type
;
...
...
@@ -932,6 +942,10 @@ initcPersistence()
/****************************************************************************
$Log: cPersistence.c,v $
Revision 1.13 1997/04/27 09:18:01 jim
Added to the CAPI to support subtypes (like Record) that want to
extend attr functions.
Revision 1.12 1997/04/24 12:48:48 jim
Fixed bug in reinit
...
...
src/ZODB/cPersistence.h
View file @
107c0b17
/*
$Id: cPersistence.h,v 1.
2 1997/04/22 02:40:28
jim Exp $
$Id: cPersistence.h,v 1.
3 1997/04/27 09:18:23
jim Exp $
Definitions to facilitate making cPersistent subclasses in C.
...
...
@@ -56,6 +56,10 @@
$Log: cPersistence.h,v $
Revision 1.3 1997/04/27 09:18:23 jim
Added to the CAPI to support subtypes (like Record) that want to
extend attr functions.
Revision 1.2 1997/04/22 02:40:28 jim
Changed object header layout.
...
...
@@ -90,6 +94,8 @@ typedef struct {
cPersistentObject
*
object
;
}
PATimeobject
;
typedef
int
(
*
persetattr
)(
PyObject
*
,
PyObject
*
,
PyObject
*
,
setattrofunc
);
typedef
PyObject
*
(
*
pergetattr
)(
PyObject
*
,
PyObject
*
,
char
*
,
getattrofunc
);
typedef
struct
{
PyMethodChain
*
methods
;
...
...
@@ -97,6 +103,8 @@ typedef struct {
setattrofunc
setattro
;
int
(
*
changed
)(
PyObject
*
);
int
(
*
setstate
)(
PyObject
*
);
pergetattr
pergetattro
;
persetattr
persetattro
;
}
cPersistenceCAPIstruct
;
static
cPersistenceCAPIstruct
*
cPersistenceCAPI
;
...
...
src/persistent/cPersistence.c
View file @
107c0b17
/*
$Id: cPersistence.c,v 1.1
2 1997/04/24 12:48:48
jim Exp $
$Id: cPersistence.c,v 1.1
3 1997/04/27 09:18:01
jim Exp $
C Persistence Module
...
...
@@ -56,7 +56,7 @@
*****************************************************************************/
static
char
*
what_string
=
"$Id: cPersistence.c,v 1.1
2 1997/04/24 12:48:48
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPersistence.c,v 1.1
3 1997/04/27 09:18:01
jim Exp $"
;
#include <time.h>
#include "cPersistence.h"
...
...
@@ -650,7 +650,8 @@ Per_atime(cPersistentObject *self)
}
static
PyObject
*
Per_getattr
(
cPersistentObject
*
self
,
PyObject
*
oname
,
char
*
name
)
Per_getattr
(
cPersistentObject
*
self
,
PyObject
*
oname
,
char
*
name
,
PyObject
*
(
*
getattrf
)(
PyObject
*
,
PyObject
*
))
{
char
*
n
=
name
;
...
...
@@ -729,7 +730,7 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name)
Per_set_atime
(
self
);
}
return
Py_FindAttr
((
PyObject
*
)
self
,
oname
);
return
getattrf
((
PyObject
*
)
self
,
oname
);
}
static
PyObject
*
...
...
@@ -738,7 +739,7 @@ Per_getattro(cPersistentObject *self, PyObject *name)
char
*
s
;
UNLESS
(
s
=
PyString_AsString
(
name
))
return
NULL
;
return
Per_getattr
(
self
,
name
,
s
);
return
Per_getattr
(
self
,
name
,
s
,
PyExtensionClassCAPI
->
getattro
);
}
static
int
...
...
@@ -753,7 +754,8 @@ changed(PyObject *self)
}
static
int
Per_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
)
_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
,
int
(
*
setattrf
)(
PyObject
*
,
PyObject
*
,
PyObject
*
))
{
char
*
name
=
""
;
...
...
@@ -810,7 +812,13 @@ Per_setattro(cPersistentObject *self, PyObject *oname, PyObject *v)
if
(
changed
((
PyObject
*
)
self
)
<
0
)
return
-
1
;
}
return
PyEC_SetAttr
((
PyObject
*
)
self
,
oname
,
v
);
return
setattrf
((
PyObject
*
)
self
,
oname
,
v
);
}
static
int
Per_setattro
(
cPersistentObject
*
self
,
PyObject
*
oname
,
PyObject
*
v
)
{
return
_setattro
(
self
,
oname
,
v
,
PyExtensionClassCAPI
->
setattro
);
}
static
char
Pertype__doc__
[]
=
...
...
@@ -899,13 +907,15 @@ truecPersistenceCAPI = {
(
setattrofunc
)
Per_setattro
,
/*tp_setattr with object key*/
changed
,
(
intfunctionwithpythonarg
)
Per_setstate
,
Per_getattr
,
_setattro
,
};
void
initcPersistence
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.1
2
$"
;
char
*
rev
=
"$Revision: 1.1
3
$"
;
PATimeType
.
ob_type
=&
PyType_Type
;
...
...
@@ -932,6 +942,10 @@ initcPersistence()
/****************************************************************************
$Log: cPersistence.c,v $
Revision 1.13 1997/04/27 09:18:01 jim
Added to the CAPI to support subtypes (like Record) that want to
extend attr functions.
Revision 1.12 1997/04/24 12:48:48 jim
Fixed bug in reinit
...
...
src/persistent/cPersistence.h
View file @
107c0b17
/*
$Id: cPersistence.h,v 1.
2 1997/04/22 02:40:28
jim Exp $
$Id: cPersistence.h,v 1.
3 1997/04/27 09:18:23
jim Exp $
Definitions to facilitate making cPersistent subclasses in C.
...
...
@@ -56,6 +56,10 @@
$Log: cPersistence.h,v $
Revision 1.3 1997/04/27 09:18:23 jim
Added to the CAPI to support subtypes (like Record) that want to
extend attr functions.
Revision 1.2 1997/04/22 02:40:28 jim
Changed object header layout.
...
...
@@ -90,6 +94,8 @@ typedef struct {
cPersistentObject
*
object
;
}
PATimeobject
;
typedef
int
(
*
persetattr
)(
PyObject
*
,
PyObject
*
,
PyObject
*
,
setattrofunc
);
typedef
PyObject
*
(
*
pergetattr
)(
PyObject
*
,
PyObject
*
,
char
*
,
getattrofunc
);
typedef
struct
{
PyMethodChain
*
methods
;
...
...
@@ -97,6 +103,8 @@ typedef struct {
setattrofunc
setattro
;
int
(
*
changed
)(
PyObject
*
);
int
(
*
setstate
)(
PyObject
*
);
pergetattr
pergetattro
;
persetattr
persetattro
;
}
cPersistenceCAPIstruct
;
static
cPersistenceCAPIstruct
*
cPersistenceCAPI
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment