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
53078b61
Commit
53078b61
authored
Jun 29, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a get method.
parent
bb13515e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
6 deletions
+72
-6
src/Persistence/cPickleCache.c
src/Persistence/cPickleCache.c
+24
-2
src/ZODB/cPickleCache.c
src/ZODB/cPickleCache.c
+24
-2
src/persistent/cPickleCache.c
src/persistent/cPickleCache.c
+24
-2
No files found.
src/Persistence/cPickleCache.c
View file @
53078b61
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file.
attributions are listed in the accompanying credits file.
****************************************************************************/
****************************************************************************/
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
3 1999/06/13 12:27:38
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
4 1999/06/29 18:27:05
jim Exp $"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
#define UNLESS(E) if(!(E))
...
@@ -399,6 +399,26 @@ cc_invalidate(ccobject *self, PyObject *args)
...
@@ -399,6 +399,26 @@ cc_invalidate(ccobject *self, PyObject *args)
return
Py_None
;
return
Py_None
;
}
}
static
PyObject
*
cc_get
(
ccobject
*
self
,
PyObject
*
args
)
{
PyObject
*
r
,
*
key
,
*
d
=
0
;
UNLESS
(
PyArg_ParseTuple
(
args
,
"O|O"
,
&
key
,
&
d
))
return
NULL
;
UNLESS
(
r
=
PyDict_GetItem
(
self
->
data
,
key
))
r
=
d
;
UNLESS
(
d
)
{
PyErr_SetObject
(
PyExc_KeyError
,
key
);
return
NULL
;
}
if
(
maybegc
(
self
,
r
)
<
0
)
return
NULL
;
Py_INCREF
(
r
);
return
r
;
}
static
struct
PyMethodDef
cc_methods
[]
=
{
static
struct
PyMethodDef
cc_methods
[]
=
{
{
"full_sweep"
,
(
PyCFunction
)
cc_full_sweep
,
METH_VARARGS
,
{
"full_sweep"
,
(
PyCFunction
)
cc_full_sweep
,
METH_VARARGS
,
...
@@ -418,6 +438,8 @@ static struct PyMethodDef cc_methods[] = {
...
@@ -418,6 +438,8 @@ static struct PyMethodDef cc_methods[] = {
"incrgc() -- Perform incremental garbage collection"
},
"incrgc() -- Perform incremental garbage collection"
},
{
"invalidate"
,
(
PyCFunction
)
cc_invalidate
,
METH_VARARGS
,
{
"invalidate"
,
(
PyCFunction
)
cc_invalidate
,
METH_VARARGS
,
"invalidate(oids) -- invalidate one, many, or all ids"
},
"invalidate(oids) -- invalidate one, many, or all ids"
},
{
"get"
,
(
PyCFunction
)
cc_get
,
METH_VARARGS
,
"get(key [, default]) -- get an item, or a default"
},
{
NULL
,
NULL
}
/* sentinel */
{
NULL
,
NULL
}
/* sentinel */
};
};
...
@@ -622,7 +644,7 @@ void
...
@@ -622,7 +644,7 @@ void
initcPickleCache
()
initcPickleCache
()
{
{
PyObject
*
m
,
*
d
;
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.2
3
$"
;
char
*
rev
=
"$Revision: 1.2
4
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
src/ZODB/cPickleCache.c
View file @
53078b61
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file.
attributions are listed in the accompanying credits file.
****************************************************************************/
****************************************************************************/
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
3 1999/06/13 12:27:38
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
4 1999/06/29 18:27:05
jim Exp $"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
#define UNLESS(E) if(!(E))
...
@@ -399,6 +399,26 @@ cc_invalidate(ccobject *self, PyObject *args)
...
@@ -399,6 +399,26 @@ cc_invalidate(ccobject *self, PyObject *args)
return
Py_None
;
return
Py_None
;
}
}
static
PyObject
*
cc_get
(
ccobject
*
self
,
PyObject
*
args
)
{
PyObject
*
r
,
*
key
,
*
d
=
0
;
UNLESS
(
PyArg_ParseTuple
(
args
,
"O|O"
,
&
key
,
&
d
))
return
NULL
;
UNLESS
(
r
=
PyDict_GetItem
(
self
->
data
,
key
))
r
=
d
;
UNLESS
(
d
)
{
PyErr_SetObject
(
PyExc_KeyError
,
key
);
return
NULL
;
}
if
(
maybegc
(
self
,
r
)
<
0
)
return
NULL
;
Py_INCREF
(
r
);
return
r
;
}
static
struct
PyMethodDef
cc_methods
[]
=
{
static
struct
PyMethodDef
cc_methods
[]
=
{
{
"full_sweep"
,
(
PyCFunction
)
cc_full_sweep
,
METH_VARARGS
,
{
"full_sweep"
,
(
PyCFunction
)
cc_full_sweep
,
METH_VARARGS
,
...
@@ -418,6 +438,8 @@ static struct PyMethodDef cc_methods[] = {
...
@@ -418,6 +438,8 @@ static struct PyMethodDef cc_methods[] = {
"incrgc() -- Perform incremental garbage collection"
},
"incrgc() -- Perform incremental garbage collection"
},
{
"invalidate"
,
(
PyCFunction
)
cc_invalidate
,
METH_VARARGS
,
{
"invalidate"
,
(
PyCFunction
)
cc_invalidate
,
METH_VARARGS
,
"invalidate(oids) -- invalidate one, many, or all ids"
},
"invalidate(oids) -- invalidate one, many, or all ids"
},
{
"get"
,
(
PyCFunction
)
cc_get
,
METH_VARARGS
,
"get(key [, default]) -- get an item, or a default"
},
{
NULL
,
NULL
}
/* sentinel */
{
NULL
,
NULL
}
/* sentinel */
};
};
...
@@ -622,7 +644,7 @@ void
...
@@ -622,7 +644,7 @@ void
initcPickleCache
()
initcPickleCache
()
{
{
PyObject
*
m
,
*
d
;
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.2
3
$"
;
char
*
rev
=
"$Revision: 1.2
4
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
src/persistent/cPickleCache.c
View file @
53078b61
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file.
attributions are listed in the accompanying credits file.
****************************************************************************/
****************************************************************************/
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
3 1999/06/13 12:27:38
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
4 1999/06/29 18:27:05
jim Exp $"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
#define UNLESS(E) if(!(E))
...
@@ -399,6 +399,26 @@ cc_invalidate(ccobject *self, PyObject *args)
...
@@ -399,6 +399,26 @@ cc_invalidate(ccobject *self, PyObject *args)
return
Py_None
;
return
Py_None
;
}
}
static
PyObject
*
cc_get
(
ccobject
*
self
,
PyObject
*
args
)
{
PyObject
*
r
,
*
key
,
*
d
=
0
;
UNLESS
(
PyArg_ParseTuple
(
args
,
"O|O"
,
&
key
,
&
d
))
return
NULL
;
UNLESS
(
r
=
PyDict_GetItem
(
self
->
data
,
key
))
r
=
d
;
UNLESS
(
d
)
{
PyErr_SetObject
(
PyExc_KeyError
,
key
);
return
NULL
;
}
if
(
maybegc
(
self
,
r
)
<
0
)
return
NULL
;
Py_INCREF
(
r
);
return
r
;
}
static
struct
PyMethodDef
cc_methods
[]
=
{
static
struct
PyMethodDef
cc_methods
[]
=
{
{
"full_sweep"
,
(
PyCFunction
)
cc_full_sweep
,
METH_VARARGS
,
{
"full_sweep"
,
(
PyCFunction
)
cc_full_sweep
,
METH_VARARGS
,
...
@@ -418,6 +438,8 @@ static struct PyMethodDef cc_methods[] = {
...
@@ -418,6 +438,8 @@ static struct PyMethodDef cc_methods[] = {
"incrgc() -- Perform incremental garbage collection"
},
"incrgc() -- Perform incremental garbage collection"
},
{
"invalidate"
,
(
PyCFunction
)
cc_invalidate
,
METH_VARARGS
,
{
"invalidate"
,
(
PyCFunction
)
cc_invalidate
,
METH_VARARGS
,
"invalidate(oids) -- invalidate one, many, or all ids"
},
"invalidate(oids) -- invalidate one, many, or all ids"
},
{
"get"
,
(
PyCFunction
)
cc_get
,
METH_VARARGS
,
"get(key [, default]) -- get an item, or a default"
},
{
NULL
,
NULL
}
/* sentinel */
{
NULL
,
NULL
}
/* sentinel */
};
};
...
@@ -622,7 +644,7 @@ void
...
@@ -622,7 +644,7 @@ void
initcPickleCache
()
initcPickleCache
()
{
{
PyObject
*
m
,
*
d
;
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.2
3
$"
;
char
*
rev
=
"$Revision: 1.2
4
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
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