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