Loading...
--- Libc/Libc-763.11/gen/FreeBSD/unvis.3
+++ Libc/Libc-320/gen/FreeBSD/unvis.3
@@ -9,6 +9,10 @@
.\" 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 by the University of
+.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
@@ -26,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)unvis.3 8.2 (Berkeley) 12/11/93
-.\" $FreeBSD: src/lib/libc/gen/unvis.3,v 1.18 2007/01/09 00:27:56 imp Exp $
+.\" $FreeBSD: src/lib/libc/gen/unvis.3,v 1.15 2002/12/18 13:33:02 ru Exp $
.\"
.Dd December 11, 1993
.Dt UNVIS 3
@@ -56,8 +60,7 @@
by the
.Xr vis 3
function, back into
-the original form.
-Unvis is called with successive characters in
+the original form. Unvis is called with successive characters in
.Fa c
until a valid
sequence is recognized, at which time the decoded character is
@@ -80,8 +83,7 @@
and returns the number of characters placed into
.Fa dst ,
or \-1 if an
-invalid escape sequence was detected.
-The size of
+invalid escape sequence was detected. The size of
.Fa dst
should be
equal to the size of
@@ -104,42 +106,36 @@
.Fn unvis
function
implements a state machine that can be used to decode an arbitrary
-stream of bytes.
-All state associated with the bytes being decoded
+stream of bytes. All state associated with the bytes being decoded
is stored outside the
.Fn unvis
function (that is, a pointer to the state is passed in), so
-calls decoding different streams can be freely intermixed.
-To
+calls decoding different streams can be freely intermixed. To
start decoding a stream of bytes, first initialize an integer
-to zero.
-Call
+to zero. Call
.Fn unvis
with each successive byte, along with a pointer
to this integer, and a pointer to a destination character.
The
.Fn unvis
function
-has several return codes that must be handled properly.
-They are:
+has several return codes that must be handled properly. They are:
.Bl -tag -width UNVIS_VALIDPUSH
.It Li \&0 (zero)
Another character is necessary; nothing has been recognized yet.
-.It Dv UNVIS_VALID
+.It Dv UNVIS_VALID
A valid character has been recognized and is available at the location
pointed to by cp.
-.It Dv UNVIS_VALIDPUSH
+.It Dv UNVIS_VALIDPUSH
A valid character has been recognized and is available at the location
pointed to by cp; however, the character currently passed in should
be passed in again.
-.It Dv UNVIS_NOCHAR
-A valid sequence was detected, but no character was produced.
-This
+.It Dv UNVIS_NOCHAR
+A valid sequence was detected, but no character was produced. This
return code is necessary to indicate a logical break between characters.
-.It Dv UNVIS_SYNBAD
+.It Dv UNVIS_SYNBAD
An invalid escape sequence was detected, or the decoder is in an
-unknown state.
-The decoder is placed into the starting state.
+unknown state. The decoder is placed into the starting state.
.El
.Pp
When all bytes in the stream have been processed, call