| 547 | |
| 548 | |
| 549 | void BLB_gen_bpb(SSHORT source, SSHORT target, UCHAR sourceCharset, UCHAR targetCharset, UCharBuffer& bpb) |
| 550 | { |
| 551 | bpb.resize(15); |
| 552 | |
| 553 | UCHAR* p = bpb.begin(); |
| 554 | *p++ = isc_bpb_version1; |
| 555 | |
| 556 | *p++ = isc_bpb_source_type; |
| 557 | *p++ = 2; |
| 558 | put_vax_short(p, source); |
| 559 | p += 2; |
| 560 | if (source == isc_blob_text) |
| 561 | { |
| 562 | *p++ = isc_bpb_source_interp; |
| 563 | *p++ = 1; |
| 564 | *p++ = sourceCharset; |
| 565 | } |
| 566 | |
| 567 | *p++ = isc_bpb_target_type; |
| 568 | *p++ = 2; |
| 569 | put_vax_short(p, target); |
| 570 | p += 2; |
| 571 | if (target == isc_blob_text) |
| 572 | { |
| 573 | *p++ = isc_bpb_target_interp; |
| 574 | *p++ = 1; |
| 575 | *p++ = targetCharset; |
| 576 | } |
| 577 | fb_assert(static_cast<size_t>(p - bpb.begin()) <= bpb.getCount()); |
| 578 | |
| 579 | // set the array count to the number of bytes we used |
| 580 | bpb.shrink(p - bpb.begin()); |
| 581 | } |
| 582 | |
| 583 | |
| 584 | void BLB_gen_bpb_from_descs(const dsc* fromDesc, const dsc* toDesc, UCharBuffer& bpb) |
no test coverage detected