FreeCalypso > hg > fc-pcsc-tools
annotate libcommon/exit.c @ 184:8d073ff62c48
fc-simtool: imsi command does higher-level parsing,
the old version is now imsi-raw
| author | Mychaela Falconia <falcon@freecalypso.org> | 
|---|---|
| date | Sat, 06 Mar 2021 05:44:17 +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 } | 
