diff options
| author | Franklin Wei <git@fwei.tk> | 2015-05-16 14:27:58 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2015-05-16 14:27:58 -0400 |
| commit | f1b434fd0e76d44056868ea4d2d8fd52138a663b (patch) | |
| tree | 37e38db0ae52c16fc27a26793993426274d9f867 /src/info.c | |
| parent | 2bb97375378c24bc62fea9445f5b445291e0a9ee (diff) | |
| download | market-sim-f1b434fd0e76d44056868ea4d2d8fd52138a663b.zip market-sim-f1b434fd0e76d44056868ea4d2d8fd52138a663b.tar.gz market-sim-f1b434fd0e76d44056868ea4d2d8fd52138a663b.tar.bz2 market-sim-f1b434fd0e76d44056868ea4d2d8fd52138a663b.tar.xz | |
add missing files
Diffstat (limited to 'src/info.c')
| -rw-r--r-- | src/info.c | 21 |
1 files changed, 21 insertions, 0 deletions
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); +} |