teknoraver / rpms / systemd

Forked from rpms/systemd 4 months ago
Clone

Blame 0002-systemd-python-wrap-sd_journal_add_conjunction.patch

Harald Hoyer 6844c2
From 7f876bc4281145e6c74e98de07c6648a5b51ed90 Mon Sep 17 00:00:00 2001
Harald Hoyer 6844c2
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Harald Hoyer 6844c2
Date: Thu, 18 Apr 2013 19:37:26 -0400
Harald Hoyer 6844c2
Subject: [PATCH] systemd-python: wrap sd_journal_add_conjunction
Harald Hoyer 6844c2
Harald Hoyer 6844c2
---
Harald Hoyer 6844c2
 src/python-systemd/_reader.c | 23 ++++++++++++++++++++++-
Harald Hoyer 6844c2
 1 file changed, 22 insertions(+), 1 deletion(-)
Harald Hoyer 6844c2
Harald Hoyer 6844c2
diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c
Harald Hoyer 6844c2
index 05993b3..b836597 100644
Harald Hoyer 6844c2
--- a/src/python-systemd/_reader.c
Harald Hoyer 6844c2
+++ b/src/python-systemd/_reader.c
Harald Hoyer 6844c2
@@ -567,7 +567,10 @@ static PyObject* Reader_add_match(Reader *self, PyObject *args, PyObject *keywds
Harald Hoyer 6844c2
 
Harald Hoyer 6844c2
 PyDoc_STRVAR(Reader_add_disjunction__doc__,
Harald Hoyer 6844c2
              "add_disjunction() -> None\n\n"
Harald Hoyer 6844c2
-             "Inserts a logical OR between matches added before and afterwards.");
Harald Hoyer 6844c2
+             "Inserts a logical OR between matches added since previous\n"
Harald Hoyer 6844c2
+             "add_disjunction() or add_conjunction() and the next\n"
Harald Hoyer 6844c2
+             "add_disjunction() or add_conjunction().\n\n"
Harald Hoyer 6844c2
+             "See man:sd_journal_add_disjunction(3) for explanation.");
Harald Hoyer 6844c2
 static PyObject* Reader_add_disjunction(Reader *self, PyObject *args)
Harald Hoyer 6844c2
 {
Harald Hoyer 6844c2
     int r;
Harald Hoyer 6844c2
@@ -579,6 +582,23 @@ static PyObject* Reader_add_disjunction(Reader *self, PyObject *args)
Harald Hoyer 6844c2
 }
Harald Hoyer 6844c2
 
Harald Hoyer 6844c2
 
Harald Hoyer 6844c2
+PyDoc_STRVAR(Reader_add_conjunction__doc__,
Harald Hoyer 6844c2
+             "add_conjunction() -> None\n\n"
Harald Hoyer 6844c2
+             "Inserts a logical AND between matches added since previous\n"
Harald Hoyer 6844c2
+             "add_disjunction() or add_conjunction() and the next\n"
Harald Hoyer 6844c2
+             "add_disjunction() or add_conjunction().\n\n"
Harald Hoyer 6844c2
+             "See man:sd_journal_add_disjunction(3) for explanation.");
Harald Hoyer 6844c2
+static PyObject* Reader_add_conjunction(Reader *self, PyObject *args)
Harald Hoyer 6844c2
+{
Harald Hoyer 6844c2
+    int r;
Harald Hoyer 6844c2
+    r = sd_journal_add_conjunction(self->j);
Harald Hoyer 6844c2
+    set_error(r, NULL, NULL);
Harald Hoyer 6844c2
+    if (r < 0)
Harald Hoyer 6844c2
+        return NULL;
Harald Hoyer 6844c2
+    Py_RETURN_NONE;
Harald Hoyer 6844c2
+}
Harald Hoyer 6844c2
+
Harald Hoyer 6844c2
+
Harald Hoyer 6844c2
 PyDoc_STRVAR(Reader_flush_matches__doc__,
Harald Hoyer 6844c2
              "flush_matches() -> None\n\n"
Harald Hoyer 6844c2
              "Clear all current match filters.");
Harald Hoyer 6844c2
@@ -980,6 +1000,7 @@ static PyMethodDef Reader_methods[] = {
Harald Hoyer 6844c2
     {"_get_monotonic",  (PyCFunction) Reader_get_monotonic, METH_NOARGS, Reader_get_monotonic__doc__},
Harald Hoyer 6844c2
     {"add_match",       (PyCFunction) Reader_add_match, METH_VARARGS|METH_KEYWORDS, Reader_add_match__doc__},
Harald Hoyer 6844c2
     {"add_disjunction", (PyCFunction) Reader_add_disjunction, METH_NOARGS, Reader_add_disjunction__doc__},
Harald Hoyer 6844c2
+    {"add_conjunction", (PyCFunction) Reader_add_conjunction, METH_NOARGS, Reader_add_conjunction__doc__},
Harald Hoyer 6844c2
     {"flush_matches",   (PyCFunction) Reader_flush_matches, METH_NOARGS, Reader_flush_matches__doc__},
Harald Hoyer 6844c2
     {"seek_head",       (PyCFunction) Reader_seek_head, METH_NOARGS, Reader_seek_head__doc__},
Harald Hoyer 6844c2
     {"seek_tail",       (PyCFunction) Reader_seek_tail, METH_NOARGS, Reader_seek_tail__doc__},
Harald Hoyer 6844c2
-- 
Harald Hoyer 6844c2
1.8.2
Harald Hoyer 6844c2