Home | History | Annotate | Download | only in installboot

Lines Matching defs:option

73 const struct option {
74 const char *name; /* Name of option */
76 enum { /* Type of option value... */
103 #define OPTION(params, type, opt) (*(type *)((char *)(params) + (opt)->offset))
281 /* XXX should be specified via option */
393 parseoptions(ib_params *params, const char *option)
396 const struct option *opt;
401 assert(option != NULL);
403 for (;; option += len) {
404 option += strspn(option, ", \t");
405 if (*option == 0)
407 len = strcspn(option, "=,");
409 if (memcmp(option, opt->name, len) == 0
414 len = strcspn(option, ",");
415 warnx("Unknown option `-o %.*s'", len, option);
420 if (option[len] != '=')
422 warnx("Option `%s' must not have a value", opt->name);
425 if (option[len] != '=') {
426 warnx("Option `%s' must have a value", opt->name);
429 option += len + 1;
430 len = strcspn(option, ",");
433 len = strlen(option);
436 cp = strdup(option);
440 OPTION(params, char *, opt) = cp;
443 val = strtoul(option, &cp, 0);
444 if (cp > option + len || (*cp != 0 && *cp != ','))
448 OPTION(params, int, opt) = (int)val;
451 errx(1, "Internal error: option `%s' has invalid type %d",
454 warnx("Invalid option value `%s=%.*s'", opt->name, len, option);