dbio.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003  -------------------
00004  cvs         : $Id: dbio.h 881 2005-10-26 15:11:09Z cstim $
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 typedef struct GWEN_DBIO GWEN_DBIO;
00043 #ifdef __cplusplus
00044 }
00045 #endif
00046 
00047 
00051 #define GWEN_DBIO_FOLDER "dbio"
00052 
00053 
00054 #include <gwenhywfar/path.h>
00055 #include <gwenhywfar/bufferedio.h>
00056 #include <gwenhywfar/types.h>
00057 #include <gwenhywfar/misc.h>
00058 #include <gwenhywfar/inherit.h>
00059 #include <gwenhywfar/db.h>
00060 #include <gwenhywfar/libloader.h>
00061 #include <gwenhywfar/error.h>
00062 
00063 #include <stdio.h>
00064 
00065 #ifdef __cplusplus
00066 extern "C" {
00067 #endif
00068 
00069 
00070 GWEN_LIST_FUNCTION_LIB_DEFS(GWEN_DBIO, GWEN_DBIO, GWENHYWFAR_API)
00071 GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_DBIO, GWENHYWFAR_API)
00072 /* No trailing semicolon here because this is a macro call */
00073 
00074 typedef enum {
00075   GWEN_DBIO_CheckFileResultOk=0,
00076   GWEN_DBIO_CheckFileResultNotOk,
00077   GWEN_DBIO_CheckFileResultUnknown
00078 } GWEN_DBIO_CHECKFILE_RESULT;
00079 
00080 
00081 typedef int (*GWEN_DBIO_IMPORTFN)(GWEN_DBIO *dbio,
00082                                   GWEN_BUFFEREDIO *bio,
00083                                   GWEN_TYPE_UINT32 flags,
00084                                   GWEN_DB_NODE *db,
00085                                   GWEN_DB_NODE *params);
00086 
00087 typedef int (*GWEN_DBIO_EXPORTFN)(GWEN_DBIO *dbio,
00088                                   GWEN_BUFFEREDIO *bio,
00089                                   GWEN_TYPE_UINT32 flags,
00090                                   GWEN_DB_NODE *db,
00091                                   GWEN_DB_NODE *params);
00092 
00093 typedef GWEN_DBIO_CHECKFILE_RESULT (*GWEN_DBIO_CHECKFILEFN)(GWEN_DBIO *dbio,
00094                                      const char *fname);
00095 
00096 
00097 
00102 typedef GWEN_DBIO* (*GWEN_DBIO_PLUGIN_FACTORYFN)(GWEN_PLUGIN *pl);
00103 
00104 GWENHYWFAR_API
00105 GWEN_PLUGIN *GWEN_DBIO_Plugin_new(GWEN_PLUGIN_MANAGER *pm,
00106                                   const char *name,
00107                                   const char *fileName);
00108 GWENHYWFAR_API
00109 void GWEN_DBIO_Plugin_SetFactoryFn(GWEN_PLUGIN *pl,
00110                                    GWEN_DBIO_PLUGIN_FACTORYFN f);
00111 GWENHYWFAR_API
00112 GWEN_DBIO *GWEN_DBIO_Plugin_Factory(GWEN_PLUGIN *pl);
00126 GWENHYWFAR_API
00127 int GWEN_DBIO_Import(GWEN_DBIO *dbio,
00128                      GWEN_BUFFEREDIO *bio,
00129                      GWEN_TYPE_UINT32 flags,
00130                      GWEN_DB_NODE *db,
00131                      GWEN_DB_NODE *params);
00132 
00137 GWENHYWFAR_API
00138 int GWEN_DBIO_Export(GWEN_DBIO *dbio,
00139                      GWEN_BUFFEREDIO *bio,
00140                      GWEN_TYPE_UINT32 flags,
00141                      GWEN_DB_NODE *db,
00142                      GWEN_DB_NODE *params);
00143 
00147 GWENHYWFAR_API
00148 GWEN_DBIO_CHECKFILE_RESULT GWEN_DBIO_CheckFile(GWEN_DBIO *dbio,
00149                                                const char *fname);
00150 
00151 
00156 GWENHYWFAR_API
00157 void GWEN_DBIO_free(GWEN_DBIO *dbio);
00158 
00163 GWENHYWFAR_API
00164 void GWEN_DBIO_Attach(GWEN_DBIO *dbio);
00165 
00169 GWENHYWFAR_API
00170 const char *GWEN_DBIO_GetName(const GWEN_DBIO *dbio);
00171 
00175 GWENHYWFAR_API
00176 const char *GWEN_DBIO_GetDescription(const GWEN_DBIO *dbio);
00177 
00190 GWENHYWFAR_API
00191 GWEN_DBIO *GWEN_DBIO_new(const char *name, const char *descr);
00192 
00196 GWENHYWFAR_API
00197 void GWEN_DBIO_SetImportFn(GWEN_DBIO *dbio, GWEN_DBIO_IMPORTFN f);
00198 
00202 GWENHYWFAR_API
00203 void GWEN_DBIO_SetExportFn(GWEN_DBIO *dbio, GWEN_DBIO_EXPORTFN f);
00204 
00205 GWENHYWFAR_API
00206 void GWEN_DBIO_SetCheckFileFn(GWEN_DBIO *dbio, GWEN_DBIO_CHECKFILEFN f);
00207 
00217 
00225 GWENHYWFAR_API
00226 GWEN_DBIO *GWEN_DBIO_GetPlugin(const char *modname);
00227 
00231 #ifdef __cplusplus
00232 }
00233 #endif
00234 
00235 
00236 #endif /* GWENHYWFAR_DBIO_H */
00237 
00238 

Generated on Thu Nov 9 22:06:48 2006 for gwenhywfar by  doxygen 1.5.1