106 lines
3.5 KiB
Groff
106 lines
3.5 KiB
Groff
.\" $NetBSD: linedisc.9,v 1.7 2002/10/14 13:43:25 wiz Exp $
|
|
.\"
|
|
.\" Copyright (c) 2000 Christopher G. Demetriou.
|
|
.\" All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed for the
|
|
.\" NetBSD Project. See http://www.netbsd.org/ for
|
|
.\" information about NetBSD.
|
|
.\" 4. The name of the author may not be used to endorse or promote products
|
|
.\" derived from this software without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
.\"
|
|
.\" --(license Id: LICENSE.proto,v 1.1 2000/06/13 21:40:26 cgd Exp )--
|
|
.\"
|
|
.Dd November 1, 2000
|
|
.Dt LINEDISC 9
|
|
.Os
|
|
.Sh NAME
|
|
.Nm ttyldisc_add ,
|
|
.Nm ttyldisc_lookup ,
|
|
.Nm ttyldisc_remove
|
|
.Nd extensible line discipline framework
|
|
.Sh SYNOPSIS
|
|
.Fd #include \*[Lt]sys/conf.h\*[Gt]
|
|
.Ft int
|
|
.Fn ttyldisc_add "struct linesw *disc" "int no"
|
|
.Ft struct linesw *
|
|
.Fn ttyldisc_remove "char *name"
|
|
.Ft struct linesw *
|
|
.Fn ttyldisc_lookup "char *name"
|
|
.Sh DESCRIPTION
|
|
The
|
|
.Nx
|
|
TTY line discipline framework allows extensibility.
|
|
Modules that need special line disciplines can add
|
|
them as convenient and do not need to modify tty_conf.c.
|
|
Line disciplines are now managed by a string, rather than
|
|
number.
|
|
.Pp
|
|
Once the framework has been initialized, a new line
|
|
discipline can be added by creating and initializing a
|
|
.Fa struct linesw
|
|
and calling
|
|
.Fn ttyldisc_add .
|
|
.Pp
|
|
The following is a brief description of each function in the framework:
|
|
.Bl -tag -width "ttyldisc_remove()"
|
|
.It Fn ttyldisc_add
|
|
Register a line discipline.
|
|
The
|
|
.Fa l_name
|
|
field of the
|
|
.Fa struct linesw
|
|
should point to a string which is to be the symbolic
|
|
name of that line discipline.
|
|
For compatibility purposes, a line discipline number can be passed in
|
|
.Fa no ,
|
|
but for new disciplines this should be set to
|
|
.Dv -1 .
|
|
.It Fn ttyldisc_lookup
|
|
Look up a line discipline by
|
|
.Fa name .
|
|
.Dv NULL
|
|
is returned if it can not be found.
|
|
.It Fn ttyldisc_remove
|
|
Remove a line discipline called
|
|
.Fa name
|
|
and return a pointer to it.
|
|
If the discipline cannot be found or removed
|
|
.Fn ttyldisc_remove
|
|
will return
|
|
.Dv NULL .
|
|
.El
|
|
.Sh SEE ALSO
|
|
.Xr tty 4
|
|
.Sh HISTORY
|
|
The
|
|
.Nm
|
|
functions were added in
|
|
.Nx 1.6 .
|
|
.Sh AUTHORS
|
|
The
|
|
.Nx
|
|
extensible line discipline framework was created by
|
|
Eduardo Horvath \*[Lt]eeh@NetBSD.ORG\*[Gt].
|