diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-05-17 14:40:46 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-05-17 14:40:46 +0200 |
commit | 0d44f16f6738c0776edf60b84f49f0c6f875a8fe (patch) | |
tree | acc2a01cea1f7c7458c8ccc6ec4b37fa5ccb5d0f /doc/examples/telephony-and-music/monitor.c | |
parent | update documentation for bus_poll (diff) | |
download | bus-0d44f16f6738c0776edf60b84f49f0c6f875a8fe.tar.gz bus-0d44f16f6738c0776edf60b84f49f0c6f875a8fe.tar.bz2 bus-0d44f16f6738c0776edf60b84f49f0c6f875a8fe.tar.xz |
style + add timed read example
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | doc/examples/telephony-and-music/monitor.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/examples/telephony-and-music/monitor.c b/doc/examples/telephony-and-music/monitor.c index bf3e290..b3cc832 100644 --- a/doc/examples/telephony-and-music/monitor.c +++ b/doc/examples/telephony-and-music/monitor.c @@ -13,7 +13,8 @@ static char* pausers = NULL; -static int is_moc_playing(void) +static int +is_moc_playing(void) { return !WEXITSTATUS(system("env LANG=C mocp -i 2>/dev/null | grep 'State: PLAY' >/dev/null")); } @@ -25,7 +26,8 @@ static int is_moc_playing(void) * too much for an example, especially since it would also require * a mutex to make sure two threads do not modify data at the same * time, causing chaos. */ -static int callback(const char *message, void *user_data) +static int +callback(const char *message, void *user_data) { char *msg = NULL; size_t len = 0; @@ -83,7 +85,8 @@ done: -int main() +int +main() { bus_t bus; t(bus_open(&bus, "/tmp/example-bus", BUS_RDONLY)); |