| 3679 | // |
| 3680 | |
| 3681 | static void gen_tpb(const tpb* tpb_buffer) |
| 3682 | { |
| 3683 | int length = 1; |
| 3684 | ULONG ltemp = 0; |
| 3685 | int offset = 24; |
| 3686 | int text_len = tpb_buffer->tpb_length; |
| 3687 | const UCHAR *text = tpb_buffer->tpb_string; |
| 3688 | |
| 3689 | // Generate the 01 group level |
| 3690 | printa(COLUMN8, false, "01 %s%d.", names[isc_tpb_pos], tpb_buffer->tpb_ident); |
| 3691 | // Dump TPB to WORKING-STORAGE in 4 byte chunks |
| 3692 | while (text_len--) |
| 3693 | { |
| 3694 | ltemp += *(text++) << offset; |
| 3695 | offset -= 8; |
| 3696 | if (offset < 0) |
| 3697 | { |
| 3698 | printa(COLUMN12, false, |
| 3699 | RAW_TPB_TEMPLATE, |
| 3700 | names[isc_tpb_pos], |
| 3701 | tpb_buffer->tpb_ident, |
| 3702 | names[UNDER], |
| 3703 | length++, |
| 3704 | ltemp); |
| 3705 | ltemp = 0; |
| 3706 | offset = 24; |
| 3707 | } |
| 3708 | } |
| 3709 | // Dump last 4 bytes, if necessary |
| 3710 | if (offset < 24) |
| 3711 | printa(COLUMN12, false, |
| 3712 | RAW_TPB_TEMPLATE, |
| 3713 | names[isc_tpb_pos], |
| 3714 | tpb_buffer->tpb_ident, |
| 3715 | names[UNDER], |
| 3716 | length++, |
| 3717 | ltemp); |
| 3718 | sprintf(output_buffer, "%sEnd of data for %s%d\n", |
| 3719 | names[COMMENT], names[isc_tpb_pos], tpb_buffer->tpb_ident); |
| 3720 | RMC_print_buffer(output_buffer, false); |
| 3721 | } |
| 3722 | |
| 3723 | |
| 3724 | //____________________________________________________________ |
no test coverage detected