Fix the rest of formatting.

This commit is contained in:
Ruslan Ermilov 2001-03-02 08:09:19 +00:00
parent 003ff9433b
commit e6959b888b

View File

@ -32,8 +32,8 @@
.Dt RESOURCE_QUERY_STRING 9
.Os FreeBSD
.Sh NAME
.Nm resource_query_string
.Nd queries the
.Nm resource_query_string , resource_query_name , resource_query_unit
.Nd query the
.Dq hints
database for matches
.Sh SYNOPSIS
@ -45,7 +45,7 @@ database for matches
.Ft int
.Fn resource_query_unit "int num"
.Sh DESCRIPTION
.Fn resouce_query_string
.Fn resource_query_string
enumerates all devices in the
.Dq hints
database whose
@ -64,7 +64,7 @@ This cookie should be passed as the
parameter on subsequent calls.
A return value of \-1 means no further matches exist.
.Pp
.Fn resource_query_name
.Fn resource_query_name
returns the name of the device matched by
.Fn resource_query_string .
.Pp
@ -72,9 +72,9 @@ returns the name of the device matched by
returns the unit of the device matched by
.Fn resource_query_string .
.Pp
.Bl -item
.It
.Fa num
The functions take the following arguments:
.Bl -tag -width "field"
.It Fa num
is the
.Dq index
of the item to lookup.
@ -83,23 +83,22 @@ Set to \-1 for the first call, and the return value of the previous
on subsequent calls.
The
.Dq index
is an opaque coookie.
.It
.Fa field
is an opaque cookie.
.It Fa field
is the name of the field in the
.Dq hints
database to query.
.Pp
.Fa what
.It Fa what
is the value of
.Fa field
in the
.Dq hints
database for which to search.
.El
.Sh RETURN VALUES
.Fn resource_query_string
returns \-1 on failure, otherwise a cookie to pass
.Fn resource_query_name
returns \-1 on failure, otherwise a cookie to pass to
.Fn resource_query_name
or
.Fn resource_query_unit .
.Pp
@ -112,32 +111,33 @@ returns the device unit number matching the cookie.
The following example will return all the
.Dq hints
that say they are
at gerbil0.
.Dq Li "at gerbil0" .
.Pp
An example hint would be:
.Bd -literal
.Bd -literal -offset indent
hint.habitat.0.at="gerbil0"
hint.ewheel.0.at="gerbil0"
hint.fred.0.at="nexus"
.Ed
.Pp
The following code
.Bd -literal
int i = -1;
while ((i = resource_query_string(i, "at", "gerbil0")) != -1) {
printf("Found %s%d at gerbil0\n", resource_query_name(i),
resource_query_unit(i));
}
.Bd -literal -offset indent
int i = -1;
while ((i = resource_query_string(i, "at", "gerbil0")) != -1) {
printf("Found %s%d at gerbil0\en", resource_query_name(i),
resource_query_unit(i));
}
.Ed
.Pp
would produce two lines:
.Bd -literal
.Bd -literal -offset indent
Found habitat0 at gerbil0
Found ewheel0 at gerbil0
.Ed
.Sh SEE ALSO
.Xr driver 9 ,
.Xr device 9 ,
.Xr resource_int_value 9 .
.Xr driver 9 ,
.Xr resource_int_value 9
.Sh AUTHORS
.An -nosplit
This man page was written by
This manual page was written by
.An Warner Losh Aq imp@FreeBSD.org .