00001 #include "db_config.h"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SWIGTEMPLATEDISAMBIGUATOR
00021 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
00022 # define SWIGTEMPLATEDISAMBIGUATOR template
00023 # else
00024 # define SWIGTEMPLATEDISAMBIGUATOR
00025 # endif
00026 #endif
00027
00028
00029 #ifndef SWIGINLINE
00030 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
00031 # define SWIGINLINE inline
00032 # else
00033 # define SWIGINLINE
00034 # endif
00035 #endif
00036
00037
00038 #ifndef SWIGUNUSED
00039 # if defined(__GNUC__) || defined(__ICC)
00040 # define SWIGUNUSED __attribute__ ((unused))
00041 # else
00042 # define SWIGUNUSED
00043 # endif
00044 #endif
00045
00046
00047 #ifndef SWIGINTERN
00048 # define SWIGINTERN static SWIGUNUSED
00049 #endif
00050
00051
00052 #ifndef SWIGINTERNINLINE
00053 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
00054 #endif
00055
00056
00057 #ifndef SWIGEXPORT
00058 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00059 # if defined(STATIC_LINKED)
00060 # define SWIGEXPORT
00061 # else
00062 # define SWIGEXPORT __declspec(dllexport)
00063 # endif
00064 # else
00065 # define SWIGEXPORT
00066 # endif
00067 #endif
00068
00069
00070 #ifndef SWIGSTDCALL
00071 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00072 # define SWIGSTDCALL __stdcall
00073 # else
00074 # define SWIGSTDCALL
00075 # endif
00076 #endif
00077
00078
00079
00080 #if defined(__GNUC__)
00081 typedef long long __int64;
00082 #endif
00083
00084
00085 #if defined(__x86_64)
00086 #ifdef _LP64
00087 #undef _LP64
00088 #endif
00089 #endif
00090
00091 #include <jni.h>
00092 #include <stdlib.h>
00093 #include <string.h>
00094
00095
00096
00097 typedef enum {
00098 SWIG_JavaOutOfMemoryError = 1,
00099 SWIG_JavaIOException,
00100 SWIG_JavaRuntimeException,
00101 SWIG_JavaIndexOutOfBoundsException,
00102 SWIG_JavaArithmeticException,
00103 SWIG_JavaIllegalArgumentException,
00104 SWIG_JavaNullPointerException,
00105 SWIG_JavaDirectorPureVirtual,
00106 SWIG_JavaUnknownError
00107 } SWIG_JavaExceptionCodes;
00108
00109 typedef struct {
00110 SWIG_JavaExceptionCodes code;
00111 const char *java_exception;
00112 } SWIG_JavaExceptions_t;
00113
00114
00115 static void SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
00116 jclass excep;
00117 static const SWIG_JavaExceptions_t java_exceptions[] = {
00118 { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
00119 { SWIG_JavaIOException, "java/io/IOException" },
00120 { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
00121 { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
00122 { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
00123 { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
00124 { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
00125 { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
00126 { SWIG_JavaUnknownError, "java/lang/UnknownError" },
00127 { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } };
00128 const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
00129
00130 while (except_ptr->code != code && except_ptr->code)
00131 except_ptr++;
00132
00133 (*jenv)->ExceptionClear(jenv);
00134 excep = (*jenv)->FindClass(jenv, except_ptr->java_exception);
00135 if (excep)
00136 (*jenv)->ThrowNew(jenv, excep, msg);
00137 }
00138
00139
00140
00141
00142 #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
00143
00144
00145 #include "db_int.h"
00146 #include "dbinc/txn.h"
00147
00148 #ifdef HAVE_CRYPTO
00149 #define CRYPTO_ONLY(x) (x);
00150 #else
00151 #define CRYPTO_ONLY(x)
00152 #endif
00153
00154
00155
00156 #define SWIG_NOINCLUDE 1
00157
00158 #define DB_ENV_INTERNAL(dbenv) ((dbenv)->api2_internal)
00159 #define DB_INTERNAL(db) ((db)->api_internal)
00160
00161 #define DB_PKG "com/sleepycat/db/"
00162
00163
00164 static int __dbj_throw(JNIEnv *jenv,
00165 int err, const char *msg, jobject obj, jobject jdbenv);
00166
00167
00168 static JavaVM *javavm;
00169
00170 static jclass db_class, dbc_class, dbenv_class, dbt_class, dblsn_class;
00171 static jclass dbpreplist_class, dbtxn_class;
00172 static jclass keyrange_class;
00173 static jclass bt_stat_class, compact_class, h_stat_class, lock_stat_class;
00174 static jclass log_stat_class, mpool_stat_class, mpool_fstat_class;
00175 static jclass mutex_stat_class, qam_stat_class, rep_stat_class;
00176 static jclass seq_stat_class, txn_stat_class;
00177 static jclass txn_active_class;
00178 static jclass lock_class, lockreq_class, rep_processmsg_class;
00179 static jclass dbex_class, deadex_class, lockex_class, memex_class;
00180 static jclass repdupmasterex_class, rephandledeadex_class;
00181 static jclass repholdelectionex_class, repjoinfailex_class, replockoutex_class;
00182 static jclass repunavailex_class;
00183 static jclass runrecex_class, versionex_class;
00184 static jclass filenotfoundex_class, illegalargex_class, outofmemerr_class;
00185 static jclass bytearray_class, string_class, outputstream_class;
00186
00187 static jfieldID dbc_cptr_fid;
00188 static jfieldID dblsn_file_fid, dblsn_offset_fid;
00189 static jfieldID dbt_data_fid, dbt_size_fid, dbt_ulen_fid, dbt_dlen_fid;
00190 static jfieldID dbt_doff_fid, dbt_flags_fid, dbt_offset_fid;
00191 static jfieldID kr_less_fid, kr_equal_fid, kr_greater_fid;
00192 static jfieldID lock_cptr_fid;
00193 static jfieldID lockreq_op_fid, lockreq_modeflag_fid, lockreq_timeout_fid;
00194 static jfieldID lockreq_obj_fid, lockreq_lock_fid;
00195 static jfieldID rep_processmsg_envid;
00196
00197
00198 static jfieldID bt_stat_bt_magic_fid;
00199 static jfieldID bt_stat_bt_version_fid;
00200 static jfieldID bt_stat_bt_metaflags_fid;
00201 static jfieldID bt_stat_bt_nkeys_fid;
00202 static jfieldID bt_stat_bt_ndata_fid;
00203 static jfieldID bt_stat_bt_pagesize_fid;
00204 static jfieldID bt_stat_bt_minkey_fid;
00205 static jfieldID bt_stat_bt_re_len_fid;
00206 static jfieldID bt_stat_bt_re_pad_fid;
00207 static jfieldID bt_stat_bt_levels_fid;
00208 static jfieldID bt_stat_bt_int_pg_fid;
00209 static jfieldID bt_stat_bt_leaf_pg_fid;
00210 static jfieldID bt_stat_bt_dup_pg_fid;
00211 static jfieldID bt_stat_bt_over_pg_fid;
00212 static jfieldID bt_stat_bt_empty_pg_fid;
00213 static jfieldID bt_stat_bt_free_fid;
00214 static jfieldID bt_stat_bt_int_pgfree_fid;
00215 static jfieldID bt_stat_bt_leaf_pgfree_fid;
00216 static jfieldID bt_stat_bt_dup_pgfree_fid;
00217 static jfieldID bt_stat_bt_over_pgfree_fid;
00218 static jfieldID compact_compact_fillpercent_fid;
00219 static jfieldID compact_compact_timeout_fid;
00220 static jfieldID compact_compact_pages_fid;
00221 static jfieldID compact_compact_pages_free_fid;
00222 static jfieldID compact_compact_pages_examine_fid;
00223 static jfieldID compact_compact_levels_fid;
00224 static jfieldID compact_compact_deadlock_fid;
00225 static jfieldID compact_compact_pages_truncated_fid;
00226 static jfieldID compact_compact_truncate_fid;
00227 static jfieldID h_stat_hash_magic_fid;
00228 static jfieldID h_stat_hash_version_fid;
00229 static jfieldID h_stat_hash_metaflags_fid;
00230 static jfieldID h_stat_hash_nkeys_fid;
00231 static jfieldID h_stat_hash_ndata_fid;
00232 static jfieldID h_stat_hash_pagesize_fid;
00233 static jfieldID h_stat_hash_ffactor_fid;
00234 static jfieldID h_stat_hash_buckets_fid;
00235 static jfieldID h_stat_hash_free_fid;
00236 static jfieldID h_stat_hash_bfree_fid;
00237 static jfieldID h_stat_hash_bigpages_fid;
00238 static jfieldID h_stat_hash_big_bfree_fid;
00239 static jfieldID h_stat_hash_overflows_fid;
00240 static jfieldID h_stat_hash_ovfl_free_fid;
00241 static jfieldID h_stat_hash_dup_fid;
00242 static jfieldID h_stat_hash_dup_free_fid;
00243 static jfieldID lock_stat_st_id_fid;
00244 static jfieldID lock_stat_st_cur_maxid_fid;
00245 static jfieldID lock_stat_st_maxlocks_fid;
00246 static jfieldID lock_stat_st_maxlockers_fid;
00247 static jfieldID lock_stat_st_maxobjects_fid;
00248 static jfieldID lock_stat_st_nmodes_fid;
00249 static jfieldID lock_stat_st_nlocks_fid;
00250 static jfieldID lock_stat_st_maxnlocks_fid;
00251 static jfieldID lock_stat_st_nlockers_fid;
00252 static jfieldID lock_stat_st_maxnlockers_fid;
00253 static jfieldID lock_stat_st_nobjects_fid;
00254 static jfieldID lock_stat_st_maxnobjects_fid;
00255 static jfieldID lock_stat_st_nrequests_fid;
00256 static jfieldID lock_stat_st_nreleases_fid;
00257 static jfieldID lock_stat_st_nupgrade_fid;
00258 static jfieldID lock_stat_st_ndowngrade_fid;
00259 static jfieldID lock_stat_st_lock_wait_fid;
00260 static jfieldID lock_stat_st_lock_nowait_fid;
00261 static jfieldID lock_stat_st_ndeadlocks_fid;
00262 static jfieldID lock_stat_st_locktimeout_fid;
00263 static jfieldID lock_stat_st_nlocktimeouts_fid;
00264 static jfieldID lock_stat_st_txntimeout_fid;
00265 static jfieldID lock_stat_st_ntxntimeouts_fid;
00266 static jfieldID lock_stat_st_region_wait_fid;
00267 static jfieldID lock_stat_st_region_nowait_fid;
00268 static jfieldID lock_stat_st_regsize_fid;
00269 static jfieldID log_stat_st_magic_fid;
00270 static jfieldID log_stat_st_version_fid;
00271 static jfieldID log_stat_st_mode_fid;
00272 static jfieldID log_stat_st_lg_bsize_fid;
00273 static jfieldID log_stat_st_lg_size_fid;
00274 static jfieldID log_stat_st_record_fid;
00275 static jfieldID log_stat_st_w_bytes_fid;
00276 static jfieldID log_stat_st_w_mbytes_fid;
00277 static jfieldID log_stat_st_wc_bytes_fid;
00278 static jfieldID log_stat_st_wc_mbytes_fid;
00279 static jfieldID log_stat_st_wcount_fid;
00280 static jfieldID log_stat_st_wcount_fill_fid;
00281 static jfieldID log_stat_st_rcount_fid;
00282 static jfieldID log_stat_st_scount_fid;
00283 static jfieldID log_stat_st_region_wait_fid;
00284 static jfieldID log_stat_st_region_nowait_fid;
00285 static jfieldID log_stat_st_cur_file_fid;
00286 static jfieldID log_stat_st_cur_offset_fid;
00287 static jfieldID log_stat_st_disk_file_fid;
00288 static jfieldID log_stat_st_disk_offset_fid;
00289 static jfieldID log_stat_st_regsize_fid;
00290 static jfieldID log_stat_st_maxcommitperflush_fid;
00291 static jfieldID log_stat_st_mincommitperflush_fid;
00292 static jfieldID mpool_fstat_file_name_fid;
00293 static jfieldID mpool_fstat_st_pagesize_fid;
00294 static jfieldID mpool_fstat_st_map_fid;
00295 static jfieldID mpool_fstat_st_cache_hit_fid;
00296 static jfieldID mpool_fstat_st_cache_miss_fid;
00297 static jfieldID mpool_fstat_st_page_create_fid;
00298 static jfieldID mpool_fstat_st_page_in_fid;
00299 static jfieldID mpool_fstat_st_page_out_fid;
00300 static jfieldID mpool_stat_st_gbytes_fid;
00301 static jfieldID mpool_stat_st_bytes_fid;
00302 static jfieldID mpool_stat_st_ncache_fid;
00303 static jfieldID mpool_stat_st_regsize_fid;
00304 static jfieldID mpool_stat_st_mmapsize_fid;
00305 static jfieldID mpool_stat_st_maxopenfd_fid;
00306 static jfieldID mpool_stat_st_maxwrite_fid;
00307 static jfieldID mpool_stat_st_maxwrite_sleep_fid;
00308 static jfieldID mpool_stat_st_map_fid;
00309 static jfieldID mpool_stat_st_cache_hit_fid;
00310 static jfieldID mpool_stat_st_cache_miss_fid;
00311 static jfieldID mpool_stat_st_page_create_fid;
00312 static jfieldID mpool_stat_st_page_in_fid;
00313 static jfieldID mpool_stat_st_page_out_fid;
00314 static jfieldID mpool_stat_st_ro_evict_fid;
00315 static jfieldID mpool_stat_st_rw_evict_fid;
00316 static jfieldID mpool_stat_st_page_trickle_fid;
00317 static jfieldID mpool_stat_st_pages_fid;
00318 static jfieldID mpool_stat_st_page_clean_fid;
00319 static jfieldID mpool_stat_st_page_dirty_fid;
00320 static jfieldID mpool_stat_st_hash_buckets_fid;
00321 static jfieldID mpool_stat_st_hash_searches_fid;
00322 static jfieldID mpool_stat_st_hash_longest_fid;
00323 static jfieldID mpool_stat_st_hash_examined_fid;
00324 static jfieldID mpool_stat_st_hash_nowait_fid;
00325 static jfieldID mpool_stat_st_hash_wait_fid;
00326 static jfieldID mpool_stat_st_hash_max_wait_fid;
00327 static jfieldID mpool_stat_st_region_nowait_fid;
00328 static jfieldID mpool_stat_st_region_wait_fid;
00329 static jfieldID mpool_stat_st_alloc_fid;
00330 static jfieldID mpool_stat_st_alloc_buckets_fid;
00331 static jfieldID mpool_stat_st_alloc_max_buckets_fid;
00332 static jfieldID mpool_stat_st_alloc_pages_fid;
00333 static jfieldID mpool_stat_st_alloc_max_pages_fid;
00334 static jfieldID mutex_stat_st_mutex_align_fid;
00335 static jfieldID mutex_stat_st_mutex_tas_spins_fid;
00336 static jfieldID mutex_stat_st_mutex_cnt_fid;
00337 static jfieldID mutex_stat_st_mutex_free_fid;
00338 static jfieldID mutex_stat_st_mutex_inuse_fid;
00339 static jfieldID mutex_stat_st_mutex_inuse_max_fid;
00340 static jfieldID mutex_stat_st_region_wait_fid;
00341 static jfieldID mutex_stat_st_region_nowait_fid;
00342 static jfieldID mutex_stat_st_regsize_fid;
00343 static jfieldID qam_stat_qs_magic_fid;
00344 static jfieldID qam_stat_qs_version_fid;
00345 static jfieldID qam_stat_qs_metaflags_fid;
00346 static jfieldID qam_stat_qs_nkeys_fid;
00347 static jfieldID qam_stat_qs_ndata_fid;
00348 static jfieldID qam_stat_qs_pagesize_fid;
00349 static jfieldID qam_stat_qs_extentsize_fid;
00350 static jfieldID qam_stat_qs_pages_fid;
00351 static jfieldID qam_stat_qs_re_len_fid;
00352 static jfieldID qam_stat_qs_re_pad_fid;
00353 static jfieldID qam_stat_qs_pgfree_fid;
00354 static jfieldID qam_stat_qs_first_recno_fid;
00355 static jfieldID qam_stat_qs_cur_recno_fid;
00356 static jfieldID rep_stat_st_status_fid;
00357 static jfieldID rep_stat_st_next_lsn_fid;
00358 static jfieldID rep_stat_st_waiting_lsn_fid;
00359 static jfieldID rep_stat_st_next_pg_fid;
00360 static jfieldID rep_stat_st_waiting_pg_fid;
00361 static jfieldID rep_stat_st_dupmasters_fid;
00362 static jfieldID rep_stat_st_env_id_fid;
00363 static jfieldID rep_stat_st_env_priority_fid;
00364 static jfieldID rep_stat_st_bulk_fills_fid;
00365 static jfieldID rep_stat_st_bulk_overflows_fid;
00366 static jfieldID rep_stat_st_bulk_records_fid;
00367 static jfieldID rep_stat_st_bulk_transfers_fid;
00368 static jfieldID rep_stat_st_client_rerequests_fid;
00369 static jfieldID rep_stat_st_client_svc_req_fid;
00370 static jfieldID rep_stat_st_client_svc_miss_fid;
00371 static jfieldID rep_stat_st_gen_fid;
00372 static jfieldID rep_stat_st_egen_fid;
00373 static jfieldID rep_stat_st_log_duplicated_fid;
00374 static jfieldID rep_stat_st_log_queued_fid;
00375 static jfieldID rep_stat_st_log_queued_max_fid;
00376 static jfieldID rep_stat_st_log_queued_total_fid;
00377 static jfieldID rep_stat_st_log_records_fid;
00378 static jfieldID rep_stat_st_log_requested_fid;
00379 static jfieldID rep_stat_st_master_fid;
00380 static jfieldID rep_stat_st_master_changes_fid;
00381 static jfieldID rep_stat_st_msgs_badgen_fid;
00382 static jfieldID rep_stat_st_msgs_processed_fid;
00383 static jfieldID rep_stat_st_msgs_recover_fid;
00384 static jfieldID rep_stat_st_msgs_send_failures_fid;
00385 static jfieldID rep_stat_st_msgs_sent_fid;
00386 static jfieldID rep_stat_st_newsites_fid;
00387 static jfieldID rep_stat_st_nsites_fid;
00388 static jfieldID rep_stat_st_nthrottles_fid;
00389 static jfieldID rep_stat_st_outdated_fid;
00390 static jfieldID rep_stat_st_pg_duplicated_fid;
00391 static jfieldID rep_stat_st_pg_records_fid;
00392 static jfieldID rep_stat_st_pg_requested_fid;
00393 static jfieldID rep_stat_st_startup_complete_fid;
00394 static jfieldID rep_stat_st_txns_applied_fid;
00395 static jfieldID rep_stat_st_elections_fid;
00396 static jfieldID rep_stat_st_elections_won_fid;
00397 static jfieldID rep_stat_st_election_cur_winner_fid;
00398 static jfieldID rep_stat_st_election_gen_fid;
00399 static jfieldID rep_stat_st_election_lsn_fid;
00400 static jfieldID rep_stat_st_election_nsites_fid;
00401 static jfieldID rep_stat_st_election_nvotes_fid;
00402 static jfieldID rep_stat_st_election_priority_fid;
00403 static jfieldID rep_stat_st_election_status_fid;
00404 static jfieldID rep_stat_st_election_tiebreaker_fid;
00405 static jfieldID rep_stat_st_election_votes_fid;
00406 static jfieldID rep_stat_st_election_sec_fid;
00407 static jfieldID rep_stat_st_election_usec_fid;
00408 static jfieldID seq_stat_st_wait_fid;
00409 static jfieldID seq_stat_st_nowait_fid;
00410 static jfieldID seq_stat_st_current_fid;
00411 static jfieldID seq_stat_st_value_fid;
00412 static jfieldID seq_stat_st_last_value_fid;
00413 static jfieldID seq_stat_st_min_fid;
00414 static jfieldID seq_stat_st_max_fid;
00415 static jfieldID seq_stat_st_cache_size_fid;
00416 static jfieldID seq_stat_st_flags_fid;
00417 static jfieldID txn_stat_st_last_ckp_fid;
00418 static jfieldID txn_stat_st_time_ckp_fid;
00419 static jfieldID txn_stat_st_last_txnid_fid;
00420 static jfieldID txn_stat_st_maxtxns_fid;
00421 static jfieldID txn_stat_st_naborts_fid;
00422 static jfieldID txn_stat_st_nbegins_fid;
00423 static jfieldID txn_stat_st_ncommits_fid;
00424 static jfieldID txn_stat_st_nactive_fid;
00425 static jfieldID txn_stat_st_nrestores_fid;
00426 static jfieldID txn_stat_st_maxnactive_fid;
00427 static jfieldID txn_stat_st_txnarray_fid;
00428 static jfieldID txn_stat_st_region_wait_fid;
00429 static jfieldID txn_stat_st_region_nowait_fid;
00430 static jfieldID txn_stat_st_regsize_fid;
00431 static jfieldID txn_active_txnid_fid;
00432 static jfieldID txn_active_parentid_fid;
00433 static jfieldID txn_active_pid_fid;
00434 static jfieldID txn_active_lsn_fid;
00435 static jfieldID txn_active_xa_status_fid;
00436 static jfieldID txn_active_xid_fid;
00437 static jfieldID txn_active_name_fid;
00438
00439
00440 static jmethodID dbenv_construct, dbt_construct, dblsn_construct;
00441 static jmethodID dbpreplist_construct, dbtxn_construct;
00442 static jmethodID bt_stat_construct, h_stat_construct;
00443 static jmethodID lock_stat_construct, log_stat_construct;
00444 static jmethodID mpool_stat_construct, mpool_fstat_construct;
00445 static jmethodID mutex_stat_construct, qam_stat_construct;
00446 static jmethodID rep_stat_construct, seq_stat_construct;
00447 static jmethodID txn_stat_construct, txn_active_construct;
00448 static jmethodID dbex_construct, deadex_construct, lockex_construct;
00449 static jmethodID memex_construct, memex_update_method;
00450 static jmethodID repdupmasterex_construct, rephandledeadex_construct;
00451 static jmethodID repholdelectionex_construct, repjoinfailex_construct;
00452 static jmethodID replockoutex_construct, repunavailex_construct;
00453 static jmethodID runrecex_construct, versionex_construct;
00454 static jmethodID filenotfoundex_construct, illegalargex_construct;
00455 static jmethodID outofmemerr_construct;
00456 static jmethodID lock_construct;
00457
00458 static jmethodID app_dispatch_method, errcall_method, env_feedback_method;
00459 static jmethodID msgcall_method, paniccall_method, rep_transport_method;
00460
00461 static jmethodID append_recno_method, bt_compare_method, bt_prefix_method;
00462 static jmethodID db_feedback_method, dup_compare_method, h_hash_method;
00463 static jmethodID seckey_create_method;
00464
00465 static jmethodID outputstream_write_method;
00466
00467 const struct {
00468 jclass *cl;
00469 const char *name;
00470 } all_classes[] = {
00471 { &dbenv_class, DB_PKG "internal/DbEnv" },
00472 { &db_class, DB_PKG "internal/Db" },
00473 { &dbc_class, DB_PKG "internal/Dbc" },
00474 { &dbt_class, DB_PKG "DatabaseEntry" },
00475 { &dblsn_class, DB_PKG "LogSequenceNumber" },
00476 { &dbpreplist_class, DB_PKG "PreparedTransaction" },
00477 { &dbtxn_class, DB_PKG "internal/DbTxn" },
00478
00479 { &bt_stat_class, DB_PKG "BtreeStats" },
00480 { &compact_class, DB_PKG "CompactStats" },
00481 { &h_stat_class, DB_PKG "HashStats" },
00482 { &lock_stat_class, DB_PKG "LockStats" },
00483 { &log_stat_class, DB_PKG "LogStats" },
00484 { &mpool_fstat_class, DB_PKG "CacheFileStats" },
00485 { &mpool_stat_class, DB_PKG "CacheStats" },
00486 { &mutex_stat_class, DB_PKG "MutexStats" },
00487 { &qam_stat_class, DB_PKG "QueueStats" },
00488 { &rep_stat_class, DB_PKG "ReplicationStats" },
00489 { &seq_stat_class, DB_PKG "SequenceStats" },
00490 { &txn_stat_class, DB_PKG "TransactionStats" },
00491 { &txn_active_class, DB_PKG "TransactionStats$Active" },
00492
00493 { &keyrange_class, DB_PKG "KeyRange" },
00494 { &lock_class, DB_PKG "internal/DbLock" },
00495 { &lockreq_class, DB_PKG "LockRequest" },
00496 { &rep_processmsg_class, DB_PKG "internal/DbEnv$RepProcessMessage" },
00497 { &rep_processmsg_class, DB_PKG "internal/DbEnv$RepProcessMessage" },
00498
00499 { &dbex_class, DB_PKG "DatabaseException" },
00500 { &deadex_class, DB_PKG "DeadlockException" },
00501 { &lockex_class, DB_PKG "LockNotGrantedException" },
00502 { &memex_class, DB_PKG "MemoryException" },
00503 { &repdupmasterex_class, DB_PKG "ReplicationDuplicateMasterException" },
00504 { &rephandledeadex_class, DB_PKG "ReplicationHandleDeadException" },
00505 { &repholdelectionex_class, DB_PKG "ReplicationHoldElectionException" },
00506 { &repjoinfailex_class, DB_PKG "ReplicationJoinFailureException" },
00507 { &replockoutex_class, DB_PKG "ReplicationLockoutException" },
00508 { &repunavailex_class, DB_PKG "ReplicationSiteUnavailableException" },
00509 { &runrecex_class, DB_PKG "RunRecoveryException" },
00510 { &versionex_class, DB_PKG "VersionMismatchException" },
00511 { &filenotfoundex_class, "java/io/FileNotFoundException" },
00512 { &illegalargex_class, "java/lang/IllegalArgumentException" },
00513 { &outofmemerr_class, "java/lang/OutOfMemoryError" },
00514
00515 { &bytearray_class, "[B" },
00516 { &string_class, "java/lang/String" },
00517 { &outputstream_class, "java/io/OutputStream" }
00518 };
00519
00520 const struct {
00521 jfieldID *fid;
00522 jclass *cl;
00523 const char *name;
00524 const char *sig;
00525 } all_fields[] = {
00526 { &dbc_cptr_fid, &dbc_class, "swigCPtr", "J" },
00527
00528 { &dblsn_file_fid, &dblsn_class, "file", "I" },
00529 { &dblsn_offset_fid, &dblsn_class, "offset", "I" },
00530
00531 { &dbt_data_fid, &dbt_class, "data", "[B" },
00532 { &dbt_size_fid, &dbt_class, "size", "I" },
00533 { &dbt_ulen_fid, &dbt_class, "ulen", "I" },
00534 { &dbt_dlen_fid, &dbt_class, "dlen", "I" },
00535 { &dbt_doff_fid, &dbt_class, "doff", "I" },
00536 { &dbt_flags_fid, &dbt_class, "flags", "I" },
00537 { &dbt_offset_fid, &dbt_class, "offset", "I" },
00538
00539 { &kr_less_fid, &keyrange_class, "less", "D" },
00540 { &kr_equal_fid, &keyrange_class, "equal", "D" },
00541 { &kr_greater_fid, &keyrange_class, "greater", "D" },
00542
00543 { &lock_cptr_fid, &lock_class, "swigCPtr", "J" },
00544
00545 { &lockreq_op_fid, &lockreq_class, "op", "I" },
00546 { &lockreq_modeflag_fid, &lockreq_class, "modeFlag", "I" },
00547 { &lockreq_timeout_fid, &lockreq_class, "timeout", "I" },
00548 { &lockreq_obj_fid, &lockreq_class, "obj",
00549 "L" DB_PKG "DatabaseEntry;" },
00550 { &lockreq_lock_fid, &lockreq_class, "lock",
00551 "L" DB_PKG "internal/DbLock;" },
00552
00553
00554 { &bt_stat_bt_magic_fid, &bt_stat_class, "bt_magic", "I" },
00555 { &bt_stat_bt_version_fid, &bt_stat_class, "bt_version", "I" },
00556 { &bt_stat_bt_metaflags_fid, &bt_stat_class, "bt_metaflags", "I" },
00557 { &bt_stat_bt_nkeys_fid, &bt_stat_class, "bt_nkeys", "I" },
00558 { &bt_stat_bt_ndata_fid, &bt_stat_class, "bt_ndata", "I" },
00559 { &bt_stat_bt_pagesize_fid, &bt_stat_class, "bt_pagesize", "I" },
00560 { &bt_stat_bt_minkey_fid, &bt_stat_class, "bt_minkey", "I" },
00561 { &bt_stat_bt_re_len_fid, &bt_stat_class, "bt_re_len", "I" },
00562 { &bt_stat_bt_re_pad_fid, &bt_stat_class, "bt_re_pad", "I" },
00563 { &bt_stat_bt_levels_fid, &bt_stat_class, "bt_levels", "I" },
00564 { &bt_stat_bt_int_pg_fid, &bt_stat_class, "bt_int_pg", "I" },
00565 { &bt_stat_bt_leaf_pg_fid, &bt_stat_class, "bt_leaf_pg", "I" },
00566 { &bt_stat_bt_dup_pg_fid, &bt_stat_class, "bt_dup_pg", "I" },
00567 { &bt_stat_bt_over_pg_fid, &bt_stat_class, "bt_over_pg", "I" },
00568 { &bt_stat_bt_empty_pg_fid, &bt_stat_class, "bt_empty_pg", "I" },
00569 { &bt_stat_bt_free_fid, &bt_stat_class, "bt_free", "I" },
00570 { &bt_stat_bt_int_pgfree_fid, &bt_stat_class, "bt_int_pgfree", "I" },
00571 { &bt_stat_bt_leaf_pgfree_fid, &bt_stat_class, "bt_leaf_pgfree", "I" },
00572 { &bt_stat_bt_dup_pgfree_fid, &bt_stat_class, "bt_dup_pgfree", "I" },
00573 { &bt_stat_bt_over_pgfree_fid, &bt_stat_class, "bt_over_pgfree", "I" },
00574 { &compact_compact_fillpercent_fid, &compact_class, "compact_fillpercent", "I" },
00575 { &compact_compact_timeout_fid, &compact_class, "compact_timeout", "I" },
00576 { &compact_compact_pages_fid, &compact_class, "compact_pages", "I" },
00577 { &compact_compact_pages_free_fid, &compact_class, "compact_pages_free", "I" },
00578 { &compact_compact_pages_examine_fid, &compact_class, "compact_pages_examine", "I" },
00579 { &compact_compact_levels_fid, &compact_class, "compact_levels", "I" },
00580 { &compact_compact_deadlock_fid, &compact_class, "compact_deadlock", "I" },
00581 { &compact_compact_pages_truncated_fid, &compact_class, "compact_pages_truncated", "I" },
00582 { &compact_compact_truncate_fid, &compact_class, "compact_truncate", "I" },
00583 { &h_stat_hash_magic_fid, &h_stat_class, "hash_magic", "I" },
00584 { &h_stat_hash_version_fid, &h_stat_class, "hash_version", "I" },
00585 { &h_stat_hash_metaflags_fid, &h_stat_class, "hash_metaflags", "I" },
00586 { &h_stat_hash_nkeys_fid, &h_stat_class, "hash_nkeys", "I" },
00587 { &h_stat_hash_ndata_fid, &h_stat_class, "hash_ndata", "I" },
00588 { &h_stat_hash_pagesize_fid, &h_stat_class, "hash_pagesize", "I" },
00589 { &h_stat_hash_ffactor_fid, &h_stat_class, "hash_ffactor", "I" },
00590 { &h_stat_hash_buckets_fid, &h_stat_class, "hash_buckets", "I" },
00591 { &h_stat_hash_free_fid, &h_stat_class, "hash_free", "I" },
00592 { &h_stat_hash_bfree_fid, &h_stat_class, "hash_bfree", "I" },
00593 { &h_stat_hash_bigpages_fid, &h_stat_class, "hash_bigpages", "I" },
00594 { &h_stat_hash_big_bfree_fid, &h_stat_class, "hash_big_bfree", "I" },
00595 { &h_stat_hash_overflows_fid, &h_stat_class, "hash_overflows", "I" },
00596 { &h_stat_hash_ovfl_free_fid, &h_stat_class, "hash_ovfl_free", "I" },
00597 { &h_stat_hash_dup_fid, &h_stat_class, "hash_dup", "I" },
00598 { &h_stat_hash_dup_free_fid, &h_stat_class, "hash_dup_free", "I" },
00599 { &lock_stat_st_id_fid, &lock_stat_class, "st_id", "I" },
00600 { &lock_stat_st_cur_maxid_fid, &lock_stat_class, "st_cur_maxid", "I" },
00601 { &lock_stat_st_maxlocks_fid, &lock_stat_class, "st_maxlocks", "I" },
00602 { &lock_stat_st_maxlockers_fid, &lock_stat_class, "st_maxlockers", "I" },
00603 { &lock_stat_st_maxobjects_fid, &lock_stat_class, "st_maxobjects", "I" },
00604 { &lock_stat_st_nmodes_fid, &lock_stat_class, "st_nmodes", "I" },
00605 { &lock_stat_st_nlocks_fid, &lock_stat_class, "st_nlocks", "I" },
00606 { &lock_stat_st_maxnlocks_fid, &lock_stat_class, "st_maxnlocks", "I" },
00607 { &lock_stat_st_nlockers_fid, &lock_stat_class, "st_nlockers", "I" },
00608 { &lock_stat_st_maxnlockers_fid, &lock_stat_class, "st_maxnlockers", "I" },
00609 { &lock_stat_st_nobjects_fid, &lock_stat_class, "st_nobjects", "I" },
00610 { &lock_stat_st_maxnobjects_fid, &lock_stat_class, "st_maxnobjects", "I" },
00611 { &lock_stat_st_nrequests_fid, &lock_stat_class, "st_nrequests", "I" },
00612 { &lock_stat_st_nreleases_fid, &lock_stat_class, "st_nreleases", "I" },
00613 { &lock_stat_st_nupgrade_fid, &lock_stat_class, "st_nupgrade", "I" },
00614 { &lock_stat_st_ndowngrade_fid, &lock_stat_class, "st_ndowngrade", "I" },
00615 { &lock_stat_st_lock_wait_fid, &lock_stat_class, "st_lock_wait", "I" },
00616 { &lock_stat_st_lock_nowait_fid, &lock_stat_class, "st_lock_nowait", "I" },
00617 { &lock_stat_st_ndeadlocks_fid, &lock_stat_class, "st_ndeadlocks", "I" },
00618 { &lock_stat_st_locktimeout_fid, &lock_stat_class, "st_locktimeout", "I" },
00619 { &lock_stat_st_nlocktimeouts_fid, &lock_stat_class, "st_nlocktimeouts", "I" },
00620 { &lock_stat_st_txntimeout_fid, &lock_stat_class, "st_txntimeout", "I" },
00621 { &lock_stat_st_ntxntimeouts_fid, &lock_stat_class, "st_ntxntimeouts", "I" },
00622 { &lock_stat_st_region_wait_fid, &lock_stat_class, "st_region_wait", "I" },
00623 { &lock_stat_st_region_nowait_fid, &lock_stat_class, "st_region_nowait", "I" },
00624 { &lock_stat_st_regsize_fid, &lock_stat_class, "st_regsize", "I" },
00625 { &log_stat_st_magic_fid, &log_stat_class, "st_magic", "I" },
00626 { &log_stat_st_version_fid, &log_stat_class, "st_version", "I" },
00627 { &log_stat_st_mode_fid, &log_stat_class, "st_mode", "I" },
00628 { &log_stat_st_lg_bsize_fid, &log_stat_class, "st_lg_bsize", "I" },
00629 { &log_stat_st_lg_size_fid, &log_stat_class, "st_lg_size", "I" },
00630 { &log_stat_st_record_fid, &log_stat_class, "st_record", "I" },
00631 { &log_stat_st_w_bytes_fid, &log_stat_class, "st_w_bytes", "I" },
00632 { &log_stat_st_w_mbytes_fid, &log_stat_class, "st_w_mbytes", "I" },
00633 { &log_stat_st_wc_bytes_fid, &log_stat_class, "st_wc_bytes", "I" },
00634 { &log_stat_st_wc_mbytes_fid, &log_stat_class, "st_wc_mbytes", "I" },
00635 { &log_stat_st_wcount_fid, &log_stat_class, "st_wcount", "I" },
00636 { &log_stat_st_wcount_fill_fid, &log_stat_class, "st_wcount_fill", "I" },
00637 { &log_stat_st_rcount_fid, &log_stat_class, "st_rcount", "I" },
00638 { &log_stat_st_scount_fid, &log_stat_class, "st_scount", "I" },
00639 { &log_stat_st_region_wait_fid, &log_stat_class, "st_region_wait", "I" },
00640 { &log_stat_st_region_nowait_fid, &log_stat_class, "st_region_nowait", "I" },
00641 { &log_stat_st_cur_file_fid, &log_stat_class, "st_cur_file", "I" },
00642 { &log_stat_st_cur_offset_fid, &log_stat_class, "st_cur_offset", "I" },
00643 { &log_stat_st_disk_file_fid, &log_stat_class, "st_disk_file", "I" },
00644 { &log_stat_st_disk_offset_fid, &log_stat_class, "st_disk_offset", "I" },
00645 { &log_stat_st_regsize_fid, &log_stat_class, "st_regsize", "I" },
00646 { &log_stat_st_maxcommitperflush_fid, &log_stat_class, "st_maxcommitperflush", "I" },
00647 { &log_stat_st_mincommitperflush_fid, &log_stat_class, "st_mincommitperflush", "I" },
00648 { &mpool_fstat_file_name_fid, &mpool_fstat_class, "file_name", "Ljava/lang/String;" },
00649 { &mpool_fstat_st_pagesize_fid, &mpool_fstat_class, "st_pagesize", "I" },
00650 { &mpool_fstat_st_map_fid, &mpool_fstat_class, "st_map", "I" },
00651 { &mpool_fstat_st_cache_hit_fid, &mpool_fstat_class, "st_cache_hit", "I" },
00652 { &mpool_fstat_st_cache_miss_fid, &mpool_fstat_class, "st_cache_miss", "I" },
00653 { &mpool_fstat_st_page_create_fid, &mpool_fstat_class, "st_page_create", "I" },
00654 { &mpool_fstat_st_page_in_fid, &mpool_fstat_class, "st_page_in", "I" },
00655 { &mpool_fstat_st_page_out_fid, &mpool_fstat_class, "st_page_out", "I" },
00656 { &mpool_stat_st_gbytes_fid, &mpool_stat_class, "st_gbytes", "I" },
00657 { &mpool_stat_st_bytes_fid, &mpool_stat_class, "st_bytes", "I" },
00658 { &mpool_stat_st_ncache_fid, &mpool_stat_class, "st_ncache", "I" },
00659 { &mpool_stat_st_regsize_fid, &mpool_stat_class, "st_regsize", "I" },
00660 { &mpool_stat_st_mmapsize_fid, &mpool_stat_class, "st_mmapsize", "I" },
00661 { &mpool_stat_st_maxopenfd_fid, &mpool_stat_class, "st_maxopenfd", "I" },
00662 { &mpool_stat_st_maxwrite_fid, &mpool_stat_class, "st_maxwrite", "I" },
00663 { &mpool_stat_st_maxwrite_sleep_fid, &mpool_stat_class, "st_maxwrite_sleep", "I" },
00664 { &mpool_stat_st_map_fid, &mpool_stat_class, "st_map", "I" },
00665 { &mpool_stat_st_cache_hit_fid, &mpool_stat_class, "st_cache_hit", "I" },
00666 { &mpool_stat_st_cache_miss_fid, &mpool_stat_class, "st_cache_miss", "I" },
00667 { &mpool_stat_st_page_create_fid, &mpool_stat_class, "st_page_create", "I" },
00668 { &mpool_stat_st_page_in_fid, &mpool_stat_class, "st_page_in", "I" },
00669 { &mpool_stat_st_page_out_fid, &mpool_stat_class, "st_page_out", "I" },
00670 { &mpool_stat_st_ro_evict_fid, &mpool_stat_class, "st_ro_evict", "I" },
00671 { &mpool_stat_st_rw_evict_fid, &mpool_stat_class, "st_rw_evict", "I" },
00672 { &mpool_stat_st_page_trickle_fid, &mpool_stat_class, "st_page_trickle", "I" },
00673 { &mpool_stat_st_pages_fid, &mpool_stat_class, "st_pages", "I" },
00674 { &mpool_stat_st_page_clean_fid, &mpool_stat_class, "st_page_clean", "I" },
00675 { &mpool_stat_st_page_dirty_fid, &mpool_stat_class, "st_page_dirty", "I" },
00676 { &mpool_stat_st_hash_buckets_fid, &mpool_stat_class, "st_hash_buckets", "I" },
00677 { &mpool_stat_st_hash_searches_fid, &mpool_stat_class, "st_hash_searches", "I" },
00678 { &mpool_stat_st_hash_longest_fid, &mpool_stat_class, "st_hash_longest", "I" },
00679 { &mpool_stat_st_hash_examined_fid, &mpool_stat_class, "st_hash_examined", "I" },
00680 { &mpool_stat_st_hash_nowait_fid, &mpool_stat_class, "st_hash_nowait", "I" },
00681 { &mpool_stat_st_hash_wait_fid, &mpool_stat_class, "st_hash_wait", "I" },
00682 { &mpool_stat_st_hash_max_wait_fid, &mpool_stat_class, "st_hash_max_wait", "I" },
00683 { &mpool_stat_st_region_nowait_fid, &mpool_stat_class, "st_region_nowait", "I" },
00684 { &mpool_stat_st_region_wait_fid, &mpool_stat_class, "st_region_wait", "I" },
00685 { &mpool_stat_st_alloc_fid, &mpool_stat_class, "st_alloc", "I" },
00686 { &mpool_stat_st_alloc_buckets_fid, &mpool_stat_class, "st_alloc_buckets", "I" },
00687 { &mpool_stat_st_alloc_max_buckets_fid, &mpool_stat_class, "st_alloc_max_buckets", "I" },
00688 { &mpool_stat_st_alloc_pages_fid, &mpool_stat_class, "st_alloc_pages", "I" },
00689 { &mpool_stat_st_alloc_max_pages_fid, &mpool_stat_class, "st_alloc_max_pages", "I" },
00690 { &mutex_stat_st_mutex_align_fid, &mutex_stat_class, "st_mutex_align", "I" },
00691 { &mutex_stat_st_mutex_tas_spins_fid, &mutex_stat_class, "st_mutex_tas_spins", "I" },
00692 { &mutex_stat_st_mutex_cnt_fid, &mutex_stat_class, "st_mutex_cnt", "I" },
00693 { &mutex_stat_st_mutex_free_fid, &mutex_stat_class, "st_mutex_free", "I" },
00694 { &mutex_stat_st_mutex_inuse_fid, &mutex_stat_class, "st_mutex_inuse", "I" },
00695 { &mutex_stat_st_mutex_inuse_max_fid, &mutex_stat_class, "st_mutex_inuse_max", "I" },
00696 { &mutex_stat_st_region_wait_fid, &mutex_stat_class, "st_region_wait", "I" },
00697 { &mutex_stat_st_region_nowait_fid, &mutex_stat_class, "st_region_nowait", "I" },
00698 { &mutex_stat_st_regsize_fid, &mutex_stat_class, "st_regsize", "I" },
00699 { &qam_stat_qs_magic_fid, &qam_stat_class, "qs_magic", "I" },
00700 { &qam_stat_qs_version_fid, &qam_stat_class, "qs_version", "I" },
00701 { &qam_stat_qs_metaflags_fid, &qam_stat_class, "qs_metaflags", "I" },
00702 { &qam_stat_qs_nkeys_fid, &qam_stat_class, "qs_nkeys", "I" },
00703 { &qam_stat_qs_ndata_fid, &qam_stat_class, "qs_ndata", "I" },
00704 { &qam_stat_qs_pagesize_fid, &qam_stat_class, "qs_pagesize", "I" },
00705 { &qam_stat_qs_extentsize_fid, &qam_stat_class, "qs_extentsize", "I" },
00706 { &qam_stat_qs_pages_fid, &qam_stat_class, "qs_pages", "I" },
00707 { &qam_stat_qs_re_len_fid, &qam_stat_class, "qs_re_len", "I" },
00708 { &qam_stat_qs_re_pad_fid, &qam_stat_class, "qs_re_pad", "I" },
00709 { &qam_stat_qs_pgfree_fid, &qam_stat_class, "qs_pgfree", "I" },
00710 { &qam_stat_qs_first_recno_fid, &qam_stat_class, "qs_first_recno", "I" },
00711 { &qam_stat_qs_cur_recno_fid, &qam_stat_class, "qs_cur_recno", "I" },
00712 { &rep_stat_st_status_fid, &rep_stat_class, "st_status", "I" },
00713 { &rep_stat_st_next_lsn_fid, &rep_stat_class, "st_next_lsn", "L" DB_PKG "LogSequenceNumber;" },
00714 { &rep_stat_st_waiting_lsn_fid, &rep_stat_class, "st_waiting_lsn", "L" DB_PKG "LogSequenceNumber;" },
00715 { &rep_stat_st_next_pg_fid, &rep_stat_class, "st_next_pg", "I" },
00716 { &rep_stat_st_waiting_pg_fid, &rep_stat_class, "st_waiting_pg", "I" },
00717 { &rep_stat_st_dupmasters_fid, &rep_stat_class, "st_dupmasters", "I" },
00718 { &rep_stat_st_env_id_fid, &rep_stat_class, "st_env_id", "I" },
00719 { &rep_stat_st_env_priority_fid, &rep_stat_class, "st_env_priority", "I" },
00720 { &rep_stat_st_bulk_fills_fid, &rep_stat_class, "st_bulk_fills", "I" },
00721 { &rep_stat_st_bulk_overflows_fid, &rep_stat_class, "st_bulk_overflows", "I" },
00722 { &rep_stat_st_bulk_records_fid, &rep_stat_class, "st_bulk_records", "I" },
00723 { &rep_stat_st_bulk_transfers_fid, &rep_stat_class, "st_bulk_transfers", "I" },
00724 { &rep_stat_st_client_rerequests_fid, &rep_stat_class, "st_client_rerequests", "I" },
00725 { &rep_stat_st_client_svc_req_fid, &rep_stat_class, "st_client_svc_req", "I" },
00726 { &rep_stat_st_client_svc_miss_fid, &rep_stat_class, "st_client_svc_miss", "I" },
00727 { &rep_stat_st_gen_fid, &rep_stat_class, "st_gen", "I" },
00728 { &rep_stat_st_egen_fid, &rep_stat_class, "st_egen", "I" },
00729 { &rep_stat_st_log_duplicated_fid, &rep_stat_class, "st_log_duplicated", "I" },
00730 { &rep_stat_st_log_queued_fid, &rep_stat_class, "st_log_queued", "I" },
00731 { &rep_stat_st_log_queued_max_fid, &rep_stat_class, "st_log_queued_max", "I" },
00732 { &rep_stat_st_log_queued_total_fid, &rep_stat_class, "st_log_queued_total", "I" },
00733 { &rep_stat_st_log_records_fid, &rep_stat_class, "st_log_records", "I" },
00734 { &rep_stat_st_log_requested_fid, &rep_stat_class, "st_log_requested", "I" },
00735 { &rep_stat_st_master_fid, &rep_stat_class, "st_master", "I" },
00736 { &rep_stat_st_master_changes_fid, &rep_stat_class, "st_master_changes", "I" },
00737 { &rep_stat_st_msgs_badgen_fid, &rep_stat_class, "st_msgs_badgen", "I" },
00738 { &rep_stat_st_msgs_processed_fid, &rep_stat_class, "st_msgs_processed", "I" },
00739 { &rep_stat_st_msgs_recover_fid, &rep_stat_class, "st_msgs_recover", "I" },
00740 { &rep_stat_st_msgs_send_failures_fid, &rep_stat_class, "st_msgs_send_failures", "I" },
00741 { &rep_stat_st_msgs_sent_fid, &rep_stat_class, "st_msgs_sent", "I" },
00742 { &rep_stat_st_newsites_fid, &rep_stat_class, "st_newsites", "I" },
00743 { &rep_stat_st_nsites_fid, &rep_stat_class, "st_nsites", "I" },
00744 { &rep_stat_st_nthrottles_fid, &rep_stat_class, "st_nthrottles", "I" },
00745 { &rep_stat_st_outdated_fid, &rep_stat_class, "st_outdated", "I" },
00746 { &rep_stat_st_pg_duplicated_fid, &rep_stat_class, "st_pg_duplicated", "I" },
00747 { &rep_stat_st_pg_records_fid, &rep_stat_class, "st_pg_records", "I" },
00748 { &rep_stat_st_pg_requested_fid, &rep_stat_class, "st_pg_requested", "I" },
00749 { &rep_stat_st_startup_complete_fid, &rep_stat_class, "st_startup_complete", "I" },
00750 { &rep_stat_st_txns_applied_fid, &rep_stat_class, "st_txns_applied", "I" },
00751 { &rep_stat_st_elections_fid, &rep_stat_class, "st_elections", "I" },
00752 { &rep_stat_st_elections_won_fid, &rep_stat_class, "st_elections_won", "I" },
00753 { &rep_stat_st_election_cur_winner_fid, &rep_stat_class, "st_election_cur_winner", "I" },
00754 { &rep_stat_st_election_gen_fid, &rep_stat_class, "st_election_gen", "I" },
00755 { &rep_stat_st_election_lsn_fid, &rep_stat_class, "st_election_lsn", "L" DB_PKG "LogSequenceNumber;" },
00756 { &rep_stat_st_election_nsites_fid, &rep_stat_class, "st_election_nsites", "I" },
00757 { &rep_stat_st_election_nvotes_fid, &rep_stat_class, "st_election_nvotes", "I" },
00758 { &rep_stat_st_election_priority_fid, &rep_stat_class, "st_election_priority", "I" },
00759 { &rep_stat_st_election_status_fid, &rep_stat_class, "st_election_status", "I" },
00760 { &rep_stat_st_election_tiebreaker_fid, &rep_stat_class, "st_election_tiebreaker", "I" },
00761 { &rep_stat_st_election_votes_fid, &rep_stat_class, "st_election_votes", "I" },
00762 { &rep_stat_st_election_sec_fid, &rep_stat_class, "st_election_sec", "I" },
00763 { &rep_stat_st_election_usec_fid, &rep_stat_class, "st_election_usec", "I" },
00764 { &seq_stat_st_wait_fid, &seq_stat_class, "st_wait", "I" },
00765 { &seq_stat_st_nowait_fid, &seq_stat_class, "st_nowait", "I" },
00766 { &seq_stat_st_current_fid, &seq_stat_class, "st_current", "J" },
00767 { &seq_stat_st_value_fid, &seq_stat_class, "st_value", "J" },
00768 { &seq_stat_st_last_value_fid, &seq_stat_class, "st_last_value", "J" },
00769 { &seq_stat_st_min_fid, &seq_stat_class, "st_min", "J" },
00770 { &seq_stat_st_max_fid, &seq_stat_class, "st_max", "J" },
00771 { &seq_stat_st_cache_size_fid, &seq_stat_class, "st_cache_size", "I" },
00772 { &seq_stat_st_flags_fid, &seq_stat_class, "st_flags", "I" },
00773 { &txn_stat_st_last_ckp_fid, &txn_stat_class, "st_last_ckp", "L" DB_PKG "LogSequenceNumber;" },
00774 { &txn_stat_st_time_ckp_fid, &txn_stat_class, "st_time_ckp", "J" },
00775 { &txn_stat_st_last_txnid_fid, &txn_stat_class, "st_last_txnid", "I" },
00776 { &txn_stat_st_maxtxns_fid, &txn_stat_class, "st_maxtxns", "I" },
00777 { &txn_stat_st_naborts_fid, &txn_stat_class, "st_naborts", "I" },
00778 { &txn_stat_st_nbegins_fid, &txn_stat_class, "st_nbegins", "I" },
00779 { &txn_stat_st_ncommits_fid, &txn_stat_class, "st_ncommits", "I" },
00780 { &txn_stat_st_nactive_fid, &txn_stat_class, "st_nactive", "I" },
00781 { &txn_stat_st_nrestores_fid, &txn_stat_class, "st_nrestores", "I" },
00782 { &txn_stat_st_maxnactive_fid, &txn_stat_class, "st_maxnactive", "I" },
00783 { &txn_stat_st_txnarray_fid, &txn_stat_class, "st_txnarray", "[L" DB_PKG "TransactionStats$Active;" },
00784 { &txn_stat_st_region_wait_fid, &txn_stat_class, "st_region_wait", "I" },
00785 { &txn_stat_st_region_nowait_fid, &txn_stat_class, "st_region_nowait", "I" },
00786 { &txn_stat_st_regsize_fid, &txn_stat_class, "st_regsize", "I" },
00787 { &txn_active_txnid_fid, &txn_active_class, "txnid", "I" },
00788 { &txn_active_parentid_fid, &txn_active_class, "parentid", "I" },
00789 { &txn_active_pid_fid, &txn_active_class, "pid", "I" },
00790 { &txn_active_lsn_fid, &txn_active_class, "lsn", "L" DB_PKG "LogSequenceNumber;" },
00791 { &txn_active_xa_status_fid, &txn_active_class, "xa_status", "I" },
00792 { &txn_active_xid_fid, &txn_active_class, "xid", "[B" },
00793 { &txn_active_name_fid, &txn_active_class, "name", "Ljava/lang/String;" },
00794
00795
00796 { &rep_processmsg_envid, &rep_processmsg_class, "envid", "I" }
00797 };
00798
00799 const struct {
00800 jmethodID *mid;
00801 jclass *cl;
00802 const char *name;
00803 const char *sig;
00804 } all_methods[] = {
00805 { &dbenv_construct, &dbenv_class, "<init>", "(JZ)V" },
00806 { &dbt_construct, &dbt_class, "<init>", "()V" },
00807 { &dblsn_construct, &dblsn_class, "<init>", "(II)V" },
00808 { &dbpreplist_construct, &dbpreplist_class, "<init>",
00809 "(L" DB_PKG "internal/DbTxn;[B)V" },
00810 { &dbtxn_construct, &dbtxn_class, "<init>", "(JZ)V" },
00811
00812 { &bt_stat_construct, &bt_stat_class, "<init>", "()V" },
00813 { &h_stat_construct, &h_stat_class, "<init>", "()V" },
00814 { &lock_stat_construct, &lock_stat_class, "<init>", "()V" },
00815 { &log_stat_construct, &log_stat_class, "<init>", "()V" },
00816 { &mpool_stat_construct, &mpool_stat_class, "<init>", "()V" },
00817 { &mpool_fstat_construct, &mpool_fstat_class, "<init>", "()V" },
00818 { &mutex_stat_construct, &mutex_stat_class, "<init>", "()V" },
00819 { &qam_stat_construct, &qam_stat_class, "<init>", "()V" },
00820 { &rep_stat_construct, &rep_stat_class, "<init>", "()V" },
00821 { &seq_stat_construct, &seq_stat_class, "<init>", "()V" },
00822 { &txn_stat_construct, &txn_stat_class, "<init>", "()V" },
00823 { &txn_active_construct, &txn_active_class, "<init>", "()V" },
00824
00825 { &dbex_construct, &dbex_class, "<init>",
00826 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00827 { &deadex_construct, &deadex_class, "<init>",
00828 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00829 { &lockex_construct, &lockex_class, "<init>",
00830 "(Ljava/lang/String;IIL" DB_PKG "DatabaseEntry;L"
00831 DB_PKG "internal/DbLock;IL" DB_PKG "internal/DbEnv;)V" },
00832 { &memex_construct, &memex_class, "<init>",
00833 "(Ljava/lang/String;L" DB_PKG "DatabaseEntry;IL"
00834 DB_PKG "internal/DbEnv;)V" },
00835 { &memex_update_method, &memex_class, "updateDatabaseEntry",
00836 "(L" DB_PKG "DatabaseEntry;)V" },
00837 { &repdupmasterex_construct, &repdupmasterex_class, "<init>",
00838 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00839 { &rephandledeadex_construct, &rephandledeadex_class, "<init>",
00840 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00841 { &repholdelectionex_construct, &repholdelectionex_class, "<init>",
00842 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00843 { &repjoinfailex_construct, &repjoinfailex_class, "<init>",
00844 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00845 { &replockoutex_construct, &replockoutex_class, "<init>",
00846 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00847 { &repunavailex_construct, &repunavailex_class, "<init>",
00848 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00849 { &runrecex_construct, &runrecex_class, "<init>",
00850 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00851 { &versionex_construct, &versionex_class, "<init>",
00852 "(Ljava/lang/String;IL" DB_PKG "internal/DbEnv;)V" },
00853 { &filenotfoundex_construct, &filenotfoundex_class, "<init>",
00854 "(Ljava/lang/String;)V" },
00855 { &illegalargex_construct, &illegalargex_class, "<init>",
00856 "(Ljava/lang/String;)V" },
00857 { &outofmemerr_construct, &outofmemerr_class, "<init>",
00858 "(Ljava/lang/String;)V" },
00859
00860 { &lock_construct, &lock_class, "<init>", "(JZ)V" },
00861
00862 { &app_dispatch_method, &dbenv_class, "handle_app_dispatch",
00863 "(L" DB_PKG "DatabaseEntry;L" DB_PKG "LogSequenceNumber;I)I" },
00864 { &env_feedback_method, &dbenv_class, "handle_env_feedback", "(II)V" },
00865 { &errcall_method, &dbenv_class, "handle_error",
00866 "(Ljava/lang/String;)V" },
00867 { &msgcall_method, &dbenv_class, "handle_message",
00868 "(Ljava/lang/String;)V" },
00869 { &paniccall_method, &dbenv_class, "handle_panic",
00870 "(L" DB_PKG "DatabaseException;)V" },
00871 { &rep_transport_method, &dbenv_class, "handle_rep_transport",
00872 "(L" DB_PKG "DatabaseEntry;L" DB_PKG "DatabaseEntry;L"
00873 DB_PKG "LogSequenceNumber;II)I" },
00874
00875 { &append_recno_method, &db_class, "handle_append_recno",
00876 "(L" DB_PKG "DatabaseEntry;I)V" },
00877 { &bt_compare_method, &db_class, "handle_bt_compare",
00878 "([B[B)I" },
00879 { &bt_prefix_method, &db_class, "handle_bt_prefix",
00880 "(L" DB_PKG "DatabaseEntry;L" DB_PKG "DatabaseEntry;)I" },
00881 { &db_feedback_method, &db_class, "handle_db_feedback", "(II)V" },
00882 { &dup_compare_method, &db_class, "handle_dup_compare",
00883 "([B[B)I" },
00884 { &h_hash_method, &db_class, "handle_h_hash", "([BI)I" },
00885 { &seckey_create_method, &db_class, "handle_seckey_create",
00886 "(L" DB_PKG "DatabaseEntry;L" DB_PKG "DatabaseEntry;L"
00887 DB_PKG "DatabaseEntry;)I" },
00888
00889 { &outputstream_write_method, &outputstream_class, "write", "([BII)V" }
00890 };
00891
00892 #define NELEM(x) (sizeof (x) / sizeof (x[0]))
00893
00894 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_initialize(
00895 JNIEnv *jenv, jclass clazz)
00896 {
00897 jclass cl;
00898 unsigned int i, j;
00899
00900 COMPQUIET(clazz, NULL);
00901
00902 if ((*jenv)->GetJavaVM(jenv, &javavm) != 0) {
00903 __db_err(NULL, "Cannot get Java VM");
00904 return;
00905 }
00906
00907 for (i = 0; i < NELEM(all_classes); i++) {
00908 cl = (*jenv)->FindClass(jenv, all_classes[i].name);
00909 if (cl == NULL) {
00910 fprintf(stderr,
00911 "Failed to load class %s - check CLASSPATH\n",
00912 all_classes[i].name);
00913 return;
00914 }
00915
00916
00917
00918
00919
00920 *all_classes[i].cl = (jclass)(*jenv)->NewGlobalRef(jenv, cl);
00921
00922 if (*all_classes[i].cl == NULL) {
00923 fprintf(stderr,
00924 "Failed to create a global reference for %s\n",
00925 all_classes[i].name);
00926 return;
00927 }
00928 }
00929
00930
00931
00932 for (i = 0; i < NELEM(all_fields); i++) {
00933 *all_fields[i].fid = (*jenv)->GetFieldID(jenv,
00934 *all_fields[i].cl, all_fields[i].name, all_fields[i].sig);
00935
00936 if (*all_fields[i].fid == NULL) {
00937 fprintf(stderr,
00938 "Failed to look up field %s with sig %s\n",
00939 all_fields[i].name, all_fields[i].sig);
00940 return;
00941 }
00942 }
00943
00944
00945 for (i = 0; i < NELEM(all_methods); i++) {
00946 *all_methods[i].mid = (*jenv)->GetMethodID(jenv,
00947 *all_methods[i].cl, all_methods[i].name,
00948 all_methods[i].sig);
00949
00950 if (*all_methods[i].mid == NULL) {
00951 for (j = 0; j < NELEM(all_classes); j++)
00952 if (all_methods[i].cl == all_classes[j].cl)
00953 break;
00954 fprintf(stderr,
00955 "Failed to look up method %s.%s with sig %s\n",
00956 all_classes[j].name, all_methods[i].name,
00957 all_methods[i].sig);
00958 return;
00959 }
00960 }
00961 }
00962
00963 static JNIEnv *__dbj_get_jnienv(void)
00964 {
00965
00966
00967
00968
00969
00970
00971 #ifdef JNI_VERSION_1_2
00972 void *jenv = 0;
00973 #else
00974 JNIEnv *jenv = 0;
00975 #endif
00976
00977
00978
00979
00980
00981 if ((*javavm)->AttachCurrentThread(javavm, &jenv, 0) != 0)
00982 return (0);
00983
00984 return ((JNIEnv *)jenv);
00985 }
00986
00987 static jobject __dbj_wrap_DB_LSN(JNIEnv *jenv, DB_LSN *lsn)
00988 {
00989 return (*jenv)->NewObject(jenv, dblsn_class, dblsn_construct,
00990 lsn->file, lsn->offset);
00991 }
00992
00993
00994
00995
00996
00997
00998 #define JDBENV (arg1 ? (jobject)DB_ENV_INTERNAL(arg1) : NULL)
00999 #define DB2JDBENV ((jobject)DB_ENV_INTERNAL(arg1->dbenv))
01000 #define DBC2JDBENV ((jobject)DB_ENV_INTERNAL(arg1->dbp->dbenv))
01001 #define TXN2JDBENV ((jobject)DB_ENV_INTERNAL(arg1->mgrp->dbenv))
01002
01003
01004 static jthrowable __dbj_get_except(JNIEnv *jenv,
01005 int err, const char *msg, jobject obj, jobject jdbenv) {
01006 jobject jmsg;
01007
01008 if (msg == NULL)
01009 msg = db_strerror(err);
01010
01011 jmsg = (*jenv)->NewStringUTF(jenv, msg);
01012
01013 switch (err) {
01014 case EINVAL:
01015 return (jthrowable)(*jenv)->NewObject(jenv,
01016 illegalargex_class, illegalargex_construct, jmsg);
01017
01018 case ENOENT:
01019 return (jthrowable)(*jenv)->NewObject(jenv,
01020 filenotfoundex_class, filenotfoundex_construct, jmsg);
01021
01022 case ENOMEM:
01023 return (jthrowable)(*jenv)->NewObject(jenv,
01024 outofmemerr_class, outofmemerr_construct, jmsg);
01025
01026 case DB_BUFFER_SMALL:
01027 return (jthrowable)(*jenv)->NewObject(jenv, memex_class,
01028 memex_construct, jmsg, obj, err, jdbenv);
01029
01030 case DB_REP_DUPMASTER:
01031 return (jthrowable)(*jenv)->NewObject(jenv,
01032 repdupmasterex_class, repdupmasterex_construct,
01033 jmsg, err, jdbenv);
01034
01035 case DB_REP_HANDLE_DEAD:
01036 return (jthrowable)(*jenv)->NewObject(jenv,
01037 rephandledeadex_class, rephandledeadex_construct,
01038 jmsg, err, jdbenv);
01039
01040 case DB_REP_HOLDELECTION:
01041 return (jthrowable)(*jenv)->NewObject(jenv,
01042 repholdelectionex_class, repholdelectionex_construct,
01043 jmsg, err, jdbenv);
01044
01045 case DB_REP_JOIN_FAILURE:
01046 return (jthrowable)(*jenv)->NewObject(jenv,
01047 repjoinfailex_class, repjoinfailex_construct,
01048 jmsg, err, jdbenv);
01049
01050 case DB_REP_LOCKOUT:
01051 return (jthrowable)(*jenv)->NewObject(jenv,
01052 replockoutex_class, replockoutex_construct,
01053 jmsg, err, jdbenv);
01054
01055 case DB_REP_UNAVAIL:
01056 return (jthrowable)(*jenv)->NewObject(jenv,
01057 repunavailex_class, repunavailex_construct,
01058 jmsg, err, jdbenv);
01059
01060 case DB_RUNRECOVERY:
01061 return (jthrowable)(*jenv)->NewObject(jenv, runrecex_class,
01062 runrecex_construct, jmsg, err, jdbenv);
01063
01064 case DB_LOCK_DEADLOCK:
01065 return (jthrowable)(*jenv)->NewObject(jenv, deadex_class,
01066 deadex_construct, jmsg, err, jdbenv);
01067
01068 case DB_LOCK_NOTGRANTED:
01069 return (jthrowable)(*jenv)->NewObject(jenv, lockex_class,
01070 lockex_construct, jmsg, 0, 0, NULL, NULL, 0, jdbenv);
01071
01072 case DB_VERSION_MISMATCH:
01073 return (jthrowable)(*jenv)->NewObject(jenv, versionex_class,
01074 versionex_construct, jmsg, 0, 0, NULL, NULL, 0, jdbenv);
01075
01076 default:
01077 return (jthrowable)(*jenv)->NewObject(jenv, dbex_class,
01078 dbex_construct, jmsg, err, jdbenv);
01079 }
01080 }
01081
01082 static int __dbj_throw(JNIEnv *jenv,
01083 int err, const char *msg, jobject obj, jobject jdbenv)
01084 {
01085 jthrowable t;
01086
01087
01088 if ((*jenv)->ExceptionOccurred(jenv) == NULL) {
01089 t = __dbj_get_except(jenv, err, msg, obj, jdbenv);
01090 if (t == NULL) {
01091
01092
01093
01094
01095
01096
01097
01098 if (msg == NULL)
01099 msg = db_strerror(err);
01100
01101 __db_err(NULL, "Couldn't create exception for: '%s'",
01102 msg);
01103 } else
01104 (*jenv)->Throw(jenv, t);
01105 }
01106
01107 return (err);
01108 }
01109
01110
01111 typedef struct __dbt_locked {
01112 DBT dbt;
01113 jbyteArray jarr;
01114 jbyte *orig_data;
01115 jint offset;
01116 int reuse;
01117 u_int32_t orig_size;
01118 jsize array_len;
01119 } DBT_LOCKED;
01120
01121 static int __dbj_dbt_copyin(
01122 JNIEnv *jenv, DBT_LOCKED *ldbt, DBT **dbtp, jobject jdbt, int allow_null)
01123 {
01124 DBT *dbt;
01125
01126 memset(ldbt, 0, sizeof (*ldbt));
01127
01128 if (jdbt == NULL) {
01129 if (allow_null) {
01130 *dbtp = NULL;
01131 return (0);
01132 } else {
01133 return (__dbj_throw(jenv, EINVAL,
01134 "DatabaseEntry must not be null", NULL, NULL));
01135 }
01136 }
01137
01138 dbt = &ldbt->dbt;
01139 if (dbtp != NULL)
01140 *dbtp = dbt;
01141
01142 ldbt->jarr = (jbyteArray)(*jenv)->GetObjectField(jenv,
01143 jdbt, dbt_data_fid);
01144 ldbt->offset = (*jenv)->GetIntField(jenv, jdbt, dbt_offset_fid);
01145
01146 dbt->size = (*jenv)->GetIntField(jenv, jdbt, dbt_size_fid);
01147 ldbt->orig_size = dbt->size;
01148 dbt->ulen = (*jenv)->GetIntField(jenv, jdbt, dbt_ulen_fid);
01149 dbt->dlen = (*jenv)->GetIntField(jenv, jdbt, dbt_dlen_fid);
01150 dbt->doff = (*jenv)->GetIntField(jenv, jdbt, dbt_doff_fid);
01151 dbt->flags = (*jenv)->GetIntField(jenv, jdbt, dbt_flags_fid);
01152
01153
01154
01155
01156
01157 if (!F_ISSET(dbt, DB_DBT_USERMEM)) {
01158 ldbt->reuse = !F_ISSET(dbt, DB_DBT_MALLOC);
01159 F_CLR(dbt, DB_DBT_REALLOC);
01160 F_SET(dbt, DB_DBT_MALLOC);
01161 }
01162
01163
01164 if ((jint)dbt->doff < 0)
01165 return (__dbj_throw(jenv, EINVAL, "DatabaseEntry doff illegal",
01166 NULL, NULL));
01167
01168 if (ldbt->jarr == NULL) {
01169
01170
01171
01172
01173
01174
01175
01176
01177 ldbt->orig_data = dbt->data = NULL;
01178 ldbt->array_len = ldbt->offset = dbt->size = dbt->ulen = 0;
01179 return (0);
01180 } else
01181 ldbt->array_len = (*jenv)->GetArrayLength(jenv, ldbt->jarr);
01182
01183 if (F_ISSET(dbt, DB_DBT_USERMEM)) {
01184 if (ldbt->offset < 0)
01185 return (__dbj_throw(jenv, EINVAL,
01186 "offset cannot be negative",
01187 NULL, NULL));
01188 if (dbt->size > dbt->ulen)
01189 return (__dbj_throw(jenv, EINVAL,
01190 "size must be less than or equal to ulen",
01191 NULL, NULL));
01192 if ((jsize)(ldbt->offset + dbt->ulen) > ldbt->array_len)
01193 return (__dbj_throw(jenv, EINVAL,
01194 "offset + ulen greater than array length",
01195 NULL, NULL));
01196 if ((ldbt->orig_data = (*jenv)->GetByteArrayElements(jenv,
01197 ldbt->jarr, NULL)) == NULL)
01198 return (EINVAL);
01199 dbt->data = ldbt->orig_data + ldbt->offset;
01200 } else {
01201 if (__os_umalloc(NULL, dbt->size, &dbt->data) != 0)
01202 return (__dbj_throw(jenv, ENOMEM,
01203 "Could not allocate memory for entry", NULL, NULL));
01204 ldbt->orig_data = dbt->data;
01205 (*jenv)->GetByteArrayRegion(jenv,
01206 ldbt->jarr, ldbt->offset, dbt->size, dbt->data);
01207 if ((*jenv)->ExceptionOccurred(jenv)) {
01208 (void)__os_ufree(NULL, dbt->data);
01209 return (EINVAL);
01210 }
01211 }
01212
01213 return (0);
01214 }
01215
01216 static void __dbj_dbt_copyout(
01217 JNIEnv *jenv, const DBT *dbt, jbyteArray *jarr, jobject jdbt)
01218 {
01219 jbyteArray newarr = (*jenv)->NewByteArray(jenv, (jsize)dbt->size);
01220 if (newarr == NULL)
01221 return;
01222 (*jenv)->SetByteArrayRegion(jenv, newarr, 0, (jsize)dbt->size,
01223 (jbyte *)dbt->data);
01224 (*jenv)->SetObjectField(jenv, jdbt, dbt_data_fid, newarr);
01225 (*jenv)->SetIntField(jenv, jdbt, dbt_offset_fid, 0);
01226 (*jenv)->SetIntField(jenv, jdbt, dbt_size_fid, (jint)dbt->size);
01227 if (jarr != NULL)
01228 *jarr = newarr;
01229 else
01230 (*jenv)->DeleteLocalRef(jenv, newarr);
01231 }
01232
01233 static void __dbj_dbt_release(
01234 JNIEnv *jenv, jobject jdbt, DBT *dbt, DBT_LOCKED *ldbt) {
01235 jthrowable t;
01236
01237 if (dbt == NULL)
01238 return;
01239
01240 if (dbt->size != ldbt->orig_size)
01241 (*jenv)->SetIntField(jenv, jdbt, dbt_size_fid, (jint)dbt->size);
01242
01243 if (F_ISSET(dbt, DB_DBT_USERMEM)) {
01244 if (ldbt->jarr != NULL)
01245 (*jenv)->ReleaseByteArrayElements(jenv,
01246 ldbt->jarr, ldbt->orig_data, 0);
01247
01248 if (dbt->size > dbt->ulen &&
01249 (t = (*jenv)->ExceptionOccurred(jenv)) != NULL &&
01250 (*jenv)->IsInstanceOf(jenv, t, memex_class)) {
01251 (*jenv)->CallNonvirtualVoidMethod(jenv, t, memex_class,
01252 memex_update_method, jdbt);
01253
01254
01255
01256
01257 (*jenv)->Throw(jenv, t);
01258 }
01259 } else {
01260 if (dbt->size > 0 && dbt->data != ldbt->orig_data) {
01261 if (ldbt->reuse &&
01262 (jsize)(ldbt->offset + dbt->size) <= ldbt->array_len)
01263 (*jenv)->SetByteArrayRegion(jenv,
01264 ldbt->jarr, ldbt->offset, (jsize)dbt->size,
01265 (jbyte *)dbt->data);
01266 else
01267 __dbj_dbt_copyout(jenv, dbt, NULL, jdbt);
01268 (void)__os_ufree(NULL, dbt->data);
01269 }
01270
01271 if (ldbt->orig_data != NULL)
01272 (void)__os_ufree(NULL, ldbt->orig_data);
01273 }
01274 }
01275
01276
01277 struct __dbj_verify_data {
01278 JNIEnv *jenv;
01279 jobject streamobj;
01280 jbyteArray bytes;
01281 int nbytes;
01282 };
01283
01284 static int __dbj_verify_callback(void *handle, const void *str_arg) {
01285 char *str;
01286 struct __dbj_verify_data *vd;
01287 int len;
01288 JNIEnv *jenv;
01289
01290 str = (char *)str_arg;
01291 vd = (struct __dbj_verify_data *)handle;
01292 jenv = vd->jenv;
01293 len = strlen(str) + 1;
01294 if (len > vd->nbytes) {
01295 vd->nbytes = len;
01296 if (vd->bytes != NULL)
01297 (*jenv)->DeleteLocalRef(jenv, vd->bytes);
01298 if ((vd->bytes = (*jenv)->NewByteArray(jenv, (jsize)len))
01299 == NULL)
01300 return (ENOMEM);
01301 }
01302
01303 if (vd->bytes != NULL) {
01304 (*jenv)->SetByteArrayRegion(jenv, vd->bytes, 0, (jsize)len,
01305 (jbyte*)str);
01306 (*jenv)->CallVoidMethod(jenv, vd->streamobj,
01307 outputstream_write_method, vd->bytes, 0, len - 1);
01308 }
01309
01310 if ((*jenv)->ExceptionOccurred(jenv) != NULL)
01311 return (EIO);
01312
01313 return (0);
01314 }
01315
01316
01317 JNIEXPORT void JNICALL
01318 Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1vec(JNIEnv *jenv,
01319 jclass jcls, jlong jdbenvp, jint locker, jint flags, jobjectArray list,
01320 jint offset, jint count) {
01321 DB_ENV *dbenv;
01322 DB_LOCKREQ *lockreq;
01323 DB_LOCKREQ *prereq;
01324 DB_LOCKREQ *failedreq;
01325 DB_LOCK *lockp;
01326 DBT_LOCKED *locked_dbts;
01327 int err, alloc_err, i;
01328 size_t bytesize, ldbtsize;
01329 jobject jlockreq;
01330 db_lockop_t op;
01331 jobject jobj, jlock, jdbenv;
01332 jlong jlockp;
01333 int completed;
01334
01335 COMPQUIET(jcls, NULL);
01336 dbenv = *(DB_ENV **)(void *)&jdbenvp;
01337 jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
01338
01339 if (dbenv == NULL) {
01340 __dbj_throw(jenv, EINVAL, "null object", NULL, jdbenv);
01341 return;
01342 }
01343
01344 if ((*jenv)->GetArrayLength(jenv, list) < offset + count) {
01345 __dbj_throw(jenv, EINVAL,
01346 "DbEnv.lock_vec array not large enough", NULL, jdbenv);
01347 goto out0;
01348 }
01349
01350 bytesize = sizeof(DB_LOCKREQ) * count;
01351 if ((err = __os_malloc(dbenv, bytesize, &lockreq)) != 0) {
01352 __dbj_throw(jenv, err, NULL, NULL, jdbenv);
01353 goto out0;
01354 }
01355 memset(lockreq, 0, bytesize);
01356
01357 ldbtsize = sizeof(DBT_LOCKED) * count;
01358 if ((err = __os_malloc(dbenv, ldbtsize, &locked_dbts)) != 0) {
01359 __dbj_throw(jenv, err, NULL, NULL, jdbenv);
01360 goto out1;
01361 }
01362 memset(locked_dbts, 0, ldbtsize);
01363 prereq = &lockreq[0];
01364
01365
01366 for (i = 0, prereq = &lockreq[0]; i < count; i++, prereq++) {
01367 jlockreq = (*jenv)->GetObjectArrayElement(jenv, list,
01368 offset + i);
01369 if (jlockreq == NULL) {
01370 __dbj_throw(jenv, EINVAL,
01371 "DbEnv.lock_vec list entry is null", NULL, jdbenv);
01372 goto out2;
01373 }
01374 op = (*jenv)->GetIntField(jenv, jlockreq, lockreq_op_fid);
01375 prereq->op = op;
01376
01377 switch (op) {
01378 case DB_LOCK_GET_TIMEOUT:
01379
01380 prereq->op = (*jenv)->GetIntField(jenv, jlockreq,
01381 lockreq_timeout_fid);
01382
01383 case DB_LOCK_GET:
01384
01385 prereq->mode = (*jenv)->GetIntField(jenv, jlockreq,
01386 lockreq_modeflag_fid);
01387 jobj = (*jenv)->GetObjectField(jenv, jlockreq,
01388 lockreq_obj_fid);
01389 if ((err = __dbj_dbt_copyin(jenv,
01390 &locked_dbts[i], &prereq->obj, jobj, 0)) != 0)
01391 goto out2;
01392 break;
01393 case DB_LOCK_PUT:
01394
01395 jlock = (*jenv)->GetObjectField(jenv, jlockreq,
01396 lockreq_lock_fid);
01397 if (jlock == NULL ||
01398 (jlockp = (*jenv)->GetLongField(jenv, jlock,
01399 lock_cptr_fid)) == 0L) {
01400 __dbj_throw(jenv, EINVAL,
01401 "LockRequest lock field is NULL", NULL,
01402 jdbenv);
01403 goto out2;
01404 }
01405 lockp = *(DB_LOCK **)(void *)&jlockp;
01406 prereq->lock = *lockp;
01407 break;
01408 case DB_LOCK_PUT_ALL:
01409 case DB_LOCK_TIMEOUT:
01410
01411 break;
01412 case DB_LOCK_PUT_OBJ:
01413
01414 jobj = (*jenv)->GetObjectField(jenv, jlockreq,
01415 lockreq_obj_fid);
01416 if ((err = __dbj_dbt_copyin(jenv,
01417 &locked_dbts[i], &prereq->obj, jobj, 0)) != 0)
01418 goto out2;
01419 break;
01420 default:
01421 __dbj_throw(jenv, EINVAL,
01422 "DbEnv.lock_vec bad op value", NULL, jdbenv);
01423 goto out2;
01424 }
01425 }
01426
01427 err = dbenv->lock_vec(dbenv, (u_int32_t)locker, (u_int32_t)flags,
01428 lockreq, count, &failedreq);
01429 if (err == 0)
01430 completed = count;
01431 else
01432 completed = failedreq - lockreq;
01433
01434
01435 for (i = 0; i < completed; i++) {
01436 op = lockreq[i].op;
01437 if (op == DB_LOCK_PUT) {
01438
01439
01440
01441
01442 jlockreq = (*jenv)->GetObjectArrayElement(jenv,
01443 list, i + offset);
01444 jlock = (*jenv)->GetObjectField(jenv, jlockreq,
01445 lockreq_lock_fid);
01446 jlockp = (*jenv)->GetLongField(jenv, jlock,
01447 lock_cptr_fid);
01448 lockp = *(DB_LOCK **)(void *)&jlockp;
01449 __os_free(NULL, lockp);
01450 (*jenv)->SetLongField(jenv, jlock, lock_cptr_fid,
01451 (jlong)0);
01452 }
01453 else if (op == DB_LOCK_GET) {
01454
01455
01456
01457
01458
01459 if ((alloc_err =
01460 __os_malloc(dbenv, sizeof(DB_LOCK), &lockp)) != 0) {
01461 __dbj_throw(jenv, alloc_err, NULL, NULL,
01462 jdbenv);
01463 goto out2;
01464 }
01465
01466 *lockp = lockreq[i].lock;
01467 *(DB_LOCK **)(void *)&jlockp = lockp;
01468
01469 jlockreq = (*jenv)->GetObjectArrayElement(jenv,
01470 list, i + offset);
01471 jlock = (*jenv)->NewObject(jenv, lock_class,
01472 lock_construct, jlockp, JNI_TRUE);
01473 if (jlock == NULL)
01474 goto out2;
01475 (*jenv)->SetLongField(jenv, jlock, lock_cptr_fid,
01476 jlockp);
01477 (*jenv)->SetObjectField(jenv, jlockreq,
01478 lockreq_lock_fid, jlock);
01479 }
01480 }
01481
01482
01483 if (err == DB_LOCK_NOTGRANTED && i < count) {
01484 jlockreq = (*jenv)->GetObjectArrayElement(jenv, list,
01485 i + offset);
01486 jobj = (*jenv)->GetObjectField(jenv, jlockreq,
01487 lockreq_obj_fid);
01488 jlock = (*jenv)->GetObjectField(jenv, jlockreq,
01489 lockreq_lock_fid);
01490 (*jenv)->Throw(jenv,
01491 (*jenv)->NewObject(jenv, lockex_class, lockex_construct,
01492 (*jenv)->NewStringUTF(jenv, "DbEnv.lock_vec incomplete"),
01493 lockreq[i].op, lockreq[i].mode, jobj, jlock, i, jdbenv));
01494 } else if (err != 0)
01495 __dbj_throw(jenv, err, NULL, NULL, jdbenv);
01496
01497 out2:
01498 for (i = 0 ; i < (prereq - lockreq); i++) {
01499 if (((op = lockreq[i].op) == DB_LOCK_GET ||
01500 op == DB_LOCK_PUT_OBJ) &&
01501 locked_dbts[i].jarr != NULL)
01502 (*jenv)->ReleaseByteArrayElements(jenv,
01503 locked_dbts[i].jarr, locked_dbts[i].orig_data, 0);
01504 }
01505 __os_free(dbenv, locked_dbts);
01506 out1: __os_free(dbenv, lockreq);
01507 out0: return;
01508 }
01509
01510
01511
01512
01513
01514 #define JAVADB_STAT_INT(jenv, jobj, fid, statp, name) \
01515 (*jenv)->SetIntField(jenv, jobj, fid, (jint)statp->name)
01516
01517 #define JAVADB_STAT_STRING(jenv, jobj, fid, statp, name) \
01518 (*jenv)->SetObjectField(jenv, jobj, fid, \
01519 (*jenv)->NewStringUTF(jenv, statp->name))
01520
01521 #define JAVADB_STAT_LSN(jenv, jobj, fid, statp, name) \
01522 (*jenv)->SetObjectField(jenv, jobj, fid, \
01523 __dbj_wrap_DB_LSN(jenv, &statp->name))
01524
01525 #define JAVADB_STAT_LONG(jenv, jobj, fid, statp, name) \
01526 (*jenv)->SetLongField(jenv, jobj, fid, \
01527 (jlong)statp->name)
01528
01529 #define JAVADB_STAT_XID(jenv, jobj, fid, statp, name) { \
01530 jobject jarr = \
01531 (*jenv)->NewByteArray(jenv, (jsize)DB_XIDDATASIZE); \
01532 (*jenv)->SetByteArrayRegion(jenv, jarr, \
01533 0, (jsize)DB_XIDDATASIZE, (jbyte *)statp->name); \
01534 (*jenv)->SetObjectField(jenv, jobj, fid, jarr); \
01535 }
01536
01537
01538
01539
01540 #define JAVADB_STAT_ACTIVE(jenv, cl, jobj, statp, name) \
01541 do {} while(0)
01542
01543 #include "java_stat_auto.c"
01544
01545
01546 static void __dbj_error(const DB_ENV *dbenv,
01547 const char *prefix, const char *msg)
01548 {
01549 JNIEnv *jenv = __dbj_get_jnienv();
01550 jobject jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
01551
01552 COMPQUIET(prefix, NULL);
01553
01554 if (jdbenv != NULL)
01555 (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, dbenv_class,
01556 errcall_method, (*jenv)->NewStringUTF(jenv, msg));
01557 }
01558
01559 static void __dbj_env_feedback(DB_ENV *dbenv, int opcode, int percent)
01560 {
01561 JNIEnv *jenv = __dbj_get_jnienv();
01562 jobject jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
01563
01564 if (jdbenv != NULL)
01565 (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, dbenv_class,
01566 env_feedback_method, opcode, percent);
01567 }
01568
01569 static void __dbj_message(const DB_ENV *dbenv, const char *msg)
01570 {
01571 JNIEnv *jenv = __dbj_get_jnienv();
01572 jobject jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
01573
01574 if (jdbenv != NULL)
01575 (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, dbenv_class,
01576 msgcall_method, (*jenv)->NewStringUTF(jenv, msg));
01577 }
01578
01579 static void __dbj_panic(DB_ENV *dbenv, int err)
01580 {
01581 JNIEnv *jenv = __dbj_get_jnienv();
01582 jobject jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
01583
01584 if (jdbenv != NULL)
01585 (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, dbenv_class,
01586 paniccall_method,
01587 __dbj_get_except(jenv, err, NULL, NULL, jdbenv));
01588 }
01589
01590 static int __dbj_app_dispatch(DB_ENV *dbenv,
01591 DBT *dbt, DB_LSN *lsn, db_recops recops)
01592 {
01593 JNIEnv *jenv = __dbj_get_jnienv();
01594 jobject jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
01595 jobject jdbt, jlsn;
01596 jbyteArray jdbtarr;
01597 int ret;
01598
01599 if (jdbenv == NULL)
01600 return (EINVAL);
01601
01602 jdbt = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01603 __dbj_dbt_copyout(jenv, dbt, &jdbtarr, jdbt);
01604 if (jdbt == NULL)
01605 return (ENOMEM);
01606
01607 jlsn = (lsn == NULL) ? NULL : __dbj_wrap_DB_LSN(jenv, lsn);
01608
01609 ret = (*jenv)->CallNonvirtualIntMethod(jenv, jdbenv, dbenv_class,
01610 app_dispatch_method, jdbt, jlsn, recops);
01611
01612 if ((*jenv)->ExceptionOccurred(jenv)) {
01613
01614 ret = EINVAL;
01615 }
01616
01617 (*jenv)->DeleteLocalRef(jenv, jdbtarr);
01618 (*jenv)->DeleteLocalRef(jenv, jdbt);
01619 if (jlsn != NULL)
01620 (*jenv)->DeleteLocalRef(jenv, jlsn);
01621
01622 return (ret);
01623 }
01624
01625 static int __dbj_rep_transport(DB_ENV *dbenv,
01626 const DBT *control, const DBT *rec, const DB_LSN *lsn, int envid,
01627 u_int32_t flags)
01628 {
01629 JNIEnv *jenv = __dbj_get_jnienv();
01630 jobject jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
01631 jobject jcontrol, jrec, jlsn;
01632 jbyteArray jcontrolarr, jrecarr;
01633 int ret;
01634
01635 if (jdbenv == NULL)
01636 return (EINVAL);
01637
01638 jcontrol = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01639 jrec = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01640 if (jcontrol == NULL || jrec == NULL)
01641 return (ENOMEM);
01642
01643 __dbj_dbt_copyout(jenv, control, &jcontrolarr, jcontrol);
01644 __dbj_dbt_copyout(jenv, rec, &jrecarr, jrec);
01645 jlsn = (lsn == NULL) ? NULL : __dbj_wrap_DB_LSN(jenv, (DB_LSN *)lsn);
01646
01647 if (jcontrolarr == NULL || jrecarr == NULL)
01648 return (ENOMEM);
01649
01650 ret = (*jenv)->CallNonvirtualIntMethod(jenv, jdbenv, dbenv_class,
01651 rep_transport_method, jcontrol, jrec, jlsn, envid, flags);
01652
01653 if ((*jenv)->ExceptionOccurred(jenv)) {
01654
01655 ret = EINVAL;
01656 }
01657
01658 (*jenv)->DeleteLocalRef(jenv, jrecarr);
01659 (*jenv)->DeleteLocalRef(jenv, jcontrolarr);
01660 (*jenv)->DeleteLocalRef(jenv, jrec);
01661 (*jenv)->DeleteLocalRef(jenv, jcontrol);
01662 if (jlsn != NULL)
01663 (*jenv)->DeleteLocalRef(jenv, jlsn);
01664
01665 return (ret);
01666 }
01667
01668 static int __dbj_seckey_create(DB *db,
01669 const DBT *key, const DBT *data, DBT *result)
01670 {
01671 JNIEnv *jenv = __dbj_get_jnienv();
01672 jobject jdb = (jobject)DB_INTERNAL(db);
01673 jobject jkey, jdata, jresult;
01674 jbyteArray jkeyarr, jdataarr;
01675 DBT_LOCKED lresult;
01676 int ret;
01677
01678 if (jdb == NULL)
01679 return (EINVAL);
01680
01681 jkey = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01682 jdata = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01683 jresult = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01684 if (jkey == NULL || jdata == NULL || jresult == NULL)
01685 return (ENOMEM);
01686
01687 __dbj_dbt_copyout(jenv, key, &jkeyarr, jkey);
01688 __dbj_dbt_copyout(jenv, data, &jdataarr, jdata);
01689
01690 if (jkeyarr == NULL || jdataarr == NULL)
01691 return (ENOMEM);
01692
01693 ret = (int)(*jenv)->CallNonvirtualIntMethod(jenv, jdb, db_class,
01694 seckey_create_method, jkey, jdata, jresult);
01695
01696 if (ret != 0)
01697 goto err;
01698
01699 if ((*jenv)->ExceptionOccurred(jenv)) {
01700
01701 ret = EINVAL;
01702 goto err;
01703 }
01704
01705 if ((ret = __dbj_dbt_copyin(jenv, &lresult, NULL, jresult, 0)) != 0)
01706 goto err;
01707
01708 if (lresult.jarr != NULL) {
01709
01710
01711
01712
01713 *result = lresult.dbt;
01714 (*jenv)->DeleteLocalRef(jenv, lresult.jarr);
01715 result->flags |= DB_DBT_APPMALLOC;
01716 }
01717
01718 err: (*jenv)->DeleteLocalRef(jenv, jkeyarr);
01719 (*jenv)->DeleteLocalRef(jenv, jkey);
01720 (*jenv)->DeleteLocalRef(jenv, jdataarr);
01721 (*jenv)->DeleteLocalRef(jenv, jdata);
01722 (*jenv)->DeleteLocalRef(jenv, jresult);
01723
01724 return (ret);
01725 }
01726
01727 static int __dbj_append_recno(DB *db, DBT *dbt, db_recno_t recno)
01728 {
01729 JNIEnv *jenv = __dbj_get_jnienv();
01730 jobject jdb = (jobject)DB_INTERNAL(db);
01731 jobject jdbt;
01732 DBT_LOCKED lresult;
01733 jbyteArray jdbtarr;
01734 int ret;
01735
01736 if (jdb == NULL)
01737 return (EINVAL);
01738
01739 jdbt = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01740 if (jdbt == NULL)
01741 return (ENOMEM);
01742
01743 __dbj_dbt_copyout(jenv, dbt, &jdbtarr, jdbt);
01744 if (jdbtarr == NULL)
01745 return (ENOMEM);
01746
01747 ret = 0;
01748 (*jenv)->CallNonvirtualVoidMethod(jenv, jdb, db_class,
01749 append_recno_method, jdbt, recno);
01750
01751 if ((*jenv)->ExceptionOccurred(jenv)) {
01752
01753 ret = EINVAL;
01754 goto err;
01755 }
01756
01757 if ((ret = __dbj_dbt_copyin(jenv, &lresult, NULL, jdbt, 0)) != 0)
01758 goto err;
01759
01760 if (lresult.jarr != NULL) {
01761
01762
01763
01764
01765 *dbt = lresult.dbt;
01766 (*jenv)->DeleteLocalRef(jenv, lresult.jarr);
01767 dbt->flags |= DB_DBT_APPMALLOC;
01768 }
01769
01770 err: (*jenv)->DeleteLocalRef(jenv, jdbtarr);
01771 (*jenv)->DeleteLocalRef(jenv, jdbt);
01772
01773 return (ret);
01774 }
01775
01776 static int __dbj_bt_compare(DB *db, const DBT *dbt1, const DBT *dbt2)
01777 {
01778 JNIEnv *jenv = __dbj_get_jnienv();
01779 jobject jdb = (jobject)DB_INTERNAL(db);
01780 jbyteArray jdbtarr1, jdbtarr2;
01781 int ret;
01782
01783 if (jdb == NULL)
01784 return (EINVAL);
01785
01786 jdbtarr1 = (*jenv)->NewByteArray(jenv, (jsize)dbt1->size);
01787 if (jdbtarr1 == NULL)
01788 return (ENOMEM);
01789 (*jenv)->SetByteArrayRegion(jenv, jdbtarr1, 0, (jsize)dbt1->size,
01790 (jbyte *)dbt1->data);
01791
01792 jdbtarr2 = (*jenv)->NewByteArray(jenv, (jsize)dbt2->size);
01793 if (jdbtarr2 == NULL)
01794 return (ENOMEM);
01795 (*jenv)->SetByteArrayRegion(jenv, jdbtarr2, 0, (jsize)dbt2->size,
01796 (jbyte *)dbt2->data);
01797
01798 ret = (int)(*jenv)->CallNonvirtualIntMethod(jenv, jdb, db_class,
01799 bt_compare_method, jdbtarr1, jdbtarr2);
01800
01801 if ((*jenv)->ExceptionOccurred(jenv)) {
01802
01803 ret = EINVAL;
01804 }
01805
01806 (*jenv)->DeleteLocalRef(jenv, jdbtarr2);
01807 (*jenv)->DeleteLocalRef(jenv, jdbtarr1);
01808
01809 return (ret);
01810 }
01811
01812 static size_t __dbj_bt_prefix(DB *db, const DBT *dbt1, const DBT *dbt2)
01813 {
01814 JNIEnv *jenv = __dbj_get_jnienv();
01815 jobject jdb = (jobject)DB_INTERNAL(db);
01816 jobject jdbt1, jdbt2;
01817 jbyteArray jdbtarr1, jdbtarr2;
01818 int ret;
01819
01820 if (jdb == NULL)
01821 return (EINVAL);
01822
01823 jdbt1 = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01824 jdbt2 = (*jenv)->NewObject(jenv, dbt_class, dbt_construct);
01825 if (jdbt1 == NULL || jdbt2 == NULL)
01826 return (ENOMEM);
01827
01828 __dbj_dbt_copyout(jenv, dbt1, &jdbtarr1, jdbt1);
01829 __dbj_dbt_copyout(jenv, dbt2, &jdbtarr2, jdbt2);
01830 if (jdbtarr1 == NULL || jdbtarr2 == NULL)
01831 return (ENOMEM);
01832
01833 ret = (int)(*jenv)->CallNonvirtualIntMethod(jenv, jdb, db_class,
01834 bt_prefix_method, jdbt1, jdbt2);
01835
01836 (*jenv)->DeleteLocalRef(jenv, jdbtarr2);
01837 (*jenv)->DeleteLocalRef(jenv, jdbtarr1);
01838 (*jenv)->DeleteLocalRef(jenv, jdbt2);
01839 (*jenv)->DeleteLocalRef(jenv, jdbt1);
01840
01841 return (ret);
01842 }
01843
01844 static int __dbj_dup_compare(DB *db, const DBT *dbt1, const DBT *dbt2)
01845 {
01846 JNIEnv *jenv = __dbj_get_jnienv();
01847 jobject jdb = (jobject)DB_INTERNAL(db);
01848 jbyteArray jdbtarr1, jdbtarr2;
01849 int ret;
01850
01851 if (jdb == NULL)
01852 return (EINVAL);
01853
01854 jdbtarr1 = (*jenv)->NewByteArray(jenv, (jsize)dbt1->size);
01855 if (jdbtarr1 == NULL)
01856 return (ENOMEM);
01857 (*jenv)->SetByteArrayRegion(jenv, jdbtarr1, 0, (jsize)dbt1->size,
01858 (jbyte *)dbt1->data);
01859
01860 jdbtarr2 = (*jenv)->NewByteArray(jenv, (jsize)dbt2->size);
01861 if (jdbtarr2 == NULL)
01862 return (ENOMEM);
01863 (*jenv)->SetByteArrayRegion(jenv, jdbtarr2, 0, (jsize)dbt2->size,
01864 (jbyte *)dbt2->data);
01865
01866 ret = (int)(*jenv)->CallNonvirtualIntMethod(jenv, jdb, db_class,
01867 dup_compare_method, jdbtarr1, jdbtarr2);
01868
01869 if ((*jenv)->ExceptionOccurred(jenv)) {
01870
01871 ret = EINVAL;
01872 }
01873
01874 (*jenv)->DeleteLocalRef(jenv, jdbtarr2);
01875 (*jenv)->DeleteLocalRef(jenv, jdbtarr1);
01876
01877 return (ret);
01878 }
01879
01880 static void __dbj_db_feedback(DB *db, int opcode, int percent)
01881 {
01882 JNIEnv *jenv = __dbj_get_jnienv();
01883 jobject jdb = (jobject)DB_INTERNAL(db);
01884
01885 if (jdb != NULL)
01886 (*jenv)->CallNonvirtualVoidMethod(jenv, jdb, db_class,
01887 db_feedback_method, opcode, percent);
01888 }
01889
01890 static u_int32_t __dbj_h_hash(DB *db, const void *data, u_int32_t len)
01891 {
01892 JNIEnv *jenv = __dbj_get_jnienv();
01893 jobject jdb = (jobject)DB_INTERNAL(db);
01894 jbyteArray jarr = (*jenv)->NewByteArray(jenv, (jsize)len);
01895 int ret;
01896
01897 if (jdb == NULL)
01898 return (EINVAL);
01899
01900 if ((jarr = (*jenv)->NewByteArray(jenv, (jsize)len)) == NULL)
01901 return (ENOMEM);
01902
01903 (*jenv)->SetByteArrayRegion(jenv, jarr, 0, (jsize)len, (jbyte *)data);
01904
01905 ret = (int)(*jenv)->CallNonvirtualIntMethod(jenv, jdb, db_class,
01906 h_hash_method, jarr, len);
01907
01908 (*jenv)->DeleteLocalRef(jenv, jarr);
01909
01910 return (ret);
01911 }
01912
01913
01914 JNIEXPORT jlong JNICALL
01915 Java_com_sleepycat_db_internal_db_1javaJNI_initDbEnvRef0(
01916 JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
01917 DB_ENV *self = *(DB_ENV **)(void *)&jarg1;
01918 jlong ret;
01919 COMPQUIET(jcls, NULL);
01920
01921 DB_ENV_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
01922 *(jobject *)(void *)&ret = (jobject)DB_ENV_INTERNAL(self);
01923 return (ret);
01924 }
01925
01926 JNIEXPORT jlong JNICALL
01927 Java_com_sleepycat_db_internal_db_1javaJNI_initDbRef0(
01928 JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
01929 DB *self = *(DB **)(void *)&jarg1;
01930 jlong ret;
01931 COMPQUIET(jcls, NULL);
01932
01933 DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
01934 *(jobject *)(void *)&ret = (jobject)DB_INTERNAL(self);
01935 return (ret);
01936 }
01937
01938 JNIEXPORT void JNICALL
01939 Java_com_sleepycat_db_internal_db_1javaJNI_deleteRef0(
01940 JNIEnv *jenv, jclass jcls, jlong jarg1) {
01941 jobject jref = *(jobject *)(void *)&jarg1;
01942 COMPQUIET(jcls, NULL);
01943
01944 if (jref != 0L)
01945 (*jenv)->DeleteGlobalRef(jenv, jref);
01946 }
01947
01948 JNIEXPORT jlong JNICALL
01949 Java_com_sleepycat_db_internal_db_1javaJNI_getDbEnv0(
01950 JNIEnv *jenv, jclass jcls, jlong jarg1) {
01951 DB *self = *(DB **)(void *)&jarg1;
01952 jlong env_cptr;
01953
01954 COMPQUIET(jenv, NULL);
01955 COMPQUIET(jcls, NULL);
01956
01957 *(DB_ENV **)(void *)&env_cptr = self->dbenv;
01958 return (env_cptr);
01959 }
01960
01961 JNIEXPORT jboolean JNICALL
01962 Java_com_sleepycat_db_internal_DbUtil_is_1big_1endian(
01963 JNIEnv *jenv, jclass clazz)
01964 {
01965 COMPQUIET(jenv, NULL);
01966 COMPQUIET(clazz, NULL);
01967
01968 return (__db_isbigendian() ? JNI_TRUE : JNI_FALSE);
01969 }
01970
01971
01972 typedef int db_ret_t;
01973 typedef int int_bool;
01974
01975 struct __db_lk_conflicts {
01976 u_int8_t *lk_conflicts;
01977 int lk_modes;
01978 };
01979
01980 struct __db_out_stream {
01981 void *handle;
01982 int (*callback) __P((void *, const void *));
01983 };
01984
01985 #define Db __db
01986 #define Dbc __dbc
01987 #define Dbt __db_dbt
01988 #define DbEnv __db_env
01989 #define DbLock __db_lock_u
01990 #define DbLogc __db_log_cursor
01991 #define DbLsn __db_lsn
01992 #define DbMpoolFile __db_mpoolfile
01993 #define DbSequence __db_sequence
01994 #define DbTxn __db_txn
01995
01996
01997 void *unused = SWIG_JavaThrowException;
01998
01999 static struct Db *new_Db(DB_ENV *dbenv,u_int32_t flags){
02000 DB *self = NULL;
02001 errno = db_create(&self, dbenv, flags);
02002 return self;
02003 }
02004 static db_ret_t Db_associate(struct Db *self,DB_TXN *txnid,DB *secondary,int (*callback)(DB *,DBT const *,DBT const *,DBT *),u_int32_t flags){
02005 return self->associate(self, txnid, secondary, callback, flags);
02006 }
02007 static db_ret_t Db_compact(struct Db *self,DB_TXN *txnid,DBT *start,DBT *stop,DB_COMPACT *c_data,u_int32_t flags,DBT *end){
02008 return self->compact(self, txnid, start, stop, c_data, flags,
02009 end);
02010 }
02011 static int Db_close(struct Db *self,u_int32_t flags){
02012 errno = self->close(self, flags);
02013 return errno;
02014 }
02015 static DBC *Db_cursor(struct Db *self,DB_TXN *txnid,u_int32_t flags){
02016 DBC *cursorp = NULL;
02017 errno = self->cursor(self, txnid, &cursorp, flags);
02018 return cursorp;
02019 }
02020 static int Db_del(struct Db *self,DB_TXN *txnid,DBT *key,u_int32_t flags){
02021 return self->del(self, txnid, key, flags);
02022 }
02023 static void Db_err(struct Db *self,int error,char const *message){
02024 self->err(self, error, message);
02025 }
02026 static void Db_errx(struct Db *self,char const *message){
02027 self->errx(self, message);
02028 }
02029 static int_bool Db_get_transactional(struct Db *self){
02030 return self->get_transactional(self);
02031 }
02032 static int Db_get(struct Db *self,DB_TXN *txnid,DBT *key,DBT *data,u_int32_t flags){
02033 return self->get(self, txnid, key, data, flags);
02034 }
02035 static int_bool Db_get_byteswapped(struct Db *self){
02036 int ret = 0;
02037 errno = self->get_byteswapped(self, &ret);
02038 return ret;
02039 }
02040 static jlong Db_get_cachesize(struct Db *self){
02041 u_int32_t gbytes = 0, bytes = 0;
02042 errno = self->get_cachesize(self, &gbytes, &bytes, NULL);
02043 return (jlong)gbytes * GIGABYTE + bytes;
02044 }
02045 static u_int32_t Db_get_cachesize_ncache(struct Db *self){
02046 int ret = 0;
02047 errno = self->get_cachesize(self, NULL, NULL, &ret);
02048 return ret;
02049 }
02050 static char const *Db_get_filename(struct Db *self){
02051 const char *ret = NULL;
02052 errno = self->get_dbname(self, &ret, NULL);
02053 return ret;
02054 }
02055 static char const *Db_get_dbname(struct Db *self){
02056 const char *ret = NULL;
02057 errno = self->get_dbname(self, NULL, &ret);
02058 return ret;
02059 }
02060 static u_int32_t Db_get_encrypt_flags(struct Db *self){
02061 u_int32_t ret = 0;
02062 CRYPTO_ONLY(errno = self->get_encrypt_flags(self, &ret))
02063 return ret;
02064 }
02065 static u_int32_t Db_get_flags(struct Db *self){
02066 u_int32_t ret = 0;
02067 errno = self->get_flags(self, &ret);
02068 return ret;
02069 }
02070 static int Db_get_lorder(struct Db *self){
02071 int ret = 0;
02072 errno = self->get_lorder(self, &ret);
02073 return ret;
02074 }
02075 static DB_MPOOLFILE *Db_get_mpf(struct Db *self){
02076 errno = 0;
02077 return self->get_mpf(self);
02078 }
02079 static u_int32_t Db_get_open_flags(struct Db *self){
02080 u_int32_t ret = 0;
02081 errno = self->get_open_flags(self, &ret);
02082 return ret;
02083 }
02084 static u_int32_t Db_get_pagesize(struct Db *self){
02085 u_int32_t ret = 0;
02086 errno = self->get_pagesize(self, &ret);
02087 return ret;
02088 }
02089 static u_int32_t Db_get_bt_minkey(struct Db *self){
02090 u_int32_t ret = 0;
02091 errno = self->get_bt_minkey(self, &ret);
02092 return ret;
02093 }
02094 static u_int32_t Db_get_h_ffactor(struct Db *self){
02095 u_int32_t ret = 0;
02096 errno = self->get_h_ffactor(self, &ret);
02097 return ret;
02098 }
02099 static u_int32_t Db_get_h_nelem(struct Db *self){
02100 u_int32_t ret = 0;
02101 errno = self->get_h_nelem(self, &ret);
02102 return ret;
02103 }
02104 static int Db_get_re_delim(struct Db *self){
02105 int ret = 0;
02106 errno = self->get_re_delim(self, &ret);
02107 return ret;
02108 }
02109 static u_int32_t Db_get_re_len(struct Db *self){
02110 u_int32_t ret = 0;
02111 errno = self->get_re_len(self, &ret);
02112 return ret;
02113 }
02114 static int Db_get_re_pad(struct Db *self){
02115 int ret = 0;
02116 errno = self->get_re_pad(self, &ret);
02117 return ret;
02118 }
02119 static char const *Db_get_re_source(struct Db *self){
02120 const char *ret = NULL;
02121 errno = self->get_re_source(self, &ret);
02122 return ret;
02123 }
02124 static u_int32_t Db_get_q_extentsize(struct Db *self){
02125 u_int32_t ret = 0;
02126 errno = self->get_q_extentsize(self, &ret);
02127 return ret;
02128 }
02129 static DBTYPE Db_get_type(struct Db *self){
02130 DBTYPE type = (DBTYPE)0;
02131 errno = self->get_type(self, &type);
02132 return type;
02133 }
02134 static DBC *Db_join(struct Db *self,DBC **curslist,u_int32_t flags){
02135 DBC *dbcp = NULL;
02136 errno = self->join(self, curslist, &dbcp, flags);
02137 return dbcp;
02138 }
02139 static db_ret_t Db_key_range(struct Db *self,DB_TXN *txnid,DBT *key,DB_KEY_RANGE *key_range,u_int32_t flags){
02140 return self->key_range(self, txnid, key, key_range, flags);
02141 }
02142 static db_ret_t Db_open(struct Db *self,DB_TXN *txnid,char const *file,char const *database,DBTYPE type,u_int32_t flags,int mode){
02143 return self->open(self, txnid, file, database,
02144 type, flags, mode);
02145 }
02146 static int Db_pget(struct Db *self,DB_TXN *txnid,DBT *key,DBT *pkey,DBT *data,u_int32_t flags){
02147 return self->pget(self, txnid, key, pkey, data, flags);
02148 }
02149 static int Db_put(struct Db *self,DB_TXN *txnid,DBT *key,DBT *data,u_int32_t flags){
02150 return self->put(self, txnid, key, data, flags);
02151 }
02152 static db_ret_t Db_remove(struct Db *self,char const *file,char const *database,u_int32_t flags){
02153 return self->remove(self, file, database, flags);
02154 }
02155 static db_ret_t Db_rename(struct Db *self,char const *file,char const *database,char const *newname,u_int32_t flags){
02156 return self->rename(self, file, database, newname, flags);
02157 }
02158 static db_ret_t Db_set_append_recno(struct Db *self,int (*db_append_recno_fcn)(DB *,DBT *,db_recno_t)){
02159 return self->set_append_recno(self, db_append_recno_fcn);
02160 }
02161 static db_ret_t Db_set_bt_compare(struct Db *self,int (*bt_compare_fcn)(DB *,DBT const *,DBT const *)){
02162 return self->set_bt_compare(self, bt_compare_fcn);
02163 }
02164 static db_ret_t Db_set_bt_minkey(struct Db *self,u_int32_t bt_minkey){
02165 return self->set_bt_minkey(self, bt_minkey);
02166 }
02167 static db_ret_t Db_set_bt_prefix(struct Db *self,size_t (*bt_prefix_fcn)(DB *,DBT const *,DBT const *)){
02168 return self->set_bt_prefix(self, bt_prefix_fcn);
02169 }
02170 static db_ret_t Db_set_cachesize(struct Db *self,jlong bytes,int ncache){
02171 return self->set_cachesize(self,
02172 (u_int32_t)(bytes / GIGABYTE),
02173 (u_int32_t)(bytes % GIGABYTE), ncache);
02174 }
02175 static db_ret_t Db_set_dup_compare(struct Db *self,int (*dup_compare_fcn)(DB *,DBT const *,DBT const *)){
02176 return self->set_dup_compare(self, dup_compare_fcn);
02177 }
02178 static db_ret_t Db_set_encrypt(struct Db *self,char const *passwd,u_int32_t flags){
02179 return self->set_encrypt(self, passwd, flags);
02180 }
02181 static db_ret_t Db_set_feedback(struct Db *self,void (*db_feedback_fcn)(DB *,int,int)){
02182 return self->set_feedback(self, db_feedback_fcn);
02183 }
02184 static db_ret_t Db_set_flags(struct Db *self,u_int32_t flags){
02185 return self->set_flags(self, flags);
02186 }
02187 static db_ret_t Db_set_h_ffactor(struct Db *self,u_int32_t h_ffactor){
02188 return self->set_h_ffactor(self, h_ffactor);
02189 }
02190 static db_ret_t Db_set_h_hash(struct Db *self,u_int32_t (*h_hash_fcn)(DB *,void const *,u_int32_t)){
02191 return self->set_h_hash(self, h_hash_fcn);
02192 }
02193 static db_ret_t Db_set_h_nelem(struct Db *self,u_int32_t h_nelem){
02194 return self->set_h_nelem(self, h_nelem);
02195 }
02196 static db_ret_t Db_set_lorder(struct Db *self,int lorder){
02197 return self->set_lorder(self, lorder);
02198 }
02199 static db_ret_t Db_set_pagesize(struct Db *self,u_int32_t pagesize){
02200 return self->set_pagesize(self, pagesize);
02201 }
02202 static db_ret_t Db_set_re_delim(struct Db *self,int re_delim){
02203 return self->set_re_delim(self, re_delim);
02204 }
02205 static db_ret_t Db_set_re_len(struct Db *self,u_int32_t re_len){
02206 return self->set_re_len(self, re_len);
02207 }
02208 static db_ret_t Db_set_re_pad(struct Db *self,int re_pad){
02209 return self->set_re_pad(self, re_pad);
02210 }
02211 static db_ret_t Db_set_re_source(struct Db *self,char *source){
02212 return self->set_re_source(self, source);
02213 }
02214 static db_ret_t Db_set_q_extentsize(struct Db *self,u_int32_t extentsize){
02215 return self->set_q_extentsize(self, extentsize);
02216 }
02217 static void *Db_stat(struct Db *self,DB_TXN *txnid,u_int32_t flags){
02218 void *statp = NULL;
02219 errno = self->stat(self, txnid, &statp, flags);
02220 return statp;
02221 }
02222 static db_ret_t Db_sync(struct Db *self,u_int32_t flags){
02223 return self->sync(self, flags);
02224 }
02225 static int Db_truncate(struct Db *self,DB_TXN *txnid,u_int32_t flags){
02226 u_int32_t count = 0;
02227 errno = self->truncate(self, txnid, &count, flags);
02228 return count;
02229 }
02230 static db_ret_t Db_upgrade(struct Db *self,char const *file,u_int32_t flags){
02231 return self->upgrade(self, file, flags);
02232 }
02233 static int_bool Db_verify(struct Db *self,char const *file,char const *database,struct __db_out_stream outfile,u_int32_t flags){
02234
02235
02236
02237
02238 extern int __db_verify_internal __P((DB *, const char *, const
02239 char *, void *, int (*)(void *, const void *), u_int32_t));
02240 errno = __db_verify_internal(self, file, database,
02241 outfile.handle, outfile.callback, flags);
02242 if (errno == DB_VERIFY_BAD) {
02243 errno = 0;
02244 return 0;
02245 } else
02246 return 1;
02247 }
02248 static db_ret_t Dbc_close(struct Dbc *self){
02249 return self->c_close(self);
02250 }
02251 static db_recno_t Dbc_count(struct Dbc *self,u_int32_t flags){
02252 db_recno_t count = 0;
02253 errno = self->c_count(self, &count, flags);
02254 return count;
02255 }
02256 static int Dbc_del(struct Dbc *self,u_int32_t flags){
02257 return self->c_del(self, flags);
02258 }
02259 static DBC *Dbc_dup(struct Dbc *self,u_int32_t flags){
02260 DBC *newcurs = NULL;
02261 errno = self->c_dup(self, &newcurs, flags);
02262 return newcurs;
02263 }
02264 static int Dbc_get(struct Dbc *self,DBT *key,DBT *data,u_int32_t flags){
02265 return self->c_get(self, key, data, flags);
02266 }
02267 static int Dbc_pget(struct Dbc *self,DBT *key,DBT *pkey,DBT *data,u_int32_t flags){
02268 return self->c_pget(self, key, pkey, data, flags);
02269 }
02270 static int Dbc_put(struct Dbc *self,DBT *key,DBT *data,u_int32_t flags){
02271 return self->c_put(self, key, data, flags);
02272 }
02273 static struct DbEnv *new_DbEnv(u_int32_t flags){
02274 DB_ENV *self = NULL;
02275 errno = db_env_create(&self, flags);
02276 return self;
02277 }
02278 static db_ret_t DbEnv_close(struct DbEnv *self,u_int32_t flags){
02279 return self->close(self, flags);
02280 }
02281 static db_ret_t DbEnv_dbremove(struct DbEnv *self,DB_TXN *txnid,char const *file,char const *database,u_int32_t flags){
02282 return self->dbremove(self, txnid, file, database, flags);
02283 }
02284 static db_ret_t DbEnv_dbrename(struct DbEnv *self,DB_TXN *txnid,char const *file,char const *database,char const *newname,u_int32_t flags){
02285 return self->dbrename(self,
02286 txnid, file, database, newname, flags);
02287 }
02288 static void DbEnv_err(struct DbEnv *self,int error,char const *message){
02289 self->err(self, error, message);
02290 }
02291 static void DbEnv_errx(struct DbEnv *self,char const *message){
02292 self->errx(self, message);
02293 }
02294 static db_ret_t DbEnv_fileid_reset(struct DbEnv *self,char const *file,u_int32_t flags){
02295 return self->fileid_reset(self, file, flags);
02296 }
02297 static char const **DbEnv_get_data_dirs(struct DbEnv *self){
02298 const char **ret;
02299 errno = self->get_data_dirs(self, &ret);
02300 return ret;
02301 }
02302 static u_int32_t DbEnv_get_encrypt_flags(struct DbEnv *self){
02303 u_int32_t ret = 0;
02304 CRYPTO_ONLY(errno = self->get_encrypt_flags(self, &ret))
02305 return ret;
02306 }
02307 static u_int32_t DbEnv_get_flags(struct DbEnv *self){
02308 u_int32_t ret;
02309 errno = self->get_flags(self, &ret);
02310 return ret;
02311 }
02312 static char const *DbEnv_get_home(struct DbEnv *self){
02313 const char *ret;
02314 errno = self->get_home(self, &ret);
02315 return ret;
02316 }
02317 static u_int32_t DbEnv_get_open_flags(struct DbEnv *self){
02318 u_int32_t ret;
02319 errno = self->get_open_flags(self, &ret);
02320 return ret;
02321 }
02322 static long DbEnv_get_shm_key(struct DbEnv *self){
02323 long ret;
02324 errno = self->get_shm_key(self, &ret);
02325 return ret;
02326 }
02327 static char const *DbEnv_get_tmp_dir(struct DbEnv *self){
02328 const char *ret;
02329 errno = self->get_tmp_dir(self, &ret);
02330 return ret;
02331 }
02332 static int_bool DbEnv_get_verbose(struct DbEnv *self,u_int32_t which){
02333 int ret;
02334 errno = self->get_verbose(self, which, &ret);
02335 return ret;
02336 }
02337 static int_bool DbEnv_is_bigendian(struct DbEnv *self){
02338 return self->is_bigendian();
02339 }
02340 static db_ret_t DbEnv_lsn_reset(struct DbEnv *self,char const *file,u_int32_t flags){
02341 return self->lsn_reset(self, file, flags);
02342 }
02343 static db_ret_t DbEnv_open(struct DbEnv *self,char const *db_home,u_int32_t flags,int mode){
02344 return self->open(self, db_home, flags, mode);
02345 }
02346 static db_ret_t DbEnv_remove(struct DbEnv *self,char const *db_home,u_int32_t flags){
02347 return self->remove(self, db_home, flags);
02348 }
02349 static db_ret_t DbEnv_set_cachesize(struct DbEnv *self,jlong bytes,int ncache){
02350 return self->set_cachesize(self,
02351 (u_int32_t)(bytes / GIGABYTE),
02352 (u_int32_t)(bytes % GIGABYTE), ncache);
02353 }
02354 static db_ret_t DbEnv_set_data_dir(struct DbEnv *self,char const *dir){
02355 return self->set_data_dir(self, dir);
02356 }
02357 static db_ret_t DbEnv_set_intermediate_dir(struct DbEnv *self,int mode,u_int32_t flags){
02358 return self->set_intermediate_dir(self, mode, flags);
02359 }
02360 static db_ret_t DbEnv_set_encrypt(struct DbEnv *self,char const *passwd,u_int32_t flags){
02361 return self->set_encrypt(self, passwd, flags);
02362 }
02363 static void DbEnv_set_errcall(struct DbEnv *self,void (*db_errcall_fcn)(DB_ENV const *,char const *,char const *)){
02364 self->set_errcall(self, db_errcall_fcn);
02365 }
02366 static db_ret_t DbEnv_set_flags(struct DbEnv *self,u_int32_t flags,int_bool onoff){
02367 return self->set_flags(self, flags, onoff);
02368 }
02369 static db_ret_t DbEnv_set_feedback(struct DbEnv *self,void (*env_feedback_fcn)(DB_ENV *,int,int)){
02370 return self->set_feedback(self, env_feedback_fcn);
02371 }
02372 static db_ret_t DbEnv_set_mp_max_openfd(struct DbEnv *self,int maxopenfd){
02373 return self->set_mp_max_openfd(self, maxopenfd);
02374 }
02375 static db_ret_t DbEnv_set_mp_max_write(struct DbEnv *self,int maxwrite,int maxwrite_sleep){
02376 return self->set_mp_max_write(self, maxwrite, maxwrite_sleep);
02377 }
02378 static db_ret_t DbEnv_set_mp_mmapsize(struct DbEnv *self,size_t mp_mmapsize){
02379 return self->set_mp_mmapsize(self, mp_mmapsize);
02380 }
02381 static void DbEnv_set_msgcall(struct DbEnv *self,void (*db_msgcall_fcn)(DB_ENV const *,char const *)){
02382 self->set_msgcall(self, db_msgcall_fcn);
02383 }
02384 static db_ret_t DbEnv_set_paniccall(struct DbEnv *self,void (*db_panic_fcn)(DB_ENV *,int)){
02385 return self->set_paniccall(self, db_panic_fcn);
02386 }
02387 static db_ret_t DbEnv_set_rpc_server(struct DbEnv *self,void *client,char *host,long cl_timeout,long sv_timeout,u_int32_t flags){
02388 return self->set_rpc_server(self, client, host,
02389 cl_timeout, sv_timeout, flags);
02390 }
02391 static db_ret_t DbEnv_set_shm_key(struct DbEnv *self,long shm_key){
02392 return self->set_shm_key(self, shm_key);
02393 }
02394 static db_ret_t DbEnv_set_timeout(struct DbEnv *self,db_timeout_t timeout,u_int32_t flags){
02395 return self->set_timeout(self, timeout, flags);
02396 }
02397 static db_ret_t DbEnv_set_tmp_dir(struct DbEnv *self,char const *dir){
02398 return self->set_tmp_dir(self, dir);
02399 }
02400 static db_ret_t DbEnv_set_tx_max(struct DbEnv *self,u_int32_t max){
02401 return self->set_tx_max(self, max);
02402 }
02403 static db_ret_t DbEnv_set_app_dispatch(struct DbEnv *self,int (*tx_recover)(DB_ENV *,DBT *,DB_LSN *,db_recops)){
02404 return self->set_app_dispatch(self, tx_recover);
02405 }
02406 static db_ret_t DbEnv_set_tx_timestamp(struct DbEnv *self,time_t *timestamp){
02407 return self->set_tx_timestamp(self, timestamp);
02408 }
02409 static db_ret_t DbEnv_set_verbose(struct DbEnv *self,u_int32_t which,int_bool onoff){
02410 return self->set_verbose(self, which, onoff);
02411 }
02412 static struct __db_lk_conflicts DbEnv_get_lk_conflicts(struct DbEnv *self){
02413 struct __db_lk_conflicts ret;
02414 errno = self->get_lk_conflicts(self,
02415 (const u_int8_t **)&ret.lk_conflicts, &ret.lk_modes);
02416 return ret;
02417 }
02418 static u_int32_t DbEnv_get_lk_detect(struct DbEnv *self){
02419 u_int32_t ret;
02420 errno = self->get_lk_detect(self, &ret);
02421 return ret;
02422 }
02423 static u_int32_t DbEnv_get_lk_max_locks(struct DbEnv *self){
02424 u_int32_t ret;
02425 errno = self->get_lk_max_locks(self, &ret);
02426 return ret;
02427 }
02428 static u_int32_t DbEnv_get_lk_max_lockers(struct DbEnv *self){
02429 u_int32_t ret;
02430 errno = self->get_lk_max_lockers(self, &ret);
02431 return ret;
02432 }
02433 static u_int32_t DbEnv_get_lk_max_objects(struct DbEnv *self){
02434 u_int32_t ret;
02435 errno = self->get_lk_max_objects(self, &ret);
02436 return ret;
02437 }
02438 static int DbEnv_lock_detect(struct DbEnv *self,u_int32_t flags,u_int32_t atype){
02439 int aborted;
02440 errno = self->lock_detect(self, flags, atype, &aborted);
02441 return aborted;
02442 }
02443 static DB_LOCK *DbEnv_lock_get(struct DbEnv *self,u_int32_t locker,u_int32_t flags,DBT const *object,db_lockmode_t lock_mode){
02444 DB_LOCK *lock = NULL;
02445 if ((errno = __os_malloc(self, sizeof (DB_LOCK), &lock)) == 0)
02446 errno = self->lock_get(self, locker, flags, object,
02447 lock_mode, lock);
02448 return lock;
02449 }
02450 static u_int32_t DbEnv_lock_id(struct DbEnv *self){
02451 u_int32_t id;
02452 errno = self->lock_id(self, &id);
02453 return id;
02454 }
02455 static db_ret_t DbEnv_lock_id_free(struct DbEnv *self,u_int32_t id){
02456 return self->lock_id_free(self, id);
02457 }
02458 static db_ret_t DbEnv_lock_put(struct DbEnv *self,DB_LOCK *lock){
02459 return self->lock_put(self, lock);
02460 }
02461 static DB_LOCK_STAT *DbEnv_lock_stat(struct DbEnv *self,u_int32_t flags){
02462 DB_LOCK_STAT *statp = NULL;
02463 errno = self->lock_stat(self, &statp, flags);
02464 return statp;
02465 }
02466 static db_ret_t DbEnv_set_lk_conflicts(struct DbEnv *self,struct __db_lk_conflicts conflicts){
02467 return self->set_lk_conflicts(self,
02468 conflicts.lk_conflicts, conflicts.lk_modes);
02469 }
02470 static db_ret_t DbEnv_set_lk_detect(struct DbEnv *self,u_int32_t detect){
02471 return self->set_lk_detect(self, detect);
02472 }
02473 static db_ret_t DbEnv_set_lk_max_lockers(struct DbEnv *self,u_int32_t max){
02474 return self->set_lk_max_lockers(self, max);
02475 }
02476 static db_ret_t DbEnv_set_lk_max_locks(struct DbEnv *self,u_int32_t max){
02477 return self->set_lk_max_locks(self, max);
02478 }
02479 static db_ret_t DbEnv_set_lk_max_objects(struct DbEnv *self,u_int32_t max){
02480 return self->set_lk_max_objects(self, max);
02481 }
02482 static u_int32_t DbEnv_get_lg_bsize(struct DbEnv *self){
02483 u_int32_t ret;
02484 errno = self->get_lg_bsize(self, &ret);
02485 return ret;
02486 }
02487 static char const *DbEnv_get_lg_dir(struct DbEnv *self){
02488 const char *ret;
02489 errno = self->get_lg_dir(self, &ret);
02490 return ret;
02491 }
02492 static int DbEnv_get_lg_filemode(struct DbEnv *self){
02493 int ret;
02494 errno = self->get_lg_filemode(self, &ret);
02495 return ret;
02496 }
02497 static u_int32_t DbEnv_get_lg_max(struct DbEnv *self){
02498 u_int32_t ret;
02499 errno = self->get_lg_max(self, &ret);
02500 return ret;
02501 }
02502 static u_int32_t DbEnv_get_lg_regionmax(struct DbEnv *self){
02503 u_int32_t ret;
02504 errno = self->get_lg_regionmax(self, &ret);
02505 return ret;
02506 }
02507 static char **DbEnv_log_archive(struct DbEnv *self,u_int32_t flags){
02508 char **list = NULL;
02509 errno = self->log_archive(self, &list, flags);
02510 return list;
02511 }
02512 static int DbEnv_log_compare(DB_LSN const *lsn0,DB_LSN const *lsn1){
02513 return log_compare(lsn0, lsn1);
02514 }
02515 static DB_LOGC *DbEnv_log_cursor(struct DbEnv *self,u_int32_t flags){
02516 DB_LOGC *cursor = NULL;
02517 errno = self->log_cursor(self, &cursor, flags);
02518 return cursor;
02519 }
02520 static char *DbEnv_log_file(struct DbEnv *self,DB_LSN *lsn){
02521 char namebuf[MAXPATHLEN];
02522 errno = self->log_file(self, lsn, namebuf, sizeof namebuf);
02523 return (errno == 0) ? strdup(namebuf) : NULL;
02524 }
02525 static db_ret_t DbEnv_log_flush(struct DbEnv *self,DB_LSN const *lsn_or_null){
02526 return self->log_flush(self, lsn_or_null);
02527 }
02528 static db_ret_t DbEnv_log_put(struct DbEnv *self,DB_LSN *lsn,DBT const *data,u_int32_t flags){
02529 return self->log_put(self, lsn, data, flags);
02530 }
02531 static db_ret_t DbEnv_log_print(struct DbEnv *self,DB_TXN *txn,char const *msg){
02532 return self->log_printf(self, txn, "%s", msg);
02533 }
02534 static DB_LOG_STAT *DbEnv_log_stat(struct DbEnv *self,u_int32_t flags){
02535 DB_LOG_STAT *sp = NULL;
02536 errno = self->log_stat(self, &sp, flags);
02537 return sp;
02538 }
02539 static db_ret_t DbEnv_set_lg_bsize(struct DbEnv *self,u_int32_t lg_bsize){
02540 return self->set_lg_bsize(self, lg_bsize);
02541 }
02542 static db_ret_t DbEnv_set_lg_dir(struct DbEnv *self,char const *dir){
02543 return self->set_lg_dir(self, dir);
02544 }
02545 static db_ret_t DbEnv_set_lg_filemode(struct DbEnv *self,int mode){
02546 return self->set_lg_filemode(self, mode);
02547 }
02548 static db_ret_t DbEnv_set_lg_max(struct DbEnv *self,u_int32_t lg_max){
02549 return self->set_lg_max(self, lg_max);
02550 }
02551 static db_ret_t DbEnv_set_lg_regionmax(struct DbEnv *self,u_int32_t lg_regionmax){
02552 return self->set_lg_regionmax(self, lg_regionmax);
02553 }
02554 static jlong DbEnv_get_cachesize(struct DbEnv *self){
02555 u_int32_t gbytes, bytes;
02556 errno = self->get_cachesize(self, &gbytes, &bytes, NULL);
02557 return (jlong)gbytes * GIGABYTE + bytes;
02558 }
02559 static int DbEnv_get_cachesize_ncache(struct DbEnv *self){
02560 int ret;
02561 errno = self->get_cachesize(self, NULL, NULL, &ret);
02562 return ret;
02563 }
02564 static int DbEnv_get_mp_max_openfd(struct DbEnv *self){
02565 int ret;
02566 errno = self->get_mp_max_openfd(self, &ret);
02567 return ret;
02568 }
02569 static int DbEnv_get_mp_max_write(struct DbEnv *self){
02570 int ret, junk;
02571 errno = self->get_mp_max_write(self, &ret, &junk);
02572 return ret;
02573 }
02574 static int DbEnv_get_mp_max_write_sleep(struct DbEnv *self){
02575 int ret, junk;
02576 errno = self->get_mp_max_write(self, &junk, &ret);
02577 return ret;
02578 }
02579 static size_t DbEnv_get_mp_mmapsize(struct DbEnv *self){
02580 size_t ret;
02581 errno = self->get_mp_mmapsize(self, &ret);
02582 return ret;
02583 }
02584 static DB_MPOOL_STAT *DbEnv_memp_stat(struct DbEnv *self,u_int32_t flags){
02585 DB_MPOOL_STAT *mp_stat = NULL;
02586 errno = self->memp_stat(self, &mp_stat, NULL, flags);
02587 return mp_stat;
02588 }
02589 static DB_MPOOL_FSTAT **DbEnv_memp_fstat(struct DbEnv *self,u_int32_t flags){
02590 DB_MPOOL_FSTAT **mp_fstat = NULL;
02591 errno = self->memp_stat(self, NULL, &mp_fstat, flags);
02592 return mp_fstat;
02593 }
02594 static int DbEnv_memp_trickle(struct DbEnv *self,int percent){
02595 int ret;
02596 errno = self->memp_trickle(self, percent, &ret);
02597 return ret;
02598 }
02599 static u_int32_t DbEnv_mutex_get_align(struct DbEnv *self){
02600 u_int32_t ret;
02601 errno = self->mutex_get_align(self, &ret);
02602 return ret;
02603 }
02604 static u_int32_t DbEnv_mutex_get_increment(struct DbEnv *self){
02605 u_int32_t ret;
02606 errno = self->mutex_get_increment(self, &ret);
02607 return ret;
02608 }
02609 static u_int32_t DbEnv_mutex_get_max(struct DbEnv *self){
02610 u_int32_t ret;
02611 errno = self->mutex_get_max(self, &ret);
02612 return ret;
02613 }
02614 static u_int32_t DbEnv_mutex_get_tas_spins(struct DbEnv *self){
02615 u_int32_t ret;
02616 errno = self->mutex_get_tas_spins(self, &ret);
02617 return ret;
02618 }
02619 static db_ret_t DbEnv_mutex_set_align(struct DbEnv *self,u_int32_t align){
02620 return self->mutex_set_align(self, align);
02621 }
02622 static db_ret_t DbEnv_mutex_set_increment(struct DbEnv *self,u_int32_t increment){
02623 return self->mutex_set_increment(self, increment);
02624 }
02625 static db_ret_t DbEnv_mutex_set_max(struct DbEnv *self,u_int32_t mutex_max){
02626 return self->mutex_set_increment(self, mutex_max);
02627 }
02628 static db_ret_t DbEnv_mutex_set_tas_spins(struct DbEnv *self,u_int32_t tas_spins){
02629 return self->mutex_set_tas_spins(self, tas_spins);
02630 }
02631 static DB_MUTEX_STAT *DbEnv_mutex_stat(struct DbEnv *self,u_int32_t flags){
02632 DB_MUTEX_STAT *statp = NULL;
02633 errno = self->mutex_stat(self, &statp, flags);
02634 return statp;
02635 }
02636 static u_int32_t DbEnv_get_tx_max(struct DbEnv *self){
02637 u_int32_t ret;
02638 errno = self->get_tx_max(self, &ret);
02639 return ret;
02640 }
02641 static time_t DbEnv_get_tx_timestamp(struct DbEnv *self){
02642 time_t ret;
02643 errno = self->get_tx_timestamp(self, &ret);
02644 return ret;
02645 }
02646 static db_timeout_t DbEnv_get_timeout(struct DbEnv *self,u_int32_t flag){
02647 db_timeout_t ret;
02648 errno = self->get_timeout(self, &ret, flag);
02649 return ret;
02650 }
02651 static DB_TXN *DbEnv_txn_begin(struct DbEnv *self,DB_TXN *parent,u_int32_t flags){
02652 DB_TXN *tid = NULL;
02653 errno = self->txn_begin(self, parent, &tid, flags);
02654 return tid;
02655 }
02656 static db_ret_t DbEnv_txn_checkpoint(struct DbEnv *self,u_int32_t kbyte,u_int32_t min,u_int32_t flags){
02657 return self->txn_checkpoint(self, kbyte, min, flags);
02658 }
02659 static DB_PREPLIST *DbEnv_txn_recover(struct DbEnv *self,int count,u_int32_t flags){
02660 DB_PREPLIST *preplist;
02661 long retcount;
02662
02663
02664 if ((errno = __os_malloc(self,
02665 (count + 1) * sizeof(DB_PREPLIST), &preplist)) != 0)
02666 return NULL;
02667
02668 if ((errno = self->txn_recover(self, preplist, count,
02669 &retcount, flags)) != 0) {
02670 __os_free(self, preplist);
02671 return NULL;
02672 }
02673
02674 preplist[retcount].txn = NULL;
02675 return preplist;
02676 }
02677 static DB_TXN_STAT *DbEnv_txn_stat(struct DbEnv *self,u_int32_t flags){
02678 DB_TXN_STAT *statp = NULL;
02679 errno = self->txn_stat(self, &statp, flags);
02680 return statp;
02681 }
02682 static jlong DbEnv_get_rep_limit(struct DbEnv *self){
02683 u_int32_t gbytes, bytes;
02684 errno = self->get_rep_limit(self, &gbytes, &bytes);
02685 return (jlong)gbytes * GIGABYTE + bytes;
02686 }
02687 static int DbEnv_rep_elect(struct DbEnv *self,int nsites,int nvotes,int priority,u_int32_t timeout,u_int32_t flags){
02688 int id;
02689 errno = self->rep_elect(self, nsites, nvotes, priority,
02690 timeout, &id, flags);
02691 return id;
02692 }
02693 static int DbEnv_rep_process_message(struct DbEnv *self,DBT *control,DBT *rec,int *envid,DB_LSN *ret_lsn){
02694 return self->rep_process_message(self, control, rec, envid,
02695 ret_lsn);
02696 }
02697 static db_ret_t DbEnv_rep_flush(struct DbEnv *self){
02698 return self->rep_flush(self);
02699 }
02700 static db_ret_t DbEnv_rep_set_config(struct DbEnv *self,u_int32_t which,int_bool onoff){
02701 return self->rep_set_config(self, which, onoff);
02702 }
02703 static db_ret_t DbEnv_rep_start(struct DbEnv *self,DBT *cdata,u_int32_t flags){
02704 return self->rep_start(self, cdata, flags);
02705 }
02706 static db_ret_t DbEnv_rep_sync(struct DbEnv *self,u_int32_t flags){
02707 return self->rep_sync(self, flags);
02708 }
02709 static int_bool DbEnv_rep_get_config(struct DbEnv *self,u_int32_t which){
02710 int ret;
02711 errno = self->rep_get_config(self, which, &ret);
02712 return ret;
02713 }
02714 static DB_REP_STAT *DbEnv_rep_stat(struct DbEnv *self,u_int32_t flags){
02715 DB_REP_STAT *statp = NULL;
02716 errno = self->rep_stat(self, &statp, flags);
02717 return statp;
02718 }
02719 static db_ret_t DbEnv_set_rep_limit(struct DbEnv *self,jlong bytes){
02720 return self->set_rep_limit(self,
02721 (u_int32_t)(bytes / GIGABYTE),
02722 (u_int32_t)(bytes % GIGABYTE));
02723 }
02724 static db_ret_t DbEnv_set_rep_request(struct DbEnv *self,u_int32_t min,u_int32_t max){
02725 return self->set_rep_request(self, min, max);
02726 }
02727 static db_ret_t DbEnv_set_rep_transport(struct DbEnv *self,int envid,int (*send)(DB_ENV *,DBT const *,DBT const *,DB_LSN const *,int,u_int32_t)){
02728 return self->set_rep_transport(self, envid, send);
02729 }
02730 static char const *DbEnv_strerror(int error){
02731 return db_strerror(error);
02732 }
02733 static int DbEnv_get_version_major(){
02734 return DB_VERSION_MAJOR;
02735 }
02736 static int DbEnv_get_version_minor(){
02737 return DB_VERSION_MINOR;
02738 }
02739 static int DbEnv_get_version_patch(){
02740 return DB_VERSION_PATCH;
02741 }
02742 static char const *DbEnv_get_version_string(){
02743 return DB_VERSION_STRING;
02744 }
02745 static void delete_DbLock(struct DbLock *self){
02746 __os_free(NULL, self);
02747 }
02748 static db_ret_t DbLogc_close(struct DbLogc *self,u_int32_t flags){
02749 return self->close(self, flags);
02750 }
02751 static int DbLogc_get(struct DbLogc *self,DB_LSN *lsn,DBT *data,u_int32_t flags){
02752 return self->get(self, lsn, data, flags);
02753 }
02754 static DB_CACHE_PRIORITY DbMpoolFile_get_priority(struct DbMpoolFile *self){
02755 DB_CACHE_PRIORITY ret;
02756 errno = self->get_priority(self, &ret);
02757 return ret;
02758 }
02759 static db_ret_t DbMpoolFile_set_priority(struct DbMpoolFile *self,DB_CACHE_PRIORITY priority){
02760 return self->set_priority(self, priority);
02761 }
02762 static u_int32_t DbMpoolFile_get_flags(struct DbMpoolFile *self){
02763 u_int32_t ret;
02764 errno = self->get_flags(self, &ret);
02765 return ret;
02766 }
02767 static db_ret_t DbMpoolFile_set_flags(struct DbMpoolFile *self,u_int32_t flags,int_bool onoff){
02768 return self->set_flags(self, flags, onoff);
02769 }
02770 static jlong DbMpoolFile_get_maxsize(struct DbMpoolFile *self){
02771 u_int32_t gbytes, bytes;
02772 errno = self->get_maxsize(self, &gbytes, &bytes);
02773 return (jlong)gbytes * GIGABYTE + bytes;
02774 }
02775 static db_ret_t DbMpoolFile_set_maxsize(struct DbMpoolFile *self,jlong bytes){
02776 return self->set_maxsize(self,
02777 (u_int32_t)(bytes / GIGABYTE),
02778 (u_int32_t)(bytes % GIGABYTE));
02779 }
02780 static struct DbSequence *new_DbSequence(DB *db,u_int32_t flags){
02781 DB_SEQUENCE *self = NULL;
02782 errno = db_sequence_create(&self, db, flags);
02783 return self;
02784 }
02785 static db_ret_t DbSequence_close(struct DbSequence *self,u_int32_t flags){
02786 return self->close(self, flags);
02787 }
02788 static db_seq_t DbSequence_get(struct DbSequence *self,DB_TXN *txnid,int32_t delta,u_int32_t flags){
02789 db_seq_t ret = 0;
02790 errno = self->get(self, txnid, delta, &ret, flags);
02791 return ret;
02792 }
02793 static int32_t DbSequence_get_cachesize(struct DbSequence *self){
02794 int32_t ret = 0;
02795 errno = self->get_cachesize(self, &ret);
02796 return ret;
02797 }
02798 static DB *DbSequence_get_db(struct DbSequence *self){
02799 DB *ret = NULL;
02800 errno = self->get_db(self, &ret);
02801 return ret;
02802 }
02803 static u_int32_t DbSequence_get_flags(struct DbSequence *self){
02804 u_int32_t ret = 0;
02805 errno = self->get_flags(self, &ret);
02806 return ret;
02807 }
02808 static db_ret_t DbSequence_get_key(struct DbSequence *self,DBT *key){
02809 return self->get_key(self, key);
02810 }
02811 static db_seq_t DbSequence_get_range_min(struct DbSequence *self){
02812 db_seq_t ret = 0;
02813 errno = self->get_range(self, &ret, NULL);
02814 return ret;
02815 }
02816 static db_seq_t DbSequence_get_range_max(struct DbSequence *self){
02817 db_seq_t ret = 0;
02818 errno = self->get_range(self, NULL, &ret);
02819 return ret;
02820 }
02821 static db_ret_t DbSequence_initial_value(struct DbSequence *self,db_seq_t val){
02822 return self->initial_value(self, val);
02823 }
02824 static db_ret_t DbSequence_open(struct DbSequence *self,DB_TXN *txnid,DBT *key,u_int32_t flags){
02825 return self->open(self, txnid, key, flags);
02826 }
02827 static db_ret_t DbSequence_remove(struct DbSequence *self,DB_TXN *txnid,u_int32_t flags){
02828 return self->remove(self, txnid, flags);
02829 }
02830 static db_ret_t DbSequence_set_cachesize(struct DbSequence *self,int32_t size){
02831 return self->set_cachesize(self, size);
02832 }
02833 static db_ret_t DbSequence_set_flags(struct DbSequence *self,u_int32_t flags){
02834 return self->set_flags(self, flags);
02835 }
02836 static db_ret_t DbSequence_set_range(struct DbSequence *self,db_seq_t min,db_seq_t max){
02837 return self->set_range(self, min, max);
02838 }
02839 static DB_SEQUENCE_STAT *DbSequence_stat(struct DbSequence *self,u_int32_t flags){
02840 DB_SEQUENCE_STAT *ret = NULL;
02841 errno = self->stat(self, &ret, flags);
02842 return ret;
02843 }
02844 static db_ret_t DbTxn_abort(struct DbTxn *self){
02845 return self->abort(self);
02846 }
02847 static db_ret_t DbTxn_commit(struct DbTxn *self,u_int32_t flags){
02848 return self->commit(self, flags);
02849 }
02850 static db_ret_t DbTxn_discard(struct DbTxn *self,u_int32_t flags){
02851 return self->discard(self, flags);
02852 }
02853 static char const *DbTxn_get_name(struct DbTxn *self){
02854 const char *name = NULL;
02855 errno = self->get_name(self, &name);
02856 return name;
02857 }
02858 static u_int32_t DbTxn_id(struct DbTxn *self){
02859 return self->id(self);
02860 }
02861 static db_ret_t DbTxn_prepare(struct DbTxn *self,u_int8_t *gid){
02862 return self->prepare(self, gid);
02863 }
02864 static db_ret_t DbTxn_set_timeout(struct DbTxn *self,db_timeout_t timeout,u_int32_t flags){
02865 return self->set_timeout(self, timeout, flags);
02866 }
02867 static db_ret_t DbTxn_set_name(struct DbTxn *self,char const *name){
02868 return self->set_name(self, name);
02869 }
02870
02871 #ifdef __cplusplus
02872 extern "C" {
02873 #endif
02874
02875 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_new_1Db(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
02876 jlong jresult = 0 ;
02877 DB_ENV *arg1 = (DB_ENV *) 0 ;
02878 u_int32_t arg2 ;
02879 struct Db *result;
02880
02881 (void)jenv;
02882 (void)jcls;
02883 arg1 = *(DB_ENV **)(void *)&jarg1;
02884 arg2 = (u_int32_t)jarg2;
02885
02886 errno = 0;
02887 result = (struct Db *)new_Db(arg1,arg2);
02888
02889 if (!DB_RETOK_STD(errno)) {
02890 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
02891 }
02892
02893 *(struct Db **)(void *)&jresult = result;
02894 return jresult;
02895 }
02896
02897
02898 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1associate(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jobject jarg4, jint jarg5) {
02899 struct Db *arg1 = (struct Db *) 0 ;
02900 DB_TXN *arg2 = (DB_TXN *) 0 ;
02901 DB *arg3 = (DB *) 0 ;
02902 int (*arg4)(DB *,DBT const *,DBT const *,DBT *) = (int (*)(DB *,DBT const *,DBT const *,DBT *)) 0 ;
02903 u_int32_t arg5 ;
02904 db_ret_t result;
02905
02906 (void)jenv;
02907 (void)jcls;
02908 arg1 = *(struct Db **)(void *)&jarg1;
02909 arg2 = *(DB_TXN **)(void *)&jarg2;
02910 arg3 = *(DB **)(void *)&jarg3;
02911
02912 arg4 = (jarg4 == NULL) ? NULL : __dbj_seckey_create;
02913
02914 arg5 = (u_int32_t)jarg5;
02915
02916 if (jarg1 == 0) {
02917 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
02918 return ;
02919 }
02920
02921 result = (db_ret_t)Db_associate(arg1,arg2,arg3,arg4,arg5);
02922
02923 if (!DB_RETOK_STD(result)) {
02924 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
02925 }
02926
02927 }
02928
02929
02930 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1compact(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jobject jarg4, jobject jarg5, jint jarg6, jobject jarg7) {
02931 struct Db *arg1 = (struct Db *) 0 ;
02932 DB_TXN *arg2 = (DB_TXN *) 0 ;
02933 DBT *arg3 = (DBT *) 0 ;
02934 DBT *arg4 = (DBT *) 0 ;
02935 DB_COMPACT *arg5 = (DB_COMPACT *) 0 ;
02936 u_int32_t arg6 ;
02937 DBT *arg7 = (DBT *) 0 ;
02938 db_ret_t result;
02939 DBT_LOCKED ldbt3 ;
02940 DBT_LOCKED ldbt4 ;
02941 DBT_LOCKED ldbt7 ;
02942
02943 (void)jenv;
02944 (void)jcls;
02945 arg1 = *(struct Db **)(void *)&jarg1;
02946 arg2 = *(DB_TXN **)(void *)&jarg2;
02947
02948 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 1) != 0) {
02949 return ;
02950 }
02951
02952 if (__dbj_dbt_copyin(jenv, &ldbt4, &arg4, jarg4, 1) != 0) {
02953 return ;
02954 }
02955 arg5 = *(DB_COMPACT **)(void *)&jarg5;
02956 arg6 = (u_int32_t)jarg6;
02957
02958 if (__dbj_dbt_copyin(jenv, &ldbt7, &arg7, jarg7, 1) != 0) {
02959 return ;
02960 }
02961
02962 if (jarg1 == 0) {
02963 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
02964 return ;
02965 }
02966
02967 result = (db_ret_t)Db_compact(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
02968
02969 if (!DB_RETOK_STD(result)) {
02970 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
02971 }
02972
02973 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
02974 __dbj_dbt_release(jenv, jarg4, arg4, &ldbt4);
02975 __dbj_fill_compact(jenv, jarg5, arg5);
02976 __dbj_dbt_release(jenv, jarg7, arg7, &ldbt7);
02977 }
02978
02979
02980 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1close0(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
02981 jint jresult = 0 ;
02982 struct Db *arg1 = (struct Db *) 0 ;
02983 u_int32_t arg2 ;
02984 int result;
02985
02986 (void)jenv;
02987 (void)jcls;
02988 arg1 = *(struct Db **)(void *)&jarg1;
02989 arg2 = (u_int32_t)jarg2;
02990
02991 if (jarg1 == 0) {
02992 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
02993 return 0;
02994 }
02995
02996 errno = 0;
02997 result = (int)Db_close(arg1,arg2);
02998
02999 if (!DB_RETOK_STD(errno)) {
03000 __dbj_throw(jenv, errno, NULL, NULL, NULL);
03001 }
03002
03003 jresult = (jint)result;
03004 return jresult;
03005 }
03006
03007
03008 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1cursor(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
03009 jlong jresult = 0 ;
03010 struct Db *arg1 = (struct Db *) 0 ;
03011 DB_TXN *arg2 = (DB_TXN *) 0 ;
03012 u_int32_t arg3 ;
03013 DBC *result;
03014
03015 (void)jenv;
03016 (void)jcls;
03017 arg1 = *(struct Db **)(void *)&jarg1;
03018 arg2 = *(DB_TXN **)(void *)&jarg2;
03019 arg3 = (u_int32_t)jarg3;
03020
03021 if (jarg1 == 0) {
03022 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03023 return 0;
03024 }
03025
03026 errno = 0;
03027 result = (DBC *)Db_cursor(arg1,arg2,arg3);
03028
03029 if (!DB_RETOK_STD(errno)) {
03030 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03031 }
03032
03033 *(DBC **)(void *)&jresult = result;
03034 return jresult;
03035 }
03036
03037
03038 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1del(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jint jarg4) {
03039 jint jresult = 0 ;
03040 struct Db *arg1 = (struct Db *) 0 ;
03041 DB_TXN *arg2 = (DB_TXN *) 0 ;
03042 DBT *arg3 = (DBT *) 0 ;
03043 u_int32_t arg4 ;
03044 int result;
03045 DBT_LOCKED ldbt3 ;
03046
03047 (void)jenv;
03048 (void)jcls;
03049 arg1 = *(struct Db **)(void *)&jarg1;
03050 arg2 = *(DB_TXN **)(void *)&jarg2;
03051
03052 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
03053 return 0;
03054 }
03055 arg4 = (u_int32_t)jarg4;
03056
03057 if (jarg1 == 0) {
03058 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03059 return 0;
03060 }
03061
03062 result = (int)Db_del(arg1,arg2,arg3,arg4);
03063
03064 if (!DB_RETOK_DBDEL(result)) {
03065 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
03066 }
03067
03068 jresult = (jint)result;
03069 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
03070 return jresult;
03071 }
03072
03073
03074 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1err(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jstring jarg3) {
03075 struct Db *arg1 = (struct Db *) 0 ;
03076 int arg2 ;
03077 char *arg3 = (char *) 0 ;
03078
03079 (void)jenv;
03080 (void)jcls;
03081 arg1 = *(struct Db **)(void *)&jarg1;
03082 arg2 = (int)jarg2;
03083 {
03084 arg3 = 0;
03085 if (jarg3) {
03086 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
03087 if (!arg3) return ;
03088 }
03089 }
03090
03091 if (jarg1 == 0) {
03092 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03093 return ;
03094 }
03095 Db_err(arg1,arg2,(char const *)arg3);
03096
03097 {
03098 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
03099 }
03100 }
03101
03102
03103 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1errx(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
03104 struct Db *arg1 = (struct Db *) 0 ;
03105 char *arg2 = (char *) 0 ;
03106
03107 (void)jenv;
03108 (void)jcls;
03109 arg1 = *(struct Db **)(void *)&jarg1;
03110 {
03111 arg2 = 0;
03112 if (jarg2) {
03113 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
03114 if (!arg2) return ;
03115 }
03116 }
03117
03118 if (jarg1 == 0) {
03119 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03120 return ;
03121 }
03122 Db_errx(arg1,(char const *)arg2);
03123
03124 {
03125 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
03126 }
03127 }
03128
03129
03130 JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1transactional(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03131 jboolean jresult = 0 ;
03132 struct Db *arg1 = (struct Db *) 0 ;
03133 int_bool result;
03134
03135 (void)jenv;
03136 (void)jcls;
03137 arg1 = *(struct Db **)(void *)&jarg1;
03138
03139 if (jarg1 == 0) {
03140 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03141 return 0;
03142 }
03143 result = (int_bool)Db_get_transactional(arg1);
03144
03145 jresult = (result) ? JNI_TRUE : JNI_FALSE;
03146 return jresult;
03147 }
03148
03149
03150 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jobject jarg4, jint jarg5) {
03151 jint jresult = 0 ;
03152 struct Db *arg1 = (struct Db *) 0 ;
03153 DB_TXN *arg2 = (DB_TXN *) 0 ;
03154 DBT *arg3 = (DBT *) 0 ;
03155 DBT *arg4 = (DBT *) 0 ;
03156 u_int32_t arg5 ;
03157 int result;
03158 DBT_LOCKED ldbt3 ;
03159 DBT_LOCKED ldbt4 ;
03160
03161 (void)jenv;
03162 (void)jcls;
03163 arg1 = *(struct Db **)(void *)&jarg1;
03164 arg2 = *(DB_TXN **)(void *)&jarg2;
03165
03166 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
03167 return 0;
03168 }
03169
03170 if (__dbj_dbt_copyin(jenv, &ldbt4, &arg4, jarg4, 0) != 0) {
03171 return 0;
03172 }
03173 arg5 = (u_int32_t)jarg5;
03174
03175 if (jarg1 == 0) {
03176 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03177 return 0;
03178 }
03179
03180 result = (int)Db_get(arg1,arg2,arg3,arg4,arg5);
03181
03182 if (!DB_RETOK_DBGET(result)) {
03183 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
03184 }
03185
03186 jresult = (jint)result;
03187 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
03188 __dbj_dbt_release(jenv, jarg4, arg4, &ldbt4);
03189 return jresult;
03190 }
03191
03192
03193 JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1byteswapped(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03194 jboolean jresult = 0 ;
03195 struct Db *arg1 = (struct Db *) 0 ;
03196 int_bool result;
03197
03198 (void)jenv;
03199 (void)jcls;
03200 arg1 = *(struct Db **)(void *)&jarg1;
03201
03202 if (jarg1 == 0) {
03203 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03204 return 0;
03205 }
03206
03207 errno = 0;
03208 result = (int_bool)Db_get_byteswapped(arg1);
03209
03210 if (!DB_RETOK_STD(errno)) {
03211 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03212 }
03213
03214 jresult = (result) ? JNI_TRUE : JNI_FALSE;
03215 return jresult;
03216 }
03217
03218
03219 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1cachesize(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03220 jlong jresult = 0 ;
03221 struct Db *arg1 = (struct Db *) 0 ;
03222 jlong result;
03223
03224 (void)jenv;
03225 (void)jcls;
03226 arg1 = *(struct Db **)(void *)&jarg1;
03227
03228 if (jarg1 == 0) {
03229 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03230 return 0;
03231 }
03232
03233 errno = 0;
03234 result = Db_get_cachesize(arg1);
03235
03236 if (!DB_RETOK_STD(errno)) {
03237 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03238 }
03239
03240 jresult = result;
03241 return jresult;
03242 }
03243
03244
03245 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1cachesize_1ncache(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03246 jint jresult = 0 ;
03247 struct Db *arg1 = (struct Db *) 0 ;
03248 u_int32_t result;
03249
03250 (void)jenv;
03251 (void)jcls;
03252 arg1 = *(struct Db **)(void *)&jarg1;
03253
03254 if (jarg1 == 0) {
03255 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03256 return 0;
03257 }
03258
03259 errno = 0;
03260 result = (u_int32_t)Db_get_cachesize_ncache(arg1);
03261
03262 if (!DB_RETOK_STD(errno)) {
03263 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03264 }
03265
03266 jresult = (jint)result;
03267 return jresult;
03268 }
03269
03270
03271 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1filename(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03272 jstring jresult = 0 ;
03273 struct Db *arg1 = (struct Db *) 0 ;
03274 char *result;
03275
03276 (void)jenv;
03277 (void)jcls;
03278 arg1 = *(struct Db **)(void *)&jarg1;
03279
03280 if (jarg1 == 0) {
03281 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03282 return 0;
03283 }
03284
03285 errno = 0;
03286 result = (char *)Db_get_filename(arg1);
03287
03288 if (!DB_RETOK_STD(errno)) {
03289 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03290 }
03291
03292 {
03293 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
03294 }
03295 return jresult;
03296 }
03297
03298
03299 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1dbname(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03300 jstring jresult = 0 ;
03301 struct Db *arg1 = (struct Db *) 0 ;
03302 char *result;
03303
03304 (void)jenv;
03305 (void)jcls;
03306 arg1 = *(struct Db **)(void *)&jarg1;
03307
03308 if (jarg1 == 0) {
03309 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03310 return 0;
03311 }
03312
03313 errno = 0;
03314 result = (char *)Db_get_dbname(arg1);
03315
03316 if (!DB_RETOK_STD(errno)) {
03317 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03318 }
03319
03320 {
03321 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
03322 }
03323 return jresult;
03324 }
03325
03326
03327 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1encrypt_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03328 jint jresult = 0 ;
03329 struct Db *arg1 = (struct Db *) 0 ;
03330 u_int32_t result;
03331
03332 (void)jenv;
03333 (void)jcls;
03334 arg1 = *(struct Db **)(void *)&jarg1;
03335
03336 if (jarg1 == 0) {
03337 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03338 return 0;
03339 }
03340
03341 errno = 0;
03342 result = (u_int32_t)Db_get_encrypt_flags(arg1);
03343
03344 if (!DB_RETOK_STD(errno)) {
03345 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03346 }
03347
03348 jresult = (jint)result;
03349 return jresult;
03350 }
03351
03352
03353 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03354 jint jresult = 0 ;
03355 struct Db *arg1 = (struct Db *) 0 ;
03356 u_int32_t result;
03357
03358 (void)jenv;
03359 (void)jcls;
03360 arg1 = *(struct Db **)(void *)&jarg1;
03361
03362 if (jarg1 == 0) {
03363 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03364 return 0;
03365 }
03366
03367 errno = 0;
03368 result = (u_int32_t)Db_get_flags(arg1);
03369
03370 if (!DB_RETOK_STD(errno)) {
03371 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03372 }
03373
03374 jresult = (jint)result;
03375 return jresult;
03376 }
03377
03378
03379 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1lorder(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03380 jint jresult = 0 ;
03381 struct Db *arg1 = (struct Db *) 0 ;
03382 int result;
03383
03384 (void)jenv;
03385 (void)jcls;
03386 arg1 = *(struct Db **)(void *)&jarg1;
03387
03388 if (jarg1 == 0) {
03389 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03390 return 0;
03391 }
03392
03393 errno = 0;
03394 result = (int)Db_get_lorder(arg1);
03395
03396 if (!DB_RETOK_STD(errno)) {
03397 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03398 }
03399
03400 jresult = (jint)result;
03401 return jresult;
03402 }
03403
03404
03405 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1mpf(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03406 jlong jresult = 0 ;
03407 struct Db *arg1 = (struct Db *) 0 ;
03408 DB_MPOOLFILE *result;
03409
03410 (void)jenv;
03411 (void)jcls;
03412 arg1 = *(struct Db **)(void *)&jarg1;
03413
03414 if (jarg1 == 0) {
03415 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03416 return 0;
03417 }
03418
03419 errno = 0;
03420 result = (DB_MPOOLFILE *)Db_get_mpf(arg1);
03421
03422 if (!DB_RETOK_STD(errno)) {
03423 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03424 }
03425
03426 *(DB_MPOOLFILE **)(void *)&jresult = result;
03427 return jresult;
03428 }
03429
03430
03431 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1open_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03432 jint jresult = 0 ;
03433 struct Db *arg1 = (struct Db *) 0 ;
03434 u_int32_t result;
03435
03436 (void)jenv;
03437 (void)jcls;
03438 arg1 = *(struct Db **)(void *)&jarg1;
03439
03440 if (jarg1 == 0) {
03441 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03442 return 0;
03443 }
03444
03445 errno = 0;
03446 result = (u_int32_t)Db_get_open_flags(arg1);
03447
03448 if (!DB_RETOK_STD(errno)) {
03449 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03450 }
03451
03452 jresult = (jint)result;
03453 return jresult;
03454 }
03455
03456
03457 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1pagesize(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03458 jint jresult = 0 ;
03459 struct Db *arg1 = (struct Db *) 0 ;
03460 u_int32_t result;
03461
03462 (void)jenv;
03463 (void)jcls;
03464 arg1 = *(struct Db **)(void *)&jarg1;
03465
03466 if (jarg1 == 0) {
03467 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03468 return 0;
03469 }
03470
03471 errno = 0;
03472 result = (u_int32_t)Db_get_pagesize(arg1);
03473
03474 if (!DB_RETOK_STD(errno)) {
03475 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03476 }
03477
03478 jresult = (jint)result;
03479 return jresult;
03480 }
03481
03482
03483 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1bt_1minkey(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03484 jint jresult = 0 ;
03485 struct Db *arg1 = (struct Db *) 0 ;
03486 u_int32_t result;
03487
03488 (void)jenv;
03489 (void)jcls;
03490 arg1 = *(struct Db **)(void *)&jarg1;
03491
03492 if (jarg1 == 0) {
03493 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03494 return 0;
03495 }
03496
03497 errno = 0;
03498 result = (u_int32_t)Db_get_bt_minkey(arg1);
03499
03500 if (!DB_RETOK_STD(errno)) {
03501 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03502 }
03503
03504 jresult = (jint)result;
03505 return jresult;
03506 }
03507
03508
03509 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1h_1ffactor(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03510 jint jresult = 0 ;
03511 struct Db *arg1 = (struct Db *) 0 ;
03512 u_int32_t result;
03513
03514 (void)jenv;
03515 (void)jcls;
03516 arg1 = *(struct Db **)(void *)&jarg1;
03517
03518 if (jarg1 == 0) {
03519 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03520 return 0;
03521 }
03522
03523 errno = 0;
03524 result = (u_int32_t)Db_get_h_ffactor(arg1);
03525
03526 if (!DB_RETOK_STD(errno)) {
03527 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03528 }
03529
03530 jresult = (jint)result;
03531 return jresult;
03532 }
03533
03534
03535 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1h_1nelem(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03536 jint jresult = 0 ;
03537 struct Db *arg1 = (struct Db *) 0 ;
03538 u_int32_t result;
03539
03540 (void)jenv;
03541 (void)jcls;
03542 arg1 = *(struct Db **)(void *)&jarg1;
03543
03544 if (jarg1 == 0) {
03545 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03546 return 0;
03547 }
03548
03549 errno = 0;
03550 result = (u_int32_t)Db_get_h_nelem(arg1);
03551
03552 if (!DB_RETOK_STD(errno)) {
03553 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03554 }
03555
03556 jresult = (jint)result;
03557 return jresult;
03558 }
03559
03560
03561 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1re_1delim(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03562 jint jresult = 0 ;
03563 struct Db *arg1 = (struct Db *) 0 ;
03564 int result;
03565
03566 (void)jenv;
03567 (void)jcls;
03568 arg1 = *(struct Db **)(void *)&jarg1;
03569
03570 if (jarg1 == 0) {
03571 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03572 return 0;
03573 }
03574
03575 errno = 0;
03576 result = (int)Db_get_re_delim(arg1);
03577
03578 if (!DB_RETOK_STD(errno)) {
03579 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03580 }
03581
03582 jresult = (jint)result;
03583 return jresult;
03584 }
03585
03586
03587 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1re_1len(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03588 jint jresult = 0 ;
03589 struct Db *arg1 = (struct Db *) 0 ;
03590 u_int32_t result;
03591
03592 (void)jenv;
03593 (void)jcls;
03594 arg1 = *(struct Db **)(void *)&jarg1;
03595
03596 if (jarg1 == 0) {
03597 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03598 return 0;
03599 }
03600
03601 errno = 0;
03602 result = (u_int32_t)Db_get_re_len(arg1);
03603
03604 if (!DB_RETOK_STD(errno)) {
03605 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03606 }
03607
03608 jresult = (jint)result;
03609 return jresult;
03610 }
03611
03612
03613 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1re_1pad(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03614 jint jresult = 0 ;
03615 struct Db *arg1 = (struct Db *) 0 ;
03616 int result;
03617
03618 (void)jenv;
03619 (void)jcls;
03620 arg1 = *(struct Db **)(void *)&jarg1;
03621
03622 if (jarg1 == 0) {
03623 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03624 return 0;
03625 }
03626
03627 errno = 0;
03628 result = (int)Db_get_re_pad(arg1);
03629
03630 if (!DB_RETOK_STD(errno)) {
03631 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03632 }
03633
03634 jresult = (jint)result;
03635 return jresult;
03636 }
03637
03638
03639 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1re_1source(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03640 jstring jresult = 0 ;
03641 struct Db *arg1 = (struct Db *) 0 ;
03642 char *result;
03643
03644 (void)jenv;
03645 (void)jcls;
03646 arg1 = *(struct Db **)(void *)&jarg1;
03647
03648 if (jarg1 == 0) {
03649 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03650 return 0;
03651 }
03652
03653 errno = 0;
03654 result = (char *)Db_get_re_source(arg1);
03655
03656 if (!DB_RETOK_STD(errno)) {
03657 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03658 }
03659
03660 {
03661 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
03662 }
03663 return jresult;
03664 }
03665
03666
03667 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1q_1extentsize(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03668 jint jresult = 0 ;
03669 struct Db *arg1 = (struct Db *) 0 ;
03670 u_int32_t result;
03671
03672 (void)jenv;
03673 (void)jcls;
03674 arg1 = *(struct Db **)(void *)&jarg1;
03675
03676 if (jarg1 == 0) {
03677 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03678 return 0;
03679 }
03680
03681 errno = 0;
03682 result = (u_int32_t)Db_get_q_extentsize(arg1);
03683
03684 if (!DB_RETOK_STD(errno)) {
03685 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03686 }
03687
03688 jresult = (jint)result;
03689 return jresult;
03690 }
03691
03692
03693 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1get_1type(JNIEnv *jenv, jclass jcls, jlong jarg1) {
03694 jint jresult = 0 ;
03695 struct Db *arg1 = (struct Db *) 0 ;
03696 DBTYPE result;
03697
03698 (void)jenv;
03699 (void)jcls;
03700 arg1 = *(struct Db **)(void *)&jarg1;
03701
03702 if (jarg1 == 0) {
03703 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03704 return 0;
03705 }
03706
03707 errno = 0;
03708 result = (DBTYPE)Db_get_type(arg1);
03709
03710 if (!DB_RETOK_STD(errno)) {
03711 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03712 }
03713
03714 jresult = (jint)result;
03715 return jresult;
03716 }
03717
03718
03719 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1join(JNIEnv *jenv, jclass jcls, jlong jarg1, jobjectArray jarg2, jint jarg3) {
03720 jlong jresult = 0 ;
03721 struct Db *arg1 = (struct Db *) 0 ;
03722 DBC **arg2 = (DBC **) 0 ;
03723 u_int32_t arg3 ;
03724 DBC *result;
03725
03726 (void)jenv;
03727 (void)jcls;
03728 arg1 = *(struct Db **)(void *)&jarg1;
03729 {
03730 int i, count, err;
03731
03732 count = (*jenv)->GetArrayLength(jenv, jarg2);
03733 if ((err = __os_malloc(NULL, (count + 1) * sizeof(DBC *), &arg2)) != 0) {
03734 __dbj_throw(jenv, err, NULL, NULL, DB2JDBENV);
03735 return 0;
03736 }
03737 for (i = 0; i < count; i++) {
03738 jobject jobj = (*jenv)->GetObjectArrayElement(jenv, jarg2, i);
03739
03740
03741
03742 if (jobj == NULL) {
03743 arg2[i] = NULL;
03744 break;
03745 } else {
03746 jlong jptr = (*jenv)->GetLongField(jenv, jobj,
03747 dbc_cptr_fid);
03748 arg2[i] = *(DBC **)(void *)&jptr;
03749 }
03750 }
03751 arg2[count] = NULL;
03752 }
03753 arg3 = (u_int32_t)jarg3;
03754
03755 if (jarg1 == 0) {
03756 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03757 return 0;
03758 }
03759
03760 errno = 0;
03761 result = (DBC *)Db_join(arg1,arg2,arg3);
03762
03763 if (!DB_RETOK_STD(errno)) {
03764 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
03765 }
03766
03767 *(DBC **)(void *)&jresult = result;
03768
03769 __os_free(NULL, arg2);
03770
03771 return jresult;
03772 }
03773
03774
03775 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1key_1range(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jobject jarg4, jint jarg5) {
03776 struct Db *arg1 = (struct Db *) 0 ;
03777 DB_TXN *arg2 = (DB_TXN *) 0 ;
03778 DBT *arg3 = (DBT *) 0 ;
03779 DB_KEY_RANGE *arg4 = (DB_KEY_RANGE *) 0 ;
03780 u_int32_t arg5 ;
03781 db_ret_t result;
03782 DBT_LOCKED ldbt3 ;
03783 DB_KEY_RANGE range4 ;
03784
03785 (void)jenv;
03786 (void)jcls;
03787 arg1 = *(struct Db **)(void *)&jarg1;
03788 arg2 = *(DB_TXN **)(void *)&jarg2;
03789
03790 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
03791 return ;
03792 }
03793 {
03794 arg4 = &range4;
03795 }
03796 arg5 = (u_int32_t)jarg5;
03797
03798 if (jarg1 == 0) {
03799 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03800 return ;
03801 }
03802
03803 result = (db_ret_t)Db_key_range(arg1,arg2,arg3,arg4,arg5);
03804
03805 if (!DB_RETOK_STD(result)) {
03806 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
03807 }
03808
03809 {
03810 (*jenv)->SetDoubleField(jenv, jarg4, kr_less_fid, arg4->less);
03811 (*jenv)->SetDoubleField(jenv, jarg4, kr_equal_fid, arg4->equal);
03812 (*jenv)->SetDoubleField(jenv, jarg4, kr_greater_fid, arg4->greater);
03813 }
03814 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
03815 }
03816
03817
03818 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1open(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jstring jarg4, jint jarg5, jint jarg6, jint jarg7) {
03819 struct Db *arg1 = (struct Db *) 0 ;
03820 DB_TXN *arg2 = (DB_TXN *) 0 ;
03821 char *arg3 = (char *) 0 ;
03822 char *arg4 = (char *) 0 ;
03823 DBTYPE arg5 ;
03824 u_int32_t arg6 ;
03825 int arg7 ;
03826 db_ret_t result;
03827
03828 (void)jenv;
03829 (void)jcls;
03830 arg1 = *(struct Db **)(void *)&jarg1;
03831 arg2 = *(DB_TXN **)(void *)&jarg2;
03832 {
03833 arg3 = 0;
03834 if (jarg3) {
03835 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
03836 if (!arg3) return ;
03837 }
03838 }
03839 {
03840 arg4 = 0;
03841 if (jarg4) {
03842 arg4 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg4, 0);
03843 if (!arg4) return ;
03844 }
03845 }
03846 arg5 = (DBTYPE)jarg5;
03847 arg6 = (u_int32_t)jarg6;
03848 arg7 = (int)jarg7;
03849
03850 if (jarg1 == 0) {
03851 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03852 return ;
03853 }
03854
03855 result = (db_ret_t)Db_open(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7);
03856
03857 if (!DB_RETOK_STD(result)) {
03858 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
03859 }
03860
03861 {
03862 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
03863 }
03864 {
03865 if (arg4) (*jenv)->ReleaseStringUTFChars(jenv, jarg4, arg4);
03866 }
03867 }
03868
03869
03870 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1pget(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jobject jarg4, jobject jarg5, jint jarg6) {
03871 jint jresult = 0 ;
03872 struct Db *arg1 = (struct Db *) 0 ;
03873 DB_TXN *arg2 = (DB_TXN *) 0 ;
03874 DBT *arg3 = (DBT *) 0 ;
03875 DBT *arg4 = (DBT *) 0 ;
03876 DBT *arg5 = (DBT *) 0 ;
03877 u_int32_t arg6 ;
03878 int result;
03879 DBT_LOCKED ldbt3 ;
03880 DBT_LOCKED ldbt4 ;
03881 DBT_LOCKED ldbt5 ;
03882
03883 (void)jenv;
03884 (void)jcls;
03885 arg1 = *(struct Db **)(void *)&jarg1;
03886 arg2 = *(DB_TXN **)(void *)&jarg2;
03887
03888 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
03889 return 0;
03890 }
03891
03892 if (__dbj_dbt_copyin(jenv, &ldbt4, &arg4, jarg4, 0) != 0) {
03893 return 0;
03894 }
03895
03896 if (__dbj_dbt_copyin(jenv, &ldbt5, &arg5, jarg5, 0) != 0) {
03897 return 0;
03898 }
03899 arg6 = (u_int32_t)jarg6;
03900
03901 if (jarg1 == 0) {
03902 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03903 return 0;
03904 }
03905
03906 result = (int)Db_pget(arg1,arg2,arg3,arg4,arg5,arg6);
03907
03908 if (!DB_RETOK_DBGET(result)) {
03909 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
03910 }
03911
03912 jresult = (jint)result;
03913 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
03914 __dbj_dbt_release(jenv, jarg4, arg4, &ldbt4);
03915 __dbj_dbt_release(jenv, jarg5, arg5, &ldbt5);
03916 return jresult;
03917 }
03918
03919
03920 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1put(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jobject jarg4, jint jarg5) {
03921 jint jresult = 0 ;
03922 struct Db *arg1 = (struct Db *) 0 ;
03923 DB_TXN *arg2 = (DB_TXN *) 0 ;
03924 DBT *arg3 = (DBT *) 0 ;
03925 DBT *arg4 = (DBT *) 0 ;
03926 u_int32_t arg5 ;
03927 int result;
03928 DBT_LOCKED ldbt3 ;
03929 DBT_LOCKED ldbt4 ;
03930
03931 (void)jenv;
03932 (void)jcls;
03933 arg1 = *(struct Db **)(void *)&jarg1;
03934 arg2 = *(DB_TXN **)(void *)&jarg2;
03935
03936 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
03937 return 0;
03938 }
03939
03940 if (__dbj_dbt_copyin(jenv, &ldbt4, &arg4, jarg4, 0) != 0) {
03941 return 0;
03942 }
03943 arg5 = (u_int32_t)jarg5;
03944
03945 if (jarg1 == 0) {
03946 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03947 return 0;
03948 }
03949
03950 result = (int)Db_put(arg1,arg2,arg3,arg4,arg5);
03951
03952 if (!DB_RETOK_DBPUT(result)) {
03953 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
03954 }
03955
03956 jresult = (jint)result;
03957 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
03958 __dbj_dbt_release(jenv, jarg4, arg4, &ldbt4);
03959 return jresult;
03960 }
03961
03962
03963 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1remove0(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jstring jarg3, jint jarg4) {
03964 struct Db *arg1 = (struct Db *) 0 ;
03965 char *arg2 = (char *) 0 ;
03966 char *arg3 = (char *) 0 ;
03967 u_int32_t arg4 ;
03968 db_ret_t result;
03969
03970 (void)jenv;
03971 (void)jcls;
03972 arg1 = *(struct Db **)(void *)&jarg1;
03973 {
03974 arg2 = 0;
03975 if (jarg2) {
03976 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
03977 if (!arg2) return ;
03978 }
03979 }
03980 {
03981 arg3 = 0;
03982 if (jarg3) {
03983 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
03984 if (!arg3) return ;
03985 }
03986 }
03987 arg4 = (u_int32_t)jarg4;
03988
03989 if (jarg1 == 0) {
03990 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
03991 return ;
03992 }
03993
03994 result = (db_ret_t)Db_remove(arg1,(char const *)arg2,(char const *)arg3,arg4);
03995
03996 if (!DB_RETOK_STD(result)) {
03997 __dbj_throw(jenv, result, NULL, NULL, NULL);
03998 }
03999
04000 {
04001 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
04002 }
04003 {
04004 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
04005 }
04006 }
04007
04008
04009 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1rename0(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jstring jarg3, jstring jarg4, jint jarg5) {
04010 struct Db *arg1 = (struct Db *) 0 ;
04011 char *arg2 = (char *) 0 ;
04012 char *arg3 = (char *) 0 ;
04013 char *arg4 = (char *) 0 ;
04014 u_int32_t arg5 ;
04015 db_ret_t result;
04016
04017 (void)jenv;
04018 (void)jcls;
04019 arg1 = *(struct Db **)(void *)&jarg1;
04020 {
04021 arg2 = 0;
04022 if (jarg2) {
04023 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
04024 if (!arg2) return ;
04025 }
04026 }
04027 {
04028 arg3 = 0;
04029 if (jarg3) {
04030 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
04031 if (!arg3) return ;
04032 }
04033 }
04034 {
04035 arg4 = 0;
04036 if (jarg4) {
04037 arg4 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg4, 0);
04038 if (!arg4) return ;
04039 }
04040 }
04041 arg5 = (u_int32_t)jarg5;
04042
04043 if (jarg1 == 0) {
04044 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04045 return ;
04046 }
04047
04048 result = (db_ret_t)Db_rename(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5);
04049
04050 if (!DB_RETOK_STD(result)) {
04051 __dbj_throw(jenv, result, NULL, NULL, NULL);
04052 }
04053
04054 {
04055 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
04056 }
04057 {
04058 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
04059 }
04060 {
04061 if (arg4) (*jenv)->ReleaseStringUTFChars(jenv, jarg4, arg4);
04062 }
04063 }
04064
04065
04066 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1append_1recno(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
04067 struct Db *arg1 = (struct Db *) 0 ;
04068 int (*arg2)(DB *,DBT *,db_recno_t) = (int (*)(DB *,DBT *,db_recno_t)) 0 ;
04069 db_ret_t result;
04070
04071 (void)jenv;
04072 (void)jcls;
04073 arg1 = *(struct Db **)(void *)&jarg1;
04074
04075 arg2 = (jarg2 == NULL) ? NULL : __dbj_append_recno;
04076
04077
04078 if (jarg1 == 0) {
04079 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04080 return ;
04081 }
04082
04083 result = (db_ret_t)Db_set_append_recno(arg1,arg2);
04084
04085 if (!DB_RETOK_STD(result)) {
04086 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04087 }
04088
04089 }
04090
04091
04092 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1bt_1compare(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
04093 struct Db *arg1 = (struct Db *) 0 ;
04094 int (*arg2)(DB *,DBT const *,DBT const *) = (int (*)(DB *,DBT const *,DBT const *)) 0 ;
04095 db_ret_t result;
04096
04097 (void)jenv;
04098 (void)jcls;
04099 arg1 = *(struct Db **)(void *)&jarg1;
04100
04101 arg2 = (jarg2 == NULL) ? NULL : __dbj_bt_compare;
04102
04103
04104 if (jarg1 == 0) {
04105 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04106 return ;
04107 }
04108
04109 result = (db_ret_t)Db_set_bt_compare(arg1,arg2);
04110
04111 if (!DB_RETOK_STD(result)) {
04112 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04113 }
04114
04115 }
04116
04117
04118 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1bt_1minkey(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04119 struct Db *arg1 = (struct Db *) 0 ;
04120 u_int32_t arg2 ;
04121 db_ret_t result;
04122
04123 (void)jenv;
04124 (void)jcls;
04125 arg1 = *(struct Db **)(void *)&jarg1;
04126 arg2 = (u_int32_t)jarg2;
04127
04128 if (jarg1 == 0) {
04129 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04130 return ;
04131 }
04132
04133 result = (db_ret_t)Db_set_bt_minkey(arg1,arg2);
04134
04135 if (!DB_RETOK_STD(result)) {
04136 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04137 }
04138
04139 }
04140
04141
04142 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1bt_1prefix(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
04143 struct Db *arg1 = (struct Db *) 0 ;
04144 size_t (*arg2)(DB *,DBT const *,DBT const *) = (size_t (*)(DB *,DBT const *,DBT const *)) 0 ;
04145 db_ret_t result;
04146
04147 (void)jenv;
04148 (void)jcls;
04149 arg1 = *(struct Db **)(void *)&jarg1;
04150
04151 arg2 = (jarg2 == NULL) ? NULL : __dbj_bt_prefix;
04152
04153
04154 if (jarg1 == 0) {
04155 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04156 return ;
04157 }
04158
04159 result = (db_ret_t)Db_set_bt_prefix(arg1,arg2);
04160
04161 if (!DB_RETOK_STD(result)) {
04162 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04163 }
04164
04165 }
04166
04167
04168 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1cachesize(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
04169 struct Db *arg1 = (struct Db *) 0 ;
04170 jlong arg2 ;
04171 int arg3 ;
04172 db_ret_t result;
04173
04174 (void)jenv;
04175 (void)jcls;
04176 arg1 = *(struct Db **)(void *)&jarg1;
04177 arg2 = jarg2;
04178 arg3 = (int)jarg3;
04179
04180 if (jarg1 == 0) {
04181 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04182 return ;
04183 }
04184
04185 result = (db_ret_t)Db_set_cachesize(arg1,arg2,arg3);
04186
04187 if (!DB_RETOK_STD(result)) {
04188 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04189 }
04190
04191 }
04192
04193
04194 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1dup_1compare(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
04195 struct Db *arg1 = (struct Db *) 0 ;
04196 int (*arg2)(DB *,DBT const *,DBT const *) = (int (*)(DB *,DBT const *,DBT const *)) 0 ;
04197 db_ret_t result;
04198
04199 (void)jenv;
04200 (void)jcls;
04201 arg1 = *(struct Db **)(void *)&jarg1;
04202
04203 arg2 = (jarg2 == NULL) ? NULL : __dbj_dup_compare;
04204
04205
04206 if (jarg1 == 0) {
04207 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04208 return ;
04209 }
04210
04211 result = (db_ret_t)Db_set_dup_compare(arg1,arg2);
04212
04213 if (!DB_RETOK_STD(result)) {
04214 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04215 }
04216
04217 }
04218
04219
04220 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1encrypt(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3) {
04221 struct Db *arg1 = (struct Db *) 0 ;
04222 char *arg2 = (char *) 0 ;
04223 u_int32_t arg3 ;
04224 db_ret_t result;
04225
04226 (void)jenv;
04227 (void)jcls;
04228 arg1 = *(struct Db **)(void *)&jarg1;
04229 {
04230 arg2 = 0;
04231 if (jarg2) {
04232 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
04233 if (!arg2) return ;
04234 }
04235 }
04236 arg3 = (u_int32_t)jarg3;
04237
04238 if (jarg1 == 0) {
04239 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04240 return ;
04241 }
04242
04243 result = (db_ret_t)Db_set_encrypt(arg1,(char const *)arg2,arg3);
04244
04245 if (!DB_RETOK_STD(result)) {
04246 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04247 }
04248
04249 {
04250 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
04251 }
04252 }
04253
04254
04255 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1feedback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
04256 struct Db *arg1 = (struct Db *) 0 ;
04257 void (*arg2)(DB *,int,int) = (void (*)(DB *,int,int)) 0 ;
04258 db_ret_t result;
04259
04260 (void)jenv;
04261 (void)jcls;
04262 arg1 = *(struct Db **)(void *)&jarg1;
04263
04264 arg2 = (jarg2 == NULL) ? NULL : __dbj_db_feedback;
04265
04266
04267 if (jarg1 == 0) {
04268 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04269 return ;
04270 }
04271
04272 result = (db_ret_t)Db_set_feedback(arg1,arg2);
04273
04274 if (!DB_RETOK_STD(result)) {
04275 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04276 }
04277
04278 }
04279
04280
04281 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04282 struct Db *arg1 = (struct Db *) 0 ;
04283 u_int32_t arg2 ;
04284 db_ret_t result;
04285
04286 (void)jenv;
04287 (void)jcls;
04288 arg1 = *(struct Db **)(void *)&jarg1;
04289 arg2 = (u_int32_t)jarg2;
04290
04291 if (jarg1 == 0) {
04292 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04293 return ;
04294 }
04295
04296 result = (db_ret_t)Db_set_flags(arg1,arg2);
04297
04298 if (!DB_RETOK_STD(result)) {
04299 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04300 }
04301
04302 }
04303
04304
04305 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1h_1ffactor(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04306 struct Db *arg1 = (struct Db *) 0 ;
04307 u_int32_t arg2 ;
04308 db_ret_t result;
04309
04310 (void)jenv;
04311 (void)jcls;
04312 arg1 = *(struct Db **)(void *)&jarg1;
04313 arg2 = (u_int32_t)jarg2;
04314
04315 if (jarg1 == 0) {
04316 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04317 return ;
04318 }
04319
04320 result = (db_ret_t)Db_set_h_ffactor(arg1,arg2);
04321
04322 if (!DB_RETOK_STD(result)) {
04323 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04324 }
04325
04326 }
04327
04328
04329 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1h_1hash(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
04330 struct Db *arg1 = (struct Db *) 0 ;
04331 u_int32_t (*arg2)(DB *,void const *,u_int32_t) = (u_int32_t (*)(DB *,void const *,u_int32_t)) 0 ;
04332 db_ret_t result;
04333
04334 (void)jenv;
04335 (void)jcls;
04336 arg1 = *(struct Db **)(void *)&jarg1;
04337
04338 arg2 = (jarg2 == NULL) ? NULL : __dbj_h_hash;
04339
04340
04341 if (jarg1 == 0) {
04342 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04343 return ;
04344 }
04345
04346 result = (db_ret_t)Db_set_h_hash(arg1,arg2);
04347
04348 if (!DB_RETOK_STD(result)) {
04349 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04350 }
04351
04352 }
04353
04354
04355 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1h_1nelem(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04356 struct Db *arg1 = (struct Db *) 0 ;
04357 u_int32_t arg2 ;
04358 db_ret_t result;
04359
04360 (void)jenv;
04361 (void)jcls;
04362 arg1 = *(struct Db **)(void *)&jarg1;
04363 arg2 = (u_int32_t)jarg2;
04364
04365 if (jarg1 == 0) {
04366 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04367 return ;
04368 }
04369
04370 result = (db_ret_t)Db_set_h_nelem(arg1,arg2);
04371
04372 if (!DB_RETOK_STD(result)) {
04373 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04374 }
04375
04376 }
04377
04378
04379 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1lorder(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04380 struct Db *arg1 = (struct Db *) 0 ;
04381 int arg2 ;
04382 db_ret_t result;
04383
04384 (void)jenv;
04385 (void)jcls;
04386 arg1 = *(struct Db **)(void *)&jarg1;
04387 arg2 = (int)jarg2;
04388
04389 if (jarg1 == 0) {
04390 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04391 return ;
04392 }
04393
04394 result = (db_ret_t)Db_set_lorder(arg1,arg2);
04395
04396 if (!DB_RETOK_STD(result)) {
04397 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04398 }
04399
04400 }
04401
04402
04403 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1pagesize(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
04404 struct Db *arg1 = (struct Db *) 0 ;
04405 u_int32_t arg2 ;
04406 db_ret_t result;
04407
04408 (void)jenv;
04409 (void)jcls;
04410 arg1 = *(struct Db **)(void *)&jarg1;
04411 arg2 = (u_int32_t)jarg2;
04412
04413 if (jarg1 == 0) {
04414 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04415 return ;
04416 }
04417
04418 result = (db_ret_t)Db_set_pagesize(arg1,arg2);
04419
04420 if (!DB_RETOK_STD(result)) {
04421 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04422 }
04423
04424 }
04425
04426
04427 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1re_1delim(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04428 struct Db *arg1 = (struct Db *) 0 ;
04429 int arg2 ;
04430 db_ret_t result;
04431
04432 (void)jenv;
04433 (void)jcls;
04434 arg1 = *(struct Db **)(void *)&jarg1;
04435 arg2 = (int)jarg2;
04436
04437 if (jarg1 == 0) {
04438 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04439 return ;
04440 }
04441
04442 result = (db_ret_t)Db_set_re_delim(arg1,arg2);
04443
04444 if (!DB_RETOK_STD(result)) {
04445 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04446 }
04447
04448 }
04449
04450
04451 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1re_1len(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04452 struct Db *arg1 = (struct Db *) 0 ;
04453 u_int32_t arg2 ;
04454 db_ret_t result;
04455
04456 (void)jenv;
04457 (void)jcls;
04458 arg1 = *(struct Db **)(void *)&jarg1;
04459 arg2 = (u_int32_t)jarg2;
04460
04461 if (jarg1 == 0) {
04462 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04463 return ;
04464 }
04465
04466 result = (db_ret_t)Db_set_re_len(arg1,arg2);
04467
04468 if (!DB_RETOK_STD(result)) {
04469 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04470 }
04471
04472 }
04473
04474
04475 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1re_1pad(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04476 struct Db *arg1 = (struct Db *) 0 ;
04477 int arg2 ;
04478 db_ret_t result;
04479
04480 (void)jenv;
04481 (void)jcls;
04482 arg1 = *(struct Db **)(void *)&jarg1;
04483 arg2 = (int)jarg2;
04484
04485 if (jarg1 == 0) {
04486 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04487 return ;
04488 }
04489
04490 result = (db_ret_t)Db_set_re_pad(arg1,arg2);
04491
04492 if (!DB_RETOK_STD(result)) {
04493 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04494 }
04495
04496 }
04497
04498
04499 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1re_1source(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
04500 struct Db *arg1 = (struct Db *) 0 ;
04501 char *arg2 = (char *) 0 ;
04502 db_ret_t result;
04503
04504 (void)jenv;
04505 (void)jcls;
04506 arg1 = *(struct Db **)(void *)&jarg1;
04507 {
04508 arg2 = 0;
04509 if (jarg2) {
04510 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
04511 if (!arg2) return ;
04512 }
04513 }
04514
04515 if (jarg1 == 0) {
04516 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04517 return ;
04518 }
04519
04520 result = (db_ret_t)Db_set_re_source(arg1,arg2);
04521
04522 if (!DB_RETOK_STD(result)) {
04523 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04524 }
04525
04526 {
04527 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
04528 }
04529 }
04530
04531
04532 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1set_1q_1extentsize(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04533 struct Db *arg1 = (struct Db *) 0 ;
04534 u_int32_t arg2 ;
04535 db_ret_t result;
04536
04537 (void)jenv;
04538 (void)jcls;
04539 arg1 = *(struct Db **)(void *)&jarg1;
04540 arg2 = (u_int32_t)jarg2;
04541
04542 if (jarg1 == 0) {
04543 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04544 return ;
04545 }
04546
04547 result = (db_ret_t)Db_set_q_extentsize(arg1,arg2);
04548
04549 if (!DB_RETOK_STD(result)) {
04550 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04551 }
04552
04553 }
04554
04555
04556 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1stat(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
04557 jobject jresult = 0 ;
04558 struct Db *arg1 = (struct Db *) 0 ;
04559 DB_TXN *arg2 = (DB_TXN *) 0 ;
04560 u_int32_t arg3 ;
04561 void *result;
04562
04563 (void)jenv;
04564 (void)jcls;
04565 arg1 = *(struct Db **)(void *)&jarg1;
04566 arg2 = *(DB_TXN **)(void *)&jarg2;
04567 arg3 = (u_int32_t)jarg3;
04568
04569 if (jarg1 == 0) {
04570 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04571 return 0;
04572 }
04573
04574 errno = 0;
04575 result = (void *)Db_stat(arg1,arg2,arg3);
04576
04577 if (!DB_RETOK_STD(errno)) {
04578 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
04579 }
04580
04581
04582 if (result == NULL)
04583 jresult = NULL;
04584 else {
04585 DB *db = (DB *)arg1;
04586 DBTYPE dbtype;
04587 int err;
04588
04589 if ((err = db->get_type(db, &dbtype)) != 0) {
04590 __dbj_throw(jenv, err, NULL, NULL, DB2JDBENV);
04591 return 0;
04592 }
04593
04594 switch (dbtype) {
04595
04596 case DB_BTREE:
04597 case DB_RECNO:
04598 jresult = (*jenv)->NewObject(jenv, bt_stat_class,
04599 bt_stat_construct);
04600 if (jresult != NULL)
04601 __dbj_fill_bt_stat(jenv, jresult,
04602 (DB_BTREE_STAT *)result);
04603 break;
04604
04605
04606 case DB_HASH:
04607 jresult = (*jenv)->NewObject(jenv, h_stat_class,
04608 h_stat_construct);
04609 if (jresult != NULL)
04610 __dbj_fill_h_stat(jenv, jresult,
04611 (DB_HASH_STAT *)result);
04612 break;
04613
04614 case DB_QUEUE:
04615 jresult = (*jenv)->NewObject(jenv, qam_stat_class,
04616 qam_stat_construct);
04617 if (jresult != NULL)
04618 __dbj_fill_qam_stat(jenv, jresult,
04619 (DB_QUEUE_STAT *)result);
04620 break;
04621
04622
04623 default:
04624 __dbj_throw(jenv, EINVAL, "Db.stat only implemented for"
04625 " BTREE, HASH, QUEUE and RECNO", NULL, DB2JDBENV);
04626 break;
04627 }
04628
04629 __os_ufree(db->dbenv, result);
04630 }
04631
04632 return jresult;
04633 }
04634
04635
04636 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1sync(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04637 struct Db *arg1 = (struct Db *) 0 ;
04638 u_int32_t arg2 ;
04639 db_ret_t result;
04640
04641 (void)jenv;
04642 (void)jcls;
04643 arg1 = *(struct Db **)(void *)&jarg1;
04644 arg2 = (u_int32_t)jarg2;
04645
04646 if (jarg1 == 0) {
04647 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04648 return ;
04649 }
04650
04651 result = (db_ret_t)Db_sync(arg1,arg2);
04652
04653 if (!DB_RETOK_STD(result)) {
04654 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04655 }
04656
04657 }
04658
04659
04660 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1truncate(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
04661 jint jresult = 0 ;
04662 struct Db *arg1 = (struct Db *) 0 ;
04663 DB_TXN *arg2 = (DB_TXN *) 0 ;
04664 u_int32_t arg3 ;
04665 int result;
04666
04667 (void)jenv;
04668 (void)jcls;
04669 arg1 = *(struct Db **)(void *)&jarg1;
04670 arg2 = *(DB_TXN **)(void *)&jarg2;
04671 arg3 = (u_int32_t)jarg3;
04672
04673 if (jarg1 == 0) {
04674 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04675 return 0;
04676 }
04677
04678 errno = 0;
04679 result = (int)Db_truncate(arg1,arg2,arg3);
04680
04681 if (!DB_RETOK_STD(errno)) {
04682 __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
04683 }
04684
04685 jresult = (jint)result;
04686 return jresult;
04687 }
04688
04689
04690 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1upgrade(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3) {
04691 struct Db *arg1 = (struct Db *) 0 ;
04692 char *arg2 = (char *) 0 ;
04693 u_int32_t arg3 ;
04694 db_ret_t result;
04695
04696 (void)jenv;
04697 (void)jcls;
04698 arg1 = *(struct Db **)(void *)&jarg1;
04699 {
04700 arg2 = 0;
04701 if (jarg2) {
04702 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
04703 if (!arg2) return ;
04704 }
04705 }
04706 arg3 = (u_int32_t)jarg3;
04707
04708 if (jarg1 == 0) {
04709 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04710 return ;
04711 }
04712
04713 result = (db_ret_t)Db_upgrade(arg1,(char const *)arg2,arg3);
04714
04715 if (!DB_RETOK_STD(result)) {
04716 __dbj_throw(jenv, result, NULL, NULL, DB2JDBENV);
04717 }
04718
04719 {
04720 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
04721 }
04722 }
04723
04724
04725 JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Db_1verify0(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jstring jarg3, jobject jarg4, jint jarg5) {
04726 jboolean jresult = 0 ;
04727 struct Db *arg1 = (struct Db *) 0 ;
04728 char *arg2 = (char *) 0 ;
04729 char *arg3 = (char *) 0 ;
04730 struct __db_out_stream arg4 ;
04731 u_int32_t arg5 ;
04732 int_bool result;
04733 struct __dbj_verify_data data4 ;
04734
04735 (void)jenv;
04736 (void)jcls;
04737 arg1 = *(struct Db **)(void *)&jarg1;
04738 {
04739 arg2 = 0;
04740 if (jarg2) {
04741 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
04742 if (!arg2) return 0;
04743 }
04744 }
04745 {
04746 arg3 = 0;
04747 if (jarg3) {
04748 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
04749 if (!arg3) return 0;
04750 }
04751 }
04752 {
04753 data4.jenv = jenv;
04754 data4.streamobj = jarg4;
04755 data4.bytes = NULL;
04756 data4.nbytes = 0;
04757 (&arg4)->handle = &data4;
04758 (&arg4)->callback = __dbj_verify_callback;
04759 }
04760 arg5 = (u_int32_t)jarg5;
04761
04762 if (jarg1 == 0) {
04763 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04764 return 0;
04765 }
04766
04767 errno = 0;
04768 result = (int_bool)Db_verify(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
04769
04770 if (!DB_RETOK_STD(errno)) {
04771 __dbj_throw(jenv, errno, NULL, NULL, NULL);
04772 }
04773
04774 jresult = (result) ? JNI_TRUE : JNI_FALSE;
04775 {
04776 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
04777 }
04778 {
04779 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
04780 }
04781 return jresult;
04782 }
04783
04784
04785 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1close0(JNIEnv *jenv, jclass jcls, jlong jarg1) {
04786 struct Dbc *arg1 = (struct Dbc *) 0 ;
04787 db_ret_t result;
04788
04789 (void)jenv;
04790 (void)jcls;
04791 arg1 = *(struct Dbc **)(void *)&jarg1;
04792
04793 if (jarg1 == 0) {
04794 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04795 return ;
04796 }
04797
04798 result = (db_ret_t)Dbc_close(arg1);
04799
04800 if (!DB_RETOK_STD(result)) {
04801 __dbj_throw(jenv, result, NULL, NULL, NULL);
04802 }
04803
04804 }
04805
04806
04807 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1count(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04808 jint jresult = 0 ;
04809 struct Dbc *arg1 = (struct Dbc *) 0 ;
04810 u_int32_t arg2 ;
04811 db_recno_t result;
04812
04813 (void)jenv;
04814 (void)jcls;
04815 arg1 = *(struct Dbc **)(void *)&jarg1;
04816 arg2 = (u_int32_t)jarg2;
04817
04818 if (jarg1 == 0) {
04819 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04820 return 0;
04821 }
04822
04823 errno = 0;
04824 result = (db_recno_t)Dbc_count(arg1,arg2);
04825
04826 if (!DB_RETOK_STD(errno)) {
04827 __dbj_throw(jenv, errno, NULL, NULL, DBC2JDBENV);
04828 }
04829
04830 jresult = (jint)result;
04831 return jresult;
04832 }
04833
04834
04835 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1del(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04836 jint jresult = 0 ;
04837 struct Dbc *arg1 = (struct Dbc *) 0 ;
04838 u_int32_t arg2 ;
04839 int result;
04840
04841 (void)jenv;
04842 (void)jcls;
04843 arg1 = *(struct Dbc **)(void *)&jarg1;
04844 arg2 = (u_int32_t)jarg2;
04845
04846 if (jarg1 == 0) {
04847 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04848 return 0;
04849 }
04850
04851 result = (int)Dbc_del(arg1,arg2);
04852
04853 if (!DB_RETOK_DBCDEL(result)) {
04854 __dbj_throw(jenv, result, NULL, NULL, DBC2JDBENV);
04855 }
04856
04857 jresult = (jint)result;
04858 return jresult;
04859 }
04860
04861
04862 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1dup(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
04863 jlong jresult = 0 ;
04864 struct Dbc *arg1 = (struct Dbc *) 0 ;
04865 u_int32_t arg2 ;
04866 DBC *result;
04867
04868 (void)jenv;
04869 (void)jcls;
04870 arg1 = *(struct Dbc **)(void *)&jarg1;
04871 arg2 = (u_int32_t)jarg2;
04872
04873 if (jarg1 == 0) {
04874 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04875 return 0;
04876 }
04877
04878 errno = 0;
04879 result = (DBC *)Dbc_dup(arg1,arg2);
04880
04881 if (!DB_RETOK_STD(errno)) {
04882 __dbj_throw(jenv, errno, NULL, NULL, DBC2JDBENV);
04883 }
04884
04885 *(DBC **)(void *)&jresult = result;
04886 return jresult;
04887 }
04888
04889
04890 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2, jobject jarg3, jint jarg4) {
04891 jint jresult = 0 ;
04892 struct Dbc *arg1 = (struct Dbc *) 0 ;
04893 DBT *arg2 = (DBT *) 0 ;
04894 DBT *arg3 = (DBT *) 0 ;
04895 u_int32_t arg4 ;
04896 int result;
04897 DBT_LOCKED ldbt2 ;
04898 DBT_LOCKED ldbt3 ;
04899
04900 (void)jenv;
04901 (void)jcls;
04902 arg1 = *(struct Dbc **)(void *)&jarg1;
04903
04904 if (__dbj_dbt_copyin(jenv, &ldbt2, &arg2, jarg2, 0) != 0) {
04905 return 0;
04906 }
04907
04908 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
04909 return 0;
04910 }
04911 arg4 = (u_int32_t)jarg4;
04912
04913 if (jarg1 == 0) {
04914 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04915 return 0;
04916 }
04917
04918 result = (int)Dbc_get(arg1,arg2,arg3,arg4);
04919
04920 if (!DB_RETOK_DBCGET(result)) {
04921 __dbj_throw(jenv, result, NULL, NULL, DBC2JDBENV);
04922 }
04923
04924 jresult = (jint)result;
04925 __dbj_dbt_release(jenv, jarg2, arg2, &ldbt2);
04926 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
04927 return jresult;
04928 }
04929
04930
04931 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1pget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2, jobject jarg3, jobject jarg4, jint jarg5) {
04932 jint jresult = 0 ;
04933 struct Dbc *arg1 = (struct Dbc *) 0 ;
04934 DBT *arg2 = (DBT *) 0 ;
04935 DBT *arg3 = (DBT *) 0 ;
04936 DBT *arg4 = (DBT *) 0 ;
04937 u_int32_t arg5 ;
04938 int result;
04939 DBT_LOCKED ldbt2 ;
04940 DBT_LOCKED ldbt3 ;
04941 DBT_LOCKED ldbt4 ;
04942
04943 (void)jenv;
04944 (void)jcls;
04945 arg1 = *(struct Dbc **)(void *)&jarg1;
04946
04947 if (__dbj_dbt_copyin(jenv, &ldbt2, &arg2, jarg2, 0) != 0) {
04948 return 0;
04949 }
04950
04951 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
04952 return 0;
04953 }
04954
04955 if (__dbj_dbt_copyin(jenv, &ldbt4, &arg4, jarg4, 0) != 0) {
04956 return 0;
04957 }
04958 arg5 = (u_int32_t)jarg5;
04959
04960 if (jarg1 == 0) {
04961 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
04962 return 0;
04963 }
04964
04965 result = (int)Dbc_pget(arg1,arg2,arg3,arg4,arg5);
04966
04967 if (!DB_RETOK_DBCGET(result)) {
04968 __dbj_throw(jenv, result, NULL, NULL, DBC2JDBENV);
04969 }
04970
04971 jresult = (jint)result;
04972 __dbj_dbt_release(jenv, jarg2, arg2, &ldbt2);
04973 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
04974 __dbj_dbt_release(jenv, jarg4, arg4, &ldbt4);
04975 return jresult;
04976 }
04977
04978
04979 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_Dbc_1put(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2, jobject jarg3, jint jarg4) {
04980 jint jresult = 0 ;
04981 struct Dbc *arg1 = (struct Dbc *) 0 ;
04982 DBT *arg2 = (DBT *) 0 ;
04983 DBT *arg3 = (DBT *) 0 ;
04984 u_int32_t arg4 ;
04985 int result;
04986 DBT_LOCKED ldbt2 ;
04987 DBT_LOCKED ldbt3 ;
04988
04989 (void)jenv;
04990 (void)jcls;
04991 arg1 = *(struct Dbc **)(void *)&jarg1;
04992
04993 if (__dbj_dbt_copyin(jenv, &ldbt2, &arg2, jarg2, 0) != 0) {
04994 return 0;
04995 }
04996
04997 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
04998 return 0;
04999 }
05000 arg4 = (u_int32_t)jarg4;
05001
05002 if (jarg1 == 0) {
05003 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05004 return 0;
05005 }
05006
05007 result = (int)Dbc_put(arg1,arg2,arg3,arg4);
05008
05009 if (!DB_RETOK_DBCPUT(result)) {
05010 __dbj_throw(jenv, result, NULL, NULL, DBC2JDBENV);
05011 }
05012
05013 jresult = (jint)result;
05014 __dbj_dbt_release(jenv, jarg2, arg2, &ldbt2);
05015 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
05016 return jresult;
05017 }
05018
05019
05020 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_new_1DbEnv(JNIEnv *jenv, jclass jcls, jint jarg1) {
05021 jlong jresult = 0 ;
05022 u_int32_t arg1 ;
05023 struct DbEnv *result;
05024
05025 (void)jenv;
05026 (void)jcls;
05027 arg1 = (u_int32_t)jarg1;
05028
05029 errno = 0;
05030 result = (struct DbEnv *)new_DbEnv(arg1);
05031
05032 if (!DB_RETOK_STD(errno)) {
05033 __dbj_throw(jenv, errno, NULL, NULL, NULL);
05034 }
05035
05036 *(struct DbEnv **)(void *)&jresult = result;
05037 return jresult;
05038 }
05039
05040
05041 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1close0(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
05042 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05043 u_int32_t arg2 ;
05044 db_ret_t result;
05045
05046 (void)jenv;
05047 (void)jcls;
05048 arg1 = *(struct DbEnv **)(void *)&jarg1;
05049 arg2 = (u_int32_t)jarg2;
05050
05051 if (jarg1 == 0) {
05052 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05053 return ;
05054 }
05055
05056 result = (db_ret_t)DbEnv_close(arg1,arg2);
05057
05058 if (!DB_RETOK_STD(result)) {
05059 __dbj_throw(jenv, result, NULL, NULL, NULL);
05060 }
05061
05062 }
05063
05064
05065 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1dbremove(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jstring jarg4, jint jarg5) {
05066 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05067 DB_TXN *arg2 = (DB_TXN *) 0 ;
05068 char *arg3 = (char *) 0 ;
05069 char *arg4 = (char *) 0 ;
05070 u_int32_t arg5 ;
05071 db_ret_t result;
05072
05073 (void)jenv;
05074 (void)jcls;
05075 arg1 = *(struct DbEnv **)(void *)&jarg1;
05076 arg2 = *(DB_TXN **)(void *)&jarg2;
05077 {
05078 arg3 = 0;
05079 if (jarg3) {
05080 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
05081 if (!arg3) return ;
05082 }
05083 }
05084 {
05085 arg4 = 0;
05086 if (jarg4) {
05087 arg4 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg4, 0);
05088 if (!arg4) return ;
05089 }
05090 }
05091 arg5 = (u_int32_t)jarg5;
05092
05093 if (jarg1 == 0) {
05094 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05095 return ;
05096 }
05097
05098 result = (db_ret_t)DbEnv_dbremove(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5);
05099
05100 if (!DB_RETOK_STD(result)) {
05101 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05102 }
05103
05104 {
05105 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
05106 }
05107 {
05108 if (arg4) (*jenv)->ReleaseStringUTFChars(jenv, jarg4, arg4);
05109 }
05110 }
05111
05112
05113 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1dbrename(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3, jstring jarg4, jstring jarg5, jint jarg6) {
05114 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05115 DB_TXN *arg2 = (DB_TXN *) 0 ;
05116 char *arg3 = (char *) 0 ;
05117 char *arg4 = (char *) 0 ;
05118 char *arg5 = (char *) 0 ;
05119 u_int32_t arg6 ;
05120 db_ret_t result;
05121
05122 (void)jenv;
05123 (void)jcls;
05124 arg1 = *(struct DbEnv **)(void *)&jarg1;
05125 arg2 = *(DB_TXN **)(void *)&jarg2;
05126 {
05127 arg3 = 0;
05128 if (jarg3) {
05129 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
05130 if (!arg3) return ;
05131 }
05132 }
05133 {
05134 arg4 = 0;
05135 if (jarg4) {
05136 arg4 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg4, 0);
05137 if (!arg4) return ;
05138 }
05139 }
05140 {
05141 arg5 = 0;
05142 if (jarg5) {
05143 arg5 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg5, 0);
05144 if (!arg5) return ;
05145 }
05146 }
05147 arg6 = (u_int32_t)jarg6;
05148
05149 if (jarg1 == 0) {
05150 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05151 return ;
05152 }
05153
05154 result = (db_ret_t)DbEnv_dbrename(arg1,arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,arg6);
05155
05156 if (!DB_RETOK_STD(result)) {
05157 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05158 }
05159
05160 {
05161 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
05162 }
05163 {
05164 if (arg4) (*jenv)->ReleaseStringUTFChars(jenv, jarg4, arg4);
05165 }
05166 {
05167 if (arg5) (*jenv)->ReleaseStringUTFChars(jenv, jarg5, arg5);
05168 }
05169 }
05170
05171
05172 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1err(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jstring jarg3) {
05173 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05174 int arg2 ;
05175 char *arg3 = (char *) 0 ;
05176
05177 (void)jenv;
05178 (void)jcls;
05179 arg1 = *(struct DbEnv **)(void *)&jarg1;
05180 arg2 = (int)jarg2;
05181 {
05182 arg3 = 0;
05183 if (jarg3) {
05184 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
05185 if (!arg3) return ;
05186 }
05187 }
05188
05189 if (jarg1 == 0) {
05190 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05191 return ;
05192 }
05193 DbEnv_err(arg1,arg2,(char const *)arg3);
05194
05195 {
05196 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
05197 }
05198 }
05199
05200
05201 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1errx(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
05202 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05203 char *arg2 = (char *) 0 ;
05204
05205 (void)jenv;
05206 (void)jcls;
05207 arg1 = *(struct DbEnv **)(void *)&jarg1;
05208 {
05209 arg2 = 0;
05210 if (jarg2) {
05211 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
05212 if (!arg2) return ;
05213 }
05214 }
05215
05216 if (jarg1 == 0) {
05217 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05218 return ;
05219 }
05220 DbEnv_errx(arg1,(char const *)arg2);
05221
05222 {
05223 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
05224 }
05225 }
05226
05227
05228 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1fileid_1reset(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3) {
05229 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05230 char *arg2 = (char *) 0 ;
05231 u_int32_t arg3 ;
05232 db_ret_t result;
05233
05234 (void)jenv;
05235 (void)jcls;
05236 arg1 = *(struct DbEnv **)(void *)&jarg1;
05237 {
05238 arg2 = 0;
05239 if (jarg2) {
05240 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
05241 if (!arg2) return ;
05242 }
05243 }
05244 arg3 = (u_int32_t)jarg3;
05245
05246 if (jarg1 == 0) {
05247 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05248 return ;
05249 }
05250 result = (db_ret_t)DbEnv_fileid_reset(arg1,(char const *)arg2,arg3);
05251
05252 {
05253 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
05254 }
05255 }
05256
05257
05258 JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1data_1dirs(JNIEnv *jenv, jclass jcls, jlong jarg1) {
05259 jobjectArray jresult = 0 ;
05260 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05261 char **result;
05262
05263 (void)jenv;
05264 (void)jcls;
05265 arg1 = *(struct DbEnv **)(void *)&jarg1;
05266
05267 if (jarg1 == 0) {
05268 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05269 return 0;
05270 }
05271
05272 errno = 0;
05273 result = (char **)DbEnv_get_data_dirs(arg1);
05274
05275 if (!DB_RETOK_STD(errno)) {
05276 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
05277 }
05278
05279 {
05280 if(result != NULL) {
05281 int i, len;
05282
05283 len = 0;
05284 while (result[len] != NULL)
05285 len++;
05286 if ((jresult = (*jenv)->NewObjectArray(jenv, (jsize)len, string_class,
05287 NULL)) == NULL)
05288 return 0;
05289 for (i = 0; i < len; i++) {
05290 jstring str = (*jenv)->NewStringUTF(jenv, result[i]);
05291 (*jenv)->SetObjectArrayElement(jenv, jresult, (jsize)i, str);
05292 }
05293
05294 }
05295 }
05296 return jresult;
05297 }
05298
05299
05300 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1encrypt_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1) {
05301 jint jresult = 0 ;
05302 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05303 u_int32_t result;
05304
05305 (void)jenv;
05306 (void)jcls;
05307 arg1 = *(struct DbEnv **)(void *)&jarg1;
05308
05309 if (jarg1 == 0) {
05310 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05311 return 0;
05312 }
05313
05314 errno = 0;
05315 result = (u_int32_t)DbEnv_get_encrypt_flags(arg1);
05316
05317 if (!DB_RETOK_STD(errno)) {
05318 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
05319 }
05320
05321 jresult = (jint)result;
05322 return jresult;
05323 }
05324
05325
05326 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1) {
05327 jint jresult = 0 ;
05328 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05329 u_int32_t result;
05330
05331 (void)jenv;
05332 (void)jcls;
05333 arg1 = *(struct DbEnv **)(void *)&jarg1;
05334
05335 if (jarg1 == 0) {
05336 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05337 return 0;
05338 }
05339
05340 errno = 0;
05341 result = (u_int32_t)DbEnv_get_flags(arg1);
05342
05343 if (!DB_RETOK_STD(errno)) {
05344 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
05345 }
05346
05347 jresult = (jint)result;
05348 return jresult;
05349 }
05350
05351
05352 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1home(JNIEnv *jenv, jclass jcls, jlong jarg1) {
05353 jstring jresult = 0 ;
05354 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05355 char *result;
05356
05357 (void)jenv;
05358 (void)jcls;
05359 arg1 = *(struct DbEnv **)(void *)&jarg1;
05360
05361 if (jarg1 == 0) {
05362 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05363 return 0;
05364 }
05365
05366 errno = 0;
05367 result = (char *)DbEnv_get_home(arg1);
05368
05369 if (!DB_RETOK_STD(errno)) {
05370 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
05371 }
05372
05373 {
05374 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
05375 }
05376 return jresult;
05377 }
05378
05379
05380 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1open_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1) {
05381 jint jresult = 0 ;
05382 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05383 u_int32_t result;
05384
05385 (void)jenv;
05386 (void)jcls;
05387 arg1 = *(struct DbEnv **)(void *)&jarg1;
05388
05389 if (jarg1 == 0) {
05390 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05391 return 0;
05392 }
05393
05394 errno = 0;
05395 result = (u_int32_t)DbEnv_get_open_flags(arg1);
05396
05397 if (!DB_RETOK_STD(errno)) {
05398 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
05399 }
05400
05401 jresult = (jint)result;
05402 return jresult;
05403 }
05404
05405
05406 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1shm_1key(JNIEnv *jenv, jclass jcls, jlong jarg1) {
05407 jlong jresult = 0 ;
05408 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05409 long result;
05410
05411 (void)jenv;
05412 (void)jcls;
05413 arg1 = *(struct DbEnv **)(void *)&jarg1;
05414
05415 if (jarg1 == 0) {
05416 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05417 return 0;
05418 }
05419
05420 errno = 0;
05421 result = (long)DbEnv_get_shm_key(arg1);
05422
05423 if (!DB_RETOK_STD(errno)) {
05424 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
05425 }
05426
05427 jresult = (jlong)result;
05428 return jresult;
05429 }
05430
05431
05432 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1tmp_1dir(JNIEnv *jenv, jclass jcls, jlong jarg1) {
05433 jstring jresult = 0 ;
05434 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05435 char *result;
05436
05437 (void)jenv;
05438 (void)jcls;
05439 arg1 = *(struct DbEnv **)(void *)&jarg1;
05440
05441 if (jarg1 == 0) {
05442 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05443 return 0;
05444 }
05445
05446 errno = 0;
05447 result = (char *)DbEnv_get_tmp_dir(arg1);
05448
05449 if (!DB_RETOK_STD(errno)) {
05450 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
05451 }
05452
05453 {
05454 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
05455 }
05456 return jresult;
05457 }
05458
05459
05460 JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1verbose(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
05461 jboolean jresult = 0 ;
05462 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05463 u_int32_t arg2 ;
05464 int_bool result;
05465
05466 (void)jenv;
05467 (void)jcls;
05468 arg1 = *(struct DbEnv **)(void *)&jarg1;
05469 arg2 = (u_int32_t)jarg2;
05470
05471 if (jarg1 == 0) {
05472 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05473 return 0;
05474 }
05475
05476 errno = 0;
05477 result = (int_bool)DbEnv_get_verbose(arg1,arg2);
05478
05479 if (!DB_RETOK_STD(errno)) {
05480 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
05481 }
05482
05483 jresult = (result) ? JNI_TRUE : JNI_FALSE;
05484 return jresult;
05485 }
05486
05487
05488 JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1is_1bigendian(JNIEnv *jenv, jclass jcls, jlong jarg1) {
05489 jboolean jresult = 0 ;
05490 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05491 int_bool result;
05492
05493 (void)jenv;
05494 (void)jcls;
05495 arg1 = *(struct DbEnv **)(void *)&jarg1;
05496
05497 if (jarg1 == 0) {
05498 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05499 return 0;
05500 }
05501 result = (int_bool)DbEnv_is_bigendian(arg1);
05502
05503 jresult = (result) ? JNI_TRUE : JNI_FALSE;
05504 return jresult;
05505 }
05506
05507
05508 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lsn_1reset(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3) {
05509 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05510 char *arg2 = (char *) 0 ;
05511 u_int32_t arg3 ;
05512 db_ret_t result;
05513
05514 (void)jenv;
05515 (void)jcls;
05516 arg1 = *(struct DbEnv **)(void *)&jarg1;
05517 {
05518 arg2 = 0;
05519 if (jarg2) {
05520 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
05521 if (!arg2) return ;
05522 }
05523 }
05524 arg3 = (u_int32_t)jarg3;
05525
05526 if (jarg1 == 0) {
05527 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05528 return ;
05529 }
05530
05531 result = (db_ret_t)DbEnv_lsn_reset(arg1,(char const *)arg2,arg3);
05532
05533 if (!DB_RETOK_STD(result)) {
05534 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05535 }
05536
05537 {
05538 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
05539 }
05540 }
05541
05542
05543 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1open(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3, jint jarg4) {
05544 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05545 char *arg2 = (char *) 0 ;
05546 u_int32_t arg3 ;
05547 int arg4 ;
05548 db_ret_t result;
05549
05550 (void)jenv;
05551 (void)jcls;
05552 arg1 = *(struct DbEnv **)(void *)&jarg1;
05553 {
05554 arg2 = 0;
05555 if (jarg2) {
05556 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
05557 if (!arg2) return ;
05558 }
05559 }
05560 arg3 = (u_int32_t)jarg3;
05561 arg4 = (int)jarg4;
05562
05563 if (jarg1 == 0) {
05564 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05565 return ;
05566 }
05567
05568 result = (db_ret_t)DbEnv_open(arg1,(char const *)arg2,arg3,arg4);
05569
05570 if (!DB_RETOK_STD(result)) {
05571 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05572 }
05573
05574 {
05575 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
05576 }
05577 }
05578
05579
05580 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1remove0(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3) {
05581 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05582 char *arg2 = (char *) 0 ;
05583 u_int32_t arg3 ;
05584 db_ret_t result;
05585
05586 (void)jenv;
05587 (void)jcls;
05588 arg1 = *(struct DbEnv **)(void *)&jarg1;
05589 {
05590 arg2 = 0;
05591 if (jarg2) {
05592 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
05593 if (!arg2) return ;
05594 }
05595 }
05596 arg3 = (u_int32_t)jarg3;
05597
05598 if (jarg1 == 0) {
05599 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05600 return ;
05601 }
05602
05603 result = (db_ret_t)DbEnv_remove(arg1,(char const *)arg2,arg3);
05604
05605 if (!DB_RETOK_STD(result)) {
05606 __dbj_throw(jenv, result, NULL, NULL, NULL);
05607 }
05608
05609 {
05610 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
05611 }
05612 }
05613
05614
05615 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1cachesize(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
05616 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05617 jlong arg2 ;
05618 int arg3 ;
05619 db_ret_t result;
05620
05621 (void)jenv;
05622 (void)jcls;
05623 arg1 = *(struct DbEnv **)(void *)&jarg1;
05624 arg2 = jarg2;
05625 arg3 = (int)jarg3;
05626
05627 if (jarg1 == 0) {
05628 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05629 return ;
05630 }
05631
05632 result = (db_ret_t)DbEnv_set_cachesize(arg1,arg2,arg3);
05633
05634 if (!DB_RETOK_STD(result)) {
05635 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05636 }
05637
05638 }
05639
05640
05641 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1data_1dir(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
05642 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05643 char *arg2 = (char *) 0 ;
05644 db_ret_t result;
05645
05646 (void)jenv;
05647 (void)jcls;
05648 arg1 = *(struct DbEnv **)(void *)&jarg1;
05649 {
05650 arg2 = 0;
05651 if (jarg2) {
05652 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
05653 if (!arg2) return ;
05654 }
05655 }
05656
05657 if (jarg1 == 0) {
05658 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05659 return ;
05660 }
05661
05662 result = (db_ret_t)DbEnv_set_data_dir(arg1,(char const *)arg2);
05663
05664 if (!DB_RETOK_STD(result)) {
05665 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05666 }
05667
05668 {
05669 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
05670 }
05671 }
05672
05673
05674 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1intermediate_1dir(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3) {
05675 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05676 int arg2 ;
05677 u_int32_t arg3 ;
05678 db_ret_t result;
05679
05680 (void)jenv;
05681 (void)jcls;
05682 arg1 = *(struct DbEnv **)(void *)&jarg1;
05683 arg2 = (int)jarg2;
05684 arg3 = (u_int32_t)jarg3;
05685
05686 if (jarg1 == 0) {
05687 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05688 return ;
05689 }
05690
05691 result = (db_ret_t)DbEnv_set_intermediate_dir(arg1,arg2,arg3);
05692
05693 if (!DB_RETOK_STD(result)) {
05694 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05695 }
05696
05697 }
05698
05699
05700 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1encrypt(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jint jarg3) {
05701 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05702 char *arg2 = (char *) 0 ;
05703 u_int32_t arg3 ;
05704 db_ret_t result;
05705
05706 (void)jenv;
05707 (void)jcls;
05708 arg1 = *(struct DbEnv **)(void *)&jarg1;
05709 {
05710 arg2 = 0;
05711 if (jarg2) {
05712 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
05713 if (!arg2) return ;
05714 }
05715 }
05716 arg3 = (u_int32_t)jarg3;
05717
05718 if (jarg1 == 0) {
05719 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05720 return ;
05721 }
05722
05723 result = (db_ret_t)DbEnv_set_encrypt(arg1,(char const *)arg2,arg3);
05724
05725 if (!DB_RETOK_STD(result)) {
05726 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05727 }
05728
05729 {
05730 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
05731 }
05732 }
05733
05734
05735 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1errcall(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
05736 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05737 void (*arg2)(DB_ENV const *,char const *,char const *) = (void (*)(DB_ENV const *,char const *,char const *)) 0 ;
05738
05739 (void)jenv;
05740 (void)jcls;
05741 arg1 = *(struct DbEnv **)(void *)&jarg1;
05742
05743 arg2 = (jarg2 == NULL) ? NULL : __dbj_error;
05744
05745
05746 if (jarg1 == 0) {
05747 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05748 return ;
05749 }
05750 DbEnv_set_errcall(arg1,arg2);
05751
05752 }
05753
05754
05755 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jboolean jarg3) {
05756 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05757 u_int32_t arg2 ;
05758 int_bool arg3 ;
05759 db_ret_t result;
05760
05761 (void)jenv;
05762 (void)jcls;
05763 arg1 = *(struct DbEnv **)(void *)&jarg1;
05764 arg2 = (u_int32_t)jarg2;
05765 arg3 = (jarg3 == JNI_TRUE);
05766
05767 if (jarg1 == 0) {
05768 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05769 return ;
05770 }
05771
05772 result = (db_ret_t)DbEnv_set_flags(arg1,arg2,arg3);
05773
05774 if (!DB_RETOK_STD(result)) {
05775 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05776 }
05777
05778 }
05779
05780
05781 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1feedback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
05782 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05783 void (*arg2)(DB_ENV *,int,int) = (void (*)(DB_ENV *,int,int)) 0 ;
05784 db_ret_t result;
05785
05786 (void)jenv;
05787 (void)jcls;
05788 arg1 = *(struct DbEnv **)(void *)&jarg1;
05789
05790 arg2 = (jarg2 == NULL) ? NULL : __dbj_env_feedback;
05791
05792
05793 if (jarg1 == 0) {
05794 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05795 return ;
05796 }
05797
05798 result = (db_ret_t)DbEnv_set_feedback(arg1,arg2);
05799
05800 if (!DB_RETOK_STD(result)) {
05801 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05802 }
05803
05804 }
05805
05806
05807 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1mp_1max_1openfd(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
05808 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05809 int arg2 ;
05810 db_ret_t result;
05811
05812 (void)jenv;
05813 (void)jcls;
05814 arg1 = *(struct DbEnv **)(void *)&jarg1;
05815 arg2 = (int)jarg2;
05816
05817 if (jarg1 == 0) {
05818 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05819 return ;
05820 }
05821
05822 result = (db_ret_t)DbEnv_set_mp_max_openfd(arg1,arg2);
05823
05824 if (!DB_RETOK_STD(result)) {
05825 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05826 }
05827
05828 }
05829
05830
05831 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1mp_1max_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3) {
05832 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05833 int arg2 ;
05834 int arg3 ;
05835 db_ret_t result;
05836
05837 (void)jenv;
05838 (void)jcls;
05839 arg1 = *(struct DbEnv **)(void *)&jarg1;
05840 arg2 = (int)jarg2;
05841 arg3 = (int)jarg3;
05842
05843 if (jarg1 == 0) {
05844 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05845 return ;
05846 }
05847
05848 result = (db_ret_t)DbEnv_set_mp_max_write(arg1,arg2,arg3);
05849
05850 if (!DB_RETOK_STD(result)) {
05851 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05852 }
05853
05854 }
05855
05856
05857 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1mp_1mmapsize(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
05858 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05859 size_t arg2 ;
05860 db_ret_t result;
05861
05862 (void)jenv;
05863 (void)jcls;
05864 arg1 = *(struct DbEnv **)(void *)&jarg1;
05865 arg2 = (size_t)jarg2;
05866
05867 if (jarg1 == 0) {
05868 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05869 return ;
05870 }
05871
05872 result = (db_ret_t)DbEnv_set_mp_mmapsize(arg1,arg2);
05873
05874 if (!DB_RETOK_STD(result)) {
05875 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05876 }
05877
05878 }
05879
05880
05881 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1msgcall(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
05882 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05883 void (*arg2)(DB_ENV const *,char const *) = (void (*)(DB_ENV const *,char const *)) 0 ;
05884
05885 (void)jenv;
05886 (void)jcls;
05887 arg1 = *(struct DbEnv **)(void *)&jarg1;
05888
05889 arg2 = (jarg2 == NULL) ? NULL : __dbj_message;
05890
05891
05892 if (jarg1 == 0) {
05893 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05894 return ;
05895 }
05896 DbEnv_set_msgcall(arg1,arg2);
05897
05898 }
05899
05900
05901 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1paniccall(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
05902 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05903 void (*arg2)(DB_ENV *,int) = (void (*)(DB_ENV *,int)) 0 ;
05904 db_ret_t result;
05905
05906 (void)jenv;
05907 (void)jcls;
05908 arg1 = *(struct DbEnv **)(void *)&jarg1;
05909
05910 arg2 = (jarg2 == NULL) ? NULL : __dbj_panic;
05911
05912
05913 if (jarg1 == 0) {
05914 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05915 return ;
05916 }
05917
05918 result = (db_ret_t)DbEnv_set_paniccall(arg1,arg2);
05919
05920 if (!DB_RETOK_STD(result)) {
05921 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05922 }
05923
05924 }
05925
05926
05927 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1rpc_1server(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2, jstring jarg3, jlong jarg4, jlong jarg5, jint jarg6) {
05928 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05929 void *arg2 = (void *) 0 ;
05930 char *arg3 = (char *) 0 ;
05931 long arg4 ;
05932 long arg5 ;
05933 u_int32_t arg6 ;
05934 db_ret_t result;
05935
05936 (void)jenv;
05937 (void)jcls;
05938 arg1 = *(struct DbEnv **)(void *)&jarg1;
05939 arg2 = *(void **)(void *)&jarg2;
05940 {
05941 arg3 = 0;
05942 if (jarg3) {
05943 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
05944 if (!arg3) return ;
05945 }
05946 }
05947 arg4 = (long)jarg4;
05948 arg5 = (long)jarg5;
05949 arg6 = (u_int32_t)jarg6;
05950
05951 if (jarg1 == 0) {
05952 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05953 return ;
05954 }
05955
05956 if (arg2 != NULL) {
05957 __dbj_throw(jenv, EINVAL, "DbEnv.set_rpc_server client arg "
05958 "must be null; reserved for future use", NULL, JDBENV);
05959 return ;
05960 }
05961
05962
05963 result = (db_ret_t)DbEnv_set_rpc_server(arg1,arg2,arg3,arg4,arg5,arg6);
05964
05965 if (!DB_RETOK_STD(result)) {
05966 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05967 }
05968
05969 {
05970 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
05971 }
05972 }
05973
05974
05975 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1shm_1key(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
05976 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
05977 long arg2 ;
05978 db_ret_t result;
05979
05980 (void)jenv;
05981 (void)jcls;
05982 arg1 = *(struct DbEnv **)(void *)&jarg1;
05983 arg2 = (long)jarg2;
05984
05985 if (jarg1 == 0) {
05986 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
05987 return ;
05988 }
05989
05990 result = (db_ret_t)DbEnv_set_shm_key(arg1,arg2);
05991
05992 if (!DB_RETOK_STD(result)) {
05993 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
05994 }
05995
05996 }
05997
05998
05999 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1timeout(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
06000 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06001 db_timeout_t arg2 ;
06002 u_int32_t arg3 ;
06003 db_ret_t result;
06004
06005 (void)jenv;
06006 (void)jcls;
06007 arg1 = *(struct DbEnv **)(void *)&jarg1;
06008 arg2 = (db_timeout_t)jarg2;
06009 arg3 = (u_int32_t)jarg3;
06010
06011 if (jarg1 == 0) {
06012 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06013 return ;
06014 }
06015
06016 result = (db_ret_t)DbEnv_set_timeout(arg1,arg2,arg3);
06017
06018 if (!DB_RETOK_STD(result)) {
06019 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06020 }
06021
06022 }
06023
06024
06025 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1tmp_1dir(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
06026 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06027 char *arg2 = (char *) 0 ;
06028 db_ret_t result;
06029
06030 (void)jenv;
06031 (void)jcls;
06032 arg1 = *(struct DbEnv **)(void *)&jarg1;
06033 {
06034 arg2 = 0;
06035 if (jarg2) {
06036 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
06037 if (!arg2) return ;
06038 }
06039 }
06040
06041 if (jarg1 == 0) {
06042 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06043 return ;
06044 }
06045
06046 result = (db_ret_t)DbEnv_set_tmp_dir(arg1,(char const *)arg2);
06047
06048 if (!DB_RETOK_STD(result)) {
06049 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06050 }
06051
06052 {
06053 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
06054 }
06055 }
06056
06057
06058 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1tx_1max(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06059 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06060 u_int32_t arg2 ;
06061 db_ret_t result;
06062
06063 (void)jenv;
06064 (void)jcls;
06065 arg1 = *(struct DbEnv **)(void *)&jarg1;
06066 arg2 = (u_int32_t)jarg2;
06067
06068 if (jarg1 == 0) {
06069 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06070 return ;
06071 }
06072
06073 result = (db_ret_t)DbEnv_set_tx_max(arg1,arg2);
06074
06075 if (!DB_RETOK_STD(result)) {
06076 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06077 }
06078
06079 }
06080
06081
06082 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1app_1dispatch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
06083 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06084 int (*arg2)(DB_ENV *,DBT *,DB_LSN *,db_recops) = (int (*)(DB_ENV *,DBT *,DB_LSN *,db_recops)) 0 ;
06085 db_ret_t result;
06086
06087 (void)jenv;
06088 (void)jcls;
06089 arg1 = *(struct DbEnv **)(void *)&jarg1;
06090
06091 arg2 = (jarg2 == NULL) ? NULL : __dbj_app_dispatch;
06092
06093
06094 if (jarg1 == 0) {
06095 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06096 return ;
06097 }
06098
06099 result = (db_ret_t)DbEnv_set_app_dispatch(arg1,arg2);
06100
06101 if (!DB_RETOK_STD(result)) {
06102 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06103 }
06104
06105 }
06106
06107
06108 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1tx_1timestamp0(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
06109 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06110 time_t *arg2 = (time_t *) 0 ;
06111 db_ret_t result;
06112 time_t time2 ;
06113
06114 (void)jenv;
06115 (void)jcls;
06116 arg1 = *(struct DbEnv **)(void *)&jarg1;
06117
06118 time2 = (time_t)jarg2;
06119 arg2 = &time2;
06120
06121
06122 if (jarg1 == 0) {
06123 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06124 return ;
06125 }
06126
06127 result = (db_ret_t)DbEnv_set_tx_timestamp(arg1,arg2);
06128
06129 if (!DB_RETOK_STD(result)) {
06130 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06131 }
06132
06133 }
06134
06135
06136 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1verbose(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jboolean jarg3) {
06137 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06138 u_int32_t arg2 ;
06139 int_bool arg3 ;
06140 db_ret_t result;
06141
06142 (void)jenv;
06143 (void)jcls;
06144 arg1 = *(struct DbEnv **)(void *)&jarg1;
06145 arg2 = (u_int32_t)jarg2;
06146 arg3 = (jarg3 == JNI_TRUE);
06147
06148 if (jarg1 == 0) {
06149 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06150 return ;
06151 }
06152
06153 result = (db_ret_t)DbEnv_set_verbose(arg1,arg2,arg3);
06154
06155 if (!DB_RETOK_STD(result)) {
06156 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06157 }
06158
06159 }
06160
06161
06162 JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1conflicts(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06163 jobjectArray jresult = 0 ;
06164 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06165 struct __db_lk_conflicts result;
06166
06167 (void)jenv;
06168 (void)jcls;
06169 arg1 = *(struct DbEnv **)(void *)&jarg1;
06170
06171 if (jarg1 == 0) {
06172 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06173 return 0;
06174 }
06175
06176 errno = 0;
06177 result = DbEnv_get_lk_conflicts(arg1);
06178
06179 if (!DB_RETOK_STD(errno)) {
06180 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06181 }
06182
06183 {
06184 int i;
06185 jbyteArray bytes;
06186
06187 jresult = (*jenv)->NewObjectArray(jenv,
06188 (jsize)(&result)->lk_modes, bytearray_class, NULL);
06189 if (jresult == NULL)
06190 return 0;
06191 for (i = 0; i < (&result)->lk_modes; i++) {
06192 bytes = (*jenv)->NewByteArray(jenv, (jsize)(&result)->lk_modes);
06193 if (bytes == NULL)
06194 return 0;
06195 (*jenv)->SetByteArrayRegion(jenv, bytes, 0, (jsize)(&result)->lk_modes,
06196 (jbyte *)((&result)->lk_conflicts + i * (&result)->lk_modes));
06197 (*jenv)->SetObjectArrayElement(jenv, jresult, (jsize)i, bytes);
06198 }
06199 }
06200 return jresult;
06201 }
06202
06203
06204 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1detect(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06205 jint jresult = 0 ;
06206 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06207 u_int32_t result;
06208
06209 (void)jenv;
06210 (void)jcls;
06211 arg1 = *(struct DbEnv **)(void *)&jarg1;
06212
06213 if (jarg1 == 0) {
06214 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06215 return 0;
06216 }
06217
06218 errno = 0;
06219 result = (u_int32_t)DbEnv_get_lk_detect(arg1);
06220
06221 if (!DB_RETOK_STD(errno)) {
06222 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06223 }
06224
06225 jresult = (jint)result;
06226 return jresult;
06227 }
06228
06229
06230 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1max_1locks(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06231 jint jresult = 0 ;
06232 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06233 u_int32_t result;
06234
06235 (void)jenv;
06236 (void)jcls;
06237 arg1 = *(struct DbEnv **)(void *)&jarg1;
06238
06239 if (jarg1 == 0) {
06240 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06241 return 0;
06242 }
06243
06244 errno = 0;
06245 result = (u_int32_t)DbEnv_get_lk_max_locks(arg1);
06246
06247 if (!DB_RETOK_STD(errno)) {
06248 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06249 }
06250
06251 jresult = (jint)result;
06252 return jresult;
06253 }
06254
06255
06256 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1max_1lockers(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06257 jint jresult = 0 ;
06258 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06259 u_int32_t result;
06260
06261 (void)jenv;
06262 (void)jcls;
06263 arg1 = *(struct DbEnv **)(void *)&jarg1;
06264
06265 if (jarg1 == 0) {
06266 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06267 return 0;
06268 }
06269
06270 errno = 0;
06271 result = (u_int32_t)DbEnv_get_lk_max_lockers(arg1);
06272
06273 if (!DB_RETOK_STD(errno)) {
06274 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06275 }
06276
06277 jresult = (jint)result;
06278 return jresult;
06279 }
06280
06281
06282 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lk_1max_1objects(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06283 jint jresult = 0 ;
06284 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06285 u_int32_t result;
06286
06287 (void)jenv;
06288 (void)jcls;
06289 arg1 = *(struct DbEnv **)(void *)&jarg1;
06290
06291 if (jarg1 == 0) {
06292 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06293 return 0;
06294 }
06295
06296 errno = 0;
06297 result = (u_int32_t)DbEnv_get_lk_max_objects(arg1);
06298
06299 if (!DB_RETOK_STD(errno)) {
06300 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06301 }
06302
06303 jresult = (jint)result;
06304 return jresult;
06305 }
06306
06307
06308 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1detect(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3) {
06309 jint jresult = 0 ;
06310 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06311 u_int32_t arg2 ;
06312 u_int32_t arg3 ;
06313 int result;
06314
06315 (void)jenv;
06316 (void)jcls;
06317 arg1 = *(struct DbEnv **)(void *)&jarg1;
06318 arg2 = (u_int32_t)jarg2;
06319 arg3 = (u_int32_t)jarg3;
06320
06321 if (jarg1 == 0) {
06322 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06323 return 0;
06324 }
06325
06326 errno = 0;
06327 result = (int)DbEnv_lock_detect(arg1,arg2,arg3);
06328
06329 if (!DB_RETOK_STD(errno)) {
06330 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06331 }
06332
06333 jresult = (jint)result;
06334 return jresult;
06335 }
06336
06337
06338 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3, jobject jarg4, jint jarg5) {
06339 jlong jresult = 0 ;
06340 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06341 u_int32_t arg2 ;
06342 u_int32_t arg3 ;
06343 DBT *arg4 = (DBT *) 0 ;
06344 db_lockmode_t arg5 ;
06345 DB_LOCK *result;
06346 DBT_LOCKED ldbt4 ;
06347
06348 (void)jenv;
06349 (void)jcls;
06350 arg1 = *(struct DbEnv **)(void *)&jarg1;
06351 arg2 = (u_int32_t)jarg2;
06352 arg3 = (u_int32_t)jarg3;
06353
06354 if (__dbj_dbt_copyin(jenv, &ldbt4, &arg4, jarg4, 0) != 0) {
06355 return 0;
06356 }
06357 arg5 = (db_lockmode_t)jarg5;
06358
06359 if (jarg1 == 0) {
06360 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06361 return 0;
06362 }
06363
06364 errno = 0;
06365 result = (DB_LOCK *)DbEnv_lock_get(arg1,arg2,arg3,(struct Dbt const *)arg4,arg5);
06366
06367 if (!DB_RETOK_STD(errno)) {
06368 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06369 }
06370
06371 *(DB_LOCK **)(void *)&jresult = result;
06372 __dbj_dbt_release(jenv, jarg4, arg4, &ldbt4);
06373 return jresult;
06374 }
06375
06376
06377 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1id(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06378 jint jresult = 0 ;
06379 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06380 u_int32_t result;
06381
06382 (void)jenv;
06383 (void)jcls;
06384 arg1 = *(struct DbEnv **)(void *)&jarg1;
06385
06386 if (jarg1 == 0) {
06387 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06388 return 0;
06389 }
06390
06391 errno = 0;
06392 result = (u_int32_t)DbEnv_lock_id(arg1);
06393
06394 if (!DB_RETOK_STD(errno)) {
06395 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06396 }
06397
06398 jresult = (jint)result;
06399 return jresult;
06400 }
06401
06402
06403 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1id_1free(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06404 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06405 u_int32_t arg2 ;
06406 db_ret_t result;
06407
06408 (void)jenv;
06409 (void)jcls;
06410 arg1 = *(struct DbEnv **)(void *)&jarg1;
06411 arg2 = (u_int32_t)jarg2;
06412
06413 if (jarg1 == 0) {
06414 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06415 return ;
06416 }
06417
06418 result = (db_ret_t)DbEnv_lock_id_free(arg1,arg2);
06419
06420 if (!DB_RETOK_STD(result)) {
06421 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06422 }
06423
06424 }
06425
06426
06427 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1put(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
06428 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06429 DB_LOCK *arg2 = (DB_LOCK *) 0 ;
06430 db_ret_t result;
06431
06432 (void)jenv;
06433 (void)jcls;
06434 arg1 = *(struct DbEnv **)(void *)&jarg1;
06435 arg2 = *(DB_LOCK **)(void *)&jarg2;
06436
06437 if (jarg1 == 0) {
06438 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06439 return ;
06440 }
06441
06442 result = (db_ret_t)DbEnv_lock_put(arg1,arg2);
06443
06444 if (!DB_RETOK_STD(result)) {
06445 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06446 }
06447
06448 }
06449
06450
06451 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1stat(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06452 jobject jresult = 0 ;
06453 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06454 u_int32_t arg2 ;
06455 DB_LOCK_STAT *result;
06456
06457 (void)jenv;
06458 (void)jcls;
06459 arg1 = *(struct DbEnv **)(void *)&jarg1;
06460 arg2 = (u_int32_t)jarg2;
06461
06462 if (jarg1 == 0) {
06463 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06464 return 0;
06465 }
06466
06467 errno = 0;
06468 result = (DB_LOCK_STAT *)DbEnv_lock_stat(arg1,arg2);
06469
06470 if (!DB_RETOK_STD(errno)) {
06471 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06472 }
06473
06474
06475 jresult = (*jenv)->NewObject(jenv, lock_stat_class, lock_stat_construct);
06476 if (jresult != NULL)
06477 __dbj_fill_lock_stat(jenv, jresult, result);
06478 __os_ufree(NULL, result);
06479
06480 return jresult;
06481 }
06482
06483
06484 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1conflicts(JNIEnv *jenv, jclass jcls, jlong jarg1, jobjectArray jarg2) {
06485 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06486 struct __db_lk_conflicts arg2 ;
06487 db_ret_t result;
06488
06489 (void)jenv;
06490 (void)jcls;
06491 arg1 = *(struct DbEnv **)(void *)&jarg1;
06492 {
06493 int i, len, err;
06494 size_t bytesize;
06495
06496 len = (&arg2)->lk_modes = (*jenv)->GetArrayLength(jenv, jarg2);
06497 bytesize = sizeof(u_char) * len * len;
06498
06499 if ((err = __os_malloc(NULL, bytesize, &(&arg2)->lk_conflicts)) != 0) {
06500 __dbj_throw(jenv, err, NULL, NULL, JDBENV);
06501 return ;
06502 }
06503
06504 for (i = 0; i < len; i++) {
06505 jobject sub_array = (*jenv)->GetObjectArrayElement(jenv,
06506 jarg2, i);
06507 (*jenv)->GetByteArrayRegion(jenv,(jbyteArray)sub_array, 0, len,
06508 (jbyte *)&(&arg2)->lk_conflicts[i * len]);
06509 }
06510 }
06511
06512 if (jarg1 == 0) {
06513 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06514 return ;
06515 }
06516
06517 result = (db_ret_t)DbEnv_set_lk_conflicts(arg1,arg2);
06518
06519 if (!DB_RETOK_STD(result)) {
06520 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06521 }
06522
06523
06524 __os_free(NULL, (&arg2)->lk_conflicts);
06525
06526 }
06527
06528
06529 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1detect(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06530 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06531 u_int32_t arg2 ;
06532 db_ret_t result;
06533
06534 (void)jenv;
06535 (void)jcls;
06536 arg1 = *(struct DbEnv **)(void *)&jarg1;
06537 arg2 = (u_int32_t)jarg2;
06538
06539 if (jarg1 == 0) {
06540 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06541 return ;
06542 }
06543
06544 result = (db_ret_t)DbEnv_set_lk_detect(arg1,arg2);
06545
06546 if (!DB_RETOK_STD(result)) {
06547 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06548 }
06549
06550 }
06551
06552
06553 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1max_1lockers(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06554 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06555 u_int32_t arg2 ;
06556 db_ret_t result;
06557
06558 (void)jenv;
06559 (void)jcls;
06560 arg1 = *(struct DbEnv **)(void *)&jarg1;
06561 arg2 = (u_int32_t)jarg2;
06562
06563 if (jarg1 == 0) {
06564 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06565 return ;
06566 }
06567
06568 result = (db_ret_t)DbEnv_set_lk_max_lockers(arg1,arg2);
06569
06570 if (!DB_RETOK_STD(result)) {
06571 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06572 }
06573
06574 }
06575
06576
06577 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1max_1locks(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06578 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06579 u_int32_t arg2 ;
06580 db_ret_t result;
06581
06582 (void)jenv;
06583 (void)jcls;
06584 arg1 = *(struct DbEnv **)(void *)&jarg1;
06585 arg2 = (u_int32_t)jarg2;
06586
06587 if (jarg1 == 0) {
06588 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06589 return ;
06590 }
06591
06592 result = (db_ret_t)DbEnv_set_lk_max_locks(arg1,arg2);
06593
06594 if (!DB_RETOK_STD(result)) {
06595 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06596 }
06597
06598 }
06599
06600
06601 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lk_1max_1objects(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06602 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06603 u_int32_t arg2 ;
06604 db_ret_t result;
06605
06606 (void)jenv;
06607 (void)jcls;
06608 arg1 = *(struct DbEnv **)(void *)&jarg1;
06609 arg2 = (u_int32_t)jarg2;
06610
06611 if (jarg1 == 0) {
06612 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06613 return ;
06614 }
06615
06616 result = (db_ret_t)DbEnv_set_lk_max_objects(arg1,arg2);
06617
06618 if (!DB_RETOK_STD(result)) {
06619 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06620 }
06621
06622 }
06623
06624
06625 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1bsize(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06626 jint jresult = 0 ;
06627 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06628 u_int32_t result;
06629
06630 (void)jenv;
06631 (void)jcls;
06632 arg1 = *(struct DbEnv **)(void *)&jarg1;
06633
06634 if (jarg1 == 0) {
06635 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06636 return 0;
06637 }
06638
06639 errno = 0;
06640 result = (u_int32_t)DbEnv_get_lg_bsize(arg1);
06641
06642 if (!DB_RETOK_STD(errno)) {
06643 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06644 }
06645
06646 jresult = (jint)result;
06647 return jresult;
06648 }
06649
06650
06651 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1dir(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06652 jstring jresult = 0 ;
06653 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06654 char *result;
06655
06656 (void)jenv;
06657 (void)jcls;
06658 arg1 = *(struct DbEnv **)(void *)&jarg1;
06659
06660 if (jarg1 == 0) {
06661 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06662 return 0;
06663 }
06664
06665 errno = 0;
06666 result = (char *)DbEnv_get_lg_dir(arg1);
06667
06668 if (!DB_RETOK_STD(errno)) {
06669 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06670 }
06671
06672 {
06673 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
06674 }
06675 return jresult;
06676 }
06677
06678
06679 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1filemode(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06680 jint jresult = 0 ;
06681 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06682 int result;
06683
06684 (void)jenv;
06685 (void)jcls;
06686 arg1 = *(struct DbEnv **)(void *)&jarg1;
06687
06688 if (jarg1 == 0) {
06689 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06690 return 0;
06691 }
06692
06693 errno = 0;
06694 result = (int)DbEnv_get_lg_filemode(arg1);
06695
06696 if (!DB_RETOK_STD(errno)) {
06697 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06698 }
06699
06700 jresult = (jint)result;
06701 return jresult;
06702 }
06703
06704
06705 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1max(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06706 jint jresult = 0 ;
06707 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06708 u_int32_t result;
06709
06710 (void)jenv;
06711 (void)jcls;
06712 arg1 = *(struct DbEnv **)(void *)&jarg1;
06713
06714 if (jarg1 == 0) {
06715 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06716 return 0;
06717 }
06718
06719 errno = 0;
06720 result = (u_int32_t)DbEnv_get_lg_max(arg1);
06721
06722 if (!DB_RETOK_STD(errno)) {
06723 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06724 }
06725
06726 jresult = (jint)result;
06727 return jresult;
06728 }
06729
06730
06731 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1lg_1regionmax(JNIEnv *jenv, jclass jcls, jlong jarg1) {
06732 jint jresult = 0 ;
06733 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06734 u_int32_t result;
06735
06736 (void)jenv;
06737 (void)jcls;
06738 arg1 = *(struct DbEnv **)(void *)&jarg1;
06739
06740 if (jarg1 == 0) {
06741 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06742 return 0;
06743 }
06744
06745 errno = 0;
06746 result = (u_int32_t)DbEnv_get_lg_regionmax(arg1);
06747
06748 if (!DB_RETOK_STD(errno)) {
06749 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06750 }
06751
06752 jresult = (jint)result;
06753 return jresult;
06754 }
06755
06756
06757 JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1archive(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06758 jobjectArray jresult = 0 ;
06759 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06760 u_int32_t arg2 ;
06761 char **result;
06762
06763 (void)jenv;
06764 (void)jcls;
06765 arg1 = *(struct DbEnv **)(void *)&jarg1;
06766 arg2 = (u_int32_t)jarg2;
06767
06768 if (jarg1 == 0) {
06769 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06770 return 0;
06771 }
06772
06773 errno = 0;
06774 result = (char **)DbEnv_log_archive(arg1,arg2);
06775
06776 if (!DB_RETOK_STD(errno)) {
06777 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06778 }
06779
06780 {
06781 if(result != NULL) {
06782 int i, len;
06783
06784 len = 0;
06785 while (result[len] != NULL)
06786 len++;
06787 if ((jresult = (*jenv)->NewObjectArray(jenv, (jsize)len, string_class,
06788 NULL)) == NULL)
06789 return 0;
06790 for (i = 0; i < len; i++) {
06791 jstring str = (*jenv)->NewStringUTF(jenv, result[i]);
06792 (*jenv)->SetObjectArrayElement(jenv, jresult, (jsize)i, str);
06793 }
06794
06795 __os_ufree(NULL, result);
06796 }
06797 }
06798 return jresult;
06799 }
06800
06801
06802 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1compare(JNIEnv *jenv, jclass jcls, jobject jarg1, jobject jarg2) {
06803 jint jresult = 0 ;
06804 DB_LSN *arg1 = (DB_LSN *) 0 ;
06805 DB_LSN *arg2 = (DB_LSN *) 0 ;
06806 int result;
06807 DB_LSN lsn1 ;
06808 DB_LSN lsn2 ;
06809
06810 (void)jenv;
06811 (void)jcls;
06812
06813 if (jarg1 == NULL) {
06814 arg1 = NULL;
06815 } else {
06816 arg1 = &lsn1;
06817 arg1->file = (*jenv)->GetIntField(jenv, jarg1, dblsn_file_fid);
06818 arg1->offset = (*jenv)->GetIntField(jenv, jarg1,
06819 dblsn_offset_fid);
06820 }
06821
06822
06823 if (jarg2 == NULL) {
06824 arg2 = NULL;
06825 } else {
06826 arg2 = &lsn2;
06827 arg2->file = (*jenv)->GetIntField(jenv, jarg2, dblsn_file_fid);
06828 arg2->offset = (*jenv)->GetIntField(jenv, jarg2,
06829 dblsn_offset_fid);
06830 }
06831
06832
06833 if (arg1 == NULL) {
06834 __dbj_throw(jenv, EINVAL, "null LogSequenceNumber", NULL, NULL);
06835 return 0;
06836 }
06837
06838
06839 if (arg2 == NULL) {
06840 __dbj_throw(jenv, EINVAL, "null LogSequenceNumber", NULL, NULL);
06841 return 0;
06842 }
06843
06844 result = (int)DbEnv_log_compare((struct DbLsn const *)arg1,(struct DbLsn const *)arg2);
06845
06846 jresult = (jint)result;
06847
06848 if (jarg1 != NULL) {
06849 (*jenv)->SetIntField(jenv, jarg1, dblsn_file_fid, arg1->file);
06850 (*jenv)->SetIntField(jenv, jarg1,
06851 dblsn_offset_fid, arg1->offset);
06852 }
06853
06854
06855 if (jarg2 != NULL) {
06856 (*jenv)->SetIntField(jenv, jarg2, dblsn_file_fid, arg2->file);
06857 (*jenv)->SetIntField(jenv, jarg2,
06858 dblsn_offset_fid, arg2->offset);
06859 }
06860
06861 return jresult;
06862 }
06863
06864
06865 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1cursor(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
06866 jlong jresult = 0 ;
06867 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06868 u_int32_t arg2 ;
06869 DB_LOGC *result;
06870
06871 (void)jenv;
06872 (void)jcls;
06873 arg1 = *(struct DbEnv **)(void *)&jarg1;
06874 arg2 = (u_int32_t)jarg2;
06875
06876 if (jarg1 == 0) {
06877 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06878 return 0;
06879 }
06880
06881 errno = 0;
06882 result = (DB_LOGC *)DbEnv_log_cursor(arg1,arg2);
06883
06884 if (!DB_RETOK_STD(errno)) {
06885 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06886 }
06887
06888 *(DB_LOGC **)(void *)&jresult = result;
06889 return jresult;
06890 }
06891
06892
06893 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1file(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
06894 jstring jresult = 0 ;
06895 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06896 DB_LSN *arg2 = (DB_LSN *) 0 ;
06897 char *result;
06898 DB_LSN lsn2 ;
06899
06900 (void)jenv;
06901 (void)jcls;
06902 arg1 = *(struct DbEnv **)(void *)&jarg1;
06903
06904 if (jarg2 == NULL) {
06905 arg2 = NULL;
06906 } else {
06907 arg2 = &lsn2;
06908 arg2->file = (*jenv)->GetIntField(jenv, jarg2, dblsn_file_fid);
06909 arg2->offset = (*jenv)->GetIntField(jenv, jarg2,
06910 dblsn_offset_fid);
06911 }
06912
06913
06914 if (jarg1 == 0) {
06915 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06916 return 0;
06917 }
06918
06919 if (arg2 == NULL) {
06920 __dbj_throw(jenv, EINVAL, "null LogSequenceNumber", NULL, NULL);
06921 return 0;
06922 }
06923
06924
06925 errno = 0;
06926 result = (char *)DbEnv_log_file(arg1,arg2);
06927
06928 if (!DB_RETOK_STD(errno)) {
06929 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
06930 }
06931
06932 {
06933 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
06934 }
06935
06936 if (jarg2 != NULL) {
06937 (*jenv)->SetIntField(jenv, jarg2, dblsn_file_fid, arg2->file);
06938 (*jenv)->SetIntField(jenv, jarg2,
06939 dblsn_offset_fid, arg2->offset);
06940 }
06941
06942 return jresult;
06943 }
06944
06945
06946 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1flush(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
06947 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06948 DB_LSN *arg2 = (DB_LSN *) 0 ;
06949 db_ret_t result;
06950 DB_LSN lsn2 ;
06951
06952 (void)jenv;
06953 (void)jcls;
06954 arg1 = *(struct DbEnv **)(void *)&jarg1;
06955
06956 if (jarg2 == NULL) {
06957 arg2 = NULL;
06958 } else {
06959 arg2 = &lsn2;
06960 arg2->file = (*jenv)->GetIntField(jenv, jarg2, dblsn_file_fid);
06961 arg2->offset = (*jenv)->GetIntField(jenv, jarg2,
06962 dblsn_offset_fid);
06963 }
06964
06965
06966 if (jarg1 == 0) {
06967 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
06968 return ;
06969 }
06970
06971
06972 result = (db_ret_t)DbEnv_log_flush(arg1,(struct DbLsn const *)arg2);
06973
06974 if (!DB_RETOK_STD(result)) {
06975 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
06976 }
06977
06978
06979 if (jarg2 != NULL) {
06980 (*jenv)->SetIntField(jenv, jarg2, dblsn_file_fid, arg2->file);
06981 (*jenv)->SetIntField(jenv, jarg2,
06982 dblsn_offset_fid, arg2->offset);
06983 }
06984
06985 }
06986
06987
06988 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1put(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2, jobject jarg3, jint jarg4) {
06989 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
06990 DB_LSN *arg2 = (DB_LSN *) 0 ;
06991 DBT *arg3 = (DBT *) 0 ;
06992 u_int32_t arg4 ;
06993 db_ret_t result;
06994 DB_LSN lsn2 ;
06995 DBT_LOCKED ldbt3 ;
06996
06997 (void)jenv;
06998 (void)jcls;
06999 arg1 = *(struct DbEnv **)(void *)&jarg1;
07000
07001 if (jarg2 == NULL) {
07002 arg2 = NULL;
07003 } else {
07004 arg2 = &lsn2;
07005 arg2->file = (*jenv)->GetIntField(jenv, jarg2, dblsn_file_fid);
07006 arg2->offset = (*jenv)->GetIntField(jenv, jarg2,
07007 dblsn_offset_fid);
07008 }
07009
07010
07011 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
07012 return ;
07013 }
07014 arg4 = (u_int32_t)jarg4;
07015
07016 if (jarg1 == 0) {
07017 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07018 return ;
07019 }
07020
07021 if (arg2 == NULL) {
07022 __dbj_throw(jenv, EINVAL, "null LogSequenceNumber", NULL, NULL);
07023 return ;
07024 }
07025
07026
07027 result = (db_ret_t)DbEnv_log_put(arg1,arg2,(struct Dbt const *)arg3,arg4);
07028
07029 if (!DB_RETOK_STD(result)) {
07030 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07031 }
07032
07033
07034 if (jarg2 != NULL) {
07035 (*jenv)->SetIntField(jenv, jarg2, dblsn_file_fid, arg2->file);
07036 (*jenv)->SetIntField(jenv, jarg2,
07037 dblsn_offset_fid, arg2->offset);
07038 }
07039
07040 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
07041 }
07042
07043
07044 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1print(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3) {
07045 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07046 DB_TXN *arg2 = (DB_TXN *) 0 ;
07047 char *arg3 = (char *) 0 ;
07048 db_ret_t result;
07049
07050 (void)jenv;
07051 (void)jcls;
07052 arg1 = *(struct DbEnv **)(void *)&jarg1;
07053 arg2 = *(DB_TXN **)(void *)&jarg2;
07054 {
07055 arg3 = 0;
07056 if (jarg3) {
07057 arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0);
07058 if (!arg3) return ;
07059 }
07060 }
07061
07062 if (jarg1 == 0) {
07063 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07064 return ;
07065 }
07066
07067 result = (db_ret_t)DbEnv_log_print(arg1,arg2,(char const *)arg3);
07068
07069 if (!DB_RETOK_STD(result)) {
07070 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07071 }
07072
07073 {
07074 if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, arg3);
07075 }
07076 }
07077
07078
07079 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1log_1stat(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07080 jobject jresult = 0 ;
07081 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07082 u_int32_t arg2 ;
07083 DB_LOG_STAT *result;
07084
07085 (void)jenv;
07086 (void)jcls;
07087 arg1 = *(struct DbEnv **)(void *)&jarg1;
07088 arg2 = (u_int32_t)jarg2;
07089
07090 if (jarg1 == 0) {
07091 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07092 return 0;
07093 }
07094
07095 errno = 0;
07096 result = (DB_LOG_STAT *)DbEnv_log_stat(arg1,arg2);
07097
07098 if (!DB_RETOK_STD(errno)) {
07099 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07100 }
07101
07102
07103 jresult = (*jenv)->NewObject(jenv, log_stat_class, log_stat_construct);
07104 if (jresult != NULL)
07105 __dbj_fill_log_stat(jenv, jresult, result);
07106 __os_ufree(NULL, result);
07107
07108 return jresult;
07109 }
07110
07111
07112 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1bsize(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07113 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07114 u_int32_t arg2 ;
07115 db_ret_t result;
07116
07117 (void)jenv;
07118 (void)jcls;
07119 arg1 = *(struct DbEnv **)(void *)&jarg1;
07120 arg2 = (u_int32_t)jarg2;
07121
07122 if (jarg1 == 0) {
07123 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07124 return ;
07125 }
07126
07127 result = (db_ret_t)DbEnv_set_lg_bsize(arg1,arg2);
07128
07129 if (!DB_RETOK_STD(result)) {
07130 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07131 }
07132
07133 }
07134
07135
07136 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1dir(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
07137 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07138 char *arg2 = (char *) 0 ;
07139 db_ret_t result;
07140
07141 (void)jenv;
07142 (void)jcls;
07143 arg1 = *(struct DbEnv **)(void *)&jarg1;
07144 {
07145 arg2 = 0;
07146 if (jarg2) {
07147 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
07148 if (!arg2) return ;
07149 }
07150 }
07151
07152 if (jarg1 == 0) {
07153 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07154 return ;
07155 }
07156
07157 result = (db_ret_t)DbEnv_set_lg_dir(arg1,(char const *)arg2);
07158
07159 if (!DB_RETOK_STD(result)) {
07160 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07161 }
07162
07163 {
07164 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
07165 }
07166 }
07167
07168
07169 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1filemode(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07170 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07171 int arg2 ;
07172 db_ret_t result;
07173
07174 (void)jenv;
07175 (void)jcls;
07176 arg1 = *(struct DbEnv **)(void *)&jarg1;
07177 arg2 = (int)jarg2;
07178
07179 if (jarg1 == 0) {
07180 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07181 return ;
07182 }
07183
07184 result = (db_ret_t)DbEnv_set_lg_filemode(arg1,arg2);
07185
07186 if (!DB_RETOK_STD(result)) {
07187 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07188 }
07189
07190 }
07191
07192
07193 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1max(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07194 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07195 u_int32_t arg2 ;
07196 db_ret_t result;
07197
07198 (void)jenv;
07199 (void)jcls;
07200 arg1 = *(struct DbEnv **)(void *)&jarg1;
07201 arg2 = (u_int32_t)jarg2;
07202
07203 if (jarg1 == 0) {
07204 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07205 return ;
07206 }
07207
07208 result = (db_ret_t)DbEnv_set_lg_max(arg1,arg2);
07209
07210 if (!DB_RETOK_STD(result)) {
07211 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07212 }
07213
07214 }
07215
07216
07217 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1lg_1regionmax(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07218 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07219 u_int32_t arg2 ;
07220 db_ret_t result;
07221
07222 (void)jenv;
07223 (void)jcls;
07224 arg1 = *(struct DbEnv **)(void *)&jarg1;
07225 arg2 = (u_int32_t)jarg2;
07226
07227 if (jarg1 == 0) {
07228 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07229 return ;
07230 }
07231
07232 result = (db_ret_t)DbEnv_set_lg_regionmax(arg1,arg2);
07233
07234 if (!DB_RETOK_STD(result)) {
07235 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07236 }
07237
07238 }
07239
07240
07241 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1cachesize(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07242 jlong jresult = 0 ;
07243 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07244 jlong result;
07245
07246 (void)jenv;
07247 (void)jcls;
07248 arg1 = *(struct DbEnv **)(void *)&jarg1;
07249
07250 if (jarg1 == 0) {
07251 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07252 return 0;
07253 }
07254
07255 errno = 0;
07256 result = DbEnv_get_cachesize(arg1);
07257
07258 if (!DB_RETOK_STD(errno)) {
07259 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07260 }
07261
07262 jresult = result;
07263 return jresult;
07264 }
07265
07266
07267 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1cachesize_1ncache(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07268 jint jresult = 0 ;
07269 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07270 int result;
07271
07272 (void)jenv;
07273 (void)jcls;
07274 arg1 = *(struct DbEnv **)(void *)&jarg1;
07275
07276 if (jarg1 == 0) {
07277 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07278 return 0;
07279 }
07280
07281 errno = 0;
07282 result = (int)DbEnv_get_cachesize_ncache(arg1);
07283
07284 if (!DB_RETOK_STD(errno)) {
07285 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07286 }
07287
07288 jresult = (jint)result;
07289 return jresult;
07290 }
07291
07292
07293 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1mp_1max_1openfd(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07294 jint jresult = 0 ;
07295 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07296 int result;
07297
07298 (void)jenv;
07299 (void)jcls;
07300 arg1 = *(struct DbEnv **)(void *)&jarg1;
07301
07302 if (jarg1 == 0) {
07303 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07304 return 0;
07305 }
07306
07307 errno = 0;
07308 result = (int)DbEnv_get_mp_max_openfd(arg1);
07309
07310 if (!DB_RETOK_STD(errno)) {
07311 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07312 }
07313
07314 jresult = (jint)result;
07315 return jresult;
07316 }
07317
07318
07319 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1mp_1max_1write(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07320 jint jresult = 0 ;
07321 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07322 int result;
07323
07324 (void)jenv;
07325 (void)jcls;
07326 arg1 = *(struct DbEnv **)(void *)&jarg1;
07327
07328 if (jarg1 == 0) {
07329 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07330 return 0;
07331 }
07332
07333 errno = 0;
07334 result = (int)DbEnv_get_mp_max_write(arg1);
07335
07336 if (!DB_RETOK_STD(errno)) {
07337 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07338 }
07339
07340 jresult = (jint)result;
07341 return jresult;
07342 }
07343
07344
07345 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1mp_1max_1write_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07346 jint jresult = 0 ;
07347 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07348 int result;
07349
07350 (void)jenv;
07351 (void)jcls;
07352 arg1 = *(struct DbEnv **)(void *)&jarg1;
07353
07354 if (jarg1 == 0) {
07355 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07356 return 0;
07357 }
07358
07359 errno = 0;
07360 result = (int)DbEnv_get_mp_max_write_sleep(arg1);
07361
07362 if (!DB_RETOK_STD(errno)) {
07363 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07364 }
07365
07366 jresult = (jint)result;
07367 return jresult;
07368 }
07369
07370
07371 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1mp_1mmapsize(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07372 jlong jresult = 0 ;
07373 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07374 size_t result;
07375
07376 (void)jenv;
07377 (void)jcls;
07378 arg1 = *(struct DbEnv **)(void *)&jarg1;
07379
07380 if (jarg1 == 0) {
07381 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07382 return 0;
07383 }
07384
07385 errno = 0;
07386 result = DbEnv_get_mp_mmapsize(arg1);
07387
07388 if (!DB_RETOK_STD(errno)) {
07389 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07390 }
07391
07392 jresult = (jlong)result;
07393 return jresult;
07394 }
07395
07396
07397 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1memp_1stat(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07398 jobject jresult = 0 ;
07399 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07400 u_int32_t arg2 ;
07401 DB_MPOOL_STAT *result;
07402
07403 (void)jenv;
07404 (void)jcls;
07405 arg1 = *(struct DbEnv **)(void *)&jarg1;
07406 arg2 = (u_int32_t)jarg2;
07407
07408 if (jarg1 == 0) {
07409 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07410 return 0;
07411 }
07412
07413 errno = 0;
07414 result = (DB_MPOOL_STAT *)DbEnv_memp_stat(arg1,arg2);
07415
07416 if (!DB_RETOK_STD(errno)) {
07417 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07418 }
07419
07420
07421 jresult = (*jenv)->NewObject(jenv, mpool_stat_class, mpool_stat_construct);
07422 if (jresult != NULL)
07423 __dbj_fill_mpool_stat(jenv, jresult, result);
07424 __os_ufree(NULL, result);
07425
07426 return jresult;
07427 }
07428
07429
07430 JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1memp_1fstat(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07431 jobjectArray jresult = 0 ;
07432 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07433 u_int32_t arg2 ;
07434 DB_MPOOL_FSTAT **result;
07435
07436 (void)jenv;
07437 (void)jcls;
07438 arg1 = *(struct DbEnv **)(void *)&jarg1;
07439 arg2 = (u_int32_t)jarg2;
07440
07441 if (jarg1 == 0) {
07442 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07443 return 0;
07444 }
07445
07446 errno = 0;
07447 result = (DB_MPOOL_FSTAT **)DbEnv_memp_fstat(arg1,arg2);
07448
07449 if (!DB_RETOK_STD(errno)) {
07450 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07451 }
07452
07453 {
07454 int i, len;
07455
07456 len = 0;
07457 while (result[len] != NULL)
07458 len++;
07459 jresult = (*jenv)->NewObjectArray(jenv, (jsize)len,
07460 mpool_fstat_class, 0);
07461 if (jresult == NULL) {
07462 __os_ufree(NULL, result);
07463 return 0;
07464 }
07465 for (i = 0; i < len; i++) {
07466 jobject obj = (*jenv)->NewObject(jenv, mpool_fstat_class,
07467 mpool_fstat_construct);
07468 if (obj == NULL) {
07469 __os_ufree(NULL, result);
07470 return 0;
07471 }
07472 (*jenv)->SetObjectArrayElement(jenv, jresult, i, obj);
07473 __dbj_fill_mpool_fstat(jenv, obj, result[i]);
07474 }
07475 __os_ufree(NULL, result);
07476 }
07477 return jresult;
07478 }
07479
07480
07481 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1memp_1trickle(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07482 jint jresult = 0 ;
07483 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07484 int arg2 ;
07485 int result;
07486
07487 (void)jenv;
07488 (void)jcls;
07489 arg1 = *(struct DbEnv **)(void *)&jarg1;
07490 arg2 = (int)jarg2;
07491
07492 if (jarg1 == 0) {
07493 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07494 return 0;
07495 }
07496
07497 errno = 0;
07498 result = (int)DbEnv_memp_trickle(arg1,arg2);
07499
07500 if (!DB_RETOK_STD(errno)) {
07501 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07502 }
07503
07504 jresult = (jint)result;
07505 return jresult;
07506 }
07507
07508
07509 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1get_1align(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07510 jint jresult = 0 ;
07511 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07512 u_int32_t result;
07513
07514 (void)jenv;
07515 (void)jcls;
07516 arg1 = *(struct DbEnv **)(void *)&jarg1;
07517
07518 if (jarg1 == 0) {
07519 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07520 return 0;
07521 }
07522
07523 errno = 0;
07524 result = (u_int32_t)DbEnv_mutex_get_align(arg1);
07525
07526 if (!DB_RETOK_STD(errno)) {
07527 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07528 }
07529
07530 jresult = (jint)result;
07531 return jresult;
07532 }
07533
07534
07535 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1get_1increment(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07536 jint jresult = 0 ;
07537 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07538 u_int32_t result;
07539
07540 (void)jenv;
07541 (void)jcls;
07542 arg1 = *(struct DbEnv **)(void *)&jarg1;
07543
07544 if (jarg1 == 0) {
07545 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07546 return 0;
07547 }
07548
07549 errno = 0;
07550 result = (u_int32_t)DbEnv_mutex_get_increment(arg1);
07551
07552 if (!DB_RETOK_STD(errno)) {
07553 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07554 }
07555
07556 jresult = (jint)result;
07557 return jresult;
07558 }
07559
07560
07561 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1get_1max(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07562 jint jresult = 0 ;
07563 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07564 u_int32_t result;
07565
07566 (void)jenv;
07567 (void)jcls;
07568 arg1 = *(struct DbEnv **)(void *)&jarg1;
07569
07570 if (jarg1 == 0) {
07571 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07572 return 0;
07573 }
07574
07575 errno = 0;
07576 result = (u_int32_t)DbEnv_mutex_get_max(arg1);
07577
07578 if (!DB_RETOK_STD(errno)) {
07579 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07580 }
07581
07582 jresult = (jint)result;
07583 return jresult;
07584 }
07585
07586
07587 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1get_1tas_1spins(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07588 jint jresult = 0 ;
07589 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07590 u_int32_t result;
07591
07592 (void)jenv;
07593 (void)jcls;
07594 arg1 = *(struct DbEnv **)(void *)&jarg1;
07595
07596 if (jarg1 == 0) {
07597 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07598 return 0;
07599 }
07600
07601 errno = 0;
07602 result = (u_int32_t)DbEnv_mutex_get_tas_spins(arg1);
07603
07604 if (!DB_RETOK_STD(errno)) {
07605 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07606 }
07607
07608 jresult = (jint)result;
07609 return jresult;
07610 }
07611
07612
07613 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1set_1align(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07614 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07615 u_int32_t arg2 ;
07616 db_ret_t result;
07617
07618 (void)jenv;
07619 (void)jcls;
07620 arg1 = *(struct DbEnv **)(void *)&jarg1;
07621 arg2 = (u_int32_t)jarg2;
07622
07623 if (jarg1 == 0) {
07624 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07625 return ;
07626 }
07627
07628 result = (db_ret_t)DbEnv_mutex_set_align(arg1,arg2);
07629
07630 if (!DB_RETOK_STD(result)) {
07631 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07632 }
07633
07634 }
07635
07636
07637 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1set_1increment(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07638 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07639 u_int32_t arg2 ;
07640 db_ret_t result;
07641
07642 (void)jenv;
07643 (void)jcls;
07644 arg1 = *(struct DbEnv **)(void *)&jarg1;
07645 arg2 = (u_int32_t)jarg2;
07646
07647 if (jarg1 == 0) {
07648 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07649 return ;
07650 }
07651
07652 result = (db_ret_t)DbEnv_mutex_set_increment(arg1,arg2);
07653
07654 if (!DB_RETOK_STD(result)) {
07655 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07656 }
07657
07658 }
07659
07660
07661 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1set_1max(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07662 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07663 u_int32_t arg2 ;
07664 db_ret_t result;
07665
07666 (void)jenv;
07667 (void)jcls;
07668 arg1 = *(struct DbEnv **)(void *)&jarg1;
07669 arg2 = (u_int32_t)jarg2;
07670
07671 if (jarg1 == 0) {
07672 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07673 return ;
07674 }
07675
07676 result = (db_ret_t)DbEnv_mutex_set_max(arg1,arg2);
07677
07678 if (!DB_RETOK_STD(result)) {
07679 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07680 }
07681
07682 }
07683
07684
07685 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1set_1tas_1spins(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07686 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07687 u_int32_t arg2 ;
07688 db_ret_t result;
07689
07690 (void)jenv;
07691 (void)jcls;
07692 arg1 = *(struct DbEnv **)(void *)&jarg1;
07693 arg2 = (u_int32_t)jarg2;
07694
07695 if (jarg1 == 0) {
07696 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07697 return ;
07698 }
07699
07700 result = (db_ret_t)DbEnv_mutex_set_tas_spins(arg1,arg2);
07701
07702 if (!DB_RETOK_STD(result)) {
07703 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07704 }
07705
07706 }
07707
07708
07709 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1mutex_1stat(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07710 jobject jresult = 0 ;
07711 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07712 u_int32_t arg2 ;
07713 DB_MUTEX_STAT *result;
07714
07715 (void)jenv;
07716 (void)jcls;
07717 arg1 = *(struct DbEnv **)(void *)&jarg1;
07718 arg2 = (u_int32_t)jarg2;
07719
07720 if (jarg1 == 0) {
07721 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07722 return 0;
07723 }
07724
07725 errno = 0;
07726 result = (DB_MUTEX_STAT *)DbEnv_mutex_stat(arg1,arg2);
07727
07728 if (!DB_RETOK_STD(errno)) {
07729 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07730 }
07731
07732
07733 jresult = (*jenv)->NewObject(jenv, mutex_stat_class, mutex_stat_construct);
07734 if (jresult != NULL)
07735 __dbj_fill_mutex_stat(jenv, jresult, result);
07736 __os_ufree(NULL, result);
07737
07738 return jresult;
07739 }
07740
07741
07742 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1tx_1max(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07743 jint jresult = 0 ;
07744 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07745 u_int32_t result;
07746
07747 (void)jenv;
07748 (void)jcls;
07749 arg1 = *(struct DbEnv **)(void *)&jarg1;
07750
07751 if (jarg1 == 0) {
07752 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07753 return 0;
07754 }
07755
07756 errno = 0;
07757 result = (u_int32_t)DbEnv_get_tx_max(arg1);
07758
07759 if (!DB_RETOK_STD(errno)) {
07760 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07761 }
07762
07763 jresult = (jint)result;
07764 return jresult;
07765 }
07766
07767
07768 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1tx_1timestamp(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07769 jlong jresult = 0 ;
07770 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07771 time_t result;
07772
07773 (void)jenv;
07774 (void)jcls;
07775 arg1 = *(struct DbEnv **)(void *)&jarg1;
07776
07777 if (jarg1 == 0) {
07778 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07779 return 0;
07780 }
07781
07782 errno = 0;
07783 result = DbEnv_get_tx_timestamp(arg1);
07784
07785 if (!DB_RETOK_STD(errno)) {
07786 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07787 }
07788
07789 jresult = (jlong)result;
07790 return jresult;
07791 }
07792
07793
07794 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1timeout(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07795 jlong jresult = 0 ;
07796 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07797 u_int32_t arg2 ;
07798 db_timeout_t result;
07799
07800 (void)jenv;
07801 (void)jcls;
07802 arg1 = *(struct DbEnv **)(void *)&jarg1;
07803 arg2 = (u_int32_t)jarg2;
07804
07805 if (jarg1 == 0) {
07806 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07807 return 0;
07808 }
07809
07810 errno = 0;
07811 result = (db_timeout_t)DbEnv_get_timeout(arg1,arg2);
07812
07813 if (!DB_RETOK_STD(errno)) {
07814 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07815 }
07816
07817 jresult = (jlong)result;
07818 return jresult;
07819 }
07820
07821
07822 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1txn_1begin(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
07823 jlong jresult = 0 ;
07824 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07825 DB_TXN *arg2 = (DB_TXN *) 0 ;
07826 u_int32_t arg3 ;
07827 DB_TXN *result;
07828
07829 (void)jenv;
07830 (void)jcls;
07831 arg1 = *(struct DbEnv **)(void *)&jarg1;
07832 arg2 = *(DB_TXN **)(void *)&jarg2;
07833 arg3 = (u_int32_t)jarg3;
07834
07835 if (jarg1 == 0) {
07836 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07837 return 0;
07838 }
07839
07840 errno = 0;
07841 result = (DB_TXN *)DbEnv_txn_begin(arg1,arg2,arg3);
07842
07843 if (!DB_RETOK_STD(errno)) {
07844 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07845 }
07846
07847 *(DB_TXN **)(void *)&jresult = result;
07848 return jresult;
07849 }
07850
07851
07852 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1txn_1checkpoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3, jint jarg4) {
07853 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07854 u_int32_t arg2 ;
07855 u_int32_t arg3 ;
07856 u_int32_t arg4 ;
07857 db_ret_t result;
07858
07859 (void)jenv;
07860 (void)jcls;
07861 arg1 = *(struct DbEnv **)(void *)&jarg1;
07862 arg2 = (u_int32_t)jarg2;
07863 arg3 = (u_int32_t)jarg3;
07864 arg4 = (u_int32_t)jarg4;
07865
07866 if (jarg1 == 0) {
07867 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07868 return ;
07869 }
07870
07871 result = (db_ret_t)DbEnv_txn_checkpoint(arg1,arg2,arg3,arg4);
07872
07873 if (!DB_RETOK_STD(result)) {
07874 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
07875 }
07876
07877 }
07878
07879
07880 JNIEXPORT jobjectArray JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1txn_1recover(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3) {
07881 jobjectArray jresult = 0 ;
07882 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07883 int arg2 ;
07884 u_int32_t arg3 ;
07885 DB_PREPLIST *result;
07886
07887 (void)jenv;
07888 (void)jcls;
07889 arg1 = *(struct DbEnv **)(void *)&jarg1;
07890 arg2 = (int)jarg2;
07891 arg3 = (u_int32_t)jarg3;
07892
07893 if (jarg1 == 0) {
07894 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07895 return 0;
07896 }
07897
07898 errno = 0;
07899 result = (DB_PREPLIST *)DbEnv_txn_recover(arg1,arg2,arg3);
07900
07901 if (!DB_RETOK_STD(errno)) {
07902 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07903 }
07904
07905 {
07906 int i, len;
07907
07908 len = 0;
07909 while (result[len].txn != NULL)
07910 len++;
07911 jresult = (*jenv)->NewObjectArray(jenv, (jsize)len, dbpreplist_class,
07912 NULL);
07913 if (jresult == NULL)
07914 return 0;
07915 for (i = 0; i < len; i++) {
07916 jobject jtxn = (*jenv)->NewObject(jenv, dbtxn_class,
07917 dbtxn_construct, result[i].txn, JNI_FALSE);
07918 jobject bytearr = (*jenv)->NewByteArray(jenv,
07919 (jsize)sizeof(result[i].gid));
07920 jobject obj = (*jenv)->NewObject(jenv, dbpreplist_class,
07921 dbpreplist_construct, jtxn, bytearr);
07922
07923 if (jtxn == NULL || bytearr == NULL || obj == NULL)
07924 return 0;
07925
07926 (*jenv)->SetByteArrayRegion(jenv, bytearr, 0,
07927 (jsize)sizeof(result[i].gid), (jbyte *)result[i].gid);
07928 (*jenv)->SetObjectArrayElement(jenv, jresult, i, obj);
07929 }
07930 __os_ufree(NULL, result);
07931 }
07932 return jresult;
07933 }
07934
07935
07936 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1txn_1stat(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
07937 jobject jresult = 0 ;
07938 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07939 u_int32_t arg2 ;
07940 DB_TXN_STAT *result;
07941
07942 (void)jenv;
07943 (void)jcls;
07944 arg1 = *(struct DbEnv **)(void *)&jarg1;
07945 arg2 = (u_int32_t)jarg2;
07946
07947 if (jarg1 == 0) {
07948 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
07949 return 0;
07950 }
07951
07952 errno = 0;
07953 result = (DB_TXN_STAT *)DbEnv_txn_stat(arg1,arg2);
07954
07955 if (!DB_RETOK_STD(errno)) {
07956 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
07957 }
07958
07959 {
07960 unsigned int i;
07961 jobjectArray actives;
07962 jresult = (*jenv)->NewObject(jenv, txn_stat_class, txn_stat_construct);
07963 if (jresult != NULL)
07964 __dbj_fill_txn_stat(jenv, jresult, result);
07965
07966 actives = (*jenv)->NewObjectArray(jenv, (jsize)result->st_nactive,
07967 txn_active_class, 0);
07968 if (actives == NULL) {
07969 __os_ufree(NULL, result);
07970 return 0;
07971 }
07972 (*jenv)->SetObjectField(jenv, jresult,
07973 txn_stat_st_txnarray_fid, actives);
07974 for (i = 0; i < result->st_nactive; i++) {
07975 jobject obj = (*jenv)->NewObject(jenv, txn_active_class,
07976 txn_active_construct);
07977 if (obj == NULL) {
07978 __os_ufree(NULL, result);
07979 return 0;
07980 }
07981 (*jenv)->SetObjectArrayElement(jenv, actives, (jsize)i, obj);
07982 __dbj_fill_txn_active(jenv, obj, &result->st_txnarray[i]);
07983 }
07984 __os_ufree(NULL, result);
07985 }
07986 return jresult;
07987 }
07988
07989
07990 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1rep_1limit(JNIEnv *jenv, jclass jcls, jlong jarg1) {
07991 jlong jresult = 0 ;
07992 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
07993 jlong result;
07994
07995 (void)jenv;
07996 (void)jcls;
07997 arg1 = *(struct DbEnv **)(void *)&jarg1;
07998
07999 if (jarg1 == 0) {
08000 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08001 return 0;
08002 }
08003
08004 errno = 0;
08005 result = DbEnv_get_rep_limit(arg1);
08006
08007 if (!DB_RETOK_STD(errno)) {
08008 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
08009 }
08010
08011 jresult = result;
08012 return jresult;
08013 }
08014
08015
08016 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1elect(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3, jint jarg4, jint jarg5, jint jarg6) {
08017 jint jresult = 0 ;
08018 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08019 int arg2 ;
08020 int arg3 ;
08021 int arg4 ;
08022 u_int32_t arg5 ;
08023 u_int32_t arg6 ;
08024 int result;
08025
08026 (void)jenv;
08027 (void)jcls;
08028 arg1 = *(struct DbEnv **)(void *)&jarg1;
08029 arg2 = (int)jarg2;
08030 arg3 = (int)jarg3;
08031 arg4 = (int)jarg4;
08032 arg5 = (u_int32_t)jarg5;
08033 arg6 = (u_int32_t)jarg6;
08034
08035 if (jarg1 == 0) {
08036 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08037 return 0;
08038 }
08039
08040 errno = 0;
08041 result = (int)DbEnv_rep_elect(arg1,arg2,arg3,arg4,arg5,arg6);
08042
08043 if (!DB_RETOK_STD(errno)) {
08044 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
08045 }
08046
08047 jresult = (jint)result;
08048 return jresult;
08049 }
08050
08051
08052 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1process_1message(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2, jobject jarg3, jobject jarg4, jobject jarg5) {
08053 jint jresult = 0 ;
08054 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08055 DBT *arg2 = (DBT *) 0 ;
08056 DBT *arg3 = (DBT *) 0 ;
08057 int *arg4 = (int *) 0 ;
08058 DB_LSN *arg5 = (DB_LSN *) 0 ;
08059 int result;
08060 DBT_LOCKED ldbt2 ;
08061 DBT_LOCKED ldbt3 ;
08062 int id4 ;
08063 DB_LSN lsn5 ;
08064
08065 (void)jenv;
08066 (void)jcls;
08067 arg1 = *(struct DbEnv **)(void *)&jarg1;
08068
08069 if (__dbj_dbt_copyin(jenv, &ldbt2, &arg2, jarg2, 0) != 0) {
08070 return 0;
08071 }
08072
08073 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
08074 return 0;
08075 }
08076
08077 id4 = (*jenv)->GetIntField(jenv, jarg4, rep_processmsg_envid);
08078 arg4 = &id4;
08079
08080
08081 if (jarg5 == NULL) {
08082 arg5 = NULL;
08083 } else {
08084 arg5 = &lsn5;
08085 arg5->file = (*jenv)->GetIntField(jenv, jarg5, dblsn_file_fid);
08086 arg5->offset = (*jenv)->GetIntField(jenv, jarg5,
08087 dblsn_offset_fid);
08088 }
08089
08090
08091 if (jarg1 == 0) {
08092 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08093 return 0;
08094 }
08095
08096 if (arg5 == NULL) {
08097 __dbj_throw(jenv, EINVAL, "null LogSequenceNumber", NULL, NULL);
08098 return 0;
08099 }
08100
08101
08102 result = (int)DbEnv_rep_process_message(arg1,arg2,arg3,arg4,arg5);
08103
08104 if (!DB_RETOK_REPPMSG(result)) {
08105 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
08106 }
08107
08108 jresult = (jint)result;
08109
08110 (*jenv)->SetIntField(jenv, jarg4, rep_processmsg_envid, *arg4);
08111
08112 __dbj_dbt_release(jenv, jarg2, arg2, &ldbt2);
08113 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
08114
08115 if (jarg5 != NULL) {
08116 (*jenv)->SetIntField(jenv, jarg5, dblsn_file_fid, arg5->file);
08117 (*jenv)->SetIntField(jenv, jarg5,
08118 dblsn_offset_fid, arg5->offset);
08119 }
08120
08121 return jresult;
08122 }
08123
08124
08125 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1flush(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08126 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08127 db_ret_t result;
08128
08129 (void)jenv;
08130 (void)jcls;
08131 arg1 = *(struct DbEnv **)(void *)&jarg1;
08132
08133 if (jarg1 == 0) {
08134 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08135 return ;
08136 }
08137
08138 result = (db_ret_t)DbEnv_rep_flush(arg1);
08139
08140 if (!DB_RETOK_STD(result)) {
08141 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
08142 }
08143
08144 }
08145
08146
08147 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1set_1config(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jboolean jarg3) {
08148 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08149 u_int32_t arg2 ;
08150 int_bool arg3 ;
08151 db_ret_t result;
08152
08153 (void)jenv;
08154 (void)jcls;
08155 arg1 = *(struct DbEnv **)(void *)&jarg1;
08156 arg2 = (u_int32_t)jarg2;
08157 arg3 = (jarg3 == JNI_TRUE);
08158
08159 if (jarg1 == 0) {
08160 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08161 return ;
08162 }
08163
08164 result = (db_ret_t)DbEnv_rep_set_config(arg1,arg2,arg3);
08165
08166 if (!DB_RETOK_STD(result)) {
08167 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
08168 }
08169
08170 }
08171
08172
08173 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1start(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2, jint jarg3) {
08174 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08175 DBT *arg2 = (DBT *) 0 ;
08176 u_int32_t arg3 ;
08177 db_ret_t result;
08178 DBT_LOCKED ldbt2 ;
08179
08180 (void)jenv;
08181 (void)jcls;
08182 arg1 = *(struct DbEnv **)(void *)&jarg1;
08183
08184 if (__dbj_dbt_copyin(jenv, &ldbt2, &arg2, jarg2, 1) != 0) {
08185 return ;
08186 }
08187 arg3 = (u_int32_t)jarg3;
08188
08189 if (jarg1 == 0) {
08190 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08191 return ;
08192 }
08193
08194 result = (db_ret_t)DbEnv_rep_start(arg1,arg2,arg3);
08195
08196 if (!DB_RETOK_STD(result)) {
08197 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
08198 }
08199
08200 __dbj_dbt_release(jenv, jarg2, arg2, &ldbt2);
08201 }
08202
08203
08204 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1sync(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
08205 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08206 u_int32_t arg2 ;
08207 db_ret_t result;
08208
08209 (void)jenv;
08210 (void)jcls;
08211 arg1 = *(struct DbEnv **)(void *)&jarg1;
08212 arg2 = (u_int32_t)jarg2;
08213
08214 if (jarg1 == 0) {
08215 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08216 return ;
08217 }
08218
08219 result = (db_ret_t)DbEnv_rep_sync(arg1,arg2);
08220
08221 if (!DB_RETOK_STD(result)) {
08222 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
08223 }
08224
08225 }
08226
08227
08228 JNIEXPORT jboolean JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1get_1config(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
08229 jboolean jresult = 0 ;
08230 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08231 u_int32_t arg2 ;
08232 int_bool result;
08233
08234 (void)jenv;
08235 (void)jcls;
08236 arg1 = *(struct DbEnv **)(void *)&jarg1;
08237 arg2 = (u_int32_t)jarg2;
08238
08239 if (jarg1 == 0) {
08240 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08241 return 0;
08242 }
08243
08244 errno = 0;
08245 result = (int_bool)DbEnv_rep_get_config(arg1,arg2);
08246
08247 if (!DB_RETOK_STD(errno)) {
08248 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
08249 }
08250
08251 jresult = (result) ? JNI_TRUE : JNI_FALSE;
08252 return jresult;
08253 }
08254
08255
08256 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1rep_1stat(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
08257 jobject jresult = 0 ;
08258 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08259 u_int32_t arg2 ;
08260 DB_REP_STAT *result;
08261
08262 (void)jenv;
08263 (void)jcls;
08264 arg1 = *(struct DbEnv **)(void *)&jarg1;
08265 arg2 = (u_int32_t)jarg2;
08266
08267 if (jarg1 == 0) {
08268 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08269 return 0;
08270 }
08271
08272 errno = 0;
08273 result = (DB_REP_STAT *)DbEnv_rep_stat(arg1,arg2);
08274
08275 if (!DB_RETOK_STD(errno)) {
08276 __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
08277 }
08278
08279
08280 jresult = (*jenv)->NewObject(jenv, rep_stat_class, rep_stat_construct);
08281 if (jresult != NULL)
08282 __dbj_fill_rep_stat(jenv, jresult, result);
08283 __os_ufree(NULL, result);
08284
08285 return jresult;
08286 }
08287
08288
08289 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1rep_1limit(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
08290 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08291 jlong arg2 ;
08292 db_ret_t result;
08293
08294 (void)jenv;
08295 (void)jcls;
08296 arg1 = *(struct DbEnv **)(void *)&jarg1;
08297 arg2 = jarg2;
08298
08299 if (jarg1 == 0) {
08300 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08301 return ;
08302 }
08303
08304 result = (db_ret_t)DbEnv_set_rep_limit(arg1,arg2);
08305
08306 if (!DB_RETOK_STD(result)) {
08307 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
08308 }
08309
08310 }
08311
08312
08313 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1rep_1request(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jint jarg3) {
08314 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08315 u_int32_t arg2 ;
08316 u_int32_t arg3 ;
08317 db_ret_t result;
08318
08319 (void)jenv;
08320 (void)jcls;
08321 arg1 = *(struct DbEnv **)(void *)&jarg1;
08322 arg2 = (u_int32_t)jarg2;
08323 arg3 = (u_int32_t)jarg3;
08324
08325 if (jarg1 == 0) {
08326 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08327 return ;
08328 }
08329
08330 result = (db_ret_t)DbEnv_set_rep_request(arg1,arg2,arg3);
08331
08332 if (!DB_RETOK_STD(result)) {
08333 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
08334 }
08335
08336 }
08337
08338
08339 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1rep_1transport(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jobject jarg3) {
08340 struct DbEnv *arg1 = (struct DbEnv *) 0 ;
08341 int arg2 ;
08342 int (*arg3)(DB_ENV *,DBT const *,DBT const *,DB_LSN const *,int,u_int32_t) = (int (*)(DB_ENV *,DBT const *,DBT const *,DB_LSN const *,int,u_int32_t)) 0 ;
08343 db_ret_t result;
08344
08345 (void)jenv;
08346 (void)jcls;
08347 arg1 = *(struct DbEnv **)(void *)&jarg1;
08348 arg2 = (int)jarg2;
08349
08350 arg3 = (jarg3 == NULL) ? NULL : __dbj_rep_transport;
08351
08352
08353 if (jarg1 == 0) {
08354 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08355 return ;
08356 }
08357
08358 result = (db_ret_t)DbEnv_set_rep_transport(arg1,arg2,arg3);
08359
08360 if (!DB_RETOK_STD(result)) {
08361 __dbj_throw(jenv, result, NULL, NULL, JDBENV);
08362 }
08363
08364 }
08365
08366
08367 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1strerror(JNIEnv *jenv, jclass jcls, jint jarg1) {
08368 jstring jresult = 0 ;
08369 int arg1 ;
08370 char *result;
08371
08372 (void)jenv;
08373 (void)jcls;
08374 arg1 = (int)jarg1;
08375 result = (char *)DbEnv_strerror(arg1);
08376
08377 {
08378 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
08379 }
08380 return jresult;
08381 }
08382
08383
08384 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1version_1major(JNIEnv *jenv, jclass jcls) {
08385 jint jresult = 0 ;
08386 int result;
08387
08388 (void)jenv;
08389 (void)jcls;
08390 result = (int)DbEnv_get_version_major();
08391
08392 jresult = (jint)result;
08393 return jresult;
08394 }
08395
08396
08397 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1version_1minor(JNIEnv *jenv, jclass jcls) {
08398 jint jresult = 0 ;
08399 int result;
08400
08401 (void)jenv;
08402 (void)jcls;
08403 result = (int)DbEnv_get_version_minor();
08404
08405 jresult = (jint)result;
08406 return jresult;
08407 }
08408
08409
08410 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1version_1patch(JNIEnv *jenv, jclass jcls) {
08411 jint jresult = 0 ;
08412 int result;
08413
08414 (void)jenv;
08415 (void)jcls;
08416 result = (int)DbEnv_get_version_patch();
08417
08418 jresult = (jint)result;
08419 return jresult;
08420 }
08421
08422
08423 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1get_1version_1string(JNIEnv *jenv, jclass jcls) {
08424 jstring jresult = 0 ;
08425 char *result;
08426
08427 (void)jenv;
08428 (void)jcls;
08429 result = (char *)DbEnv_get_version_string();
08430
08431 {
08432 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
08433 }
08434 return jresult;
08435 }
08436
08437
08438 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_delete_1DbLock(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08439 struct DbLock *arg1 = (struct DbLock *) 0 ;
08440
08441 (void)jenv;
08442 (void)jcls;
08443 arg1 = *(struct DbLock **)(void *)&jarg1;
08444
08445 if (jarg1 == 0) {
08446 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08447 return ;
08448 }
08449 delete_DbLock(arg1);
08450
08451 }
08452
08453
08454 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbLogc_1close0(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
08455 struct DbLogc *arg1 = (struct DbLogc *) 0 ;
08456 u_int32_t arg2 ;
08457 db_ret_t result;
08458
08459 (void)jenv;
08460 (void)jcls;
08461 arg1 = *(struct DbLogc **)(void *)&jarg1;
08462 arg2 = (u_int32_t)jarg2;
08463
08464 if (jarg1 == 0) {
08465 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08466 return ;
08467 }
08468
08469 result = (db_ret_t)DbLogc_close(arg1,arg2);
08470
08471 if (!DB_RETOK_STD(result)) {
08472 __dbj_throw(jenv, result, NULL, NULL, NULL);
08473 }
08474
08475 }
08476
08477
08478 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbLogc_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2, jobject jarg3, jint jarg4) {
08479 jint jresult = 0 ;
08480 struct DbLogc *arg1 = (struct DbLogc *) 0 ;
08481 DB_LSN *arg2 = (DB_LSN *) 0 ;
08482 DBT *arg3 = (DBT *) 0 ;
08483 u_int32_t arg4 ;
08484 int result;
08485 DB_LSN lsn2 ;
08486 DBT_LOCKED ldbt3 ;
08487
08488 (void)jenv;
08489 (void)jcls;
08490 arg1 = *(struct DbLogc **)(void *)&jarg1;
08491
08492 if (jarg2 == NULL) {
08493 arg2 = NULL;
08494 } else {
08495 arg2 = &lsn2;
08496 arg2->file = (*jenv)->GetIntField(jenv, jarg2, dblsn_file_fid);
08497 arg2->offset = (*jenv)->GetIntField(jenv, jarg2,
08498 dblsn_offset_fid);
08499 }
08500
08501
08502 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
08503 return 0;
08504 }
08505 arg4 = (u_int32_t)jarg4;
08506
08507 if (jarg1 == 0) {
08508 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08509 return 0;
08510 }
08511
08512 if (arg2 == NULL) {
08513 __dbj_throw(jenv, EINVAL, "null LogSequenceNumber", NULL, NULL);
08514 return 0;
08515 }
08516
08517
08518 result = (int)DbLogc_get(arg1,arg2,arg3,arg4);
08519
08520 if (!DB_RETOK_LGGET(result)) {
08521 __dbj_throw(jenv, result, NULL, NULL, NULL);
08522 }
08523
08524 jresult = (jint)result;
08525
08526 if (jarg2 != NULL) {
08527 (*jenv)->SetIntField(jenv, jarg2, dblsn_file_fid, arg2->file);
08528 (*jenv)->SetIntField(jenv, jarg2,
08529 dblsn_offset_fid, arg2->offset);
08530 }
08531
08532 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
08533 return jresult;
08534 }
08535
08536
08537 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1get_1priority(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08538 jint jresult = 0 ;
08539 struct DbMpoolFile *arg1 = (struct DbMpoolFile *) 0 ;
08540 DB_CACHE_PRIORITY result;
08541
08542 (void)jenv;
08543 (void)jcls;
08544 arg1 = *(struct DbMpoolFile **)(void *)&jarg1;
08545
08546 if (jarg1 == 0) {
08547 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08548 return 0;
08549 }
08550
08551 errno = 0;
08552 result = (DB_CACHE_PRIORITY)DbMpoolFile_get_priority(arg1);
08553
08554 if (!DB_RETOK_STD(errno)) {
08555 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08556 }
08557
08558 jresult = (jint)result;
08559 return jresult;
08560 }
08561
08562
08563 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1set_1priority(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
08564 struct DbMpoolFile *arg1 = (struct DbMpoolFile *) 0 ;
08565 DB_CACHE_PRIORITY arg2 ;
08566 db_ret_t result;
08567
08568 (void)jenv;
08569 (void)jcls;
08570 arg1 = *(struct DbMpoolFile **)(void *)&jarg1;
08571 arg2 = (DB_CACHE_PRIORITY)jarg2;
08572
08573 if (jarg1 == 0) {
08574 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08575 return ;
08576 }
08577
08578 result = (db_ret_t)DbMpoolFile_set_priority(arg1,arg2);
08579
08580 if (!DB_RETOK_STD(result)) {
08581 __dbj_throw(jenv, result, NULL, NULL, NULL);
08582 }
08583
08584 }
08585
08586
08587 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1get_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08588 jint jresult = 0 ;
08589 struct DbMpoolFile *arg1 = (struct DbMpoolFile *) 0 ;
08590 u_int32_t result;
08591
08592 (void)jenv;
08593 (void)jcls;
08594 arg1 = *(struct DbMpoolFile **)(void *)&jarg1;
08595
08596 if (jarg1 == 0) {
08597 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08598 return 0;
08599 }
08600
08601 errno = 0;
08602 result = (u_int32_t)DbMpoolFile_get_flags(arg1);
08603
08604 if (!DB_RETOK_STD(errno)) {
08605 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08606 }
08607
08608 jresult = (jint)result;
08609 return jresult;
08610 }
08611
08612
08613 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1set_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2, jboolean jarg3) {
08614 struct DbMpoolFile *arg1 = (struct DbMpoolFile *) 0 ;
08615 u_int32_t arg2 ;
08616 int_bool arg3 ;
08617 db_ret_t result;
08618
08619 (void)jenv;
08620 (void)jcls;
08621 arg1 = *(struct DbMpoolFile **)(void *)&jarg1;
08622 arg2 = (u_int32_t)jarg2;
08623 arg3 = (jarg3 == JNI_TRUE);
08624
08625 if (jarg1 == 0) {
08626 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08627 return ;
08628 }
08629
08630 result = (db_ret_t)DbMpoolFile_set_flags(arg1,arg2,arg3);
08631
08632 if (!DB_RETOK_STD(result)) {
08633 __dbj_throw(jenv, result, NULL, NULL, NULL);
08634 }
08635
08636 }
08637
08638
08639 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1get_1maxsize(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08640 jlong jresult = 0 ;
08641 struct DbMpoolFile *arg1 = (struct DbMpoolFile *) 0 ;
08642 jlong result;
08643
08644 (void)jenv;
08645 (void)jcls;
08646 arg1 = *(struct DbMpoolFile **)(void *)&jarg1;
08647
08648 if (jarg1 == 0) {
08649 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08650 return 0;
08651 }
08652
08653 errno = 0;
08654 result = DbMpoolFile_get_maxsize(arg1);
08655
08656 if (!DB_RETOK_STD(errno)) {
08657 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08658 }
08659
08660 jresult = result;
08661 return jresult;
08662 }
08663
08664
08665 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbMpoolFile_1set_1maxsize(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
08666 struct DbMpoolFile *arg1 = (struct DbMpoolFile *) 0 ;
08667 jlong arg2 ;
08668 db_ret_t result;
08669
08670 (void)jenv;
08671 (void)jcls;
08672 arg1 = *(struct DbMpoolFile **)(void *)&jarg1;
08673 arg2 = jarg2;
08674
08675 if (jarg1 == 0) {
08676 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08677 return ;
08678 }
08679
08680 result = (db_ret_t)DbMpoolFile_set_maxsize(arg1,arg2);
08681
08682 if (!DB_RETOK_STD(result)) {
08683 __dbj_throw(jenv, result, NULL, NULL, NULL);
08684 }
08685
08686 }
08687
08688
08689 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_new_1DbSequence(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
08690 jlong jresult = 0 ;
08691 DB *arg1 = (DB *) 0 ;
08692 u_int32_t arg2 ;
08693 struct DbSequence *result;
08694
08695 (void)jenv;
08696 (void)jcls;
08697 arg1 = *(DB **)(void *)&jarg1;
08698 arg2 = (u_int32_t)jarg2;
08699
08700 errno = 0;
08701 result = (struct DbSequence *)new_DbSequence(arg1,arg2);
08702
08703 if (!DB_RETOK_STD(errno)) {
08704 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08705 }
08706
08707 *(struct DbSequence **)(void *)&jresult = result;
08708 return jresult;
08709 }
08710
08711
08712 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1close0(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
08713 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08714 u_int32_t arg2 ;
08715 db_ret_t result;
08716
08717 (void)jenv;
08718 (void)jcls;
08719 arg1 = *(struct DbSequence **)(void *)&jarg1;
08720 arg2 = (u_int32_t)jarg2;
08721
08722 if (jarg1 == 0) {
08723 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08724 return ;
08725 }
08726
08727 result = (db_ret_t)DbSequence_close(arg1,arg2);
08728
08729 if (!DB_RETOK_STD(result)) {
08730 __dbj_throw(jenv, result, NULL, NULL, NULL);
08731 }
08732
08733 }
08734
08735
08736 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3, jint jarg4) {
08737 jlong jresult = 0 ;
08738 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08739 DB_TXN *arg2 = (DB_TXN *) 0 ;
08740 int32_t arg3 ;
08741 u_int32_t arg4 ;
08742 db_seq_t result;
08743
08744 (void)jenv;
08745 (void)jcls;
08746 arg1 = *(struct DbSequence **)(void *)&jarg1;
08747 arg2 = *(DB_TXN **)(void *)&jarg2;
08748 arg3 = (int32_t)jarg3;
08749 arg4 = (u_int32_t)jarg4;
08750
08751 if (jarg1 == 0) {
08752 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08753 return 0;
08754 }
08755
08756 errno = 0;
08757 result = (db_seq_t)DbSequence_get(arg1,arg2,arg3,arg4);
08758
08759 if (!DB_RETOK_STD(errno)) {
08760 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08761 }
08762
08763 jresult = (jlong)result;
08764 return jresult;
08765 }
08766
08767
08768 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1cachesize(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08769 jint jresult = 0 ;
08770 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08771 int32_t result;
08772
08773 (void)jenv;
08774 (void)jcls;
08775 arg1 = *(struct DbSequence **)(void *)&jarg1;
08776
08777 if (jarg1 == 0) {
08778 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08779 return 0;
08780 }
08781
08782 errno = 0;
08783 result = (int32_t)DbSequence_get_cachesize(arg1);
08784
08785 if (!DB_RETOK_STD(errno)) {
08786 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08787 }
08788
08789 jresult = (jint)result;
08790 return jresult;
08791 }
08792
08793
08794 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1db(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08795 jlong jresult = 0 ;
08796 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08797 DB *result;
08798
08799 (void)jenv;
08800 (void)jcls;
08801 arg1 = *(struct DbSequence **)(void *)&jarg1;
08802
08803 if (jarg1 == 0) {
08804 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08805 return 0;
08806 }
08807
08808 errno = 0;
08809 result = (DB *)DbSequence_get_db(arg1);
08810
08811 if (!DB_RETOK_STD(errno)) {
08812 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08813 }
08814
08815 *(DB **)(void *)&jresult = result;
08816 return jresult;
08817 }
08818
08819
08820 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08821 jint jresult = 0 ;
08822 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08823 u_int32_t result;
08824
08825 (void)jenv;
08826 (void)jcls;
08827 arg1 = *(struct DbSequence **)(void *)&jarg1;
08828
08829 if (jarg1 == 0) {
08830 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08831 return 0;
08832 }
08833
08834 errno = 0;
08835 result = (u_int32_t)DbSequence_get_flags(arg1);
08836
08837 if (!DB_RETOK_STD(errno)) {
08838 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08839 }
08840
08841 jresult = (jint)result;
08842 return jresult;
08843 }
08844
08845
08846 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1key(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
08847 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08848 DBT *arg2 = (DBT *) 0 ;
08849 db_ret_t result;
08850 DBT_LOCKED ldbt2 ;
08851
08852 (void)jenv;
08853 (void)jcls;
08854 arg1 = *(struct DbSequence **)(void *)&jarg1;
08855
08856 if (__dbj_dbt_copyin(jenv, &ldbt2, &arg2, jarg2, 0) != 0) {
08857 return ;
08858 }
08859
08860 if (jarg1 == 0) {
08861 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08862 return ;
08863 }
08864
08865 result = (db_ret_t)DbSequence_get_key(arg1,arg2);
08866
08867 if (!DB_RETOK_STD(result)) {
08868 __dbj_throw(jenv, result, NULL, NULL, NULL);
08869 }
08870
08871 __dbj_dbt_release(jenv, jarg2, arg2, &ldbt2);
08872 }
08873
08874
08875 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1range_1min(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08876 jlong jresult = 0 ;
08877 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08878 db_seq_t result;
08879
08880 (void)jenv;
08881 (void)jcls;
08882 arg1 = *(struct DbSequence **)(void *)&jarg1;
08883
08884 if (jarg1 == 0) {
08885 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08886 return 0;
08887 }
08888
08889 errno = 0;
08890 result = (db_seq_t)DbSequence_get_range_min(arg1);
08891
08892 if (!DB_RETOK_STD(errno)) {
08893 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08894 }
08895
08896 jresult = (jlong)result;
08897 return jresult;
08898 }
08899
08900
08901 JNIEXPORT jlong JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1get_1range_1max(JNIEnv *jenv, jclass jcls, jlong jarg1) {
08902 jlong jresult = 0 ;
08903 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08904 db_seq_t result;
08905
08906 (void)jenv;
08907 (void)jcls;
08908 arg1 = *(struct DbSequence **)(void *)&jarg1;
08909
08910 if (jarg1 == 0) {
08911 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08912 return 0;
08913 }
08914
08915 errno = 0;
08916 result = (db_seq_t)DbSequence_get_range_max(arg1);
08917
08918 if (!DB_RETOK_STD(errno)) {
08919 __dbj_throw(jenv, errno, NULL, NULL, NULL);
08920 }
08921
08922 jresult = (jlong)result;
08923 return jresult;
08924 }
08925
08926
08927 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1initial_1value(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
08928 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08929 db_seq_t arg2 ;
08930 db_ret_t result;
08931
08932 (void)jenv;
08933 (void)jcls;
08934 arg1 = *(struct DbSequence **)(void *)&jarg1;
08935 arg2 = (db_seq_t)jarg2;
08936
08937 if (jarg1 == 0) {
08938 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08939 return ;
08940 }
08941
08942 result = (db_ret_t)DbSequence_initial_value(arg1,arg2);
08943
08944 if (!DB_RETOK_STD(result)) {
08945 __dbj_throw(jenv, result, NULL, NULL, NULL);
08946 }
08947
08948 }
08949
08950
08951 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1open(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg3, jint jarg4) {
08952 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08953 DB_TXN *arg2 = (DB_TXN *) 0 ;
08954 DBT *arg3 = (DBT *) 0 ;
08955 u_int32_t arg4 ;
08956 db_ret_t result;
08957 DBT_LOCKED ldbt3 ;
08958
08959 (void)jenv;
08960 (void)jcls;
08961 arg1 = *(struct DbSequence **)(void *)&jarg1;
08962 arg2 = *(DB_TXN **)(void *)&jarg2;
08963
08964 if (__dbj_dbt_copyin(jenv, &ldbt3, &arg3, jarg3, 0) != 0) {
08965 return ;
08966 }
08967 arg4 = (u_int32_t)jarg4;
08968
08969 if (jarg1 == 0) {
08970 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08971 return ;
08972 }
08973
08974 result = (db_ret_t)DbSequence_open(arg1,arg2,arg3,arg4);
08975
08976 if (!DB_RETOK_STD(result)) {
08977 __dbj_throw(jenv, result, NULL, NULL, NULL);
08978 }
08979
08980 __dbj_dbt_release(jenv, jarg3, arg3, &ldbt3);
08981 }
08982
08983
08984 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1remove0(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
08985 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
08986 DB_TXN *arg2 = (DB_TXN *) 0 ;
08987 u_int32_t arg3 ;
08988 db_ret_t result;
08989
08990 (void)jenv;
08991 (void)jcls;
08992 arg1 = *(struct DbSequence **)(void *)&jarg1;
08993 arg2 = *(DB_TXN **)(void *)&jarg2;
08994 arg3 = (u_int32_t)jarg3;
08995
08996 if (jarg1 == 0) {
08997 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
08998 return ;
08999 }
09000
09001 result = (db_ret_t)DbSequence_remove(arg1,arg2,arg3);
09002
09003 if (!DB_RETOK_STD(result)) {
09004 __dbj_throw(jenv, result, NULL, NULL, NULL);
09005 }
09006
09007 }
09008
09009
09010 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1set_1cachesize(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
09011 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
09012 int32_t arg2 ;
09013 db_ret_t result;
09014
09015 (void)jenv;
09016 (void)jcls;
09017 arg1 = *(struct DbSequence **)(void *)&jarg1;
09018 arg2 = (int32_t)jarg2;
09019
09020 if (jarg1 == 0) {
09021 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09022 return ;
09023 }
09024
09025 result = (db_ret_t)DbSequence_set_cachesize(arg1,arg2);
09026
09027 if (!DB_RETOK_STD(result)) {
09028 __dbj_throw(jenv, result, NULL, NULL, NULL);
09029 }
09030
09031 }
09032
09033
09034 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1set_1flags(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
09035 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
09036 u_int32_t arg2 ;
09037 db_ret_t result;
09038
09039 (void)jenv;
09040 (void)jcls;
09041 arg1 = *(struct DbSequence **)(void *)&jarg1;
09042 arg2 = (u_int32_t)jarg2;
09043
09044 if (jarg1 == 0) {
09045 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09046 return ;
09047 }
09048
09049 result = (db_ret_t)DbSequence_set_flags(arg1,arg2);
09050
09051 if (!DB_RETOK_STD(result)) {
09052 __dbj_throw(jenv, result, NULL, NULL, NULL);
09053 }
09054
09055 }
09056
09057
09058 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1set_1range(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3) {
09059 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
09060 db_seq_t arg2 ;
09061 db_seq_t arg3 ;
09062 db_ret_t result;
09063
09064 (void)jenv;
09065 (void)jcls;
09066 arg1 = *(struct DbSequence **)(void *)&jarg1;
09067 arg2 = (db_seq_t)jarg2;
09068 arg3 = (db_seq_t)jarg3;
09069
09070 if (jarg1 == 0) {
09071 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09072 return ;
09073 }
09074
09075 result = (db_ret_t)DbSequence_set_range(arg1,arg2,arg3);
09076
09077 if (!DB_RETOK_STD(result)) {
09078 __dbj_throw(jenv, result, NULL, NULL, NULL);
09079 }
09080
09081 }
09082
09083
09084 JNIEXPORT jobject JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbSequence_1stat(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
09085 jobject jresult = 0 ;
09086 struct DbSequence *arg1 = (struct DbSequence *) 0 ;
09087 u_int32_t arg2 ;
09088 DB_SEQUENCE_STAT *result;
09089
09090 (void)jenv;
09091 (void)jcls;
09092 arg1 = *(struct DbSequence **)(void *)&jarg1;
09093 arg2 = (u_int32_t)jarg2;
09094
09095 if (jarg1 == 0) {
09096 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09097 return 0;
09098 }
09099
09100 errno = 0;
09101 result = (DB_SEQUENCE_STAT *)DbSequence_stat(arg1,arg2);
09102
09103 if (!DB_RETOK_STD(errno)) {
09104 __dbj_throw(jenv, errno, NULL, NULL, NULL);
09105 }
09106
09107
09108 jresult = (*jenv)->NewObject(jenv, seq_stat_class, seq_stat_construct);
09109 if (jresult != NULL)
09110 __dbj_fill_seq_stat(jenv, jresult, result);
09111 __os_ufree(NULL, result);
09112
09113 return jresult;
09114 }
09115
09116
09117 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1abort0(JNIEnv *jenv, jclass jcls, jlong jarg1) {
09118 struct DbTxn *arg1 = (struct DbTxn *) 0 ;
09119 db_ret_t result;
09120
09121 (void)jenv;
09122 (void)jcls;
09123 arg1 = *(struct DbTxn **)(void *)&jarg1;
09124
09125 if (jarg1 == 0) {
09126 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09127 return ;
09128 }
09129
09130 result = (db_ret_t)DbTxn_abort(arg1);
09131
09132 if (!DB_RETOK_STD(result)) {
09133 __dbj_throw(jenv, result, NULL, NULL, NULL);
09134 }
09135
09136 }
09137
09138
09139 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1commit0(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
09140 struct DbTxn *arg1 = (struct DbTxn *) 0 ;
09141 u_int32_t arg2 ;
09142 db_ret_t result;
09143
09144 (void)jenv;
09145 (void)jcls;
09146 arg1 = *(struct DbTxn **)(void *)&jarg1;
09147 arg2 = (u_int32_t)jarg2;
09148
09149 if (jarg1 == 0) {
09150 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09151 return ;
09152 }
09153
09154 result = (db_ret_t)DbTxn_commit(arg1,arg2);
09155
09156 if (!DB_RETOK_STD(result)) {
09157 __dbj_throw(jenv, result, NULL, NULL, NULL);
09158 }
09159
09160 }
09161
09162
09163 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1discard0(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) {
09164 struct DbTxn *arg1 = (struct DbTxn *) 0 ;
09165 u_int32_t arg2 ;
09166 db_ret_t result;
09167
09168 (void)jenv;
09169 (void)jcls;
09170 arg1 = *(struct DbTxn **)(void *)&jarg1;
09171 arg2 = (u_int32_t)jarg2;
09172
09173 if (jarg1 == 0) {
09174 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09175 return ;
09176 }
09177
09178 result = (db_ret_t)DbTxn_discard(arg1,arg2);
09179
09180 if (!DB_RETOK_STD(result)) {
09181 __dbj_throw(jenv, result, NULL, NULL, NULL);
09182 }
09183
09184 }
09185
09186
09187 JNIEXPORT jstring JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1get_1name(JNIEnv *jenv, jclass jcls, jlong jarg1) {
09188 jstring jresult = 0 ;
09189 struct DbTxn *arg1 = (struct DbTxn *) 0 ;
09190 char *result;
09191
09192 (void)jenv;
09193 (void)jcls;
09194 arg1 = *(struct DbTxn **)(void *)&jarg1;
09195
09196 if (jarg1 == 0) {
09197 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09198 return 0;
09199 }
09200
09201 errno = 0;
09202 result = (char *)DbTxn_get_name(arg1);
09203
09204 if (!DB_RETOK_STD(errno)) {
09205 __dbj_throw(jenv, errno, NULL, NULL, TXN2JDBENV);
09206 }
09207
09208 {
09209 if(result) jresult = (*jenv)->NewStringUTF(jenv, result);
09210 }
09211 return jresult;
09212 }
09213
09214
09215 JNIEXPORT jint JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1id(JNIEnv *jenv, jclass jcls, jlong jarg1) {
09216 jint jresult = 0 ;
09217 struct DbTxn *arg1 = (struct DbTxn *) 0 ;
09218 u_int32_t result;
09219
09220 (void)jenv;
09221 (void)jcls;
09222 arg1 = *(struct DbTxn **)(void *)&jarg1;
09223
09224 if (jarg1 == 0) {
09225 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09226 return 0;
09227 }
09228 result = (u_int32_t)DbTxn_id(arg1);
09229
09230 jresult = (jint)result;
09231 return jresult;
09232 }
09233
09234
09235 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1prepare(JNIEnv *jenv, jclass jcls, jlong jarg1, jbyteArray jarg2) {
09236 struct DbTxn *arg1 = (struct DbTxn *) 0 ;
09237 u_int8_t *arg2 = (u_int8_t *) 0 ;
09238 db_ret_t result;
09239
09240 (void)jenv;
09241 (void)jcls;
09242 arg1 = *(struct DbTxn **)(void *)&jarg1;
09243
09244 arg2 = (u_int8_t *)(*jenv)->GetByteArrayElements(jenv, jarg2, NULL);
09245
09246
09247 if (jarg1 == 0) {
09248 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09249 return ;
09250 }
09251
09252 if ((*jenv)->GetArrayLength(jenv, jarg2) < DB_XIDDATASIZE) {
09253 __dbj_throw(jenv, EINVAL,
09254 "DbTxn.prepare gid array must be >= 128 bytes", NULL,
09255 TXN2JDBENV);
09256 return ;
09257 }
09258
09259
09260 result = (db_ret_t)DbTxn_prepare(arg1,arg2);
09261
09262 if (!DB_RETOK_STD(result)) {
09263 __dbj_throw(jenv, result, NULL, NULL, TXN2JDBENV);
09264 }
09265
09266
09267 (*jenv)->ReleaseByteArrayElements(jenv, jarg2, (jbyte *)arg2, 0);
09268
09269 }
09270
09271
09272 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1set_1timeout(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jint jarg3) {
09273 struct DbTxn *arg1 = (struct DbTxn *) 0 ;
09274 db_timeout_t arg2 ;
09275 u_int32_t arg3 ;
09276 db_ret_t result;
09277
09278 (void)jenv;
09279 (void)jcls;
09280 arg1 = *(struct DbTxn **)(void *)&jarg1;
09281 arg2 = (db_timeout_t)jarg2;
09282 arg3 = (u_int32_t)jarg3;
09283
09284 if (jarg1 == 0) {
09285 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09286 return ;
09287 }
09288
09289 result = (db_ret_t)DbTxn_set_timeout(arg1,arg2,arg3);
09290
09291 if (!DB_RETOK_STD(result)) {
09292 __dbj_throw(jenv, result, NULL, NULL, TXN2JDBENV);
09293 }
09294
09295 }
09296
09297
09298 JNIEXPORT void JNICALL Java_com_sleepycat_db_internal_db_1javaJNI_DbTxn_1set_1name(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
09299 struct DbTxn *arg1 = (struct DbTxn *) 0 ;
09300 char *arg2 = (char *) 0 ;
09301 db_ret_t result;
09302
09303 (void)jenv;
09304 (void)jcls;
09305 arg1 = *(struct DbTxn **)(void *)&jarg1;
09306 {
09307 arg2 = 0;
09308 if (jarg2) {
09309 arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
09310 if (!arg2) return ;
09311 }
09312 }
09313
09314 if (jarg1 == 0) {
09315 __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
09316 return ;
09317 }
09318
09319 result = (db_ret_t)DbTxn_set_name(arg1,(char const *)arg2);
09320
09321 if (!DB_RETOK_STD(result)) {
09322 __dbj_throw(jenv, result, NULL, NULL, TXN2JDBENV);
09323 }
09324
09325 {
09326 if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, arg2);
09327 }
09328 }
09329
09330
09331 #ifdef __cplusplus
09332 }
09333 #endif
09334