From 615a6a246a8cac15992a2778449e45acc555bf7b Mon Sep 17 00:00:00 2001 From: ru Date: Thu, 1 Jul 2004 18:20:57 +0000 Subject: Markup, grammar, punctuation. --- lib/libgeom/libgeom.3 | 72 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 30 deletions(-) (limited to 'lib/libgeom/libgeom.3') diff --git a/lib/libgeom/libgeom.3 b/lib/libgeom/libgeom.3 index e141345..0c142ed 100644 --- a/lib/libgeom/libgeom.3 +++ b/lib/libgeom/libgeom.3 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2003 +.Dd March 7, 2004 .Dt LIBGEOM 3 .Os .Sh NAME @@ -151,12 +151,13 @@ if there are no more items in the snapshot. .Ss "Control Functions" The .Fn gctl_* -functions are used to send requests to GEOM classes. In order for a GEOM +functions are used to send requests to GEOM classes. +In order for a GEOM class to actually be able to receive these requests, it must have defined a "ctlreq" method. .Pp A -.Ar struct gctl_req * , +.Vt "struct gctl_req *" , obtained with .Fn gctl_get_handle , can hold any number of parameters, which must be added to it with @@ -170,56 +171,69 @@ Both and .Fn gctl_rw_param take a string -.Ar name , +.Fa name , which is used to identify the parameter, and a -.Ar value , -which contains - in the read-only case - the data to be passed to the -GEOM class, or - in the read/write case - a pointer to preallocated memory -that the GEOM class should fill with the desired data. If -.Ar len +.Fa value , +which contains, in the read-only case, the data to be passed to the +GEOM class, or, in the read/write case, a pointer to preallocated memory +that the GEOM class should fill with the desired data. +If +.Fa len is negative, it is assumed that -.Ar value -is an ASCII string and the actual length is taken from the string length of -.Ar value ; +.Fa value +is an +.Tn ASCII +string and the actual length is taken from the string length of +.Fa value ; otherwise it must hold the size of -.Ar value . +.Fa value . .Pp A parameter with a -.Ar name -containing the string "class" is mandatory for each request, and the +.Fa name +containing the string +.Qq Li class +is mandatory for each request, and the corresponding -.Ar value +.Fa value must hold the name of the GEOM class where the request should be sent to. .Pp Also mandatory for each request is a parameter with a -.Ar name -called "verb", and the corresponding -.Ar value +.Fa name +called +.Qq Li verb , +and the corresponding +.Fa value needs to hold the command string that the GEOM class should react upon. .Pp Once all desired parameters are filled in, the request must be sent to the GEOM subsystem with .Fn gctl_issue , -which returns NULL on success, or a string containing the error message +which returns +.Dv NULL +on success, or a string containing the error message on failure. .Pp After the request is finished, the allocated memory should be released with .Fn gctl_free . .Pp +The .Fn gctl_dump +function can be used to format the contents of -.Ar req +.Fa req to the open file handle pointed to by -.Ar f +.Fa f , for debugging purposes. .Pp Error handling for the control functions is postponed until the call -to -.Fn gctl_issue -which returns NULL on success or an error message corresponding to the +to +.Fn gctl_issue , +which returns +.Dv NULL +on success, or an error message corresponding to the first error which happened. .Sh EXAMPLES -Create a request that is to be sent to the CCD class and tell +Create a request that is to be sent to the CCD class, and tell it to destroy a specific geom: .Bd -literal -offset indent H = gctl_get_handle(); @@ -229,13 +243,11 @@ sprintf(buf, "ccd%d", ccd); gctl_ro_param(H, "geom", -1, buf); errstr = gctl_issue(H); if (errstr != NULL) - err(1, "Could not destroy ccd: %s", errstr); + err(1, "could not destroy ccd: %s", errstr); gctl_free(H); .Ed .Sh SEE ALSO -.Rs -http://ezine.daemonnews.org/200308/blueprints.html -.Re +.Pa http://ezine.daemonnews.org/200308/blueprints.html .Sh HISTORY The .Nm geom -- cgit v1.1