Lines Matching defs:options
36 struct options {
181 printf("Usage: %s [options]\n", cmd);
195 static int options_init(int argc, char *argv[], struct options *options)
212 strftime(options->postfix, sizeof(options->postfix),
225 options->config = optarg;
228 options->duration = atoi(optarg) * 1000;
231 options->loglvl = log_str2level(optarg);
237 strcpy(options->postfix, optarg);
240 strcpy(options->output, optarg);
243 options->logopt = TO_SYSLOG;
246 options->overwrite = 1;
356 struct options *options)
365 if (access(options->output, F_OK) && mkdir(options->output, 0700)) {
366 ERROR("Failed to create directory '%s'\n", options->output);
372 asprintf(&path, "%s/%s%s", options->output,
373 thermometer->tz[i].name, options->postfix);
375 if (!options->overwrite && !access(path, F_OK)) {
460 static int thermometer_wait(struct options *options, pid_t pid)
470 if (options->duration) {
473 timer_it.it_value = msec_to_timespec(options->duration);
534 struct options options = {
544 if (options_init(argc, argv, &options))
547 if (log_init(options.loglvl, argv[0], options.logopt))
550 if (configuration_init(options.config, &config))
559 if (thermometer_start(&thermometer, &options))
565 if (thermometer_wait(&options, pid))