aboutsummaryrefslogtreecommitdiffstats
path: root/src/bus.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-05-01 13:18:15 +0200
committerMattias Andrée <maandree@operamail.com>2015-05-01 13:18:15 +0200
commit17c4ef2204e09acf7e383ae57df3049f36f2068a (patch)
treec659ab1bd614797aa95d2e48be8f4cefc042dc50 /src/bus.c
parentdoc (diff)
downloadbus-17c4ef2204e09acf7e383ae57df3049f36f2068a.tar.gz
bus-17c4ef2204e09acf7e383ae57df3049f36f2068a.tar.bz2
bus-17c4ef2204e09acf7e383ae57df3049f36f2068a.tar.xz
doc bus_poll
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/bus.c')
-rw-r--r--src/bus.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bus.c b/src/bus.c
index 369fa2f..19270fb 100644
--- a/src/bus.c
+++ b/src/bus.c
@@ -766,6 +766,19 @@ bus_poll_stop(const bus_t *bus)
}
+/**
+ * Wait for a message to be broadcasted on the bus.
+ * The caller should make a copy of the received message,
+ * without freeing the original copy, and parse it in a
+ * separate thread. When the new thread has started be
+ * started, the caller of this function should then
+ * either call `bus_poll` again or `bus_poll_stop`.
+ *
+ * @param bus Bus information
+ * @param flags `IPC_NOWAIT` if the bus should fail and set `errno` to
+ * `EAGAIN` if this isn't already a message available on the bus
+ * @return The received message, `NULL` on error
+ */
const char *
bus_poll(bus_t *bus, int flags)
{