FreeCalypso > hg > freecalypso-hwlab
diff simtool/exit.c @ 124:6c4567dd8946
fc-simtool: add non-interactive one-shot command (or script) mode
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 28 Jan 2021 18:56:34 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/simtool/exit.c Thu Jan 28 18:56:34 2021 +0000 @@ -0,0 +1,20 @@ +#include <sys/types.h> +#include <stdio.h> +#include <stdlib.h> +#include <pcsclite.h> +#include <winscard.h> +#include "globals.h" + +good_exit() +{ + SCardDisconnect(hCard, SCARD_UNPOWER_CARD); + SCardReleaseContext(hContext); + exit(0); +} + +error_exit() +{ + SCardDisconnect(hCard, SCARD_UNPOWER_CARD); + SCardReleaseContext(hContext); + exit(1); +}