FreeCalypso > hg > fc-sim-tools
annotate pcsc/rdlist.c @ 53:fbedb67d234f
serial: fix parity for inverse coding convention
Important note: it is my (Mother Mychaela's) understanding that
SIM cards with inverse coding convention are extremely rare,
and I have never seen such a card. Therefore, our support for
the inverse coding convention will likely remain forever untested.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 21 Mar 2021 20:46:09 +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 } |