aboutsummaryrefslogtreecommitdiff
path: root/src/info.c
blob: 0fa66fe2bafd5dacb37307514915e578d2933c0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 = read_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);
}