It adds all of the things in a Python mapping into a gmappish object.
What's not to like?
-static int update_core(PyObject *me, PyObject *map)
+int gmap_pyupdate(PyObject *me, PyObject *map)
{
const gmap_ops *gmops = GMAP_OPS(me);
PyObject *i = 0, *item = 0, *k = 0, *v = 0;
{
const gmap_ops *gmops = GMAP_OPS(me);
PyObject *i = 0, *item = 0, *k = 0, *v = 0;
unsigned foundp;
int rc = -1;
unsigned foundp;
int rc = -1;
v = PyObject_CallMethod(map, PY23("iteritems", "items"), 0);
#ifdef PY3
if (v) { i = PyObject_GetIter(v); Py_DECREF(v); v = 0; }
v = PyObject_CallMethod(map, PY23("iteritems", "items"), 0);
#ifdef PY3
if (v) { i = PyObject_GetIter(v); Py_DECREF(v); v = 0; }
PyObject *map = 0;
if (!PyArg_ParseTuple(arg, "|O:update", &map)) return (0);
PyObject *map = 0;
if (!PyArg_ParseTuple(arg, "|O:update", &map)) return (0);
- if (map && update_core(me, map)) return (0);
- if (kw && update_core(me, kw)) return (0);
+ if (gmap_pyupdate(me, map)) return (0);
+ if (gmap_pyupdate(me, kw)) return (0);
extern PyObject *gmap_pylookup(PyObject *, PyObject *); /* for `mp_subscript' */
extern int gmap_pystore(PyObject *, PyObject *, PyObject *); /* for `mp_ass_subscript' */
extern int gmap_pyhaskey(PyObject *, PyObject *); /* for `sq_contains' */
extern PyObject *gmap_pylookup(PyObject *, PyObject *); /* for `mp_subscript' */
extern int gmap_pystore(PyObject *, PyObject *, PyObject *); /* for `mp_ass_subscript' */
extern int gmap_pyhaskey(PyObject *, PyObject *); /* for `sq_contains' */
+extern int gmap_pyupdate(PyObject *me, PyObject *map);
extern const PySequenceMethods gmap_pysequence; /* for `tp_as_sequence' */
extern const PyMethodDef gmapro_pymethods[]; /* read-only methods */
extern const PyMethodDef gmap_pymethods[]; /* all the standard methods */
extern const PySequenceMethods gmap_pysequence; /* for `tp_as_sequence' */
extern const PyMethodDef gmapro_pymethods[]; /* read-only methods */
extern const PyMethodDef gmap_pymethods[]; /* all the standard methods */