Changeset ed88c8e in mainline for uspace/lib/c/generic/io
- Timestamp:
- 2018-05-29T13:25:07Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fc0b2a8
- Parents:
- a57fa32
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-28 17:24:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-29 13:25:07)
- Location:
- uspace/lib/c/generic/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/chargrid.c
ra57fa32 red88c8e 140 140 * 141 141 */ 142 sysarg_t chargrid_put char(chargrid_t *scrbuf, wchar_t ch, bool update)142 sysarg_t chargrid_putwchar(chargrid_t *scrbuf, wchar_t ch, bool update) 143 143 { 144 144 assert(scrbuf->col < scrbuf->cols); … … 199 199 200 200 for (sysarg_t i = 0; i < spaces; i++) 201 flush += chargrid_put char(scrbuf, ' ', true) - 1;201 flush += chargrid_putwchar(scrbuf, ' ', true) - 1; 202 202 203 203 return flush; … … 228 228 scrbuf->row--; 229 229 230 chargrid_put char(scrbuf, ' ', false);230 chargrid_putwchar(scrbuf, ' ', false); 231 231 return 2; 232 232 } 233 233 234 234 scrbuf->col--; 235 chargrid_put char(scrbuf, ' ', false);235 chargrid_putwchar(scrbuf, ' ', false); 236 236 return 1; 237 237 } -
uspace/lib/c/generic/io/io.c
ra57fa32 red88c8e 46 46 #include <ipc/loc.h> 47 47 #include <adt/list.h> 48 #include <wchar.h> 48 49 #include "../private/io.h" 49 50 #include "../private/stdio.h" … … 702 703 } 703 704 704 int fputc(wchar_tc, FILE *stream)705 wint_t fputwc(wchar_t wc, FILE *stream) 705 706 { 706 707 char buf[STR_BOUNDS(1)]; 707 708 size_t sz = 0; 708 709 709 if (chr_encode(c, buf, &sz, STR_BOUNDS(1)) == EOK) { 710 size_t wr = fwrite(buf, 1, sz, stream); 711 712 if (wr < sz) 713 return EOF; 714 715 return (int) c; 716 } 717 718 return EOF; 719 } 720 721 int putchar(wchar_t c) 710 if (chr_encode(wc, buf, &sz, STR_BOUNDS(1)) != EOK) { 711 errno = EILSEQ; 712 return WEOF; 713 } 714 715 size_t wr = fwrite(buf, 1, sz, stream); 716 if (wr < sz) 717 return WEOF; 718 719 return wc; 720 } 721 722 wint_t putwchar(wchar_t wc) 723 { 724 return fputwc(wc, stdout); 725 } 726 727 int fputc(int c, FILE *stream) 728 { 729 unsigned char b; 730 size_t wr; 731 732 b = (unsigned char) c; 733 wr = fwrite(&b, sizeof(b), 1, stream); 734 if (wr < 1) 735 return EOF; 736 737 return b; 738 } 739 740 int putchar(int c) 722 741 { 723 742 return fputc(c, stdout); -
uspace/lib/c/generic/io/vprintf.c
ra57fa32 red88c8e 54 54 55 55 while (offset < size) { 56 if (fput c(str[chars], (FILE *) stream) <= 0)56 if (fputwc(str[chars], (FILE *) stream) <= 0) 57 57 break; 58 58
Note:
See TracChangeset
for help on using the changeset viewer.