2003-04-16 17:34:34 +04:00
|
|
|
.\" $NetBSD: linedisc.9,v 1.9 2003/04/16 13:35:30 wiz Exp $
|
2000-11-03 02:15:10 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2000 Christopher G. Demetriou.
|
|
|
|
.\" All rights reserved.
|
2001-04-09 21:13:19 +04:00
|
|
|
.\"
|
2000-11-03 02:15:10 +03:00
|
|
|
.\" 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
|
2003-02-14 18:20:17 +03:00
|
|
|
.\" NetBSD Project. See http://www.NetBSD.org/ for
|
2000-11-03 02:15:10 +03:00
|
|
|
.\" 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.
|
2001-04-09 21:13:19 +04:00
|
|
|
.\"
|
2000-11-03 02:15:10 +03:00
|
|
|
.\" 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.
|
2001-04-09 21:13:19 +04:00
|
|
|
.\"
|
2000-11-03 02:15:10 +03:00
|
|
|
.\" --(license Id: LICENSE.proto,v 1.1 2000/06/13 21:40:26 cgd Exp )--
|
|
|
|
.\"
|
2001-04-09 21:13:19 +04:00
|
|
|
.Dd November 1, 2000
|
2000-11-03 02:15:10 +03:00
|
|
|
.Dt LINEDISC 9
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm ttyldisc_add ,
|
|
|
|
.Nm ttyldisc_lookup ,
|
|
|
|
.Nm ttyldisc_remove
|
|
|
|
.Nd extensible line discipline framework
|
|
|
|
.Sh SYNOPSIS
|
2003-04-16 17:34:34 +04:00
|
|
|
.In sys/conf.h
|
2000-11-03 02:15:10 +03:00
|
|
|
.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
|
2001-04-09 21:13:19 +04:00
|
|
|
and calling
|
2000-11-03 02:15:10 +03:00
|
|
|
.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
|
2002-10-14 17:43:14 +04:00
|
|
|
Register a line discipline.
|
|
|
|
The
|
2000-11-03 02:15:10 +03:00
|
|
|
.Fa l_name
|
2001-04-09 21:13:19 +04:00
|
|
|
field of the
|
2000-11-03 02:15:10 +03:00
|
|
|
.Fa struct linesw
|
|
|
|
should point to a string which is to be the symbolic
|
2002-10-14 17:43:14 +04:00
|
|
|
name of that line discipline.
|
|
|
|
For compatibility purposes, a line discipline number can be passed in
|
2000-11-03 02:15:10 +03:00
|
|
|
.Fa no ,
|
2001-04-09 21:13:19 +04:00
|
|
|
but for new disciplines this should be set to
|
2000-11-03 02:15:10 +03:00
|
|
|
.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
|
2001-04-09 21:13:19 +04:00
|
|
|
.Fa name
|
2002-10-14 17:43:14 +04:00
|
|
|
and return a pointer to it.
|
|
|
|
If the discipline cannot be found or removed
|
2000-11-03 02:15:10 +03:00
|
|
|
.Fn ttyldisc_remove
|
|
|
|
will return
|
|
|
|
.Dv NULL .
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
2001-02-11 02:24:12 +03:00
|
|
|
.Xr tty 4
|
2000-11-03 02:15:10 +03:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
functions were added in
|
|
|
|
.Nx 1.6 .
|
2001-12-26 04:07:45 +03:00
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nx
|
|
|
|
extensible line discipline framework was created by
|
2003-02-14 18:20:17 +03:00
|
|
|
.An Eduardo Horvath
|
|
|
|
.Aq eeh@NetBSD.org .
|