From f1b434fd0e76d44056868ea4d2d8fd52138a663b Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 16 May 2015 14:27:58 -0400 Subject: add missing files --- src/info.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/info.c (limited to 'src/info.c') diff --git a/src/info.c b/src/info.c new file mode 100644 index 0000000..ea79dd7 --- /dev/null +++ b/src/info.c @@ -0,0 +1,21 @@ +#include "globals.h" + +void info_handler(struct player_t *player) +{ + char *sym; + printf("Enter the ticker symbol of the stock to get information for: "); + sym = get_ticker(); + + struct stock_t *stock = find_stock(player, sym); + + free(sym); + + if(!stock) + { + printf("Couldn't find '%s' in portfolio.\n", sym); + return; + } + + printf("Transaction history:\n"); + print_history(stock); +} -- cgit v1.1