Lines Matching refs:optarg
55 static off_t opts_parse_ctime(const char *o, const char *optarg);
56 static off_t opts_parse_bytes(const char *o, const char *optarg);
57 static off_t opts_parse_atopi(const char *o, const char *optarg);
58 static off_t opts_parse_seconds(const char *o, const char *optarg);
216 opts_set(struct opts *opts, const char *o, const char *optarg)
222 opts->op_raw = lut_add(opts->op_raw, o, (void *)optarg);
225 *rval = (*info->oi_parser)(o, optarg);
258 * opts_optarg -- return the optarg for the given option, NULL if not set
317 * opts_parse_ctime -- parse a ctime format optarg
320 opts_parse_ctime(const char *o, const char *optarg)
325 if (strptime(optarg, "%a %b %e %T %Z %Y", &tm) == NULL &&
326 strptime(optarg, "%c", &tm) == NULL)
337 * opts_parse_atopi -- parse a positive integer format optarg
340 opts_parse_atopi(const char *o, const char *optarg)
342 off_t ret = atoll(optarg);
344 while (isdigit(*optarg))
345 optarg++;
347 if (*optarg)
355 * opts_parse_atopi -- parse a size format optarg into bytes
358 opts_parse_bytes(const char *o, const char *optarg)
360 off_t ret = atoll(optarg);
361 while (isdigit(*optarg))
362 optarg++;
364 switch (*optarg) {
379 if (optarg[1] == '\0')
390 * opts_parse_seconds -- parse a time format optarg into seconds
393 opts_parse_seconds(const char *o, const char *optarg)
397 if (strcasecmp(optarg, "now") == 0)
400 if (strcasecmp(optarg, "never") == 0)
403 ret = atoll(optarg);
404 while (isdigit(*optarg))
405 optarg++;
407 if (optarg[1] == '\0')
408 switch (*optarg) {