comparison src/hardcopy.c @ 835:8bebcabccc2c v7.0e01

updated for version 7.0e01
author vimboss
date Mon, 17 Apr 2006 22:14:47 +0000
parents 9ab23f1e137f
children 2c885fab04e3
comparison
equal deleted inserted replaced
834:5117153003bd 835:8bebcabccc2c
899 * Appropriately expand any tabs to spaces. 899 * Appropriately expand any tabs to spaces.
900 */ 900 */
901 if (line[col] == TAB || tab_spaces != 0) 901 if (line[col] == TAB || tab_spaces != 0)
902 { 902 {
903 if (tab_spaces == 0) 903 if (tab_spaces == 0)
904 tab_spaces = curbuf->b_p_ts - (print_pos % curbuf->b_p_ts); 904 tab_spaces = (int)(curbuf->b_p_ts - (print_pos % curbuf->b_p_ts));
905 905
906 while (tab_spaces > 0) 906 while (tab_spaces > 0)
907 { 907 {
908 need_break = mch_print_text_out((char_u *)" ", 1); 908 need_break = mch_print_text_out((char_u *)" ", 1);
909 print_pos++; 909 print_pos++;
934 print_pos++; 934 print_pos++;
935 } 935 }
936 } 936 }
937 937
938 ppos->lead_spaces = tab_spaces; 938 ppos->lead_spaces = tab_spaces;
939 ppos->print_pos = print_pos; 939 ppos->print_pos = (int)print_pos;
940 940
941 /* 941 /*
942 * Start next line of file if we clip lines, or have reached end of the 942 * Start next line of file if we clip lines, or have reached end of the
943 * line, unless we are doing a formfeed. 943 * line, unless we are doing a formfeed.
944 */ 944 */
1474 1474
1475 static void 1475 static void
1476 prt_write_file(buffer) 1476 prt_write_file(buffer)
1477 char_u *buffer; 1477 char_u *buffer;
1478 { 1478 {
1479 prt_write_file_len(buffer, STRLEN(buffer)); 1479 prt_write_file_len(buffer, (int)STRLEN(buffer));
1480 } 1480 }
1481 1481
1482 static void 1482 static void
1483 prt_write_file_len(buffer, bytes) 1483 prt_write_file_len(buffer, bytes)
1484 char_u *buffer; 1484 char_u *buffer;
1935 return FALSE; 1935 return FALSE;
1936 } 1936 }
1937 vim_memset(prt_resfile.buffer, NUL, PRT_FILE_BUFFER_LEN); 1937 vim_memset(prt_resfile.buffer, NUL, PRT_FILE_BUFFER_LEN);
1938 1938
1939 /* Parse first line to ensure valid resource file */ 1939 /* Parse first line to ensure valid resource file */
1940 prt_resfile.len = fread((char *)prt_resfile.buffer, sizeof(char_u), 1940 prt_resfile.len = (int)fread((char *)prt_resfile.buffer, sizeof(char_u),
1941 PRT_FILE_BUFFER_LEN, fd_resource); 1941 PRT_FILE_BUFFER_LEN, fd_resource);
1942 if (ferror(fd_resource)) 1942 if (ferror(fd_resource))
1943 { 1943 {
1944 EMSG2(_("E457: Can't read PostScript resource file \"%s\""), 1944 EMSG2(_("E457: Can't read PostScript resource file \"%s\""),
1945 resource->filename); 1945 resource->filename);
1953 return FALSE; 1953 return FALSE;
1954 1954
1955 offset = 0; 1955 offset = 0;
1956 1956
1957 if (prt_resfile_strncmp(offset, PRT_RESOURCE_HEADER, 1957 if (prt_resfile_strncmp(offset, PRT_RESOURCE_HEADER,
1958 STRLEN(PRT_RESOURCE_HEADER)) != 0) 1958 (int)STRLEN(PRT_RESOURCE_HEADER)) != 0)
1959 { 1959 {
1960 EMSG2(_("E618: file \"%s\" is not a PostScript resource file"), 1960 EMSG2(_("E618: file \"%s\" is not a PostScript resource file"),
1961 resource->filename); 1961 resource->filename);
1962 fclose(fd_resource); 1962 fclose(fd_resource);
1963 return FALSE; 1963 return FALSE;
1964 } 1964 }
1965 1965
1966 /* Skip over any version numbers and following ws */ 1966 /* Skip over any version numbers and following ws */
1967 offset += STRLEN(PRT_RESOURCE_HEADER); 1967 offset += (int)STRLEN(PRT_RESOURCE_HEADER);
1968 offset = prt_resfile_skip_nonws(offset); 1968 offset = prt_resfile_skip_nonws(offset);
1969 if (offset == -1) 1969 if (offset == -1)
1970 return FALSE; 1970 return FALSE;
1971 offset = prt_resfile_skip_ws(offset); 1971 offset = prt_resfile_skip_ws(offset);
1972 if (offset == -1) 1972 if (offset == -1)
1973 return FALSE; 1973 return FALSE;
1974 1974
1975 if (prt_resfile_strncmp(offset, PRT_RESOURCE_RESOURCE, 1975 if (prt_resfile_strncmp(offset, PRT_RESOURCE_RESOURCE,
1976 STRLEN(PRT_RESOURCE_RESOURCE)) != 0) 1976 (int)STRLEN(PRT_RESOURCE_RESOURCE)) != 0)
1977 { 1977 {
1978 EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"), 1978 EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
1979 resource->filename); 1979 resource->filename);
1980 fclose(fd_resource); 1980 fclose(fd_resource);
1981 return FALSE; 1981 return FALSE;
1982 } 1982 }
1983 offset += STRLEN(PRT_RESOURCE_RESOURCE); 1983 offset += (int)STRLEN(PRT_RESOURCE_RESOURCE);
1984 1984
1985 /* Decide type of resource in the file */ 1985 /* Decide type of resource in the file */
1986 if (prt_resfile_strncmp(offset, PRT_RESOURCE_PROCSET, 1986 if (prt_resfile_strncmp(offset, PRT_RESOURCE_PROCSET,
1987 STRLEN(PRT_RESOURCE_PROCSET)) == 0) 1987 (int)STRLEN(PRT_RESOURCE_PROCSET)) == 0)
1988 resource->type = PRT_RESOURCE_TYPE_PROCSET; 1988 resource->type = PRT_RESOURCE_TYPE_PROCSET;
1989 else if (prt_resfile_strncmp(offset, PRT_RESOURCE_ENCODING, 1989 else if (prt_resfile_strncmp(offset, PRT_RESOURCE_ENCODING,
1990 STRLEN(PRT_RESOURCE_ENCODING)) == 0) 1990 (int)STRLEN(PRT_RESOURCE_ENCODING)) == 0)
1991 resource->type = PRT_RESOURCE_TYPE_ENCODING; 1991 resource->type = PRT_RESOURCE_TYPE_ENCODING;
1992 else if (prt_resfile_strncmp(offset, PRT_RESOURCE_CMAP, 1992 else if (prt_resfile_strncmp(offset, PRT_RESOURCE_CMAP,
1993 STRLEN(PRT_RESOURCE_CMAP)) == 0) 1993 (int)STRLEN(PRT_RESOURCE_CMAP)) == 0)
1994 resource->type = PRT_RESOURCE_TYPE_CMAP; 1994 resource->type = PRT_RESOURCE_TYPE_CMAP;
1995 else 1995 else
1996 { 1996 {
1997 EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"), 1997 EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
1998 resource->filename); 1998 resource->filename);
2412 int enc_len; 2412 int enc_len;
2413 struct prt_ps_encoding_S *p_mbenc; 2413 struct prt_ps_encoding_S *p_mbenc;
2414 2414
2415 *pp_mbenc = NULL; 2415 *pp_mbenc = NULL;
2416 /* Look for recognised encoding */ 2416 /* Look for recognised encoding */
2417 enc_len = STRLEN(p_encoding); 2417 enc_len = (int)STRLEN(p_encoding);
2418 p_mbenc = p_cmap->encodings; 2418 p_mbenc = p_cmap->encodings;
2419 for (mbenc = 0; mbenc < p_cmap->num_encodings; mbenc++) 2419 for (mbenc = 0; mbenc < p_cmap->num_encodings; mbenc++)
2420 { 2420 {
2421 if (STRNICMP(p_mbenc->encoding, p_encoding, enc_len) == 0) 2421 if (STRNICMP(p_mbenc->encoding, p_encoding, enc_len) == 0)
2422 { 2422 {
2439 struct prt_ps_charset_S *p_mbchar; 2439 struct prt_ps_charset_S *p_mbchar;
2440 2440
2441 /* Look for recognised character set, using default if one is not given */ 2441 /* Look for recognised character set, using default if one is not given */
2442 if (*p_charset == NUL) 2442 if (*p_charset == NUL)
2443 p_charset = p_cmap->defcs; 2443 p_charset = p_cmap->defcs;
2444 char_len = STRLEN(p_charset); 2444 char_len = (int)STRLEN(p_charset);
2445 p_mbchar = p_cmap->charsets; 2445 p_mbchar = p_cmap->charsets;
2446 for (mbchar = 0; mbchar < p_cmap->num_charsets; mbchar++) 2446 for (mbchar = 0; mbchar < p_cmap->num_charsets; mbchar++)
2447 { 2447 {
2448 if (STRNICMP(p_mbchar->charset, p_charset, char_len) == 0) 2448 if (STRNICMP(p_mbchar->charset, p_charset, char_len) == 0)
2449 { 2449 {
2829 fclose(fd_resource); 2829 fclose(fd_resource);
2830 return FALSE; 2830 return FALSE;
2831 } 2831 }
2832 if (bytes_read == 0) 2832 if (bytes_read == 0)
2833 break; 2833 break;
2834 prt_write_file_raw_len(resource_buffer, bytes_read); 2834 prt_write_file_raw_len(resource_buffer, (int)bytes_read);
2835 if (prt_file_error) 2835 if (prt_file_error)
2836 { 2836 {
2837 fclose(fd_resource); 2837 fclose(fd_resource);
2838 return FALSE; 2838 return FALSE;
2839 } 2839 }
3632 3632
3633 void 3633 void
3634 mch_print_set_bg(bgcol) 3634 mch_print_set_bg(bgcol)
3635 long_u bgcol; 3635 long_u bgcol;
3636 { 3636 {
3637 prt_bgcol = bgcol; 3637 prt_bgcol = (int)bgcol;
3638 prt_attribute_change = TRUE; 3638 prt_attribute_change = TRUE;
3639 prt_need_bgcol = TRUE; 3639 prt_need_bgcol = TRUE;
3640 } 3640 }
3641 3641
3642 void 3642 void
3643 mch_print_set_fg(fgcol) 3643 mch_print_set_fg(fgcol)
3644 long_u fgcol; 3644 long_u fgcol;
3645 { 3645 {
3646 if (fgcol != (long_u)prt_fgcol) 3646 if (fgcol != (long_u)prt_fgcol)
3647 { 3647 {
3648 prt_fgcol = fgcol; 3648 prt_fgcol = (int)fgcol;
3649 prt_attribute_change = TRUE; 3649 prt_attribute_change = TRUE;
3650 prt_need_fgcol = TRUE; 3650 prt_need_fgcol = TRUE;
3651 } 3651 }
3652 } 3652 }
3653 3653