aboutsummarylogtreecommitdiffstats
path: root/api.h
diff options
context:
space:
mode:
authorAntony Kellermann2018-06-25 10:52:50 -0400
committerAntony Kellermann2018-06-25 10:52:50 -0400
commit71b4f6194f0e776c0139d0f531f430da8383dd68 (patch)
tree7af13a0aae9ceac6b5a8c250992da252061d5c0c /api.h
parent4b02268aaf2081bf37e4c48a908d73b729019809 (diff)
downloadaur-71b4f6194f0e776c0139d0f531f430da8383dd68.tar.gz
Changed Info_Array to use Info for totals
Diffstat (limited to 'api.h')
-rw-r--r--api.h31
1 files changed, 7 insertions, 24 deletions
diff --git a/api.h b/api.h
index a70a7798dbeb..7476b7ca2a95 100644
--- a/api.h
+++ b/api.h
@@ -126,30 +126,7 @@ struct info {
struct info_array {
Info** array;
size_t length;
-
- double total_spent; // Total USD spent
- double current_value; // Total USD value
-
- char ftotal_spent[CELL_MAX_LENGTH]; // Total USD spent
- char fcurrent_value[CELL_MAX_LENGTH]; // Total USD value
-
- double profit_total; // Total profit
- double profit_total_percent; // Total profit %
- double profit_last_close; // Profit since last close
- double profit_last_close_percent; // Profit since last close %
- double profit_7d; // Profit since seven days ago
- double profit_7d_percent; // Profit since seven days ago %
- double profit_30d; // Profit since thirty days ago
- double profit_30d_percent; // Profit since thirty days ago %
-
- char fprofit_total[CELL_MAX_LENGTH]; // Total profit
- char fprofit_total_percent[CELL_MAX_LENGTH]; // Total profit %
- char fprofit_last_close[CELL_MAX_LENGTH]; // Profit since last close
- char fprofit_last_close_percent[CELL_MAX_LENGTH]; // Profit since last close %
- char fprofit_7d[CELL_MAX_LENGTH]; // Profit since seven days ago
- char fprofit_7d_percent[CELL_MAX_LENGTH]; // Profit since seven days ago %
- char fprofit_30d[CELL_MAX_LENGTH]; // Profit since thirty days ago
- char fprofit_30d_percent[CELL_MAX_LENGTH]; // Profit since thirty days ago %
+ Info* totals;
};
/**
@@ -172,6 +149,12 @@ Info* api_info_init(void);
Info_Array* api_info_array_init(void);
/**
+ * Adds up values of Info array and sets values in totals.
+ * @param pInfo_Array
+ */
+void info_array_calculate_totals(Info_Array* pInfo_Array);
+
+/**
* writefunction for cURL HTTP GET/POST
* stolen from a nice man on stackoverflow
*/