FreeCalypso > hg > freecalypso-hwlab
annotate simtool/exit.c @ 161:d3128f3e1bde
fc-simtool and fc-uicc-tool moved to new fc-pcsc-tools repository
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Fri, 12 Feb 2021 05:39:38 +0000 |
| parents | 6c4567dd8946 |
| children |
| rev | line source |
|---|---|
|
124
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include <sys/types.h> |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 #include <stdio.h> |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 #include <stdlib.h> |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #include <pcsclite.h> |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <winscard.h> |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include "globals.h" |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 good_exit() |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 { |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 SCardDisconnect(hCard, SCARD_UNPOWER_CARD); |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 SCardReleaseContext(hContext); |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 exit(0); |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 } |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 error_exit() |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 { |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 SCardDisconnect(hCard, SCARD_UNPOWER_CARD); |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 SCardReleaseContext(hContext); |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 exit(1); |
|
6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 } |
