dbio.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003  -------------------
00004  cvs         : $Id$
00005  begin       : Wed Mar 31 2004
00006  copyright   : (C) 2004 by Martin Preuss
00007  email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 
00033 #ifndef GWENHYWFAR_DBIO_H
00034 #define GWENHYWFAR_DBIO_H
00035 
00036 #include <gwenhywfar/gwenhywfarapi.h>
00037 #include <gwenhywfar/plugin.h>
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00043 typedef struct GWEN_DBIO GWEN_DBIO;
00044 
00045 #ifdef __cplusplus
00046 }
00047 #endif
00048 
00049 
00050 #define GWEN_DBIO_PLUGIN_NAME "dbio"
00051 
00052 
00056 #define GWEN_DBIO_FOLDER "dbio"
00057 
00058 
00059 #include <gwenhywfar/path.h>
00060 #include <gwenhywfar/syncio.h>
00061 #include <gwenhywfar/types.h>
00062 #include <gwenhywfar/misc.h>
00063 #include <gwenhywfar/inherit.h>
00064 #include <gwenhywfar/db.h>
00065 #include <gwenhywfar/libloader.h>
00066 #include <gwenhywfar/error.h>
00067 
00068 #include <stdio.h>
00069 
00070 #ifdef __cplusplus
00071 extern "C" {
00072 #endif
00073 
00074 
00075 GWEN_LIST_FUNCTION_LIB_DEFS(GWEN_DBIO, GWEN_DBIO, GWENHYWFAR_API)
00076 GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_DBIO, GWENHYWFAR_API)
00077 /* No trailing semicolon here because this is a macro call */
00078 
00079 typedef enum {
00080   GWEN_DBIO_CheckFileResultOk=0,
00081   GWEN_DBIO_CheckFileResultNotOk,
00082   GWEN_DBIO_CheckFileResultUnknown
00083 } GWEN_DBIO_CHECKFILE_RESULT;
00084 
00085 
00086 
00091 typedef GWEN_DBIO* (*GWEN_DBIO_PLUGIN_FACTORYFN)(GWEN_PLUGIN *pl);
00092 
00093 GWENHYWFAR_API
00094 GWEN_DBIO *GWEN_DBIO_Plugin_Factory(GWEN_PLUGIN *pl);
00108 GWENHYWFAR_API
00109 int GWEN_DBIO_Import(GWEN_DBIO *dbio,
00110                      GWEN_SYNCIO *sio,
00111                      GWEN_DB_NODE *db,
00112                      GWEN_DB_NODE *params,
00113                      uint32_t flags);
00114 
00115 GWENHYWFAR_API
00116 int GWEN_DBIO_ImportFromFile(GWEN_DBIO *dbio,
00117                              const char *fname,
00118                              GWEN_DB_NODE *db,
00119                              GWEN_DB_NODE *params,
00120                              uint32_t flags);
00121 
00126 GWENHYWFAR_API
00127 int GWEN_DBIO_Export(GWEN_DBIO *dbio,
00128                      GWEN_SYNCIO *sio,
00129                      GWEN_DB_NODE *db,
00130                      GWEN_DB_NODE *params,
00131                      uint32_t flags);
00132 
00133 GWENHYWFAR_API
00134 int GWEN_DBIO_ExportToFile(GWEN_DBIO *dbio,
00135                            const char *fname,
00136                            GWEN_DB_NODE *db,
00137                            GWEN_DB_NODE *params,
00138                            uint32_t flags);
00139 
00140 GWENHYWFAR_API
00141 int GWEN_DBIO_ExportToBuffer(GWEN_DBIO *dbio,
00142                              GWEN_BUFFER *buf,
00143                              GWEN_DB_NODE *db,
00144                              GWEN_DB_NODE *params,
00145                              uint32_t flags);
00146 
00147 
00151 GWENHYWFAR_API
00152 GWEN_DBIO_CHECKFILE_RESULT GWEN_DBIO_CheckFile(GWEN_DBIO *dbio, const char *fname);
00153 
00154 
00159 GWENHYWFAR_API
00160 void GWEN_DBIO_free(GWEN_DBIO *dbio);
00161 
00166 GWENHYWFAR_API
00167 void GWEN_DBIO_Attach(GWEN_DBIO *dbio);
00168 
00172 GWENHYWFAR_API
00173 const char *GWEN_DBIO_GetName(const GWEN_DBIO *dbio);
00174 
00178 GWENHYWFAR_API
00179 const char *GWEN_DBIO_GetDescription(const GWEN_DBIO *dbio);
00180 
00190 
00198 GWENHYWFAR_API
00199 GWEN_DBIO *GWEN_DBIO_GetPlugin(const char *modname);
00200 
00204 #ifdef __cplusplus
00205 }
00206 #endif
00207 
00208 
00209 #endif /* GWENHYWFAR_DBIO_H */
00210 
00211