From: Roger E. Masse Date: Tue, 25 Mar 1997 17:39:56 +0000 (+0000) Subject: As per GvR recomendation, added support for a 'sync' attribute for the X-Git-Tag: v1.5a1~262 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5a9c8fa3133838e26bb1e29d441e7a99ffc18a9;p=python As per GvR recomendation, added support for a 'sync' attribute for the GDBM module. --- diff --git a/Modules/gdbmmodule.c b/Modules/gdbmmodule.c index de5f94a2d8..6cace286ef 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 */ };