00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <eyedbconfig.h>
00026
00027 #include <assert.h>
00028 #include <stdlib.h>
00029
00030 #define _IDB_KERN_
00031 #include "eyedblib/semlib.h"
00032 #include "eyedbsm/eyedbsm_p.h"
00033 #include "serv_lib.h"
00034 #include "eyedb/internals/ObjectHeader.h"
00035 #include "eyedb/base.h"
00036 #include "eyedb/Error.h"
00037 #include "eyedb/Exception.h"
00038 #include "eyedb/TransactionParams.h"
00039 #include "kernel.h"
00040 #include "kernel_p.h"
00041 #include "Argument_code.h"
00042 #include "code.h"
00043
00044 namespace eyedb {
00045
00046 static RPCStatusRec *RPCInvalidDbId, *RPCInvalidClientId;
00047
00048 #define SE_STATUS_MAKE(S, UA, I) \
00049 if (S)\
00050 {\
00051 UA[I].a_status.err = (eyedblib::int32)(S)->err;\
00052 strcpy((char *)UA[I].a_status.err_msg, eyedbsm::statusGet(S));\
00053 } \
00054 else\
00055 {\
00056 UA[I].a_status.err = (eyedblib::int32)IDB_SUCCESS;\
00057 UA[I].a_status.err_msg[0] = 0;\
00058 }
00059
00060 #define RPC_STATUS_MAKE(S, UA, I) \
00061 if (S)\
00062 UA[I].a_status = *(S); \
00063 else\
00064 {\
00065 UA[I].a_status.err = (eyedblib::int32)IDB_SUCCESS;\
00066 UA[I].a_status.err_msg[0] = 0;\
00067 }
00068
00069 void
00070 be_init()
00071 {
00072 RPCInvalidDbId = rpc_new(RPCStatusRec);
00073 RPCInvalidDbId->err = IDB_INVALID_DB_ID;
00074
00075 RPCInvalidClientId = rpc_new(RPCStatusRec);
00076 RPCInvalidClientId->err = IDB_INVALID_CLIENT_ID;
00077 }
00078
00079 static int
00080 database_register(rpc_ClientId clientid, int id, rpc_Boolean mode,
00081 int flag, DbHandle *dbh)
00082 {
00083 rpcDB_DbHandleInfo *dbhinfo;
00084
00085 dbhinfo = rpcDB_open_simple_realize(rpc_getMainServer(), id);
00086 return rpcDB_clientDbhSet(clientid, mode, flag, dbhinfo, dbh);
00087 }
00088
00089 static int forbidden;
00090 #define CHECK_ACCESS() if (forbidden) exit(1)
00091
00092 void
00093 DBOPEN_realize(rpc_ClientId clientid, void *xua)
00094 {
00095 ServerArg *ua = (ServerArg *)xua;
00096 RPCStatus status;
00097 DbHandle *dbh;
00098 int id = rpcDB_getDbhId();
00099 rpcDB_DbHandleInfo *dbhinfo;
00100 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00101
00102 CHECK_ACCESS();
00103
00104 if (!ci)
00105 status = RPCInvalidClientId;
00106 else if ((status = IDB_dbOpen_make((ConnHandle *)ci->user_data,
00107 ua[0].a_string, ua[1].a_string,
00108 ua[2].a_string, ua[3].a_string,
00109 ua[4].a_int, ua[5].a_int,
00110 ua[6].a_int, ua[7].a_int,
00111 &id, &ua[8].a_int, &ua[9].a_string,
00112 &ua[10].a_int,
00113 (unsigned int *)&ua[12].a_int, &dbh)) ==
00114 RPCSuccess)
00115 {
00116 ua[11].a_int = database_register(clientid, id, rpc_False,
00117 ua[5].a_int, dbh);
00118 ua[13].a_oid = dbh->sch.oid;
00119 }
00120
00121 RPC_STATUS_MAKE(status, ua, 14);
00122 }
00123
00124 void
00125 DBOPENLOCAL_realize(rpc_ClientId clientid, void *xua)
00126 {
00127 ServerArg *ua = (ServerArg *)xua;
00128 RPCStatus status;
00129 DbHandle *ldbh;
00130 int id = rpcDB_getDbhId();
00131 rpcDB_DbHandleInfo *dbhinfo;
00132 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00133
00134 CHECK_ACCESS();
00135
00136 if (!ci)
00137 status = RPCInvalidClientId;
00138 else if ((status = IDB_dbOpen_make((ConnHandle *)ci->user_data,
00139 ua[0].a_string, ua[1].a_string,
00140 ua[2].a_string, ua[3].a_string,
00141 ua[4].a_int,
00142 ua[5].a_int,
00143 ua[6].a_int, ua[7].a_int,
00144 &id, &ua[8].a_int,
00145 &ua[9].a_string,
00146 &ua[10].a_int,
00147 (unsigned int *)&ua[11].a_int, &ldbh)) ==
00148 RPCSuccess)
00149 {
00150
00151 ua[12].a_ldbctx.rdbhid = 0;
00152 ua[12].a_ldbctx.xid = ldbh->sedbh->xid;
00153 ua[12].a_ldbctx.local = rpc_True;
00154 ua[12].a_ldbctx.rdbhid = database_register(clientid, id, rpc_True,
00155 ua[5].a_int, ldbh);
00156 ua[13].a_oid = ldbh->sch.oid;
00157 }
00158
00159 RPC_STATUS_MAKE(status, ua, 14);
00160 }
00161
00162 void *
00163 close_realize(rpcDB_DbHandleClientInfo *dbhclientinfo)
00164 {
00165 return (void *)IDB_dbClose_make((DbHandle *)dbhclientinfo->dbh);
00166 }
00167
00168 void
00169 DBCLOSE_realize(rpc_ClientId clientid, void *xua)
00170 {
00171 ServerArg *ua = (ServerArg *)xua;
00172 RPCStatus status;
00173
00174 CHECK_ACCESS();
00175
00176 rpcDB_close_realize(rpc_getMainServer(), clientid, ua[0].a_int,
00177 close_realize, (void **)&status);
00178 RPC_STATUS_MAKE(status, ua, 1);
00179 }
00180
00181 extern void
00182 decode_dbdescription(Data, void *, DbCreateDescription *);
00183
00184 void
00185 DBCREATE_realize(rpc_ClientId clientid, void *xua)
00186 {
00187 ServerArg *ua = (ServerArg *)xua;
00188 RPCStatus status;
00189 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00190
00191 CHECK_ACCESS();
00192
00193 if (!ci)
00194 status = RPCInvalidClientId;
00195 else
00196 {
00197 DbCreateDescription *dbdesc = (DbCreateDescription *)malloc(sizeof(DbCreateDescription));
00198 decode_dbdescription((unsigned char *)ua[4].a_data.data, &ua[4].a_data, dbdesc);
00199
00200 status = IDB_dbCreate((ConnHandle *)ci->user_data,
00201 ua[0].a_string, ua[1].a_string,
00202 ua[2].a_string, ua[3].a_string,
00203 dbdesc);
00204 free(dbdesc);
00205 }
00206
00207 RPC_STATUS_MAKE(status, ua, 5);
00208 }
00209
00210 void
00211 DBDELETE_realize(rpc_ClientId clientid, void *xua)
00212 {
00213 ServerArg *ua = (ServerArg *)xua;
00214 RPCStatus rpc_status;
00215 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00216
00217 CHECK_ACCESS();
00218
00219 if (!ci)
00220 rpc_status = RPCInvalidClientId;
00221 else
00222 rpc_status = IDB_dbDelete((ConnHandle *)ci->user_data,
00223 ua[0].a_string, ua[1].a_string,
00224 ua[2].a_string, ua[3].a_string);
00225
00226 RPC_STATUS_MAKE(rpc_status, ua, 4);
00227 }
00228
00229 extern Data code_dbdescription(const DbCreateDescription *,
00230 int *);
00231
00232 void
00233 DBINFO_realize(rpc_ClientId clientid, void *xua)
00234 {
00235 ServerArg *ua = (ServerArg *)xua;
00236 RPCStatus status;
00237 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00238
00239 CHECK_ACCESS();
00240
00241 if (!ci)
00242 status = RPCInvalidClientId;
00243 else
00244 {
00245 DbCreateDescription *dbdesc = (DbCreateDescription *)malloc(sizeof(DbCreateDescription));
00246
00247 status = IDB_dbInfo((ConnHandle *)ci->user_data,
00248 ua[0].a_string, ua[1].a_string,
00249 ua[2].a_string, ua[3].a_string,
00250 &ua[4].a_int,
00251 dbdesc);
00252
00253 if (!status)
00254 ua[5].a_data.data = code_dbdescription(dbdesc, &ua[5].a_data.size);
00255 else
00256 ua[5].a_data.data = (unsigned char *)malloc(1);
00257
00258 ua[5].a_data.status = rpc_TempDataUsed;
00259
00260 free(dbdesc);
00261 }
00262
00263 RPC_STATUS_MAKE(status, ua, 6);
00264 }
00265
00266 void
00267 DBMOVE_realize(rpc_ClientId clientid, void *xua)
00268 {
00269 ServerArg *ua = (ServerArg *)xua;
00270 RPCStatus status;
00271 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00272
00273 CHECK_ACCESS();
00274
00275 if (!ci)
00276 status = RPCInvalidClientId;
00277 else
00278 {
00279 DbCreateDescription *dbdesc = (DbCreateDescription *)malloc(sizeof(DbCreateDescription));
00280 decode_dbdescription((unsigned char *)ua[4].a_data.data, &ua[4].a_data, dbdesc);
00281
00282 status = IDB_dbMove((ConnHandle *)ci->user_data,
00283 ua[0].a_string, ua[1].a_string,
00284 ua[2].a_string, ua[3].a_string,
00285 dbdesc);
00286 free(dbdesc);
00287 }
00288
00289 RPC_STATUS_MAKE(status, ua, 5);
00290 }
00291
00292 void
00293 DBCOPY_realize(rpc_ClientId clientid, void *xua)
00294 {
00295 ServerArg *ua = (ServerArg *)xua;
00296 RPCStatus status;
00297 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00298
00299 CHECK_ACCESS();
00300
00301 if (!ci)
00302 status = RPCInvalidClientId;
00303 else
00304 {
00305 DbCreateDescription *dbdesc = (DbCreateDescription *)malloc(sizeof(DbCreateDescription));
00306 decode_dbdescription((unsigned char *)ua[6].a_data.data, &ua[6].a_data, dbdesc);
00307
00308 status = IDB_dbCopy((ConnHandle *)ci->user_data,
00309 ua[0].a_string, ua[1].a_string,
00310 ua[2].a_string, ua[3].a_string,
00311 ua[4].a_string, (Bool)ua[5].a_int, dbdesc);
00312 free(dbdesc);
00313 }
00314
00315 RPC_STATUS_MAKE(status, ua, 7);
00316 }
00317
00318 void
00319 DBRENAME_realize(rpc_ClientId clientid, void *xua)
00320 {
00321 ServerArg *ua = (ServerArg *)xua;
00322 RPCStatus status;
00323 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00324
00325 CHECK_ACCESS();
00326
00327 if (!ci)
00328 status = RPCInvalidClientId;
00329 else
00330 status = IDB_dbRename((ConnHandle *)ci->user_data,
00331 ua[0].a_string, ua[1].a_string,
00332 ua[2].a_string, ua[3].a_string,
00333 ua[4].a_string);
00334
00335 RPC_STATUS_MAKE(status, ua, 5);
00336 }
00337
00338 void
00339 DBMCREATE_realize(rpc_ClientId clientid, void *xua)
00340 {
00341 ServerArg *ua = (ServerArg *)xua;
00342 RPCStatus status;
00343 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00344
00345 CHECK_ACCESS();
00346
00347 if (!ci)
00348 status = RPCInvalidClientId;
00349 else
00350 {
00351 DbCreateDescription *dbdesc = (DbCreateDescription *)malloc(sizeof(DbCreateDescription));
00352 decode_dbdescription((unsigned char *)ua[2].a_data.data, &ua[2].a_data, dbdesc);
00353
00354 status = IDB_dbmCreate((ConnHandle *)ci->user_data,
00355 ua[0].a_string, ua[1].a_string,
00356 dbdesc);
00357 free(dbdesc);
00358 }
00359
00360 RPC_STATUS_MAKE(status, ua, 3);
00361 }
00362
00363 void
00364 DBMUPDATE_realize(rpc_ClientId clientid, void *xua)
00365 {
00366 ServerArg *ua = (ServerArg *)xua;
00367 RPCStatus status;
00368 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00369
00370 CHECK_ACCESS();
00371
00372 if (!ci)
00373 status = RPCInvalidClientId;
00374 else
00375 status = IDB_dbmUpdate((ConnHandle *)ci->user_data,
00376 ua[0].a_string, ua[1].a_string,
00377 ua[2].a_string);
00378
00379 RPC_STATUS_MAKE(status, ua, 3);
00380 }
00381
00382 void
00383 USER_ADD_realize(rpc_ClientId clientid, void *xua)
00384 {
00385 ServerArg *ua = (ServerArg *)xua;
00386 RPCStatus status;
00387 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00388
00389 if (!ci)
00390 status = RPCInvalidClientId;
00391 else
00392 status = IDB_userAdd((ConnHandle *)ci->user_data,
00393 ua[0].a_string, ua[1].a_string,
00394 ua[2].a_string, ua[3].a_string,
00395 ua[4].a_string, ua[5].a_int);
00396
00397 RPC_STATUS_MAKE(status, ua, 6);
00398 }
00399
00400 void
00401 USER_DELETE_realize(rpc_ClientId clientid, void *xua)
00402 {
00403 ServerArg *ua = (ServerArg *)xua;
00404 RPCStatus status;
00405 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00406
00407 if (!ci)
00408 status = RPCInvalidClientId;
00409 else
00410 status = IDB_userDelete((ConnHandle *)ci->user_data,
00411 ua[0].a_string, ua[1].a_string,
00412 ua[2].a_string, ua[3].a_string);
00413
00414 RPC_STATUS_MAKE(status, ua, 4);
00415 }
00416
00417 void
00418 USER_PASSWD_SET_realize(rpc_ClientId clientid, void *xua)
00419 {
00420 ServerArg *ua = (ServerArg *)xua;
00421 RPCStatus status;
00422 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00423
00424 if (!ci)
00425 status = RPCInvalidClientId;
00426 else
00427 status = IDB_userPasswdSet((ConnHandle *)ci->user_data,
00428 ua[0].a_string, ua[1].a_string,
00429 ua[2].a_string, ua[3].a_string,
00430 ua[4].a_string);
00431
00432 RPC_STATUS_MAKE(status, ua, 5);
00433 }
00434
00435 void
00436 PASSWD_SET_realize(rpc_ClientId clientid, void *xua)
00437 {
00438 ServerArg *ua = (ServerArg *)xua;
00439 RPCStatus status;
00440 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00441
00442 if (!ci)
00443 status = RPCInvalidClientId;
00444 else
00445 status = IDB_passwdSet((ConnHandle *)ci->user_data,
00446 ua[0].a_string, ua[1].a_string,
00447 ua[2].a_string, ua[3].a_string);
00448
00449 RPC_STATUS_MAKE(status, ua, 4);
00450 }
00451
00452 void
00453 DEFAULT_DBACCESS_SET_realize(rpc_ClientId clientid, void *xua)
00454 {
00455 ServerArg *ua = (ServerArg *)xua;
00456 RPCStatus status;
00457 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00458
00459 if (!ci)
00460 status = RPCInvalidClientId;
00461 else
00462 status = IDB_defaultDBAccessSet((ConnHandle *)ci->user_data,
00463 ua[0].a_string, ua[1].a_string,
00464 ua[2].a_string, ua[3].a_string,
00465 ua[4].a_int);
00466
00467 RPC_STATUS_MAKE(status, ua, 5);
00468 }
00469
00470 void
00471 USER_DBACCESS_SET_realize(rpc_ClientId clientid, void *xua)
00472 {
00473 ServerArg *ua = (ServerArg *)xua;
00474 RPCStatus status;
00475 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00476
00477 if (!ci)
00478 status = RPCInvalidClientId;
00479 else
00480 status = IDB_userDBAccessSet((ConnHandle *)ci->user_data,
00481 ua[0].a_string, ua[1].a_string,
00482 ua[2].a_string, ua[3].a_string,
00483 ua[4].a_string, ua[5].a_int);
00484
00485 RPC_STATUS_MAKE(status, ua, 6);
00486 }
00487
00488 void
00489 USER_SYSACCESS_SET_realize(rpc_ClientId clientid, void *xua)
00490 {
00491 ServerArg *ua = (ServerArg *)xua;
00492 RPCStatus status;
00493 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00494
00495 if (!ci)
00496 status = RPCInvalidClientId;
00497 else
00498 status = IDB_userSysAccessSet((ConnHandle *)ci->user_data,
00499 ua[0].a_string, ua[1].a_string,
00500 ua[2].a_string, ua[3].a_string,
00501 ua[4].a_int);
00502
00503 RPC_STATUS_MAKE(status, ua, 5);
00504 }
00505
00506 void
00507 BACKEND_INTERRUPT_realize(rpc_ClientId clientid, void *xua)
00508 {
00509 ServerArg *ua = (ServerArg *)xua;
00510 RPCStatus status;
00511 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00512
00513 if (!ci)
00514 status = RPCInvalidClientId;
00515 else
00516 status = IDB_backendInterrupt((ConnHandle *)ci->user_data,
00517 ua[0].a_int);
00518
00519 RPC_STATUS_MAKE(status, ua, 1);
00520 }
00521
00522 void
00523 GET_SERVER_OUTOFBAND_DATA_realize(rpc_ClientId clientid, void *xua)
00524 {
00525 ServerArg *ua = (ServerArg *)xua;
00526 RPCStatus status;
00527 rpcDB_ClientInfo *ci = rpcDB_clientInfoGet(clientid);
00528
00529 if (!ci)
00530 status = RPCInvalidDbId;
00531 else
00532 status = IDB_getServerOutOfBandData((ConnHandle *)ci->user_data,
00533 &ua[0].a_int, 0, 0, &ua[1].a_data);
00534
00535 RPC_STATUS_MAKE(status, ua, 2);
00536 }
00537
00538 void
00539 TRANSACTION_BEGIN_realize(rpc_ClientId clientid, void *xua)
00540 {
00541 ServerArg *ua = (ServerArg *)xua;
00542 RPCStatus status;
00543 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00544
00545 if (dcinfo)
00546 {
00547 TransactionParams params;
00548 params.trsmode = (TransactionMode)ua[1].a_int;
00549 params.lockmode = (TransactionLockMode)ua[2].a_int;
00550 params.recovmode = (RecoveryMode)ua[3].a_int;
00551 params.magorder = ua[4].a_int;
00552 params.ratioalrt = ua[5].a_int;
00553 params.wait_timeout = ua[6].a_int;
00554 status = IDB_transactionBegin((DbHandle *)dcinfo->dbh, ¶ms, False);
00555 }
00556 else
00557 status = RPCInvalidDbId;
00558
00559 ua[7].a_int = 0;
00560
00561 RPC_STATUS_MAKE(status, ua, 8);
00562 }
00563
00564 void
00565 TRANSACTION_COMMIT_realize(rpc_ClientId clientid, void *xua)
00566 {
00567 ServerArg *ua = (ServerArg *)xua;
00568 RPCStatus status;
00569 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00570
00571 if (dcinfo)
00572 status = IDB_transactionCommit((DbHandle *)dcinfo->dbh, False);
00573 else
00574 status = RPCInvalidDbId;
00575
00576 RPC_STATUS_MAKE(status, ua, 2);
00577 }
00578
00579 void
00580 TRANSACTION_ABORT_realize(rpc_ClientId clientid, void *xua)
00581 {
00582 ServerArg *ua = (ServerArg *)xua;
00583 RPCStatus status;
00584 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00585
00586 if (dcinfo)
00587 status = IDB_transactionAbort((DbHandle *)dcinfo->dbh, False);
00588 else
00589 status = RPCInvalidDbId;
00590
00591 RPC_STATUS_MAKE(status, ua, 2);
00592 }
00593
00594 void
00595 TRANSACTION_PARAMS_SET_realize(rpc_ClientId clientid, void *xua)
00596 {
00597 ServerArg *ua = (ServerArg *)xua;
00598 RPCStatus status;
00599 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00600
00601 if (dcinfo)
00602 {
00603 TransactionParams params;
00604 params.trsmode = (TransactionMode)ua[1].a_int;
00605 params.lockmode = (TransactionLockMode)ua[2].a_int;
00606 params.recovmode = (RecoveryMode)ua[3].a_int;
00607 params.magorder = ua[4].a_int;
00608 params.ratioalrt = ua[5].a_int;
00609 params.wait_timeout = ua[6].a_int;
00610 status = IDB_transactionParamsSet((DbHandle *)dcinfo->dbh, ¶ms);
00611 }
00612 else
00613 status = RPCInvalidDbId;
00614
00615 RPC_STATUS_MAKE(status, ua, 7);
00616 }
00617
00618 void
00619 TRANSACTION_PARAMS_GET_realize(rpc_ClientId clientid, void *xua)
00620 {
00621 ServerArg *ua = (ServerArg *)xua;
00622 RPCStatus status;
00623 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00624
00625 if (dcinfo)
00626 {
00627 TransactionParams params;
00628 status = IDB_transactionParamsGet((DbHandle *)dcinfo->dbh, ¶ms);
00629
00630 ua[1].a_int = params.trsmode;
00631 ua[2].a_int = params.lockmode;
00632 ua[3].a_int = params.recovmode;
00633 ua[4].a_int = params.magorder;
00634 ua[5].a_int = params.ratioalrt;
00635 ua[6].a_int = params.wait_timeout;
00636 }
00637 else
00638 status = RPCInvalidDbId;
00639
00640 RPC_STATUS_MAKE(status, ua, 7);
00641 }
00642
00643 void
00644 OBJECT_CREATE_realize(rpc_ClientId clientid, void *xua)
00645 {
00646 ServerArg *ua = (ServerArg *)xua;
00647 RPCStatus status;
00648 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00649
00650 if (dcinfo)
00651 status = IDB_objectCreate((DbHandle *)dcinfo->dbh, ua[1].a_int,
00652 (unsigned char *)ua[2].a_data.data, &ua[3].a_oid,
00653 &ua[2].a_data, 0, &ua[4].a_data);
00654 else
00655 status = RPCInvalidDbId;
00656
00657 RPC_STATUS_MAKE(status, ua, 5);
00658 }
00659
00660 void
00661 OBJECT_READ_realize(rpc_ClientId clientid, void *xua)
00662 {
00663 ServerArg *ua = (ServerArg *)xua;
00664 RPCStatus status;
00665 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00666
00667 short dspid;
00668 if (dcinfo)
00669 status = IDB_objectRead((DbHandle *)dcinfo->dbh, (unsigned char *)ua[1].a_data.data, 0, &dspid,
00670 &ua[3].a_oid,
00671 (LockMode)ua[4].a_int, &ua[5].a_data);
00672 else
00673 status = RPCInvalidDbId;
00674
00675 ua[2].a_int = dspid;
00676 RPC_STATUS_MAKE(status, ua, 6);
00677 }
00678
00679 void
00680 OBJECT_WRITE_realize(rpc_ClientId clientid, void *xua)
00681 {
00682 ServerArg *ua = (ServerArg *)xua;
00683 RPCStatus status;
00684 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00685
00686 if (dcinfo)
00687 status = IDB_objectWrite((DbHandle *)dcinfo->dbh, (unsigned char *)ua[1].a_data.data, &ua[2].a_oid,
00688 &ua[1].a_data, 0, &ua[3].a_data);
00689 else
00690 status = RPCInvalidDbId;
00691
00692 RPC_STATUS_MAKE(status, ua, 4);
00693 }
00694
00695 void
00696 OBJECT_DELETE_realize(rpc_ClientId clientid, void *xua)
00697 {
00698 ServerArg *ua = (ServerArg *)xua;
00699 RPCStatus status;
00700 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00701
00702 if (dcinfo)
00703 status = IDB_objectDelete((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int,
00704 0, &ua[3].a_data);
00705 else
00706 status = RPCInvalidDbId;
00707
00708 RPC_STATUS_MAKE(status, ua, 4);
00709 }
00710
00711 void
00712 OBJECT_HEADER_READ_realize(rpc_ClientId clientid, void *xua)
00713 {
00714 ServerArg *ua = (ServerArg *)xua;
00715 RPCStatus status;
00716 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00717
00718 if (dcinfo)
00719 {
00720 ObjectHeader hdr;
00721 status = IDB_objectHeaderRead((DbHandle *)dcinfo->dbh, &ua[1].a_oid, &hdr);
00722 if (status == RPCSuccess)
00723 {
00724 ua[2].a_int = hdr.type;
00725 ua[3].a_int = hdr.size;
00726 ua[4].a_int = hdr.ctime;
00727 ua[5].a_int = hdr.mtime;
00728 ua[6].a_oid = hdr.oid_cl;
00729 ua[7].a_oid = hdr.oid_prot;
00730 }
00731 }
00732 else
00733 status = RPCInvalidDbId;
00734
00735 RPC_STATUS_MAKE(status, ua, 8);
00736 }
00737
00738 void
00739 OBJECT_SIZE_MODIFY_realize(rpc_ClientId clientid, void *xua)
00740 {
00741 ServerArg *ua = (ServerArg *)xua;
00742 RPCStatus status;
00743 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00744
00745 if (dcinfo)
00746 status = IDB_objectSizeModify((DbHandle *)dcinfo->dbh, ua[1].a_int, &ua[2].a_oid);
00747 else
00748 status = RPCInvalidDbId;
00749
00750 RPC_STATUS_MAKE(status, ua, 3);
00751 }
00752
00753 void
00754 OBJECT_CHECK_realize(rpc_ClientId clientid, void *xua)
00755 {
00756 ServerArg *ua = (ServerArg *)xua;
00757 RPCStatus status;
00758 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00759
00760 if (dcinfo)
00761 status = IDB_objectCheck((DbHandle *)dcinfo->dbh, &ua[1].a_oid, &ua[2].a_int, &ua[3].a_oid);
00762 else
00763 status = RPCInvalidDbId;
00764
00765 RPC_STATUS_MAKE(status, ua, 4);
00766 }
00767
00768 void
00769 OBJECT_PROTECTION_SET_realize(rpc_ClientId clientid, void *xua)
00770 {
00771 ServerArg *ua = (ServerArg *)xua;
00772 RPCStatus status;
00773 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00774
00775 if (dcinfo)
00776 status = IDB_objectProtectionSet((DbHandle *)dcinfo->dbh, &ua[1].a_oid, &ua[2].a_oid);
00777 else
00778 status = RPCInvalidDbId;
00779
00780 RPC_STATUS_MAKE(status, ua, 3);
00781 }
00782
00783 void
00784 OBJECT_PROTECTION_GET_realize(rpc_ClientId clientid, void *xua)
00785 {
00786 ServerArg *ua = (ServerArg *)xua;
00787 RPCStatus status;
00788 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00789
00790 if (dcinfo)
00791 status = IDB_objectProtectionGet((DbHandle *)dcinfo->dbh, &ua[1].a_oid, &ua[2].a_oid);
00792 else
00793 status = RPCInvalidDbId;
00794
00795 RPC_STATUS_MAKE(status, ua, 3);
00796 }
00797
00798 void
00799 OID_MAKE_realize(rpc_ClientId clientid, void *xua)
00800 {
00801 ServerArg *ua = (ServerArg *)xua;
00802 RPCStatus status;
00803 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00804
00805 if (dcinfo) {
00806 #ifdef E_XDR
00807 ObjectHeader hdr;
00808 Offset offset = 0;
00809 object_header_decode((unsigned char *)ua[2].a_data.data, &offset, &hdr);
00810 status = IDB_oidMake((DbHandle *)dcinfo->dbh,
00811 &hdr,
00812 ua[1].a_int,
00813 ua[3].a_int, &ua[4].a_oid);
00814 #else
00815 status = IDB_oidMake((DbHandle *)dcinfo->dbh,
00816 (ObjectHeader *)ua[2].a_data.data,
00817 ua[1].a_int,
00818 ua[3].a_int, &ua[4].a_oid);
00819 #endif
00820 }
00821 else
00822 status = RPCInvalidDbId;
00823
00824 RPC_STATUS_MAKE(status, ua, 5);
00825 }
00826
00827 void
00828 DATA_CREATE_realize(rpc_ClientId clientid, void *xua)
00829 {
00830 ServerArg *ua = (ServerArg *)xua;
00831 RPCStatus status;
00832 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00833
00834 if (dcinfo)
00835 status = IDB_dataCreate((DbHandle *)dcinfo->dbh, ua[1].a_int,
00836 ua[2].a_data.size, (unsigned char *)ua[2].a_data.data,
00837 &ua[3].a_oid, &ua[2].a_data);
00838 else
00839 status = RPCInvalidDbId;
00840
00841 RPC_STATUS_MAKE(status, ua, 4);
00842 }
00843
00844 void
00845 DATA_READ_realize(rpc_ClientId clientid, void *xua)
00846 {
00847 ServerArg *ua = (ServerArg *)xua;
00848 RPCStatus status;
00849 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00850
00851 short dspid;
00852 if (dcinfo)
00853 status = IDB_dataRead((DbHandle *)dcinfo->dbh, ua[1].a_int, ua[2].a_int,
00854 (unsigned char *)ua[5].a_data.data, &dspid, &ua[4].a_oid,
00855 &ua[5].a_data);
00856 else
00857 status = RPCInvalidDbId;
00858
00859 ua[3].a_int = dspid;
00860 RPC_STATUS_MAKE(status, ua, 6);
00861 }
00862
00863 void
00864 DATA_WRITE_realize(rpc_ClientId clientid, void *xua)
00865 {
00866 ServerArg *ua = (ServerArg *)xua;
00867 RPCStatus status;
00868 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00869
00870 if (dcinfo)
00871 status = IDB_dataWrite((DbHandle *)dcinfo->dbh, ua[1].a_int, ua[2].a_data.size,
00872 (unsigned char *)ua[2].a_data.data, &ua[3].a_oid, &ua[2].a_data);
00873 else
00874 status = RPCInvalidDbId;
00875
00876 RPC_STATUS_MAKE(status, ua, 4);
00877 }
00878
00879 void
00880 DATA_DELETE_realize(rpc_ClientId clientid, void *xua)
00881 {
00882 ServerArg *ua = (ServerArg *)xua;
00883 RPCStatus status;
00884 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00885
00886 if (dcinfo)
00887 status = IDB_dataDelete((DbHandle *)dcinfo->dbh, &ua[1].a_oid);
00888 else
00889 status = RPCInvalidDbId;
00890
00891 RPC_STATUS_MAKE(status, ua, 2);
00892 }
00893
00894 void
00895 DATA_SIZE_GET_realize(rpc_ClientId clientid, void *xua)
00896 {
00897 ServerArg *ua = (ServerArg *)xua;
00898 RPCStatus status;
00899 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00900
00901 if (dcinfo)
00902 status = IDB_dataSizeGet((DbHandle *)dcinfo->dbh, &ua[1].a_oid, (unsigned int *)&ua[2].a_int);
00903 else
00904 status = RPCInvalidDbId;
00905
00906 RPC_STATUS_MAKE(status, ua, 3);
00907 }
00908
00909 void
00910 DATA_SIZE_MODIFY_realize(rpc_ClientId clientid, void *xua)
00911 {
00912 printf("coucou les lapins\n");
00913 ServerArg *ua = (ServerArg *)xua;
00914 RPCStatus status;
00915 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00916
00917 if (dcinfo)
00918 status = IDB_dataSizeModify((DbHandle *)dcinfo->dbh, ua[1].a_int, &ua[2].a_oid);
00919 else
00920 status = RPCInvalidDbId;
00921
00922 RPC_STATUS_MAKE(status, ua, 3);
00923 }
00924
00925 void
00926 VDDATA_CREATE_realize(rpc_ClientId clientid, void *xua)
00927 {
00928 ServerArg *ua = (ServerArg *)xua;
00929 RPCStatus status;
00930 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00931
00932 if (dcinfo)
00933 status = IDB_VDdataCreate((DbHandle *)dcinfo->dbh, ua[1].a_int,
00934 &ua[2].a_oid, &ua[3].a_oid,
00935 ua[4].a_int, ua[5].a_int,
00936 ua[6].a_data.size, (unsigned char *)ua[6].a_data.data,
00937 &ua[8].a_oid, &ua[9].a_oid,
00938 (unsigned char *)ua[7].a_data.data, ua[7].a_data.size,
00939 &ua[6].a_data, &ua[7].a_data);
00940 else
00941 status = RPCInvalidDbId;
00942
00943 RPC_STATUS_MAKE(status, ua, 10);
00944 }
00945
00946 void
00947 VDDATA_WRITE_realize(rpc_ClientId clientid, void *xua)
00948 {
00949 ServerArg *ua = (ServerArg *)xua;
00950 RPCStatus status;
00951 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00952
00953 if (dcinfo)
00954 status = IDB_VDdataWrite((DbHandle *)dcinfo->dbh, &ua[1].a_oid, &ua[2].a_oid,
00955 ua[3].a_int, ua[4].a_int,
00956 ua[5].a_data.size, (unsigned char *)ua[5].a_data.data,
00957 &ua[7].a_oid, &ua[8].a_oid,
00958 (unsigned char *)ua[6].a_data.data, ua[6].a_data.size,
00959 &ua[5].a_data, &ua[6].a_data);
00960 else
00961 status = RPCInvalidDbId;
00962
00963 RPC_STATUS_MAKE(status, ua, 9);
00964 }
00965
00966 void
00967 VDDATA_DELETE_realize(rpc_ClientId clientid, void *xua)
00968 {
00969 ServerArg *ua = (ServerArg *)xua;
00970 RPCStatus status;
00971 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00972
00973 if (dcinfo)
00974 status = IDB_VDdataDelete((DbHandle *)dcinfo->dbh, &ua[1].a_oid, &ua[2].a_oid,
00975 ua[3].a_int, &ua[4].a_oid, &ua[5].a_oid,
00976 (unsigned char *)ua[6].a_data.data, ua[6].a_data.size,
00977 &ua[6].a_data);
00978 else
00979 status = RPCInvalidDbId;
00980
00981 RPC_STATUS_MAKE(status, ua, 7);
00982 }
00983
00984 void
00985 ATTRIBUTE_INDEX_CREATE_realize(rpc_ClientId clientid, void *xua)
00986 {
00987 ServerArg *ua = (ServerArg *)xua;
00988 RPCStatus status;
00989 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
00990
00991 if (dcinfo)
00992 status = IDB_attributeIndexCreate((DbHandle *)dcinfo->dbh, &ua[1].a_oid,
00993 ua[2].a_int, ua[3].a_int, &ua[4].a_oid,
00994 (unsigned char *)ua[5].a_data.data,
00995 ua[5].a_data.size, &ua[5].a_data);
00996 else
00997 status = RPCInvalidDbId;
00998
00999 RPC_STATUS_MAKE(status, ua, 6);
01000 }
01001
01002 void
01003 CONSTRAINT_CREATE_realize(rpc_ClientId clientid, void *xua)
01004 {
01005 ServerArg *ua = (ServerArg *)xua;
01006 RPCStatus status;
01007 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01008
01009 if (dcinfo)
01010 status = IDB_constraintCreate((DbHandle *)dcinfo->dbh, &ua[1].a_oid);
01011 else
01012 status = RPCInvalidDbId;
01013
01014 RPC_STATUS_MAKE(status, ua, 2);
01015 }
01016
01017 void
01018 CONSTRAINT_DELETE_realize(rpc_ClientId clientid, void *xua)
01019 {
01020 ServerArg *ua = (ServerArg *)xua;
01021 RPCStatus status;
01022 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01023
01024 if (dcinfo)
01025 status = IDB_constraintDelete((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int);
01026 else
01027 status = RPCInvalidDbId;
01028
01029 RPC_STATUS_MAKE(status, ua, 3);
01030 }
01031
01032 void
01033 SCHEMA_COMPLETE_realize(rpc_ClientId clientid, void *xua)
01034 {
01035 ServerArg *ua = (ServerArg *)xua;
01036 RPCStatus status;
01037 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01038
01039 if (dcinfo)
01040 status = IDB_schemaComplete((DbHandle *)dcinfo->dbh, ua[1].a_string);
01041 else
01042 status = RPCInvalidDbId;
01043
01044 RPC_STATUS_MAKE(status, ua, 2);
01045 }
01046
01047 void
01048 ATTRIBUTE_INDEX_REMOVE_realize(rpc_ClientId clientid, void *xua)
01049 {
01050 ServerArg *ua = (ServerArg *)xua;
01051 RPCStatus status;
01052 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01053
01054 if (dcinfo)
01055 status = IDB_attributeIndexRemove((DbHandle *)dcinfo->dbh, &ua[1].a_oid,
01056 ua[2].a_int, ua[3].a_int,
01057 (unsigned char *)ua[4].a_data.data,
01058 ua[4].a_data.size, &ua[4].a_data);
01059 else
01060 status = RPCInvalidDbId;
01061
01062 RPC_STATUS_MAKE(status, ua, 5);
01063 }
01064
01065 void
01066 INDEX_CREATE_realize(rpc_ClientId clientid, void *xua)
01067 {
01068 ServerArg *ua = (ServerArg *)xua;
01069 RPCStatus status;
01070 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01071
01072 if (dcinfo)
01073 status = IDB_indexCreate((DbHandle *)dcinfo->dbh, ua[1].a_int, &ua[2].a_oid);
01074 else
01075 status = RPCInvalidDbId;
01076
01077 RPC_STATUS_MAKE(status, ua, 3);
01078 }
01079
01080 void
01081 INDEX_REMOVE_realize(rpc_ClientId clientid, void *xua)
01082 {
01083 ServerArg *ua = (ServerArg *)xua;
01084 RPCStatus status;
01085 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01086
01087 if (dcinfo)
01088 status = IDB_indexRemove((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int);
01089 else
01090 status = RPCInvalidDbId;
01091
01092 RPC_STATUS_MAKE(status, ua, 3);
01093 }
01094
01095 void
01096 COLLECTION_GET_BY_IND_realize(rpc_ClientId clientid, void *xua)
01097 {
01098 ServerArg *ua = (ServerArg *)xua;
01099 RPCStatus status;
01100 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01101
01102 if (dcinfo)
01103 status = IDB_collectionGetByInd((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int,
01104 &ua[3].a_int, 0, &ua[4].a_data);
01105 else
01106 status = RPCInvalidDbId;
01107
01108 RPC_STATUS_MAKE(status, ua, 5);
01109 }
01110
01111 void
01112 COLLECTION_GET_BY_VALUE_realize(rpc_ClientId clientid, void *xua)
01113 {
01114 ServerArg *ua = (ServerArg *)xua;
01115 RPCStatus status;
01116 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01117
01118 if (dcinfo)
01119 status = IDB_collectionGetByValue((DbHandle *)dcinfo->dbh, &ua[1].a_oid, (unsigned char *)ua[2].a_data.data,
01120 &ua[3].a_int, &ua[4].a_int);
01121 else
01122 status = RPCInvalidDbId;
01123
01124 RPC_STATUS_MAKE(status, ua, 5);
01125 }
01126
01127 void
01128 SET_OBJECT_LOCK_realize(rpc_ClientId clientid, void *xua)
01129 {
01130 ServerArg *ua = (ServerArg *)xua;
01131 RPCStatus status;
01132 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01133
01134 if (dcinfo)
01135 status = IDB_setObjectLock((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int, &ua[3].a_int);
01136 else
01137 status = RPCInvalidDbId;
01138
01139 RPC_STATUS_MAKE(status, ua, 4);
01140 }
01141
01142 void
01143 GET_OBJECT_LOCK_realize(rpc_ClientId clientid, void *xua)
01144 {
01145 ServerArg *ua = (ServerArg *)xua;
01146 RPCStatus status;
01147 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01148
01149 if (dcinfo)
01150 status = IDB_getObjectLock((DbHandle *)dcinfo->dbh, &ua[1].a_oid, &ua[2].a_int);
01151 else
01152 status = RPCInvalidDbId;
01153
01154 RPC_STATUS_MAKE(status, ua, 3);
01155 }
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206 void
01207 QUERY_COLLECTION_CREATE_realize(rpc_ClientId clientid, void *xua)
01208 {
01209 ServerArg *ua = (ServerArg *)xua;
01210 RPCStatus status;
01211 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01212
01213 if (dcinfo)
01214 status = IDB_queryCollectionCreate((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int,
01215 &ua[3].a_int);
01216 else
01217 status = RPCInvalidDbId;
01218
01219 RPC_STATUS_MAKE(status, ua, 4);
01220 }
01221
01222 void
01223 QUERY_ATTRIBUTE_CREATE_realize(rpc_ClientId clientid, void *xua)
01224 {
01225 ServerArg *ua = (ServerArg *)xua;
01226 RPCStatus status;
01227 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01228
01229 if (dcinfo)
01230 status = IDB_queryAttributeCreate((DbHandle *)dcinfo->dbh, &ua[1].a_oid,
01231 ua[2].a_int,
01232 ua[3].a_int,
01233 (unsigned char *)ua[4].a_data.data,
01234 (unsigned char *)ua[5].a_data.data,
01235 ua[6].a_int,
01236 ua[7].a_int,
01237 ua[4].a_data.size,
01238 &ua[8].a_int);
01239 else
01240 status = RPCInvalidDbId;
01241
01242 RPC_STATUS_MAKE(status, ua, 9);
01243 }
01244
01245 void
01246 QUERY_DELETE_realize(rpc_ClientId clientid, void *xua)
01247 {
01248 ServerArg *ua = (ServerArg *)xua;
01249 RPCStatus status;
01250 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01251
01252 if (dcinfo)
01253 status = IDB_queryDelete((DbHandle *)dcinfo->dbh, ua[1].a_int);
01254 else
01255 status = RPCInvalidDbId;
01256
01257 RPC_STATUS_MAKE(status, ua, 2);
01258 }
01259
01260 void
01261 QUERY_SCAN_NEXT_realize(rpc_ClientId clientid, void *xua)
01262 {
01263 ServerArg *ua = (ServerArg *)xua;
01264 RPCStatus status;
01265 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01266
01267 if (dcinfo)
01268 status = IDB_queryScanNext((DbHandle *)dcinfo->dbh, ua[1].a_int, ua[2].a_int,
01269 &ua[3].a_int, 0, &ua[4].a_data);
01270 else
01271 status = RPCInvalidDbId;
01272
01273 RPC_STATUS_MAKE(status, ua, 5);
01274 }
01275
01276
01277
01278 void
01279 OQL_CREATE_realize(rpc_ClientId clientid, void *xua)
01280 {
01281 ServerArg *ua = (ServerArg *)xua;
01282 RPCStatus status = 0;
01283 rpcDB_DbHandleClientInfo *dcinfo;
01284 DbHandle *dbh;
01285
01286 if (ua[0].a_int)
01287 {
01288 dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01289 if (dcinfo)
01290 dbh = (DbHandle *)dcinfo->dbh;
01291 else
01292 status = RPCInvalidDbId;
01293 }
01294 else
01295 dbh = 0;
01296
01297 if (!status)
01298 status = IDB_oqlCreate(dbh, (const char *)ua[1].a_data.data, &ua[2].a_int,
01299 0, &ua[1].a_data, &ua[3].a_data);
01300
01301 RPC_STATUS_MAKE(status, ua, 4);
01302 }
01303
01304 void
01305 OQL_DELETE_realize(rpc_ClientId clientid, void *xua)
01306 {
01307 ServerArg *ua = (ServerArg *)xua;
01308 RPCStatus status = 0;
01309 rpcDB_DbHandleClientInfo *dcinfo;
01310 DbHandle *dbh;
01311
01312 if (ua[0].a_int)
01313 {
01314 dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01315 if (dcinfo)
01316 dbh = (DbHandle *)dcinfo->dbh;
01317 else
01318 status = RPCInvalidDbId;
01319 }
01320 else
01321 dbh = 0;
01322
01323 if (!status)
01324 status = IDB_oqlDelete(dbh, ua[1].a_int);
01325
01326 RPC_STATUS_MAKE(status, ua, 2);
01327 }
01328
01329 void
01330 OQL_GETRESULT_realize(rpc_ClientId clientid, void *xua)
01331 {
01332 ServerArg *ua = (ServerArg *)xua;
01333 RPCStatus status = 0;
01334 rpcDB_DbHandleClientInfo *dcinfo;
01335 DbHandle *dbh;
01336
01337 if (ua[0].a_int)
01338 {
01339 dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01340 if (dcinfo)
01341 dbh = (DbHandle *)dcinfo->dbh;
01342 else
01343 status = RPCInvalidDbId;
01344 }
01345 else
01346 dbh = 0;
01347
01348 if (!status)
01349 status = IDB_oqlGetResult(dbh, ua[1].a_int, 0, &ua[2].a_data);
01350
01351 RPC_STATUS_MAKE(status, ua, 3);
01352 }
01353
01354
01355 void
01356 EXECUTABLE_CHECK_realize(rpc_ClientId clientid, void *xua)
01357 {
01358 ServerArg *ua = (ServerArg *)xua;
01359 RPCStatus status;
01360 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01361
01362 if (dcinfo)
01363 status = IDB_execCheck((DbHandle *)dcinfo->dbh, ua[1].a_string, &ua[2].a_oid,
01364 ua[3].a_string);
01365 else
01366 status = RPCInvalidDbId;
01367
01368 RPC_STATUS_MAKE(status, ua, 4);
01369 }
01370
01371 void
01372 EXECUTABLE_EXECUTE_realize(rpc_ClientId clientid, void *xua)
01373 {
01374 ServerArg *ua = (ServerArg *)xua;
01375 RPCStatus status;
01376 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01377
01378 if (dcinfo)
01379 status = IDB_execExecute((DbHandle *)dcinfo->dbh,
01380 ua[1].a_string,
01381 ua[2].a_string,
01382 ua[3].a_string,
01383 ua[4].a_string,
01384 ua[5].a_int,
01385 &ua[6].a_oid,
01386 ua[7].a_string,
01387 0, &ua[8].a_data,
01388 &ua[9].a_oid,
01389 &ua[10].a_oid,
01390 0,
01391 0, &ua[11].a_data,
01392 0, &ua[12].a_data);
01393 else
01394 status = RPCInvalidDbId;
01395
01396 RPC_STATUS_MAKE(status, ua, 13);
01397 }
01398
01399 void
01400 EXECUTABLE_SET_EXTREF_PATH_realize(rpc_ClientId clientid, void *xua)
01401 {
01402 ServerArg *ua = (ServerArg *)xua;
01403 RPCStatus status;
01404
01405 status = IDB_execSetExtRefPath(ua[0].a_string, ua[1].a_string,
01406 ua[2].a_string);
01407
01408 RPC_STATUS_MAKE(status, ua, 3);
01409 }
01410
01411 void
01412 EXECUTABLE_GET_EXTREF_PATH_realize(rpc_ClientId clientid, void *xua)
01413 {
01414 ServerArg *ua = (ServerArg *)xua;
01415 RPCStatus status;
01416
01417 status = IDB_execGetExtRefPath(ua[0].a_string, ua[1].a_string,
01418 &ua[2].a_data, 0);
01419
01420 RPC_STATUS_MAKE(status, ua, 3);
01421 }
01422
01423 void
01424 SET_CONN_INFO_realize(rpc_ClientId clientid, void *xua)
01425 {
01426 ServerArg *ua = (ServerArg *)xua;
01427 RPCStatus status;
01428
01429 status = IDB_setConnInfo(ua[0].a_string, ua[1].a_int, ua[2].a_string,
01430 ua[3].a_string,
01431 ua[4].a_int, &ua[5].a_int, &ua[6].a_int,
01432 ua[7].a_int, &ua[8].a_string);
01433 if (status)
01434 forbidden = 1;
01435
01436 RPC_STATUS_MAKE(status, ua, 9);
01437 }
01438
01439 void
01440 CHECK_AUTH_realize(rpc_ClientId clientid, void *xua)
01441 {
01442 ServerArg *ua = (ServerArg *)xua;
01443 RPCStatus status;
01444
01445 status = IDB_checkAuth(ua[0].a_string);
01446
01447 RPC_STATUS_MAKE(status, ua, 1);
01448 }
01449
01450 void
01451 SET_LOG_MASK_realize(rpc_ClientId clientid, void *xua)
01452 {
01453 ServerArg *ua = (ServerArg *)xua;
01454 RPCStatus status;
01455
01456 status = IDB_setLogMask(ua[0].a_int64);
01457
01458 RPC_STATUS_MAKE(status, ua, 1);
01459 }
01460
01461 void
01462 INDEX_GET_COUNT_realize(rpc_ClientId clientid, void *xua)
01463 {
01464 ServerArg *ua = (ServerArg *)xua;
01465 RPCStatus status;
01466 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01467
01468 if (dcinfo)
01469 status = IDB_indexGetCount((DbHandle *)dcinfo->dbh, &ua[1].a_oid, &ua[2].a_int);
01470 else
01471 status = RPCInvalidDbId;
01472
01473 RPC_STATUS_MAKE(status, ua, 3);
01474 }
01475
01476 void
01477 INDEX_GET_STATS_realize(rpc_ClientId clientid, void *xua)
01478 {
01479 ServerArg *ua = (ServerArg *)xua;
01480 RPCStatus status;
01481 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01482
01483 if (dcinfo)
01484 status = IDB_indexGetStats((DbHandle *)dcinfo->dbh, &ua[1].a_oid,
01485 (unsigned char **)ua[2].a_data.data, &ua[2].a_data);
01486 else
01487 status = RPCInvalidDbId;
01488
01489 RPC_STATUS_MAKE(status, ua, 3);
01490 }
01491
01492 void
01493 INDEX_SIMUL_STATS_realize(rpc_ClientId clientid, void *xua)
01494 {
01495 ServerArg *ua = (ServerArg *)xua;
01496 RPCStatus status;
01497 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01498
01499 if (dcinfo)
01500 status = IDB_indexSimulStats((DbHandle *)dcinfo->dbh, &ua[1].a_oid,
01501 (unsigned char *)ua[2].a_data.data, &ua[2].a_data,
01502 (unsigned char **)ua[3].a_data.data, &ua[3].a_data);
01503 else
01504 status = RPCInvalidDbId;
01505
01506 RPC_STATUS_MAKE(status, ua, 4);
01507 }
01508
01509 void
01510 COLLECTION_GET_IMPLSTATS_realize(rpc_ClientId clientid, void *xua)
01511 {
01512 ServerArg *ua = (ServerArg *)xua;
01513 RPCStatus status;
01514 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01515
01516 if (dcinfo)
01517 status = IDB_collectionGetImplStats((DbHandle *)dcinfo->dbh, ua[1].a_int, &ua[2].a_oid,
01518 (unsigned char **)ua[3].a_data.data, &ua[3].a_data);
01519 else
01520 status = RPCInvalidDbId;
01521
01522 RPC_STATUS_MAKE(status, ua, 4);
01523 }
01524
01525 void
01526 COLLECTION_SIMUL_IMPLSTATS_realize(rpc_ClientId clientid, void *xua)
01527 {
01528 ServerArg *ua = (ServerArg *)xua;
01529 RPCStatus status;
01530 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01531
01532 if (dcinfo)
01533 status = IDB_collectionSimulImplStats((DbHandle *)dcinfo->dbh, ua[1].a_int,
01534 &ua[2].a_oid,
01535 (unsigned char *)ua[3].a_data.data, &ua[3].a_data,
01536 (unsigned char **)ua[4].a_data.data, &ua[4].a_data);
01537 else
01538 status = RPCInvalidDbId;
01539
01540 RPC_STATUS_MAKE(status, ua, 5);
01541 }
01542
01543 void
01544 INDEX_GET_IMPL_realize(rpc_ClientId clientid, void *xua)
01545 {
01546 ServerArg *ua = (ServerArg *)xua;
01547 RPCStatus status;
01548 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01549
01550 if (dcinfo)
01551 status = IDB_indexGetImplementation((DbHandle *)dcinfo->dbh, &ua[1].a_oid, 0, &ua[2].a_data);
01552 else
01553 status = RPCInvalidDbId;
01554
01555 RPC_STATUS_MAKE(status, ua, 3);
01556 }
01557
01558 void
01559 COLLECTION_GET_IMPL_realize(rpc_ClientId clientid, void *xua)
01560 {
01561 ServerArg *ua = (ServerArg *)xua;
01562 RPCStatus status;
01563 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01564
01565 if (dcinfo)
01566 status = IDB_collectionGetImplementation((DbHandle *)dcinfo->dbh, ua[1].a_int, &ua[2].a_oid, 0, &ua[3].a_data);
01567 else
01568 status = RPCInvalidDbId;
01569
01570 RPC_STATUS_MAKE(status, ua, 4);
01571 }
01572
01573 void
01574 GET_DEFAULT_DATASPACE_realize(rpc_ClientId clientid, void *xua)
01575 {
01576 ServerArg *ua = (ServerArg *)xua;
01577 RPCStatus status;
01578 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01579
01580 if (dcinfo)
01581 status = IDB_getDefaultDataspace((DbHandle *)dcinfo->dbh, &ua[1].a_int);
01582 else
01583 status = RPCInvalidDbId;
01584
01585 RPC_STATUS_MAKE(status, ua, 2);
01586 }
01587
01588 void
01589 SET_DEFAULT_DATASPACE_realize(rpc_ClientId clientid, void *xua)
01590 {
01591 ServerArg *ua = (ServerArg *)xua;
01592 RPCStatus status;
01593 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01594
01595 if (dcinfo)
01596 status = IDB_setDefaultDataspace((DbHandle *)dcinfo->dbh, ua[1].a_int);
01597 else
01598 status = RPCInvalidDbId;
01599
01600 RPC_STATUS_MAKE(status, ua, 2);
01601 }
01602
01603 void
01604 DATASPACE_SET_CURRENT_DATAFILE_realize(rpc_ClientId clientid, void *xua)
01605 {
01606 ServerArg *ua = (ServerArg *)xua;
01607 RPCStatus status;
01608 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01609
01610 if (dcinfo)
01611 status = IDB_dataspaceSetCurrentDatafile((DbHandle *)dcinfo->dbh, ua[1].a_int, ua[2].a_int);
01612 else
01613 status = RPCInvalidDbId;
01614
01615 RPC_STATUS_MAKE(status, ua, 3);
01616 }
01617
01618 void
01619 DATASPACE_GET_CURRENT_DATAFILE_realize(rpc_ClientId clientid, void *xua)
01620 {
01621 ServerArg *ua = (ServerArg *)xua;
01622 RPCStatus status;
01623 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01624
01625 if (dcinfo)
01626 status = IDB_dataspaceGetCurrentDatafile((DbHandle *)dcinfo->dbh, ua[1].a_int, &ua[2].a_int);
01627 else
01628 status = RPCInvalidDbId;
01629
01630 RPC_STATUS_MAKE(status, ua, 3);
01631 }
01632
01633 void
01634 GET_DEFAULT_INDEX_DATASPACE_realize(rpc_ClientId clientid, void *xua)
01635 {
01636 ServerArg *ua = (ServerArg *)xua;
01637 RPCStatus status;
01638 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01639
01640 if (dcinfo)
01641 status = IDB_getDefaultIndexDataspace((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int, &ua[3].a_int);
01642 else
01643 status = RPCInvalidDbId;
01644
01645 RPC_STATUS_MAKE(status, ua, 4);
01646 }
01647
01648 void
01649 SET_DEFAULT_INDEX_DATASPACE_realize(rpc_ClientId clientid, void *xua)
01650 {
01651 ServerArg *ua = (ServerArg *)xua;
01652 RPCStatus status;
01653 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01654
01655 if (dcinfo)
01656 status = IDB_setDefaultIndexDataspace((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int, ua[3].a_int);
01657 else
01658 status = RPCInvalidDbId;
01659
01660 RPC_STATUS_MAKE(status, ua, 4);
01661 }
01662
01663 void
01664 GET_INDEX_LOCATIONS_realize(rpc_ClientId clientid, void *xua)
01665 {
01666 ServerArg *ua = (ServerArg *)xua;
01667 RPCStatus status;
01668 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01669
01670 if (dcinfo)
01671 status = IDB_getIndexLocations((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int,
01672 (unsigned char **)ua[3].a_data.data, &ua[3].a_data);
01673 else
01674 status = RPCInvalidDbId;
01675
01676 RPC_STATUS_MAKE(status, ua, 4);
01677 }
01678
01679 void
01680 MOVE_INDEX_realize(rpc_ClientId clientid, void *xua)
01681 {
01682 ServerArg *ua = (ServerArg *)xua;
01683 RPCStatus status;
01684 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01685
01686 if (dcinfo)
01687 status = IDB_moveIndex((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int, ua[3].a_int);
01688 else
01689 status = RPCInvalidDbId;
01690
01691 RPC_STATUS_MAKE(status, ua, 4);
01692 }
01693
01694 void
01695 GET_INSTANCE_CLASS_LOCATIONS_realize(rpc_ClientId clientid, void *xua)
01696 {
01697 ServerArg *ua = (ServerArg *)xua;
01698 RPCStatus status;
01699 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01700
01701 if (dcinfo)
01702 status = IDB_getInstanceClassLocations((DbHandle *)dcinfo->dbh, &ua[1].a_oid,
01703 ua[2].a_int,
01704 (unsigned char **)ua[3].a_data.data, &ua[3].a_data);
01705 else
01706 status = RPCInvalidDbId;
01707
01708 RPC_STATUS_MAKE(status, ua, 4);
01709 }
01710
01711 void
01712 MOVE_INSTANCE_CLASS_realize(rpc_ClientId clientid, void *xua)
01713 {
01714 ServerArg *ua = (ServerArg *)xua;
01715 RPCStatus status;
01716 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01717
01718 if (dcinfo)
01719 status = IDB_moveInstanceClass((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int,
01720 ua[3].a_int);
01721 else
01722 status = RPCInvalidDbId;
01723
01724 RPC_STATUS_MAKE(status, ua, 4);
01725 }
01726
01727 void
01728 GET_OBJECTS_LOCATIONS_realize(rpc_ClientId clientid, void *xua)
01729 {
01730 ServerArg *ua = (ServerArg *)xua;
01731 RPCStatus status;
01732 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01733
01734 if (dcinfo)
01735 status = IDB_getObjectsLocations((DbHandle *)dcinfo->dbh,
01736 (eyedbsm::Oid *)ua[1].a_data.data,
01737 0,
01738 &ua[1].a_data,
01739 (unsigned char **)ua[2].a_data.data,
01740 &ua[2].a_data);
01741 else
01742 status = RPCInvalidDbId;
01743
01744 RPC_STATUS_MAKE(status, ua, 3);
01745 }
01746
01747 void
01748 MOVE_OBJECTS_realize(rpc_ClientId clientid, void *xua)
01749 {
01750 ServerArg *ua = (ServerArg *)xua;
01751 RPCStatus status;
01752 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01753
01754 if (dcinfo)
01755 status = IDB_moveObjects((DbHandle *)dcinfo->dbh,
01756 (const eyedbsm::Oid *)ua[1].a_data.data,
01757 0,
01758 ua[2].a_int,
01759 &ua[1].a_data);
01760 else
01761 status = RPCInvalidDbId;
01762
01763 RPC_STATUS_MAKE(status, ua, 3);
01764 }
01765
01766 void
01767 GET_ATTRIBUTE_LOCATIONS_realize(rpc_ClientId clientid, void *xua)
01768 {
01769 ServerArg *ua = (ServerArg *)xua;
01770 RPCStatus status;
01771 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01772
01773 if (dcinfo)
01774 status = IDB_getAttributeLocations((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int,
01775 (unsigned char **)ua[3].a_data.data, &ua[3].a_data);
01776 else
01777 status = RPCInvalidDbId;
01778
01779 RPC_STATUS_MAKE(status, ua, 4);
01780 }
01781
01782 void
01783 MOVE_ATTRIBUTE_realize(rpc_ClientId clientid, void *xua)
01784 {
01785 ServerArg *ua = (ServerArg *)xua;
01786 RPCStatus status;
01787 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01788
01789 if (dcinfo)
01790 status = IDB_moveAttribute((DbHandle *)dcinfo->dbh, &ua[1].a_oid, ua[2].a_int, ua[3].a_int);
01791 else
01792 status = RPCInvalidDbId;
01793
01794 RPC_STATUS_MAKE(status, ua, 4);
01795 }
01796
01797 void
01798 CREATE_DATAFILE_realize(rpc_ClientId clientid, void *xua)
01799 {
01800 ServerArg *ua = (ServerArg *)xua;
01801 RPCStatus status;
01802 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01803
01804 if (dcinfo)
01805 status = IDB_createDatafile((DbHandle *)dcinfo->dbh, ua[1].a_string, ua[2].a_string, ua[3].a_int, ua[4].a_int, ua[5].a_int);
01806 else
01807 status = RPCInvalidDbId;
01808
01809 RPC_STATUS_MAKE(status, ua, 6);
01810 }
01811
01812 void
01813 DELETE_DATAFILE_realize(rpc_ClientId clientid, void *xua)
01814 {
01815 ServerArg *ua = (ServerArg *)xua;
01816 RPCStatus status;
01817 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01818
01819 if (dcinfo)
01820 status = IDB_deleteDatafile((DbHandle *)dcinfo->dbh, ua[1].a_int);
01821 else
01822 status = RPCInvalidDbId;
01823
01824 RPC_STATUS_MAKE(status, ua, 2);
01825 }
01826
01827 void
01828 MOVE_DATAFILE_realize(rpc_ClientId clientid, void *xua)
01829 {
01830 ServerArg *ua = (ServerArg *)xua;
01831 RPCStatus status;
01832 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01833
01834 if (dcinfo)
01835 status = IDB_moveDatafile((DbHandle *)dcinfo->dbh, ua[1].a_int, ua[2].a_string);
01836 else
01837 status = RPCInvalidDbId;
01838
01839 RPC_STATUS_MAKE(status, ua, 3);
01840 }
01841
01842 void
01843 DEFRAGMENT_DATAFILE_realize(rpc_ClientId clientid, void *xua)
01844 {
01845 ServerArg *ua = (ServerArg *)xua;
01846 RPCStatus status;
01847 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01848
01849 if (dcinfo)
01850 status = IDB_defragmentDatafile((DbHandle *)dcinfo->dbh, ua[1].a_int);
01851 else
01852 status = RPCInvalidDbId;
01853
01854 RPC_STATUS_MAKE(status, ua, 2);
01855 }
01856
01857 void
01858 RESIZE_DATAFILE_realize(rpc_ClientId clientid, void *xua)
01859 {
01860 ServerArg *ua = (ServerArg *)xua;
01861 RPCStatus status;
01862 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01863
01864 if (dcinfo)
01865 status = IDB_resizeDatafile((DbHandle *)dcinfo->dbh, ua[1].a_int, ua[2].a_int);
01866 else
01867 status = RPCInvalidDbId;
01868
01869 RPC_STATUS_MAKE(status, ua, 3);
01870 }
01871
01872 void
01873 GET_DATAFILEI_NFO_realize(rpc_ClientId clientid, void *xua)
01874 {
01875 ServerArg *ua = (ServerArg *)xua;
01876 RPCStatus status;
01877 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01878
01879 if (dcinfo)
01880 status = IDB_getDatafileInfo((DbHandle *)dcinfo->dbh, ua[1].a_int, (unsigned char **)ua[2].a_data.data,
01881 &ua[2].a_data);
01882 else
01883 status = RPCInvalidDbId;
01884
01885 RPC_STATUS_MAKE(status, ua, 3);
01886 }
01887
01888 void
01889 RENAME_DATAFILE_realize(rpc_ClientId clientid, void *xua)
01890 {
01891 ServerArg *ua = (ServerArg *)xua;
01892 RPCStatus status;
01893 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01894
01895 if (dcinfo)
01896 status = IDB_renameDatafile((DbHandle *)dcinfo->dbh, ua[1].a_int, ua[2].a_string);
01897 else
01898 status = RPCInvalidDbId;
01899
01900 RPC_STATUS_MAKE(status, ua, 3);
01901 }
01902
01903 void
01904 CREATE_DATASPACE_realize(rpc_ClientId clientid, void *xua)
01905 {
01906 ServerArg *ua = (ServerArg *)xua;
01907 RPCStatus status;
01908 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01909
01910 if (dcinfo)
01911 status = IDB_createDataspace((DbHandle *)dcinfo->dbh, ua[1].a_string,
01912 (void *)ua[2].a_data.data, 0, &ua[2].a_data);
01913 else
01914 status = RPCInvalidDbId;
01915
01916 RPC_STATUS_MAKE(status, ua, 3);
01917 }
01918
01919 void
01920 UPDATE_DATASPACE_realize(rpc_ClientId clientid, void *xua)
01921 {
01922 ServerArg *ua = (ServerArg *)xua;
01923 RPCStatus status;
01924 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01925
01926 if (dcinfo)
01927 status = IDB_updateDataspace((DbHandle *)dcinfo->dbh, ua[1].a_int,
01928 (void *)ua[2].a_data.data, 0, &ua[2].a_data,
01929 ua[3].a_int, ua[4].a_int);
01930 else
01931 status = RPCInvalidDbId;
01932
01933 RPC_STATUS_MAKE(status, ua, 5);
01934 }
01935
01936 void
01937 DELETE_DATASPACE_realize(rpc_ClientId clientid, void *xua)
01938 {
01939 ServerArg *ua = (ServerArg *)xua;
01940 RPCStatus status;
01941 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01942
01943 if (dcinfo)
01944 status = IDB_deleteDataspace((DbHandle *)dcinfo->dbh, ua[1].a_int);
01945 else
01946 status = RPCInvalidDbId;
01947
01948 RPC_STATUS_MAKE(status, ua, 2);
01949 }
01950
01951 void
01952 RENAME_DATASPACE_realize(rpc_ClientId clientid, void *xua)
01953 {
01954 ServerArg *ua = (ServerArg *)xua;
01955 RPCStatus status;
01956 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01957
01958 if (dcinfo)
01959 status = IDB_renameDataspace((DbHandle *)dcinfo->dbh, ua[1].a_int, ua[2].a_string);
01960 else
01961 status = RPCInvalidDbId;
01962
01963 RPC_STATUS_MAKE(status, ua, 3);
01964 }
01965
01966 void
01967 SET_MAXOBJCOUNT_realize(rpc_ClientId clientid, void *xua)
01968 {
01969 ServerArg *ua = (ServerArg *)xua;
01970 RPCStatus status;
01971 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01972
01973 if (dcinfo)
01974 status = IDB_setMaxObjCount((DbHandle *)dcinfo->dbh, ua[1].a_int);
01975 else
01976 status = RPCInvalidDbId;
01977
01978 RPC_STATUS_MAKE(status, ua, 2);
01979 }
01980
01981 void
01982 GET_MAXOBJCOUNT_realize(rpc_ClientId clientid, void *xua)
01983 {
01984 ServerArg *ua = (ServerArg *)xua;
01985 RPCStatus status;
01986 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
01987
01988 if (dcinfo)
01989 status = IDB_getMaxObjCount((DbHandle *)dcinfo->dbh, &ua[1].a_int);
01990 else
01991 status = RPCInvalidDbId;
01992
01993 RPC_STATUS_MAKE(status, ua, 2);
01994 }
01995
01996 void
01997 SET_LOGSIZE_realize(rpc_ClientId clientid, void *xua)
01998 {
01999 ServerArg *ua = (ServerArg *)xua;
02000 RPCStatus status;
02001 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
02002
02003 if (dcinfo)
02004 status = IDB_setLogSize((DbHandle *)dcinfo->dbh, ua[1].a_int);
02005 else
02006 status = RPCInvalidDbId;
02007
02008 RPC_STATUS_MAKE(status, ua, 2);
02009 }
02010
02011 void
02012 GET_LOGSIZE_realize(rpc_ClientId clientid, void *xua)
02013 {
02014 ServerArg *ua = (ServerArg *)xua;
02015 RPCStatus status;
02016 rpcDB_DbHandleClientInfo *dcinfo = rpcDB_clientDbhGet(clientid, ua[0].a_int);
02017
02018 if (dcinfo)
02019 status = IDB_getLogSize((DbHandle *)dcinfo->dbh, &ua[1].a_int);
02020 else
02021 status = RPCInvalidDbId;
02022
02023 RPC_STATUS_MAKE(status, ua, 2);
02024 }
02025
02026 void
02027 GARBAGE()
02028 {
02029 RPCStatus status;
02030
02031 rpcDB_close_realize(0, rpc_client_id, 0,
02032 close_realize, (void **)&status);
02033 }
02034 }