diff options
Diffstat (limited to 'portfolio.h')
-rw-r--r-- | portfolio.h | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/portfolio.h b/portfolio.h index 42012d57113e..fe50b16ff1c7 100644 --- a/portfolio.h +++ b/portfolio.h @@ -2,15 +2,12 @@ #define PORTFOLIO_H #include <math.h> -#include <unistd.h> #include "api.h" #include "rc4.h" #define REMOVE 0 #define ADD 1 #define SET 2 -#define DECRYPT 0 -#define ENCRYPT 1 extern char* portfolio_file; @@ -26,7 +23,7 @@ void portfolio_file_init(void); * the returned string will be null terminated somewhere in the middle several times * @return the string containing the file */ -char* portfolio_file_get_string(FILE* fp, size_t* len); +String* portfolio_file_get_string(void); /** * Adds quantity_shares of given symbol at given price to portfolio @@ -35,7 +32,7 @@ char* portfolio_file_get_string(FILE* fp, size_t* len); * @param purchase_price quantity_shares of money spent * @param fp portfolio file */ -void portfolio_modify(const char* ticker_name_string, double quantity_shares, double usd_spent, FILE* fp, int option); +void portfolio_modify(const char* ticker_name_string, double quantity_shares, double usd_spent, int option); /** * Prints current holdings of all symbols @@ -43,7 +40,7 @@ void portfolio_modify(const char* ticker_name_string, double quantity_shares, do * @param crypto_data JSON to hold STRING data in * @param fp portfolio file */ -void portfolio_print_all(FILE* fp); +void portfolio_print_all(void); /** * Prints current holdings of a symbol @@ -51,7 +48,7 @@ void portfolio_print_all(FILE* fp); * @param fp portfolio file, NULL if printing all * @param current_index portfolio file index, NULL if printing one */ -double* portfolio_print_stock(char* ticker_name_string, FILE* fp, Json* current_index); +double* portfolio_print_stock(char* ticker_name_string, Json* current_index); /** * Returns the index in the Json array of the given symbol @@ -61,34 +58,4 @@ double* portfolio_print_stock(char* ticker_name_string, FILE* fp, Json* current_ */ int portfolio_symbol_index(const char* ticker_name_string, Json* jarray); -/** - * Returns a string from the current stream pointer to the next space, newline, or EOF - * @param fp the file - * @return the string - */ -char* portfolio_legacy_get_next_val(FILE* fp); - -/** - * Adds contents of legacy portfolio to JSON formatted portfolio - * @param fp JSON formatted portfolio - */ -void portfolio_legacy_convert(void); - -/** - * Returns an either encrypted or decrypted string of the input - * @param input the string to encrypt or decrypt - * @param input_len the length of the string - * @param password the password to encrypt or decrypt with - * @return encrypted or decrypted string - */ -char* portfolio_get_encrypt_string(char* input, size_t input_len, char* password); - -/** - * Either encrypts or decrypts the portfolio file - * @param option ENCRYPT or DECRYPT - * @param fp portfolio file - * @param password the password to encrypt/decrypt with or NULL to ask user - */ -void portfolio_encrypt_decrypt(int option, FILE* fp, char* password); - #endif
\ No newline at end of file |