FreeCalypso > hg > freecalypso-hwlab
annotate uicc/exit.c @ 144:429a8f80426e
fc-uicc-tool: catch record length from manual select
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 06 Feb 2021 02:03:11 +0000 |
parents | f691a19f191d |
children |
rev | line source |
---|---|
130
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include <sys/types.h> |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 #include <stdio.h> |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 #include <stdlib.h> |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #include <pcsclite.h> |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <winscard.h> |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include "globals.h" |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 good_exit() |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 { |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 SCardDisconnect(hCard, SCARD_UNPOWER_CARD); |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 SCardReleaseContext(hContext); |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 exit(0); |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 } |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 error_exit() |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 { |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 SCardDisconnect(hCard, SCARD_UNPOWER_CARD); |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 SCardReleaseContext(hContext); |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 exit(1); |
f691a19f191d
fc-uicc-tool skeleton started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 } |