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