annotate libcommon/exit.c @ 0:f7145c77b7fb

starting libcommon: factored out of fc-simtool
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 11 Feb 2021 22:28:45 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 }