summaryrefslogtreecommitdiffstats
path: root/Modules/gdbmmodule.c
diff options
context:
space:
mode:
authorRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>1997-03-25 17:39:56 (GMT)
committerRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>1997-03-25 17:39:56 (GMT)
commite5a9c8fa3133838e26bb1e29d441e7a99ffc18a9 (patch)
treefe57c04a8a9db02c34e8d0118958b513eb95d9b0 /Modules/gdbmmodule.c
parent1eb9a81eb92dd5d133c8584bad8aecd5b8f0ccd1 (diff)
downloadcpython-e5a9c8fa3133838e26bb1e29d441e7a99ffc18a9.zip
cpython-e5a9c8fa3133838e26bb1e29d441e7a99ffc18a9.tar.gz
cpython-e5a9c8fa3133838e26bb1e29d441e7a99ffc18a9.tar.bz2
As per GvR recomendation, added support for a 'sync' attribute for the
GDBM module.
Diffstat (limited to 'Modules/gdbmmodule.c')
-rw-r--r--Modules/gdbmmodule.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Modules/gdbmmodule.c b/Modules/gdbmmodule.c
index de5f94a..6cace28 100644
--- a/Modules/gdbmmodule.c
+++ b/Modules/gdbmmodule.c
@@ -32,7 +32,12 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/*****************************************************************
+ Modification History:
+ Added support for 'gdbm_sync' method. Roger E. Masse 3/25/97
+
+ *****************************************************************/
/* DBM module using dictionary interface */
@@ -310,6 +315,18 @@ PyObject *args;
return Py_None;
}
+static PyObject *
+dbm_sync(dp, args)
+ register dbmobject *dp;
+ PyObject *args;
+{
+ if (!PyArg_NoArgs(args))
+ return NULL;
+ gdbm_sync(dp->di_dbm);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static PyMethodDef dbm_methods[] = {
{"close", (PyCFunction)dbm_close},
{"keys", (PyCFunction)dbm_keys},
@@ -317,6 +334,7 @@ static PyMethodDef dbm_methods[] = {
{"firstkey", (PyCFunction)dbm_firstkey},
{"nextkey", (PyCFunction)dbm_nextkey},
{"reorganize", (PyCFunction)dbm_reorganize},
+ {"sync", (PyCFunction)dbm_sync},
{NULL, NULL} /* sentinel */
};