1 /***************************************************************************
2  $RCSfile$
3  -------------------
4  cvs         : $Id: dbio.h 1107 2007-01-07 21:17:05Z martin $
5  begin       : Wed Mar 31 2004
6  copyright   : (C) 2004 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 /** @file dbio.h
30  * @short This file provides the GWEN DB import/export framework.
31  */
32 
33 #ifndef GWENHYWFAR_DBIO_BE_H
34 #define GWENHYWFAR_DBIO_BE_H
35 
36 #include <gwenhywfar/dbio.h>
37 
38 
39 
40 typedef int (*GWEN_DBIO_IMPORTFN)(GWEN_DBIO *dbio,
41                                   GWEN_SYNCIO *sio,
42                                   GWEN_DB_NODE *db,
43                                   GWEN_DB_NODE *params,
44                                   uint32_t flags);
45 
46 typedef int (*GWEN_DBIO_EXPORTFN)(GWEN_DBIO *dbio,
47                                   GWEN_SYNCIO *sio,
48                                   GWEN_DB_NODE *db,
49                                   GWEN_DB_NODE *params,
50                                   uint32_t flags);
51 
52 typedef GWEN_DBIO_CHECKFILE_RESULT(*GWEN_DBIO_CHECKFILEFN)(GWEN_DBIO *dbio, const char *fname);
53 
54 
55 
56 GWENHYWFAR_API
57 GWEN_PLUGIN *GWEN_DBIO_Plugin_new(GWEN_PLUGIN_MANAGER *pm,
58                                   const char *name,
59                                   const char *fileName);
60 
61 GWENHYWFAR_API
62 void GWEN_DBIO_Plugin_SetFactoryFn(GWEN_PLUGIN *pl,
63                                    GWEN_DBIO_PLUGIN_FACTORYFN f);
64 
65 
66 /** @name Functions To Be Used By Inheritors
67  *
68  */
69 /*@{*/
70 /**
71  * Creates the base object which is to be extended by the inheritor.
72  */
73 GWENHYWFAR_API
74 GWEN_DBIO *GWEN_DBIO_new(const char *name, const char *descr);
75 
76 /**
77  * Sets the import function for this kind of GWEN_DBIO.
78  */
79 GWENHYWFAR_API
80 void GWEN_DBIO_SetImportFn(GWEN_DBIO *dbio, GWEN_DBIO_IMPORTFN f);
81 
82 /**
83  * Sets the export function for this kind of GWEN_DBIO.
84  */
85 GWENHYWFAR_API
86 void GWEN_DBIO_SetExportFn(GWEN_DBIO *dbio, GWEN_DBIO_EXPORTFN f);
87 
88 GWENHYWFAR_API
89 void GWEN_DBIO_SetCheckFileFn(GWEN_DBIO *dbio, GWEN_DBIO_CHECKFILEFN f);
90 
91 /*@}*/
92 
93 
94 #endif
95 
96