aboutsummaryrefslogtreecommitdiff
path: root/src/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/info.c')
-rw-r--r--src/info.c21
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);
+}