rpcdb_be.h

00001 /* 
00002    EyeDB Object Database Management System
00003    Copyright (C) 1994-2008 SYSRA
00004    
00005    EyeDB is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009    
00010    EyeDB is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014    
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with this library; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA 
00018 */
00019 
00020 /*
00021    Author: Eric Viara <viara@sysra.com>
00022 */
00023 
00024 
00025 #ifndef _EYEDBLIB_RPCDB_BE_H
00026 #define _EYEDBLIB_RPCDB_BE_H
00027 
00028 #include <eyedblib/rpcdb.h>
00029 
00030 typedef unsigned int rpcDB_TransactionMode;
00031 
00032 typedef struct {
00033   int id;
00034   rpcDB_LocalDBContext ldbctx;
00035   int refcnt;
00036 } rpcDB_DbHandleInfo;
00037 
00038 typedef struct {
00039   rpcDB_DbHandleInfo *dbhinfo;
00040   void *dbh;
00041   int flags;
00042   rpcDB_TransactionMode trmode;
00043   rpc_Boolean local;
00044 } rpcDB_DbHandleClientInfo;
00045 
00046 #define RPCDB_MAX_DBH 128
00047 
00048 typedef struct {
00049   rpcDB_DbHandleClientInfo *dbhclientinfo[RPCDB_MAX_DBH];
00050   void *user_data;
00051 } rpcDB_ClientInfo;
00052 
00053 extern rpcDB_DbHandleInfo *
00054 rpcDB_dbhinfoNew(int id);
00055 
00056 extern rpcDB_DbHandleInfo *
00057 rpcDB_dbhinfoGet(int id);
00058 
00059 extern void
00060 rpcDB_clientDbhDelete(rpcDB_DbHandleClientInfo *dcinfo);
00061 
00062 extern int
00063 rpcDB_clientDbhSet(rpc_ClientId, rpc_Boolean, int, rpcDB_DbHandleInfo *, void *);
00064 
00065 extern rpcDB_DbHandleClientInfo *
00066 rpcDB_clientDbhGet(rpc_ClientId, int);
00067 
00068 extern void rpcDB_mutexInit(void);
00069 
00070 extern void rpcDB_lock(void);
00071 extern void rpcDB_unlock(void);
00072 
00073 extern rpcDB_ClientInfo *rpcDB_clientInfoGet(rpc_ClientId);
00074 
00075 extern rpcDB_DbHandleInfo *rpcDB_open_realize(rpc_Server *, int);
00076 extern rpcDB_DbHandleInfo *rpcDB_open_simple_realize(rpc_Server *, int);
00077 
00078 extern rpc_Boolean
00079 rpcDB_close_do(rpc_Server *, rpcDB_DbHandleClientInfo **,
00080                void *(*close)(rpcDB_DbHandleClientInfo *),
00081                void **);
00082 
00083 extern rpc_Boolean
00084 rpcDB_close_realize(rpc_Server *, rpc_ClientId, int,
00085                     void *(*close)(rpcDB_DbHandleClientInfo *),
00086                     void **);
00087 extern int
00088 rpcDB_getDbhId();
00089 
00090 #endif

Generated on Mon Dec 22 18:16:07 2008 for eyedb by  doxygen 1.5.3