From 485f69d1e5289a640e9d0079da8808c42ea74fa5 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 25 Dec 2021 23:29:38 +0400 Subject: [PATCH] [main.h] Renoved struct arguments_t. Changed definition of `parse_arguments`. `to_seconds` -> `interval_to_seconds`, and inlined. `print_version` and `print_usage` are inlined. --- src/main.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main.h b/src/main.h index 76dc4f8..3c4a44c 100644 --- a/src/main.h +++ b/src/main.h @@ -7,21 +7,12 @@ typedef long double price_t; typedef long double wattage_t; typedef unsigned long interval_t; -typedef struct { - price_t price; - wattage_t wattage; - interval_t interval; -} arguments_t; +int parse_arguments(int argc, char **argv, price_t *price, wattage_t *wattage, interval_t *interval); -arguments_t *parse_arguments(int argc, char **argv); - - -interval_t to_seconds(char *interval); -inline price_t to_wattpersecond(price_t price); - - -void print_version(); -void print_usage(); +inline interval_t interval_to_seconds(char *interval); +inline price_t to_wattspersecond(price_t price); +inline void print_version(); +inline void print_usage(); #endif