Fix Nd; use In instead of Fd; grammar fixes.

This commit is contained in:
wiz 2003-09-10 09:16:45 +00:00
parent 328ce86893
commit 0e9a92473d
1 changed files with 15 additions and 16 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: randomid.3,v 1.1 2003/09/09 22:10:34 itojun Exp $
.\" $NetBSD: randomid.3,v 1.2 2003/09/10 09:16:45 wiz Exp $
.\"
.\" Copyright (C) 2003 WIDE Project.
.\" All rights reserved.
@ -34,10 +34,10 @@
.Nm randomid
.Nm randomid_new ,
.Nm randomid_delete ,
.Nd make a copy of a struct passwd
.Nd provide pseudo-random data stream without repetitions
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <randomid.h>
.In sys/types.h
.In randomid.h
.Ft u_int32_t
.Fn randomid "randomid_t ctx"
.Ft randomid_t
@ -53,30 +53,29 @@ a certain duration.
.Fa ctx
is the context which holds internal state for the random number generator.
.Pp
To initialize context
To initialize a context,
.Fa randomid_new
is used.
.Fa bits
specifies the bitwidth of value generated by
specifies the bitwidth of the value generated by
.Fn randomid .
Currently 32, 20 and 16 are supported.
Currently 32, 20, and 16 are supported.
.Fa timeo
specifies reinitialization interval in seconds.
specifies the reinitialization interval in seconds.
.Fa timeo
has to be bigger than
.Dv RANDOMID_TIMEO_MIN .
Return value of
.Fa randomid_new
is a dynamically-allocated memory region allocated by
returns a dynamically-allocated memory region allocated by
.Xr malloc 3 .
.Pp
.Fn randomid_delete
will
.Xr free 3
the internal state,
the internal state
.Fa ctx .
.Pp
Same number may appear after two reinitialization events of the internal state,
The same number may appear after two reinitialization events of the internal state,
.Fa ctx .
Reinitialization happens when the random number generator cycle is exhausted,
or
@ -92,7 +91,7 @@ or after
.Fa timeo
seconds
.Pc ,
therefore same data will not appear until after 36000 calls to
therefore the same data will not appear until after 36000 calls to
.Fn randomid
.Po
or after 2 times
@ -111,8 +110,8 @@ It must not be shared among multiple data streams with different usage.
.\"
.Sh EXAMPLES
.Bd -literal -offset indent
#include <sys/types.h>
#include <randomid.h>
#include \*[Lt]sys/types.h\*[Gt]
#include \*[Lt]randomid.h\*[Gt]
u_int32_t
genid(void)
@ -129,7 +128,7 @@ genid(void)
.Fn randomid_new
returns
.Dv NULL
on error and set the external variable
on error and sets the external variable
.Va errno .
.\"
.Sh SEE ALSO