From 0d44f16f6738c0776edf60b84f49f0c6f875a8fe Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 17 May 2015 14:40:46 +0200 Subject: style + add timed read example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/examples/telephony-and-music/cleanup.c | 3 ++- doc/examples/telephony-and-music/end-call.c | 3 ++- doc/examples/telephony-and-music/init.c | 3 ++- doc/examples/telephony-and-music/monitor.c | 9 ++++++--- doc/examples/telephony-and-music/receive-or-make-call.c | 3 ++- 5 files changed, 14 insertions(+), 7 deletions(-) (limited to 'doc/examples/telephony-and-music') 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 #include -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 #include -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()); -- cgit v1.2.3-70-g09d2