1 /***************************************************************************
2 $RCSfile$
3 -------------------
4 cvs : $Id$
5 begin : Wed Mar 27 2002
6 copyright : (C) 2002 by Martin Preuss
7 email : martin@libchipcard.de
8
9 ***************************************************************************
10 * *
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of the GNU Lesser General Public *
13 * License as published by the Free Software Foundation; either *
14 * version 2.1 of the License, or (at your option) any later version. *
15 * *
16 * This library is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19 * Lesser General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU Lesser General Public *
22 * License along with this library; if not, write to the Free Software *
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
24 * MA 02111-1307 USA *
25 * *
26 ***************************************************************************/
27
28
29
30 #ifdef HAVE_CONFIG_H
31 # include <config.h>
32 #endif
33
34
35 #include <gwenhywfar/gwenhywfar.h>
36 #include <stdio.h>
37 #include <stdlib.h>
38
39
40 static void GWEN_LibInit(void) __attribute__((constructor));
41 static void GWEN_LibFini(void) __attribute__((destructor));
42
43
GWEN_LibInit(void)44 void GWEN_LibInit(void)
45 {
46 int err;
47
48 err=GWEN_Init();
49 if (err) {
50 fprintf(stderr, "Could not initialize Gwenhywfar, aborting\n");
51 abort();
52 }
53 /* fprintf(stderr, "Gwenhywfar initialized.\n"); */
54 }
55
56
GWEN_LibFini(void)57 void GWEN_LibFini(void)
58 {
59 int err;
60
61 err=GWEN_Fini_Forced();
62 if (err) {
63 fprintf(stderr, "Could not deinitialize Gwenhywfar\n");
64 }
65 /* fprintf(stderr, "Gwenhywfar deinitialized.\n"); */
66 }
67
68
69