comparison uicc/main.c @ 15:b70d35f5476f

fc-uicc-tool ported over
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Mar 2021 07:41:09 +0000
parents
children e2ef4b8e4136
comparison
equal deleted inserted replaced
14:b7ee2e85686b 15:b70d35f5476f
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4
5 extern char be_reader_name[];
6 extern char be_atr_string[];
7
8 main(argc, argv)
9 char **argv;
10 {
11 extern int optind;
12 char command[512];
13 int rc;
14
15 parse_global_options(argc, argv);
16 launch_backend();
17 collect_backend_init_strings();
18 if (argc > optind) {
19 rc = dispatch_ready_argv(argc - optind, argv + optind);
20 if (rc)
21 exit(1);
22 else
23 good_exit();
24 }
25 if (be_reader_name[0])
26 printf("Card reader name: %s\n", be_reader_name);
27 if (be_atr_string[0])
28 printf("ATR: %s\n", be_atr_string);
29 for (;;) {
30 if (isatty(0)) {
31 fputs("uicc> ", stdout);
32 fflush(stdout);
33 }
34 if (!fgets(command, sizeof command, stdin))
35 good_exit();
36 simtool_dispatch_cmd(command, 0);
37 }
38 }