Lines Matching refs:ldbt
47 DBT_LOCKED *ldbt = dbt->app_data;
48 JNIEnv *jenv = ldbt->jenv;
71 (*jenv)->GetByteArrayRegion(jenv, ldbt->jarr, ldbt->offset +
79 if (offset == 0 && (!ldbt->reuse ||
80 (jsize)(ldbt->offset + dbt->size) > ldbt->array_len)) {
81 if (ldbt->jarr != NULL)
82 (*jenv)->DeleteLocalRef(jenv, ldbt->jarr);
83 ldbt->jarr = (*jenv)->NewByteArray(jenv, (jsize)dbt->size);
84 if (ldbt->jarr == NULL)
86 (*jenv)->SetObjectField(jenv, ldbt->jdbt, dbt_data_fid, ldbt->jarr);
88 ldbt->offset = 0;
90 (*jenv)->SetByteArrayRegion(jenv, ldbt->jarr, ldbt->offset +
117 JNIEnv *jenv, DBT_LOCKED *ldbt, DBT **dbtp, jobject jdbt, int allow_null)
122 memset(ldbt, 0, sizeof (*ldbt));
123 ldbt->jenv = jenv;
124 ldbt->jdbt = jdbt;
136 dbt = &ldbt->dbt;
140 ldbt->jdata_nio = (*jenv)->GetObjectField(jenv, jdbt, dbt_data_nio_fid);
141 if (ldbt->jdata_nio != NULL)
144 ldbt->jarr = (jbyteArray)(*jenv)->GetObjectField(jenv, jdbt, dbt_data_fid);
145 ldbt->offset = (*jenv)->GetIntField(jenv, jdbt, dbt_offset_fid);
147 ldbt->orig_size = dbt->size;
166 ldbt->reuse = !F_ISSET(dbt, DB_DBT_MALLOC);
171 if (ldbt->jdata_nio != NULL) {
173 ldbt->jdata_nio);
178 ldbt->array_len = (u_int32_t)capacity;
179 } else if (ldbt->jarr == NULL) {
189 ldbt->array_len = ldbt->offset = dbt->size = dbt->ulen = 0;
191 ldbt->array_len = (*jenv)->GetArrayLength(jenv, ldbt->jarr);
194 if (ldbt->offset < 0)
202 if ((jsize)(ldbt->offset + dbt->ulen) > ldbt->array_len)
208 if (ldbt->jdata_nio) {
210 ldbt->jdata_nio);
211 dbt->data = (u_int8_t *)dbt->data + ldbt->offset;
213 if (ldbt->jarr != NULL &&
215 ldbt->jarr, NULL)) == NULL)
217 dbt->data = (u_int8_t *)dbt->data + ldbt->offset;
220 dbt->app_data = ldbt;
226 JNIEnv *jenv, jobject jdbt, DBT *dbt, DBT_LOCKED *ldbt) {
232 if (dbt->size != ldbt->orig_size)
236 if (ldbt->jarr != NULL)
237 (*jenv)->ReleaseByteArrayElements(jenv, ldbt->jarr,
238 (jbyte *)dbt->data - ldbt->offset, 0);
255 %typemap(in) DBT * (DBT_LOCKED ldbt) %{
256 if (__dbj_dbt_copyin(jenv, &ldbt, &$1, $input, 0) != 0) {
261 %typemap(in) DBT *data_or_null (DBT_LOCKED ldbt) %{
262 if (__dbj_dbt_copyin(jenv, &ldbt, &$1, $input, 1) != 0) {
268 %typemap(freearg) DBT * %{ __dbj_dbt_release(jenv, $input, $1, &ldbt$argnum); %}