FreeCalypso > hg > freecalypso-hwlab
annotate simtool/exit.c @ 138:baf5bd698764
fc-uicc-tool: select-aid command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 04 Feb 2021 04:51:08 +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 } |