FreeCalypso > hg > fc-pcsc-tools
annotate misc/fc-pcsc-list.c @ 194:a5fee308b699
doc/Low-level-commands: erase-file documented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 06 Mar 2021 23:13:28 +0000 |
parents | be9984600bf8 |
children |
rev | line source |
---|---|
31
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include <string.h> |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 #include <strings.h> |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 #include <stdio.h> |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #include <stdlib.h> |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <pcsclite.h> |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <winscard.h> |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include "cardif.h" |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 main(argc, argv) |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 char **argv; |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 { |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 char *cp; |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 unsigned num; |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 setup_pcsc_context(); |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 get_reader_list(); |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 for (cp = reader_list, num = 0; *cp; num++) { |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 printf("#%u: %s\n", num, cp); |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 cp += strlen(cp) + 1; |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 } |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 SCardReleaseContext(hContext); |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 exit(0); |
be9984600bf8
fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 } |