Mercurial > vim
comparison src/hardcopy.c @ 15470:55ccc2d353bd v8.1.0743
patch 8.1.0743: giving error messages is not flexible
commit https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 13 23:38:42 2019 +0100
patch 8.1.0743: giving error messages is not flexible
Problem: Giving error messages is not flexible.
Solution: Add semsg(). Change argument from "char_u *" to "char *", also
for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 13 Jan 2019 23:45:08 +0100 |
parents | 27b9a84395b5 |
children | dd725a8ab112 |
comparison
equal
deleted
inserted
replaced
15469:bc9b5261ed01 | 15470:55ccc2d353bd |
---|---|
133 linenr_T file_line; /* line nr in the buffer */ | 133 linenr_T file_line; /* line nr in the buffer */ |
134 long_u bytes_printed; /* bytes printed so far */ | 134 long_u bytes_printed; /* bytes printed so far */ |
135 int ff; /* seen form feed character */ | 135 int ff; /* seen form feed character */ |
136 } prt_pos_T; | 136 } prt_pos_T; |
137 | 137 |
138 static char_u *parse_list_options(char_u *option_str, option_table_T *table, int table_size); | 138 static char *parse_list_options(char_u *option_str, option_table_T *table, int table_size); |
139 | 139 |
140 static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T *ppos); | 140 static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T *ppos); |
141 | 141 |
142 /* | 142 /* |
143 * Parse 'printoptions' and set the flags in "printer_opts". | 143 * Parse 'printoptions' and set the flags in "printer_opts". |
144 * Returns an error message or NULL; | 144 * Returns an error message or NULL; |
145 */ | 145 */ |
146 char_u * | 146 char * |
147 parse_printoptions(void) | 147 parse_printoptions(void) |
148 { | 148 { |
149 return parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS); | 149 return parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS); |
150 } | 150 } |
151 | 151 |
152 #if (defined(FEAT_MBYTE) && defined(FEAT_POSTSCRIPT)) || defined(PROTO) | 152 #if (defined(FEAT_MBYTE) && defined(FEAT_POSTSCRIPT)) || defined(PROTO) |
153 /* | 153 /* |
154 * Parse 'printmbfont' and set the flags in "mbfont_opts". | 154 * Parse 'printmbfont' and set the flags in "mbfont_opts". |
155 * Returns an error message or NULL; | 155 * Returns an error message or NULL; |
156 */ | 156 */ |
157 char_u * | 157 char * |
158 parse_printmbfont(void) | 158 parse_printmbfont(void) |
159 { | 159 { |
160 return parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS); | 160 return parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS); |
161 } | 161 } |
162 #endif | 162 #endif |
168 * "value" can start with a number which is parsed out, e.g. margin:12mm | 168 * "value" can start with a number which is parsed out, e.g. margin:12mm |
169 * | 169 * |
170 * Returns an error message for an illegal option, NULL otherwise. | 170 * Returns an error message for an illegal option, NULL otherwise. |
171 * Only used for the printer at the moment... | 171 * Only used for the printer at the moment... |
172 */ | 172 */ |
173 static char_u * | 173 static char * |
174 parse_list_options( | 174 parse_list_options( |
175 char_u *option_str, | 175 char_u *option_str, |
176 option_table_T *table, | 176 option_table_T *table, |
177 int table_size) | 177 int table_size) |
178 { | 178 { |
179 option_table_T *old_opts; | 179 option_table_T *old_opts; |
180 char_u *ret = NULL; | 180 char *ret = NULL; |
181 char_u *stringp; | 181 char_u *stringp; |
182 char_u *colonp; | 182 char_u *colonp; |
183 char_u *commap; | 183 char_u *commap; |
184 char_u *p; | 184 char_u *p; |
185 int idx = 0; /* init for GCC */ | 185 int idx = 0; /* init for GCC */ |
203 while (*stringp) | 203 while (*stringp) |
204 { | 204 { |
205 colonp = vim_strchr(stringp, ':'); | 205 colonp = vim_strchr(stringp, ':'); |
206 if (colonp == NULL) | 206 if (colonp == NULL) |
207 { | 207 { |
208 ret = (char_u *)N_("E550: Missing colon"); | 208 ret = N_("E550: Missing colon"); |
209 break; | 209 break; |
210 } | 210 } |
211 commap = vim_strchr(stringp, ','); | 211 commap = vim_strchr(stringp, ','); |
212 if (commap == NULL) | 212 if (commap == NULL) |
213 commap = option_str + STRLEN(option_str); | 213 commap = option_str + STRLEN(option_str); |
218 if (STRNICMP(stringp, table[idx].name, len) == 0) | 218 if (STRNICMP(stringp, table[idx].name, len) == 0) |
219 break; | 219 break; |
220 | 220 |
221 if (idx == table_size) | 221 if (idx == table_size) |
222 { | 222 { |
223 ret = (char_u *)N_("E551: Illegal component"); | 223 ret = N_("E551: Illegal component"); |
224 break; | 224 break; |
225 } | 225 } |
226 p = colonp + 1; | 226 p = colonp + 1; |
227 table[idx].present = TRUE; | 227 table[idx].present = TRUE; |
228 | 228 |
229 if (table[idx].hasnum) | 229 if (table[idx].hasnum) |
230 { | 230 { |
231 if (!VIM_ISDIGIT(*p)) | 231 if (!VIM_ISDIGIT(*p)) |
232 { | 232 { |
233 ret = (char_u *)N_("E552: digit expected"); | 233 ret = N_("E552: digit expected"); |
234 break; | 234 break; |
235 } | 235 } |
236 | 236 |
237 table[idx].number = getdigits(&p); /*advances p*/ | 237 table[idx].number = getdigits(&p); /*advances p*/ |
238 } | 238 } |
574 settings.has_color = TRUE; | 574 settings.has_color = TRUE; |
575 | 575 |
576 # ifdef FEAT_POSTSCRIPT | 576 # ifdef FEAT_POSTSCRIPT |
577 if (*eap->arg == '>') | 577 if (*eap->arg == '>') |
578 { | 578 { |
579 char_u *errormsg = NULL; | 579 char *errormsg = NULL; |
580 | 580 |
581 /* Expand things like "%.ps". */ | 581 /* Expand things like "%.ps". */ |
582 if (expand_filename(eap, eap->cmdlinep, &errormsg) == FAIL) | 582 if (expand_filename(eap, eap->cmdlinep, &errormsg) == FAIL) |
583 { | 583 { |
584 if (errormsg != NULL) | 584 if (errormsg != NULL) |
585 EMSG(errormsg); | 585 emsg(errormsg); |
586 return; | 586 return; |
587 } | 587 } |
588 settings.outfile = skipwhite(eap->arg + 1); | 588 settings.outfile = skipwhite(eap->arg + 1); |
589 } | 589 } |
590 else if (*eap->arg != NUL) | 590 else if (*eap->arg != NUL) |
1429 { | 1429 { |
1430 if (!prt_file_error | 1430 if (!prt_file_error |
1431 && fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd) | 1431 && fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd) |
1432 != (size_t)bytes) | 1432 != (size_t)bytes) |
1433 { | 1433 { |
1434 EMSG(_("E455: Error writing to PostScript output file")); | 1434 emsg(_("E455: Error writing to PostScript output file")); |
1435 prt_file_error = TRUE; | 1435 prt_file_error = TRUE; |
1436 } | 1436 } |
1437 } | 1437 } |
1438 | 1438 |
1439 static void | 1439 static void |
1871 struct prt_dsc_line_S dsc_line; | 1871 struct prt_dsc_line_S dsc_line; |
1872 | 1872 |
1873 fd_resource = mch_fopen((char *)resource->filename, READBIN); | 1873 fd_resource = mch_fopen((char *)resource->filename, READBIN); |
1874 if (fd_resource == NULL) | 1874 if (fd_resource == NULL) |
1875 { | 1875 { |
1876 EMSG2(_("E624: Can't open file \"%s\""), resource->filename); | 1876 semsg(_("E624: Can't open file \"%s\""), resource->filename); |
1877 return FALSE; | 1877 return FALSE; |
1878 } | 1878 } |
1879 vim_memset(prt_resfile.buffer, NUL, PRT_FILE_BUFFER_LEN); | 1879 vim_memset(prt_resfile.buffer, NUL, PRT_FILE_BUFFER_LEN); |
1880 | 1880 |
1881 /* Parse first line to ensure valid resource file */ | 1881 /* Parse first line to ensure valid resource file */ |
1882 prt_resfile.len = (int)fread((char *)prt_resfile.buffer, sizeof(char_u), | 1882 prt_resfile.len = (int)fread((char *)prt_resfile.buffer, sizeof(char_u), |
1883 PRT_FILE_BUFFER_LEN, fd_resource); | 1883 PRT_FILE_BUFFER_LEN, fd_resource); |
1884 if (ferror(fd_resource)) | 1884 if (ferror(fd_resource)) |
1885 { | 1885 { |
1886 EMSG2(_("E457: Can't read PostScript resource file \"%s\""), | 1886 semsg(_("E457: Can't read PostScript resource file \"%s\""), |
1887 resource->filename); | 1887 resource->filename); |
1888 fclose(fd_resource); | 1888 fclose(fd_resource); |
1889 return FALSE; | 1889 return FALSE; |
1890 } | 1890 } |
1891 fclose(fd_resource); | 1891 fclose(fd_resource); |
1898 offset = 0; | 1898 offset = 0; |
1899 | 1899 |
1900 if (prt_resfile_strncmp(offset, PRT_RESOURCE_HEADER, | 1900 if (prt_resfile_strncmp(offset, PRT_RESOURCE_HEADER, |
1901 (int)STRLEN(PRT_RESOURCE_HEADER)) != 0) | 1901 (int)STRLEN(PRT_RESOURCE_HEADER)) != 0) |
1902 { | 1902 { |
1903 EMSG2(_("E618: file \"%s\" is not a PostScript resource file"), | 1903 semsg(_("E618: file \"%s\" is not a PostScript resource file"), |
1904 resource->filename); | 1904 resource->filename); |
1905 return FALSE; | 1905 return FALSE; |
1906 } | 1906 } |
1907 | 1907 |
1908 /* Skip over any version numbers and following ws */ | 1908 /* Skip over any version numbers and following ws */ |
1915 return FALSE; | 1915 return FALSE; |
1916 | 1916 |
1917 if (prt_resfile_strncmp(offset, PRT_RESOURCE_RESOURCE, | 1917 if (prt_resfile_strncmp(offset, PRT_RESOURCE_RESOURCE, |
1918 (int)STRLEN(PRT_RESOURCE_RESOURCE)) != 0) | 1918 (int)STRLEN(PRT_RESOURCE_RESOURCE)) != 0) |
1919 { | 1919 { |
1920 EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"), | 1920 semsg(_("E619: file \"%s\" is not a supported PostScript resource file"), |
1921 resource->filename); | 1921 resource->filename); |
1922 return FALSE; | 1922 return FALSE; |
1923 } | 1923 } |
1924 offset += (int)STRLEN(PRT_RESOURCE_RESOURCE); | 1924 offset += (int)STRLEN(PRT_RESOURCE_RESOURCE); |
1925 | 1925 |
1933 else if (prt_resfile_strncmp(offset, PRT_RESOURCE_CMAP, | 1933 else if (prt_resfile_strncmp(offset, PRT_RESOURCE_CMAP, |
1934 (int)STRLEN(PRT_RESOURCE_CMAP)) == 0) | 1934 (int)STRLEN(PRT_RESOURCE_CMAP)) == 0) |
1935 resource->type = PRT_RESOURCE_TYPE_CMAP; | 1935 resource->type = PRT_RESOURCE_TYPE_CMAP; |
1936 else | 1936 else |
1937 { | 1937 { |
1938 EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"), | 1938 semsg(_("E619: file \"%s\" is not a supported PostScript resource file"), |
1939 resource->filename); | 1939 resource->filename); |
1940 return FALSE; | 1940 return FALSE; |
1941 } | 1941 } |
1942 | 1942 |
1943 /* Look for title and version of resource */ | 1943 /* Look for title and version of resource */ |
1975 } | 1975 } |
1976 } | 1976 } |
1977 | 1977 |
1978 if (!seen_title || !seen_version) | 1978 if (!seen_title || !seen_version) |
1979 { | 1979 { |
1980 EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"), | 1980 semsg(_("E619: file \"%s\" is not a supported PostScript resource file"), |
1981 resource->filename); | 1981 resource->filename); |
1982 return FALSE; | 1982 return FALSE; |
1983 } | 1983 } |
1984 | 1984 |
1985 return TRUE; | 1985 return TRUE; |
1989 prt_check_resource(struct prt_ps_resource_S *resource, char_u *version) | 1989 prt_check_resource(struct prt_ps_resource_S *resource, char_u *version) |
1990 { | 1990 { |
1991 /* Version number m.n should match, the revision number does not matter */ | 1991 /* Version number m.n should match, the revision number does not matter */ |
1992 if (STRNCMP(resource->version, version, STRLEN(version))) | 1992 if (STRNCMP(resource->version, version, STRLEN(version))) |
1993 { | 1993 { |
1994 EMSG2(_("E621: \"%s\" resource file has wrong version"), | 1994 semsg(_("E621: \"%s\" resource file has wrong version"), |
1995 resource->name); | 1995 resource->name); |
1996 return FALSE; | 1996 return FALSE; |
1997 } | 1997 } |
1998 | 1998 |
1999 /* Other checks to be added as needed */ | 1999 /* Other checks to be added as needed */ |
2463 if (!prt_custom_cmap) | 2463 if (!prt_custom_cmap) |
2464 { | 2464 { |
2465 /* Check encoding and character set are compatible */ | 2465 /* Check encoding and character set are compatible */ |
2466 if ((p_mbenc->needs_charset & p_mbchar->has_charset) == 0) | 2466 if ((p_mbenc->needs_charset & p_mbchar->has_charset) == 0) |
2467 { | 2467 { |
2468 EMSG(_("E673: Incompatible multi-byte encoding and character set.")); | 2468 emsg(_("E673: Incompatible multi-byte encoding and character set.")); |
2469 return FALSE; | 2469 return FALSE; |
2470 } | 2470 } |
2471 | 2471 |
2472 /* Add charset name if not empty */ | 2472 /* Add charset name if not empty */ |
2473 if (p_mbchar->cmap_charset != NULL) | 2473 if (p_mbchar->cmap_charset != NULL) |
2480 else | 2480 else |
2481 { | 2481 { |
2482 /* Add custom CMap character set name */ | 2482 /* Add custom CMap character set name */ |
2483 if (*p_pmcs == NUL) | 2483 if (*p_pmcs == NUL) |
2484 { | 2484 { |
2485 EMSG(_("E674: printmbcharset cannot be empty with multi-byte encoding.")); | 2485 emsg(_("E674: printmbcharset cannot be empty with multi-byte encoding.")); |
2486 return FALSE; | 2486 return FALSE; |
2487 } | 2487 } |
2488 vim_strncpy((char_u *)prt_cmap, p_pmcs, sizeof(prt_cmap) - 3); | 2488 vim_strncpy((char_u *)prt_cmap, p_pmcs, sizeof(prt_cmap) - 3); |
2489 STRCAT(prt_cmap, "-"); | 2489 STRCAT(prt_cmap, "-"); |
2490 } | 2490 } |
2498 } | 2498 } |
2499 STRCAT(prt_cmap, "H"); | 2499 STRCAT(prt_cmap, "H"); |
2500 | 2500 |
2501 if (!mbfont_opts[OPT_MBFONT_REGULAR].present) | 2501 if (!mbfont_opts[OPT_MBFONT_REGULAR].present) |
2502 { | 2502 { |
2503 EMSG(_("E675: No default font specified for multi-byte printing.")); | 2503 emsg(_("E675: No default font specified for multi-byte printing.")); |
2504 return FALSE; | 2504 return FALSE; |
2505 } | 2505 } |
2506 | 2506 |
2507 /* Derive CID font names with fallbacks if not defined */ | 2507 /* Derive CID font names with fallbacks if not defined */ |
2508 if (!prt_build_cid_fontname(PRT_PS_FONT_ROMAN, | 2508 if (!prt_build_cid_fontname(PRT_PS_FONT_ROMAN, |
2675 if (psettings->outfile == NULL) | 2675 if (psettings->outfile == NULL) |
2676 { | 2676 { |
2677 prt_ps_file_name = vim_tempname('p', TRUE); | 2677 prt_ps_file_name = vim_tempname('p', TRUE); |
2678 if (prt_ps_file_name == NULL) | 2678 if (prt_ps_file_name == NULL) |
2679 { | 2679 { |
2680 EMSG(_(e_notmp)); | 2680 emsg(_(e_notmp)); |
2681 return FAIL; | 2681 return FAIL; |
2682 } | 2682 } |
2683 prt_ps_fd = mch_fopen((char *)prt_ps_file_name, WRITEBIN); | 2683 prt_ps_fd = mch_fopen((char *)prt_ps_file_name, WRITEBIN); |
2684 } | 2684 } |
2685 else | 2685 else |
2691 vim_free(p); | 2691 vim_free(p); |
2692 } | 2692 } |
2693 } | 2693 } |
2694 if (prt_ps_fd == NULL) | 2694 if (prt_ps_fd == NULL) |
2695 { | 2695 { |
2696 EMSG(_("E324: Can't open PostScript output file")); | 2696 emsg(_("E324: Can't open PostScript output file")); |
2697 mch_print_cleanup(); | 2697 mch_print_cleanup(); |
2698 return FAIL; | 2698 return FAIL; |
2699 } | 2699 } |
2700 | 2700 |
2701 prt_bufsiz = psettings->chars_per_line; | 2701 prt_bufsiz = psettings->chars_per_line; |
2727 size_t bytes_read; | 2727 size_t bytes_read; |
2728 | 2728 |
2729 fd_resource = mch_fopen((char *)resource->filename, READBIN); | 2729 fd_resource = mch_fopen((char *)resource->filename, READBIN); |
2730 if (fd_resource == NULL) | 2730 if (fd_resource == NULL) |
2731 { | 2731 { |
2732 EMSG2(_("E456: Can't open file \"%s\""), resource->filename); | 2732 semsg(_("E456: Can't open file \"%s\""), resource->filename); |
2733 return FALSE; | 2733 return FALSE; |
2734 } | 2734 } |
2735 prt_dsc_resources("BeginResource", prt_resource_types[resource->type], | 2735 prt_dsc_resources("BeginResource", prt_resource_types[resource->type], |
2736 (char *)resource->title); | 2736 (char *)resource->title); |
2737 | 2737 |
2741 { | 2741 { |
2742 bytes_read = fread((char *)resource_buffer, sizeof(char_u), | 2742 bytes_read = fread((char *)resource_buffer, sizeof(char_u), |
2743 sizeof(resource_buffer), fd_resource); | 2743 sizeof(resource_buffer), fd_resource); |
2744 if (ferror(fd_resource)) | 2744 if (ferror(fd_resource)) |
2745 { | 2745 { |
2746 EMSG2(_("E457: Can't read PostScript resource file \"%s\""), | 2746 semsg(_("E457: Can't read PostScript resource file \"%s\""), |
2747 resource->filename); | 2747 resource->filename); |
2748 fclose(fd_resource); | 2748 fclose(fd_resource); |
2749 return FALSE; | 2749 return FALSE; |
2750 } | 2750 } |
2751 if (bytes_read == 0) | 2751 if (bytes_read == 0) |
2878 #endif | 2878 #endif |
2879 | 2879 |
2880 /* Search for external resources VIM supplies */ | 2880 /* Search for external resources VIM supplies */ |
2881 if (!prt_find_resource("prolog", res_prolog)) | 2881 if (!prt_find_resource("prolog", res_prolog)) |
2882 { | 2882 { |
2883 EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\"")); | 2883 emsg(_("E456: Can't find PostScript resource file \"prolog.ps\"")); |
2884 goto theend; | 2884 goto theend; |
2885 } | 2885 } |
2886 if (!prt_open_resource(res_prolog)) | 2886 if (!prt_open_resource(res_prolog)) |
2887 goto theend; | 2887 goto theend; |
2888 if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION)) | 2888 if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION)) |
2891 if (prt_out_mbyte) | 2891 if (prt_out_mbyte) |
2892 { | 2892 { |
2893 /* Look for required version of multi-byte printing procset */ | 2893 /* Look for required version of multi-byte printing procset */ |
2894 if (!prt_find_resource("cidfont", res_cidfont)) | 2894 if (!prt_find_resource("cidfont", res_cidfont)) |
2895 { | 2895 { |
2896 EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\"")); | 2896 emsg(_("E456: Can't find PostScript resource file \"cidfont.ps\"")); |
2897 goto theend; | 2897 goto theend; |
2898 } | 2898 } |
2899 if (!prt_open_resource(res_cidfont)) | 2899 if (!prt_open_resource(res_cidfont)) |
2900 goto theend; | 2900 goto theend; |
2901 if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION)) | 2901 if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION)) |
2929 { | 2929 { |
2930 /* Use latin1 as default printing encoding */ | 2930 /* Use latin1 as default printing encoding */ |
2931 p_encoding = (char_u *)"latin1"; | 2931 p_encoding = (char_u *)"latin1"; |
2932 if (!prt_find_resource((char *)p_encoding, res_encoding)) | 2932 if (!prt_find_resource((char *)p_encoding, res_encoding)) |
2933 { | 2933 { |
2934 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""), | 2934 semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), |
2935 p_encoding); | 2935 p_encoding); |
2936 goto theend; | 2936 goto theend; |
2937 } | 2937 } |
2938 } | 2938 } |
2939 } | 2939 } |
2951 if (prt_use_courier) | 2951 if (prt_use_courier) |
2952 { | 2952 { |
2953 /* Include ASCII range encoding vector */ | 2953 /* Include ASCII range encoding vector */ |
2954 if (!prt_find_resource(prt_ascii_encoding, res_encoding)) | 2954 if (!prt_find_resource(prt_ascii_encoding, res_encoding)) |
2955 { | 2955 { |
2956 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""), | 2956 semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), |
2957 prt_ascii_encoding); | 2957 prt_ascii_encoding); |
2958 goto theend; | 2958 goto theend; |
2959 } | 2959 } |
2960 if (!prt_open_resource(res_encoding)) | 2960 if (!prt_open_resource(res_encoding)) |
2961 goto theend; | 2961 goto theend; |
2967 prt_conv.vc_type = CONV_NONE; | 2967 prt_conv.vc_type = CONV_NONE; |
2968 if (!(enc_canon_props(p_enc) & enc_canon_props(p_encoding) & ENC_8BIT)) { | 2968 if (!(enc_canon_props(p_enc) & enc_canon_props(p_encoding) & ENC_8BIT)) { |
2969 /* Set up encoding conversion if required */ | 2969 /* Set up encoding conversion if required */ |
2970 if (FAIL == convert_setup(&prt_conv, p_enc, p_encoding)) | 2970 if (FAIL == convert_setup(&prt_conv, p_enc, p_encoding)) |
2971 { | 2971 { |
2972 EMSG2(_("E620: Unable to convert to print encoding \"%s\""), | 2972 semsg(_("E620: Unable to convert to print encoding \"%s\""), |
2973 p_encoding); | 2973 p_encoding); |
2974 goto theend; | 2974 goto theend; |
2975 } | 2975 } |
2976 prt_do_conv = TRUE; | 2976 prt_do_conv = TRUE; |
2977 } | 2977 } |
2980 if (prt_out_mbyte && prt_custom_cmap) | 2980 if (prt_out_mbyte && prt_custom_cmap) |
2981 { | 2981 { |
2982 /* Find user supplied CMap */ | 2982 /* Find user supplied CMap */ |
2983 if (!prt_find_resource(prt_cmap, res_cmap)) | 2983 if (!prt_find_resource(prt_cmap, res_cmap)) |
2984 { | 2984 { |
2985 EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""), | 2985 semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), |
2986 prt_cmap); | 2986 prt_cmap); |
2987 goto theend; | 2987 goto theend; |
2988 } | 2988 } |
2989 if (!prt_open_resource(res_cmap)) | 2989 if (!prt_open_resource(res_cmap)) |
2990 goto theend; | 2990 goto theend; |
3234 } | 3234 } |
3235 prt_message((char_u *)_("Sending to printer...")); | 3235 prt_message((char_u *)_("Sending to printer...")); |
3236 | 3236 |
3237 /* Not printing to a file: use 'printexpr' to print the file. */ | 3237 /* Not printing to a file: use 'printexpr' to print the file. */ |
3238 if (eval_printexpr(prt_ps_file_name, psettings->arguments) == FAIL) | 3238 if (eval_printexpr(prt_ps_file_name, psettings->arguments) == FAIL) |
3239 EMSG(_("E365: Failed to print PostScript file")); | 3239 emsg(_("E365: Failed to print PostScript file")); |
3240 else | 3240 else |
3241 prt_message((char_u *)_("Print job sent.")); | 3241 prt_message((char_u *)_("Print job sent.")); |
3242 } | 3242 } |
3243 | 3243 |
3244 mch_print_cleanup(); | 3244 mch_print_cleanup(); |