dbio.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: dbio.h,v $
00003  -------------------
00004  cvs         : $Id: dbio.h,v 1.9 2005/02/15 02:13:06 aquamaniac Exp $
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 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 typedef struct GWEN_DBIO GWEN_DBIO;
00042 #ifdef __cplusplus
00043 }
00044 #endif
00045 
00046 
00050 #define GWEN_DBIO_FOLDER "dbio"
00051 
00052 
00053 #include <gwenhywfar/path.h>
00054 #include <gwenhywfar/bufferedio.h>
00055 #include <gwenhywfar/types.h>
00056 #include <gwenhywfar/misc.h>
00057 #include <gwenhywfar/inherit.h>
00058 #include <gwenhywfar/db.h>
00059 #include <gwenhywfar/libloader.h>
00060 #include <gwenhywfar/error.h>
00061 
00062 #include <stdio.h>
00063 
00064 #ifdef __cplusplus
00065 extern "C" {
00066 #endif
00067 
00068 
00069 GWEN_LIST_FUNCTION_LIB_DEFS(GWEN_DBIO, GWEN_DBIO, GWENHYWFAR_API)
00070 GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_DBIO, GWENHYWFAR_API)
00071 /* No trailing semicolon here because this is a macro call */
00072 
00073 typedef enum {
00074   GWEN_DBIO_CheckFileResultOk=0,
00075   GWEN_DBIO_CheckFileResultNotOk,
00076   GWEN_DBIO_CheckFileResultUnknown
00077 } GWEN_DBIO_CHECKFILE_RESULT;
00078 
00079 typedef GWEN_DBIO* (*GWEN_DBIO_FACTORYFN)(void);
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 
00106 GWENHYWFAR_API
00107 int GWEN_DBIO_Import(GWEN_DBIO *dbio,
00108                      GWEN_BUFFEREDIO *bio,
00109                      GWEN_TYPE_UINT32 flags,
00110                      GWEN_DB_NODE *db,
00111                      GWEN_DB_NODE *params);
00112 
00117 GWENHYWFAR_API
00118 int GWEN_DBIO_Export(GWEN_DBIO *dbio,
00119                      GWEN_BUFFEREDIO *bio,
00120                      GWEN_TYPE_UINT32 flags,
00121                      GWEN_DB_NODE *db,
00122                      GWEN_DB_NODE *params);
00123 
00127 GWENHYWFAR_API
00128 GWEN_DBIO_CHECKFILE_RESULT GWEN_DBIO_CheckFile(GWEN_DBIO *dbio,
00129                                                const char *fname);
00130 
00131 
00136 GWENHYWFAR_API
00137 void GWEN_DBIO_free(GWEN_DBIO *dbio);
00138 
00143 GWENHYWFAR_API
00144 void GWEN_DBIO_Attach(GWEN_DBIO *dbio);
00145 
00149 GWENHYWFAR_API
00150 const char *GWEN_DBIO_GetName(const GWEN_DBIO *dbio);
00151 
00155 GWENHYWFAR_API
00156 const char *GWEN_DBIO_GetDescription(const GWEN_DBIO *dbio);
00157 
00162 GWENHYWFAR_API
00163 GWEN_DBIO *GWEN_DBIO_Find(const char *name);
00164 
00173 GWENHYWFAR_API
00174 int GWEN_DBIO_GetPluginPath(GWEN_BUFFER *pbuf);
00175 
00188 GWENHYWFAR_API
00189 GWEN_DBIO *GWEN_DBIO_new(const char *name, const char *descr);
00190 
00194 GWENHYWFAR_API
00195 void GWEN_DBIO_SetImportFn(GWEN_DBIO *dbio, GWEN_DBIO_IMPORTFN f);
00196 
00200 GWENHYWFAR_API
00201 void GWEN_DBIO_SetExportFn(GWEN_DBIO *dbio, GWEN_DBIO_EXPORTFN f);
00202 
00203 GWENHYWFAR_API
00204 void GWEN_DBIO_SetCheckFileFn(GWEN_DBIO *dbio, GWEN_DBIO_CHECKFILEFN f);
00205 
00215 
00222 GWENHYWFAR_API
00223 GWEN_LIBLOADER *GWEN_DBIO_GetLibLoader(const GWEN_DBIO *dbio);
00224 
00231 GWENHYWFAR_API
00232 void GWEN_DBIO_SetLibLoader(GWEN_DBIO *dbio, GWEN_LIBLOADER *ll);
00233 
00239 GWENHYWFAR_API
00240 int GWEN_DBIO_Register(GWEN_DBIO *dbio);
00241 
00245 GWENHYWFAR_API
00246 GWEN_DBIO *GWEN_DBIO_LoadPluginFile(const char *modname, const char *fname);
00247 
00253 GWENHYWFAR_API
00254 GWEN_DBIO *GWEN_DBIO_LoadPlugin(const char *modname);
00255 
00264 GWENHYWFAR_API
00265 GWEN_DBIO *GWEN_DBIO_GetPlugin(const char *modname);
00266 
00270 #ifdef __cplusplus
00271 }
00272 #endif
00273 
00274 
00275 #endif /* GWENHYWFAR_DBIO_H */
00276 
00277 

Generated on Thu Mar 16 00:13:22 2006 for gwenhywfar by  doxygen 1.4.6