Add new rpmte methods.
authorjbj <devnull@localhost>
Tue, 3 Dec 2002 21:00:38 +0000 (21:00 +0000)
committerjbj <devnull@localhost>
Tue, 3 Dec 2002 21:00:38 +0000 (21:00 +0000)
CVS patchset: 5914
CVS date: 2002/12/03 21:00:38

python/rpmte-py.c

index 87eb54a..7a0ac8e 100644 (file)
@@ -150,8 +150,40 @@ static PyObject *
 rpmte_AddedKey(rpmteObject * s, PyObject * args)
        /*@*/
 {
-    if (!PyArg_ParseTuple(args, ":Degree")) return NULL;
-    return Py_BuildValue("i", rpmteDegree(s->te));
+    if (!PyArg_ParseTuple(args, ":AddedKey")) return NULL;
+    return Py_BuildValue("i", rpmteAddedKey(s->te));
+}
+
+static PyObject *
+rpmte_DependsOnKey(rpmteObject * s, PyObject * args)
+       /*@*/
+{
+    if (!PyArg_ParseTuple(args, ":DependsOnKey")) return NULL;
+    return Py_BuildValue("i", rpmteDependsOnKey(s->te));
+}
+
+static PyObject *
+rpmte_DBOffset(rpmteObject * s, PyObject * args)
+       /*@*/
+{
+    if (!PyArg_ParseTuple(args, ":DBOffset")) return NULL;
+    return Py_BuildValue("i", rpmteDBOffset(s->te));
+}
+
+static PyObject *
+rpmte_Key(rpmteObject * s, PyObject * args)
+       /*@*/
+{
+    PyObject * Key;
+
+    if (!PyArg_ParseTuple(args, ":Key")) return NULL;
+    /* XXX how to insure this is a PyObject??? */
+    Key = (PyObject *) rpmteKey(s->te);
+    if (Key == NULL) {
+       Py_INCREF(Py_None);
+       return Py_None;
+    }
+    return Key;
 }
 
 static PyObject *
@@ -250,6 +282,12 @@ static struct PyMethodDef rpmte_methods[] = {
         NULL},
     {"AddedKey",(PyCFunction)rpmte_AddedKey,   METH_VARARGS,
         NULL},
+    {"DependsOnKey",(PyCFunction)rpmte_DependsOnKey,   METH_VARARGS,
+        NULL},
+    {"DBOffset",(PyCFunction)rpmte_DBOffset,   METH_VARARGS,
+        NULL},
+    {"Key",    (PyCFunction)rpmte_Key, METH_VARARGS,
+        NULL},
     {"DS",     (PyCFunction)rpmte_DS,          METH_VARARGS,
 "te.DS(TagN) -> DS\n\
 - Return the TagN dependency set (or None). TagN is one of\n\