annotate misc/fc-pcsc-list.c @ 212:43b57865fdb5

fc-simtool spn command: fix ancient bug
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 07 Mar 2021 06:46:21 +0000
parents be9984600bf8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 }