diff options
author | Antony Kellermann | 2018-09-04 19:47:19 -0400 |
---|---|---|
committer | Antony Kellermann | 2018-09-04 19:47:19 -0400 |
commit | 5e2e750b4eb1adb25385ee13f6cb62c4b8868f78 (patch) | |
tree | 87e0297975a1e2b8a4c1b3aaa9cb3d1e6b4a417f /portfolio.c | |
parent | 4166914b1a911c15fe2c18f345ac8d103155b583 (diff) | |
download | aur-5e2e750b4eb1adb25385ee13f6cb62c4b8868f78.tar.gz |
Refactoring
Diffstat (limited to 'portfolio.c')
-rw-r--r-- | portfolio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/portfolio.c b/portfolio.c index 83ad3f7987bd..9bbc6e1944c6 100644 --- a/portfolio.c +++ b/portfolio.c @@ -82,15 +82,15 @@ int portfolio_modify_string(String* pString, const char* symbol, double quantity } if (strcmp("USD$", symbol) != 0) { // Check that the symbol is valid, except if it's USD - Info* data = api_info_init(); + Info* data = info_init(); strcpy(data->symbol, symbol); - api_info_store_data_batch(data, CHECK); + api_store_info(data, DATA_LEVEL_CHECK); if (data->api_provider == EMPTY) {// If NULL response from APIs, it's invalid - api_info_destroy(&data); + info_destroy(&data); status = 1; GOTO_CLEAN_MSG("Invalid symbol.") } - api_info_destroy(&data); + info_destroy(&data); } Json* new_object = json_object_new_object(); // Creates new array index and adds values to it @@ -153,7 +153,7 @@ Info_Array* portfolio_info_array_init_from_portfolio_string(String* pString) { RETNULL_MSG("Your portfolio is empty."); } - Info_Array* portfolio_data = api_info_array_init_from_length(length); + Info_Array* portfolio_data = info_array_init_length(length); portfolio_data->totals->total_spent = 0; for (size_t i = 0; i < portfolio_data->length; i++) { strcpy(portfolio_data->array[i]->symbol, |