Mercurial > vim
comparison src/hardcopy.c @ 27490:fb4c30606b4a v8.2.4273
patch 8.2.4273: the EBCDIC support is outdated
Commit: https://github.com/vim/vim/commit/424bcae1fb0f69e0aef5e0cf84fd771cf34a0fb7
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 31 14:59:41 2022 +0000
patch 8.2.4273: the EBCDIC support is outdated
Problem: The EBCDIC support is outdated.
Solution: Remove the EBCDIC support.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 31 Jan 2022 16:00:09 +0100 |
parents | c7f614c9ceb3 |
children | 60977de70684 |
comparison
equal
deleted
inserted
replaced
27489:9f00e1edb43c | 27490:fb4c30606b4a |
---|---|
1417 } | 1417 } |
1418 | 1418 |
1419 static void | 1419 static void |
1420 prt_write_file_len(char_u *buffer, int bytes) | 1420 prt_write_file_len(char_u *buffer, int bytes) |
1421 { | 1421 { |
1422 #ifdef EBCDIC | |
1423 ebcdic2ascii(buffer, bytes); | |
1424 #endif | |
1425 prt_write_file_raw_len(buffer, bytes); | 1422 prt_write_file_raw_len(buffer, bytes); |
1426 } | 1423 } |
1427 | 1424 |
1428 /* | 1425 /* |
1429 * Write a string. | 1426 * Write a string. |
1624 // Underline length of text run | 1621 // Underline length of text run |
1625 prt_write_real(prt_text_run, 2); | 1622 prt_write_real(prt_text_run, 2); |
1626 prt_write_string("ul\n"); | 1623 prt_write_string("ul\n"); |
1627 } | 1624 } |
1628 // Draw the text | 1625 // Draw the text |
1629 // Note: we write text out raw - EBCDIC conversion is handled in the | |
1630 // PostScript world via the font encoding vector. | |
1631 if (prt_out_mbyte) | 1626 if (prt_out_mbyte) |
1632 prt_write_string("<"); | 1627 prt_write_string("<"); |
1633 else | 1628 else |
1634 prt_write_string("("); | 1629 prt_write_string("("); |
1635 prt_write_file_raw_len(prt_ps_buffer.ga_data, prt_ps_buffer.ga_len); | 1630 prt_write_file_raw_len(prt_ps_buffer.ga_data, prt_ps_buffer.ga_len); |
3117 | 3112 |
3118 prt_dsc_noarg("EOF"); | 3113 prt_dsc_noarg("EOF"); |
3119 | 3114 |
3120 // Write CTRL-D to close serial communication link if used. | 3115 // Write CTRL-D to close serial communication link if used. |
3121 // NOTHING MUST BE WRITTEN AFTER THIS! | 3116 // NOTHING MUST BE WRITTEN AFTER THIS! |
3122 prt_write_file((char_u *)IF_EB("\004", "\067")); | 3117 prt_write_file((char_u *)"\004"); |
3123 | 3118 |
3124 if (!prt_file_error && psettings->outfile == NULL | 3119 if (!prt_file_error && psettings->outfile == NULL |
3125 && !got_int && !psettings->user_abort) | 3120 && !got_int && !psettings->user_abort) |
3126 { | 3121 { |
3127 // Close the file first. | 3122 // Close the file first. |
3377 ch = *p; | 3372 ch = *p; |
3378 if (ch < 32 || ch == '(' || ch == ')' || ch == '\\') | 3373 if (ch < 32 || ch == '(' || ch == ')' || ch == '\\') |
3379 { | 3374 { |
3380 // Convert non-printing characters to either their escape or octal | 3375 // Convert non-printing characters to either their escape or octal |
3381 // sequence, ensures PS sent over a serial line does not interfere | 3376 // sequence, ensures PS sent over a serial line does not interfere |
3382 // with the comms protocol. Note: For EBCDIC we need to write out | 3377 // with the comms protocol. |
3383 // the escape sequences as ASCII codes! | 3378 ga_append(&prt_ps_buffer, '\\'); |
3384 // Note 2: Char codes < 32 are identical in EBCDIC and ASCII AFAIK! | |
3385 ga_append(&prt_ps_buffer, IF_EB('\\', 0134)); | |
3386 switch (ch) | 3379 switch (ch) |
3387 { | 3380 { |
3388 case BS: ga_append(&prt_ps_buffer, IF_EB('b', 0142)); break; | 3381 case BS: ga_append(&prt_ps_buffer, 'b'); break; |
3389 case TAB: ga_append(&prt_ps_buffer, IF_EB('t', 0164)); break; | 3382 case TAB: ga_append(&prt_ps_buffer, 't'); break; |
3390 case NL: ga_append(&prt_ps_buffer, IF_EB('n', 0156)); break; | 3383 case NL: ga_append(&prt_ps_buffer, 'n'); break; |
3391 case FF: ga_append(&prt_ps_buffer, IF_EB('f', 0146)); break; | 3384 case FF: ga_append(&prt_ps_buffer, 'f'); break; |
3392 case CAR: ga_append(&prt_ps_buffer, IF_EB('r', 0162)); break; | 3385 case CAR: ga_append(&prt_ps_buffer, 'r'); break; |
3393 case '(': ga_append(&prt_ps_buffer, IF_EB('(', 0050)); break; | 3386 case '(': ga_append(&prt_ps_buffer, '('); break; |
3394 case ')': ga_append(&prt_ps_buffer, IF_EB(')', 0051)); break; | 3387 case ')': ga_append(&prt_ps_buffer, ')'); break; |
3395 case '\\': ga_append(&prt_ps_buffer, IF_EB('\\', 0134)); break; | 3388 case '\\': ga_append(&prt_ps_buffer, '\\'); break; |
3396 | 3389 |
3397 default: | 3390 default: |
3398 sprintf((char *)ch_buff, "%03o", (unsigned int)ch); | 3391 sprintf((char *)ch_buff, "%03o", (unsigned int)ch); |
3399 #ifdef EBCDIC | |
3400 ebcdic2ascii(ch_buff, 3); | |
3401 #endif | |
3402 ga_append(&prt_ps_buffer, ch_buff[0]); | 3392 ga_append(&prt_ps_buffer, ch_buff[0]); |
3403 ga_append(&prt_ps_buffer, ch_buff[1]); | 3393 ga_append(&prt_ps_buffer, ch_buff[1]); |
3404 ga_append(&prt_ps_buffer, ch_buff[2]); | 3394 ga_append(&prt_ps_buffer, ch_buff[2]); |
3405 break; | 3395 break; |
3406 } | 3396 } |