Add the part of the last commit which cvs appearantly didn't like

the first time.
This commit is contained in:
phk 2003-06-01 15:05:22 +00:00
parent 069191fcbf
commit 8f1078dc32
2 changed files with 4 additions and 17 deletions

View File

@ -45,8 +45,6 @@
#define GCTL_TABLE 1
#include <libgeom.h>
#include <geom/geom_ext.h>
void
gctl_dump(struct gctl_req *req, FILE *f)
{
@ -58,14 +56,14 @@ gctl_dump(struct gctl_req *req, FILE *f)
fprintf(f, "Dump of gctl request at NULL\n");
return;
}
fprintf(f, "Dump of gctl %s request at %p:\n", req->reqt->name, req);
fprintf(f, "Dump of gctl request at %p:\n", req);
if (req->error != NULL)
fprintf(f, " error:\t\"%s\"\n", req->error);
else
fprintf(f, " error:\tNULL\n");
for (i = 0; i < req->narg; i++) {
ap = &req->arg[i];
fprintf(f, " param:\t\"%s\"", ap->name);
fprintf(f, " param:\t\"%s\" (%d)", ap->name, ap->nlen);
fprintf(f, " [%s%s",
ap->flag & GCTL_PARAM_RD ? "R" : "",
ap->flag & GCTL_PARAM_WR ? "W" : "");
@ -119,22 +117,11 @@ gctl_check_alloc(struct gctl_req *req, void *ptr)
* XXX: Why bother checking the type ?
*/
struct gctl_req *
gctl_get_handle(enum gctl_request req)
gctl_get_handle(void)
{
struct gctl_req_table *gtp;
struct gctl_req *rp;
rp = calloc(1, sizeof *rp);
if (rp == NULL)
return (NULL);
for (gtp = gcrt; gtp->request != req; gtp++)
if (gtp->request == GCTL_INVALID_REQUEST)
break;
rp->request = req;
rp->reqt = gtp;
if (rp->reqt->request == GCTL_INVALID_REQUEST)
gctl_set_error(rp, "Invalid request");
return (rp);
}

View File

@ -135,7 +135,7 @@ struct gctl_req;
void gctl_dump(struct gctl_req *req, FILE *f);
#endif
void gctl_free(struct gctl_req *req);
struct gctl_req *gctl_get_handle(enum gctl_request req);
struct gctl_req *gctl_get_handle(void);
const char *gctl_issue(struct gctl_req *req);
void gctl_ro_param(struct gctl_req *req, const char *name, int len, const void* val);
void gctl_rw_param(struct gctl_req *req, const char *name, int len, void* val);