aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-05-01 14:42:43 +0200
committerMattias Andrée <maandree@operamail.com>2015-05-01 14:42:43 +0200
commit8aacddbe8e827f13306460ff211aae25e4db68a8 (patch)
tree515cc019aa88f5ee80cfbdbc8fb94f43ffcd6c81 /doc
parentfix manpages + add manpages for bus_chown and bus_chmod (diff)
downloadbus-8aacddbe8e827f13306460ff211aae25e4db68a8.tar.gz
bus-8aacddbe8e827f13306460ff211aae25e4db68a8.tar.bz2
bus-8aacddbe8e827f13306460ff211aae25e4db68a8.tar.xz
m + add bus_poll.3
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--doc/bus_chmod.38
-rw-r--r--doc/bus_chown.34
-rw-r--r--doc/bus_open.33
-rw-r--r--doc/bus_poll.364
-rw-r--r--doc/bus_read.33
-rw-r--r--doc/bus_write.32
-rw-r--r--doc/libbus.73
7 files changed, 77 insertions, 10 deletions
diff --git a/doc/bus_chmod.3 b/doc/bus_chmod.3
index c61fcd3..f7d431d 100644
--- a/doc/bus_chmod.3
+++ b/doc/bus_chmod.3
@@ -6,12 +6,12 @@ bus_chmod - Change bus mode bits
int bus_chmod(const char *file, mode_t mode);
.SH DESCRIPTION
-The \fIbus_chmod()\fP function shall give access to the bus associated
-with \fIfile\fP according to the following rules:
+The \fIbus_chmod()\fP function gives access to the bus associated with
+\fIfile\fP according to the following rules:
.TP
*
-If (\fImode\fP &S_IRWXU) the owner should be given full access to
-the bus. Otherwise the owner should have no access.
+If (\fImode\fP &S_IRWXU) the owner should be given full access to the
+bus. Otherwise the owner should have no access.
.TP
*
If (\fImode\fP &S_IRWXG) the group should be given read and write
diff --git a/doc/bus_chown.3 b/doc/bus_chown.3
index 7bfe60a..86e9481 100644
--- a/doc/bus_chown.3
+++ b/doc/bus_chown.3
@@ -6,8 +6,8 @@ bus_chown - Change bus owner and group
int bus_chown(const char *file, uid_t owner, gid_t group);
.SH DESCRIPTION
-The \fIbus_chown()\fP function shall change the owner and the group of
-the bus associated with \fIfile\fP to the \fIowner\fP and \fIgroup\fP,
+The \fIbus_chown()\fP function change the owner and the group of the bus
+associated with \fIfile\fP to the \fIowner\fP and \fIgroup\fP,
respectively.
.SH RETURN VALUES
Upon successful completion, the function returns 0. Otherwise the
diff --git a/doc/bus_open.3 b/doc/bus_open.3
index 34ffb5f..f40f444 100644
--- a/doc/bus_open.3
+++ b/doc/bus_open.3
@@ -45,7 +45,8 @@ function may also fail and set \fIerrno\fP to any of the errors
specified for the routine
.BR open(2).
.SH SEE ALSO
-bus-create(1), bus(5), libbus(7), bus_open(3), bus_unlink(3), open(2)
+bus-create(1), bus(5), libbus(7), bus_close(3), bus_unlink(3),
+bus_write(3), bus_read(3), bus_poll(3), open(2)
.SH AUTHORS
Principal author, Mattias Andrée. See the LICENSE file for the full
list of authors.
diff --git a/doc/bus_poll.3 b/doc/bus_poll.3
new file mode 100644
index 0000000..857ea20
--- /dev/null
+++ b/doc/bus_poll.3
@@ -0,0 +1,64 @@
+.TH BUS_POLL 3 BUS-%VERSION%
+.SH NAME
+bus_poll - Wait a message to be broadcasted
+.SH SYNOPSIS
+.LP
+.nf
+#include <bus.h>
+.P
+int bus_poll_start(bus_t *bus);
+int bus_poll_stop(const bus_t *bus);
+const char * bus_poll(bus_t *bus, int flags);
+.fi
+.SH DESCRIPTION
+The
+.BR bus_poll(3)
+function waits for a message to broadcasted on the \fIbus\fP, and return
+the message it receives. The function fails if there is not already a
+message waiting on the bus when the function is called and (\fIflags\fP
+&BUS_NOWAIT). Received messages shall be copied and parsed, and acted
+upon, in a separate thread, and
+.BR bus_poll(3)
+or
+.BR bus_poll_stop(3)
+called again as soon as possible.
+.PP
+The
+.BR bus_poll_start(3)
+funcion must be called before
+.BR bus_poll(3)
+is called for the first time. When the process is done listening on the
+bus it must call the
+.BR bus_poll_stop(3)
+function.
+.SH RETURN VALUES
+Upon successful completion, the functions
+.BR bus_poll_start(3)
+and
+.BR bus_poll_stop(3)
+returns 0. Otherwise the functions returns -1 and sets \fIerrno\fP to
+indicate the error.
+.PP
+Upon successful completion, the function
+.BR bus_poll(3)
+returns the received message. Otherwise the function returns \fINULL\fP
+and sets \fIerrno\fP to indicate the error.
+.SH ERRORS
+The
+.BR bus_poll(3),
+.BR bus_poll_start(3)
+and
+.BR bus_poll_stop(3)
+functions may fail and set \fIerrno\fP to any of the errors specified for
+.BR semop(3).
+.SH SEE ALSO
+bus-create(1), bus(5), libbus(7), bus_open(3), bus_write(3),
+bus_read(3), semop(3)
+.SH AUTHORS
+Principal author, Mattias Andrée. See the LICENSE file for the full
+list of authors.
+.SH LICENSE
+MIT/X Consortium License.
+.SH BUGS
+Please report bugs to https://github.com/maandree/bus/issues or to
+maandree@member.fsf.org
diff --git a/doc/bus_read.3 b/doc/bus_read.3
index 7ad0189..b8b927e 100644
--- a/doc/bus_read.3
+++ b/doc/bus_read.3
@@ -34,7 +34,8 @@ The
function may fail and set \fIerrno\fP to any of the errors specified for
.BR semop(3).
.SH SEE ALSO
-bus-create(1), bus(5), libbus(7), bus_open(3), bus_write(3), semop(3)
+bus-create(1), bus(5), libbus(7), bus_open(3), bus_write(3),
+bus_poll(3), semop(3)
.SH AUTHORS
Principal author, Mattias Andrée. See the LICENSE file for the full
list of authors.
diff --git a/doc/bus_write.3 b/doc/bus_write.3
index 8fbecbf..55ca7df 100644
--- a/doc/bus_write.3
+++ b/doc/bus_write.3
@@ -25,7 +25,7 @@ errors specified for
.BR semop(3).
.SH SEE ALSO
bus-create(1), bus(5), libbus(7), bus_open(3), bus_read(3),
-bus_chown(3), bus_chmod(3)
+bus_poll(3), bus_chown(3), bus_chmod(3)
.SH AUTHORS
Principal author, Mattias Andrée. See the LICENSE file for the full
list of authors.
diff --git a/doc/libbus.7 b/doc/libbus.7
index 73c289e..256e672 100644
--- a/doc/libbus.7
+++ b/doc/libbus.7
@@ -14,7 +14,8 @@ Private and abstract buses might be interesting. Timed out read and
writes might be too.
.SH SEE ALSO
bus(1), bus(5), bus_create(3), bus_unlink(3), bus_open(3), bus_close(3),
-bus_read(3), bus_write(3), bus_chown(3), bus_chmod(3)
+bus_write(3), bus_read(3), bus_poll_start(3), bus_poll_stop(3),
+bus_poll(3), bus_chown(3), bus_chmod(3)
.SH AUTHORS
Principal author, Mattias Andrée. See the LICENSE file for the full
list of authors.