FreeCalypso > hg > freecalypso-hwlab
comparison simtool/main.c @ 85:b57cf64ece29
fc-simtool project started
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 24 Jan 2021 00:32:10 +0000 |
parents | |
children | b391204d3cd5 |
comparison
equal
deleted
inserted
replaced
84:1d7d8615d628 | 85:b57cf64ece29 |
---|---|
1 #include <sys/types.h> | |
2 #include <stdio.h> | |
3 #include <stdlib.h> | |
4 #include <pcsclite.h> | |
5 #include <winscard.h> | |
6 #include "globals.h" | |
7 | |
8 main(argc, argv) | |
9 char **argv; | |
10 { | |
11 char command[512]; | |
12 | |
13 setup_pcsc_context(); | |
14 get_reader_name(); | |
15 printf("Card reader name: %s\n", reader_name_buf); | |
16 connect_to_card(); | |
17 retrieve_atr(); | |
18 for (;;) { | |
19 if (isatty(0)) { | |
20 fputs("simtool> ", stdout); | |
21 fflush(stdout); | |
22 } | |
23 if (!fgets(command, sizeof command, stdin)) | |
24 cmd_exit(); | |
25 simtool_dispatch_cmd(command); | |
26 } | |
27 } |