FreeCalypso > hg > fc-sim-tools
annotate pcsc/rdlist.c @ 3:45ea06eaa9fd
fc-pcsc-backend main program put together
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Mar 2021 02:21:49 +0000 |
parents | f4479a0d4cea |
children |
rev | line source |
---|---|
0
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include <string.h> |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 #include <strings.h> |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 #include <stdio.h> |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #include <stdlib.h> |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <pcsclite.h> |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <winscard.h> |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 extern SCARDCONTEXT hContext; |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 extern char *reader_list; |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 main(argc, argv) |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 char **argv; |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 { |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 char *cp; |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 unsigned num; |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 setup_pcsc_context(); |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 get_reader_list(); |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 for (cp = reader_list, num = 0; *cp; num++) { |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 printf("#%u: %s\n", num, cp); |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 cp += strlen(cp) + 1; |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 } |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 SCardReleaseContext(hContext); |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 exit(0); |
f4479a0d4cea
fc-pcsc-list ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 } |