Kaydet (Commit) e5a9c8fa authored tarafından Roger E. Masse's avatar Roger E. Masse

As per GvR recomendation, added support for a 'sync' attribute for the

GDBM module.
üst 1eb9a81e
...@@ -32,7 +32,12 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ...@@ -32,7 +32,12 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
******************************************************************/ ******************************************************************/
/*****************************************************************
Modification History:
Added support for 'gdbm_sync' method. Roger E. Masse 3/25/97
*****************************************************************/
/* DBM module using dictionary interface */ /* DBM module using dictionary interface */
...@@ -310,6 +315,18 @@ PyObject *args; ...@@ -310,6 +315,18 @@ PyObject *args;
return Py_None; 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[] = { static PyMethodDef dbm_methods[] = {
{"close", (PyCFunction)dbm_close}, {"close", (PyCFunction)dbm_close},
{"keys", (PyCFunction)dbm_keys}, {"keys", (PyCFunction)dbm_keys},
...@@ -317,6 +334,7 @@ static PyMethodDef dbm_methods[] = { ...@@ -317,6 +334,7 @@ static PyMethodDef dbm_methods[] = {
{"firstkey", (PyCFunction)dbm_firstkey}, {"firstkey", (PyCFunction)dbm_firstkey},
{"nextkey", (PyCFunction)dbm_nextkey}, {"nextkey", (PyCFunction)dbm_nextkey},
{"reorganize", (PyCFunction)dbm_reorganize}, {"reorganize", (PyCFunction)dbm_reorganize},
{"sync", (PyCFunction)dbm_sync},
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };
......
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