2021-12-23 23:59:00 +04:00
|
|
|
#ifndef _MAIN_H_
|
|
|
|
#define _MAIN_H_
|
|
|
|
|
2023-09-23 05:16:47 +04:00
|
|
|
#define VERSION "1.1.1"
|
2021-12-23 23:59:00 +04:00
|
|
|
|
|
|
|
typedef long double price_t;
|
|
|
|
typedef long double wattage_t;
|
|
|
|
typedef unsigned long interval_t;
|
|
|
|
|
2022-10-07 03:48:34 +04:00
|
|
|
int parse_arguments(const int argc, const char *const *const argv,
|
2023-09-17 22:47:17 +04:00
|
|
|
price_t *const price, wattage_t *const wattage, interval_t *const interval);
|
2021-12-23 23:59:00 +04:00
|
|
|
|
2023-09-17 22:47:17 +04:00
|
|
|
inline interval_t interval_to_seconds(const char *const interval);
|
|
|
|
inline price_t price_kwh_to_wattspersecond(const price_t price);
|
2021-12-23 23:59:00 +04:00
|
|
|
|
2021-12-25 23:29:38 +04:00
|
|
|
inline void print_version();
|
|
|
|
inline void print_usage();
|
2021-12-23 23:59:00 +04:00
|
|
|
|
2021-12-24 01:01:43 +04:00
|
|
|
#endif
|