FreeCalypso > hg > fc-pcsc-tools
annotate libcommon/exit.c @ 197:3ddbc3fea5f0
encode_plmn_3bytes() error handling change
in preparation for PLMN list reading addition
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 07 Mar 2021 02:36:27 +0000 |
parents | f7145c77b7fb |
children |
rev | line source |
---|---|
0
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include <stdio.h> |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 #include <stdlib.h> |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 #include <pcsclite.h> |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #include <winscard.h> |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include "cardif.h" |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 good_exit() |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 { |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 SCardDisconnect(hCard, SCARD_UNPOWER_CARD); |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 SCardReleaseContext(hContext); |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 exit(0); |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 } |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 error_exit() |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 { |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 SCardDisconnect(hCard, SCARD_UNPOWER_CARD); |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 SCardReleaseContext(hContext); |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 exit(1); |
f7145c77b7fb
starting libcommon: factored out of fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 } |