geom_ctl.c (5e53a4f90f82c4345f277dd87cc9292f26e04a29) geom_ctl.c (2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2003 Poul-Henning Kamp
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 137 unchanged lines hidden (view full) ---

146 req->narg = 0;
147 return (NULL);
148 }
149 ap = req->arg + (req->narg - 1);
150 memset(ap, 0, sizeof *ap);
151 return (ap);
152}
153
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2003 Poul-Henning Kamp
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 137 unchanged lines hidden (view full) ---

146 req->narg = 0;
147 return (NULL);
148 }
149 ap = req->arg + (req->narg - 1);
150 memset(ap, 0, sizeof *ap);
151 return (ap);
152}
153
154static void
155gctl_param_add(struct gctl_req *req, const char *name, int len, void *value,
154void
155gctl_add_param(struct gctl_req *req, const char *name, int len, void *value,
156 int flag)
157{
158 struct gctl_req_arg *ap;
159
160 if (req == NULL || req->error != NULL)
161 return;
162 ap = gctl_new_arg(req);
163 if (ap == NULL)

--- 12 unchanged lines hidden (view full) ---

176 ap->len = strlen(value) + 1;
177 }
178}
179
180void
181gctl_ro_param(struct gctl_req *req, const char *name, int len, const void* value)
182{
183
156 int flag)
157{
158 struct gctl_req_arg *ap;
159
160 if (req == NULL || req->error != NULL)
161 return;
162 ap = gctl_new_arg(req);
163 if (ap == NULL)

--- 12 unchanged lines hidden (view full) ---

176 ap->len = strlen(value) + 1;
177 }
178}
179
180void
181gctl_ro_param(struct gctl_req *req, const char *name, int len, const void* value)
182{
183
184 gctl_param_add(req, name, len, __DECONST(void *, value), GCTL_PARAM_RD);
184 gctl_add_param(req, name, len, __DECONST(void *, value), GCTL_PARAM_RD);
185}
186
187void
188gctl_rw_param(struct gctl_req *req, const char *name, int len, void *value)
189{
190
185}
186
187void
188gctl_rw_param(struct gctl_req *req, const char *name, int len, void *value)
189{
190
191 gctl_param_add(req, name, len, value, GCTL_PARAM_RW);
191 gctl_add_param(req, name, len, value, GCTL_PARAM_RW);
192}
193
194const char *
195gctl_issue(struct gctl_req *req)
196{
197 int fd, error;
198
199 if (req == NULL)

--- 40 unchanged lines hidden ---
192}
193
194const char *
195gctl_issue(struct gctl_req *req)
196{
197 int fd, error;
198
199 if (req == NULL)

--- 40 unchanged lines hidden ---