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 | |
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 'doc/examples/telephony-and-music')
-rw-r--r-- | doc/examples/telephony-and-music/cleanup.c | 3 | ||||
-rw-r--r-- | doc/examples/telephony-and-music/end-call.c | 3 | ||||
-rw-r--r-- | doc/examples/telephony-and-music/init.c | 3 | ||||
-rw-r--r-- | doc/examples/telephony-and-music/monitor.c | 9 | ||||
-rw-r--r-- | doc/examples/telephony-and-music/receive-or-make-call.c | 3 |
5 files changed, 14 insertions, 7 deletions
diff --git a/doc/examples/telephony-and-music/cleanup.c b/doc/examples/telephony-and-music/cleanup.c index 00f07bc..bf54226 100644 --- a/doc/examples/telephony-and-music/cleanup.c +++ b/doc/examples/telephony-and-music/cleanup.c @@ -1,7 +1,8 @@ #include <bus.h> #include <stdio.h> -int main() +int +main() { return bus_unlink("/tmp/example-bus") && (perror("cleanup"), 1); } diff --git a/doc/examples/telephony-and-music/end-call.c b/doc/examples/telephony-and-music/end-call.c index 6198cbb..c03eedf 100644 --- a/doc/examples/telephony-and-music/end-call.c +++ b/doc/examples/telephony-and-music/end-call.c @@ -11,7 +11,8 @@ static char message[BUS_MEMORY_SIZE]; -int main() +int +main() { bus_t bus; sprintf(message, "%ji unforce-pause", (intmax_t)getppid()); diff --git a/doc/examples/telephony-and-music/init.c b/doc/examples/telephony-and-music/init.c index 870e10d..d1325fb 100644 --- a/doc/examples/telephony-and-music/init.c +++ b/doc/examples/telephony-and-music/init.c @@ -1,7 +1,8 @@ #include <bus.h> #include <stdio.h> -int main() +int +main() { return bus_create("/tmp/example-bus", 0, NULL) && (perror("init"), 1); } 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)); diff --git a/doc/examples/telephony-and-music/receive-or-make-call.c b/doc/examples/telephony-and-music/receive-or-make-call.c index 92132fa..c61dc30 100644 --- a/doc/examples/telephony-and-music/receive-or-make-call.c +++ b/doc/examples/telephony-and-music/receive-or-make-call.c @@ -11,7 +11,8 @@ static char message[BUS_MEMORY_SIZE]; -int main() +int +main() { bus_t bus; sprintf(message, "%ji force-pause", (intmax_t)getppid()); |