summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2020-06-18 04:45:04 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2020-06-18 04:45:04 +0000
commit33e6194075f4a8a6c0cf7380e0eb40b1a8011e65 (patch)
tree30f88fc60ad58b51ba58f053988b4a5cd0c21e7e /lib
parent5c537859c3b48d4bc081e6782ebf76782e84ba89 (diff)
Document sioctl_desc structure maxval attribute
Diffstat (limited to 'lib')
-rw-r--r--lib/libsndio/sioctl_open.324
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/libsndio/sioctl_open.3 b/lib/libsndio/sioctl_open.3
index 54c79fb2d10..e25cd4c40bd 100644
--- a/lib/libsndio/sioctl_open.3
+++ b/lib/libsndio/sioctl_open.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sioctl_open.3,v 1.4 2020/04/19 09:54:56 jmc Exp $
+.\" $OpenBSD: sioctl_open.3,v 1.5 2020/06/18 04:45:03 ratchov Exp $
.\"
.\" Copyright (c) 2011-2020 Alexandre Ratchov <alex@caoua.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 19 2020 $
+.Dd $Mdocdate: June 18 2020 $
.Dt SIOCTL_OPEN 3
.Os
.Sh NAME
@@ -123,7 +123,7 @@ struct sioctl_node {
struct sioctl_desc {
unsigned int addr; /* control address */
#define SIOCTL_NONE 0 /* deleted */
-#define SIOCTL_NUM 2 /* integer in the 0..127 range */
+#define SIOCTL_NUM 2 /* integer in the maxval range */
#define SIOCTL_SW 3 /* on/off switch (0 or 1) */
#define SIOCTL_VEC 4 /* number, element of vector */
#define SIOCTL_LIST 5 /* switch, element of a list */
@@ -132,6 +132,7 @@ struct sioctl_desc {
char group[SIOCTL_NAMEMAX]; /* group this control belongs to */
struct sioctl_node node0; /* affected node */
struct sioctl_node node1; /* dito for SIOCTL_{VEC,LIST} */
+ unsigned int maxval; /* max value */
};
.Ed
.Pp
@@ -149,7 +150,11 @@ Possible types are:
.It SIOCTL_NONE
A previously valid control was deleted.
.It SIOCTL_NUM
-A continuous control in the 0..SIOCTL_VALMAX range.
+A continuous control in the
+.Sm 0 ..
+.Va maxval
+.Sm
+range.
For instance the volume of the speaker.
.It SIOCTL_SW
A on/off switch control.
@@ -190,6 +195,11 @@ attributes and
.Va func
are strings usable as unique identifiers within the the given
.Va group .
+.Pp
+The
+.Va maxval
+attribute indicates the maximum value of this control.
+For boolean control types it is set to 1.
.Sh Changing and reading control values
Controls are changed with the
.Fn sioctl_setval
@@ -198,7 +208,11 @@ The
.Fn sioctl_onval
function can be used to register a call-back which will be invoked whenever
a control changes.
-Continuous values are in the 0..127 range.
+Continuous values are in the
+.Sm 0 ..
+.Va maxval
+.Sm
+range.
.Sh "Interface to" Xr poll 2
The
.Fn sioctl_pollfd