Lines Matching refs:data
79 __bam_iitem(dbc, hp, indxp, key, data, op, flags)
83 DBT *key, *data;
134 if ((ret = __db_dput(dbc, data, hp, indxp, __bam_new)) != 0)
141 if (F_ISSET(dbp, DB_RE_FIXEDLEN) && data->size != t->recno->re_len) {
142 tdbt = *data;
145 data = &tdbt;
149 * Figure out how much space the data will take, including if it's a
150 * partial record. If either of the key or data items won't fit on
154 data_size = F_ISSET(data, DB_DBT_PARTIAL) ?
155 __bam_partsize(data, h, indx) : data->size;
160 /* If BI_NEWKEY is set we're adding a new key and data pair. */
171 * We're either overwriting the data item of a key/data pair
172 * or we're adding the data item only, i.e. a new duplicate.
208 if (F_ISSET(data, DB_DBT_PARTIAL)) {
209 tdbt = *data;
213 data = &tdbt;
219 * 1. Append a new key/data pair.
220 * 2. Insert a new key/data pair.
221 * 3. Append a new data item (a new duplicate).
222 * 4. Insert a new data item (a new duplicate).
223 * 5. Overflow item: delete and re-add the data item.
224 * 6. Replace the data item.
228 case DB_AFTER: /* 1. Append a new key/data pair. */
232 case DB_BEFORE: /* 2. Insert a new key/data pair. */
249 case DB_AFTER: /* 3. Append a new data item. */
270 case DB_BEFORE: /* 4. Insert a new data item. */
290 * 5. Delete/re-add the data item.
301 /* 6. Replace the data item. */
309 /* Add the data. */
311 if ((ret = __bam_ovput(dbc, h, indx, data)) != 0)
319 __bk.len = data->size;
320 __hdr.data = &__bk;
321 __hdr.size = SSZA(BKEYDATA, data);
323 BKEYDATA_SIZE(data->size), &__hdr, data);
325 ret = __bam_ritem(dbc, h, indx, data);
328 BKEYDATA_SIZE(data->size), NULL, data);
369 * Figure out how much space a partial data item is in total.
372 __bam_partsize(data, h, indx)
373 DBT *data;
382 * already exist, it's simply the data we're provided.
385 return (data->doff + data->size);
388 * Otherwise, it's the data provided plus any already existing data
409 if (nbytes < data->doff + data->dlen) /* Case 1 */
410 return (data->doff + data->size);
412 return (nbytes + data->size - data->dlen); /* Case 2 */
423 __hdr.data = &bo; \
463 __bam_ritem(dbc, h, indx, data)
467 DBT *data;
489 * We might as well check to see if the two data items share
493 min = data->size < bk->len ? data->size : bk->len;
495 p = bk->data, t = data->data;
501 p = (u_int8_t *)bk->data + bk->len - 1,
502 t = (u_int8_t *)data->data + data->size - 1;
507 orig.data = (u_int8_t *)bk->data + prefix;
509 repl.data = (u_int8_t *)data->data + prefix;
510 repl.size = data->size - (prefix + suffix);
526 * If the entry is growing in size, shift the beginning of the data
528 * the beginning of the data part of the page up. Use memmove(3),
532 ln = BKEYDATA_SIZE(data->size);
555 bk->len = data->size;
556 memcpy(bk->data, data->data, data->size);
609 * key of the first duplicate key/data pair, cnt is the number of pairs
616 hdr.data = bk;
632 /* Delete the data item. */
643 /* Put in a new data item that points to the duplicates page. */
683 * short. Pad it out. We use the record data return memory, it's
687 if ((ret = __os_realloc(&dbc->rdata.data, rp->re_len)) != 0) {
689 dbc->rdata.data = NULL;
694 memcpy(dbc->rdata.data, dbt->data, dbt->size);
695 memset((u_int8_t *)dbc->rdata.data + dbt->size,
734 /* We use the record data return memory, it's only a short-term use. */
736 if ((ret = __os_realloc(&dbc->rdata.data, nbytes)) != 0) {
738 dbc->rdata.data = NULL;
748 memset(dbc->rdata.data, 0, nbytes);
752 * to the place at which to copy the user's data, b) set tlen to the
754 * the user, and c) copy any valid data from an existing record.
758 p = (u_int8_t *)dbc->rdata.data + dbt->doff;
778 bo->pgno, &dbc->rdata.data, &dbc->rdata.ulen)) != 0)
781 /* Skip any leading data from the original record. */
783 p = (u_int8_t *)dbc->rdata.data + dbt->doff;
786 * Copy in any trailing data from the original record.
789 * plus the bytes being deleted, there is trailing data in the
803 /* Copy in any leading data from the original record. */
804 memcpy(dbc->rdata.data,
805 bk->data, dbt->doff > bk->len ? bk->len : dbt->doff);
807 p = (u_int8_t *)dbc->rdata.data + dbt->doff;
809 /* Copy in any trailing data from the original record. */
812 memcpy(p + dbt->size, bk->data + len, bk->len - len);
818 * Copy in the application provided data -- p and tlen must have been
821 memcpy(p, dbt->data, dbt->size);