Changes in uspace/lib/c/generic/io/kio.c [690ad20:694ca3d6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/kio.c
r690ad20 r694ca3d6 34 34 */ 35 35 36 #include <abi/syscall.h>37 36 #include <stddef.h> 38 37 #include <libc.h> … … 113 112 } 114 113 115 size_t kio_read(char *buf, size_t n, size_t at)116 {117 return __SYSCALL3(SYS_KIO_READ, (sysarg_t) buf, n, at);118 }119 120 114 /** Print formatted text to kio. 121 115 * … … 137 131 } 138 132 139 static errno_t kio_vprintf_str_write(const char *str, size_t size, void *data)133 static int kio_vprintf_str_write(const char *str, size_t size, void *data) 140 134 { 141 size_t wr = 0; 142 return kio_write(str, size, &wr); 135 size_t wr; 136 137 wr = 0; 138 (void) kio_write(str, size, &wr); 139 return str_nlength(str, wr); 140 } 141 142 static int kio_vprintf_wstr_write(const char32_t *str, size_t size, void *data) 143 { 144 size_t offset = 0; 145 size_t chars = 0; 146 size_t wr; 147 148 while (offset < size) { 149 char buf[STR_BOUNDS(1)]; 150 size_t sz = 0; 151 152 if (chr_encode(str[chars], buf, &sz, STR_BOUNDS(1)) == EOK) 153 kio_write(buf, sz, &wr); 154 155 chars++; 156 offset += sizeof(char32_t); 157 } 158 159 return chars; 143 160 } 144 161 … … 155 172 printf_spec_t ps = { 156 173 kio_vprintf_str_write, 174 kio_vprintf_wstr_write, 157 175 NULL 158 176 };
Note:
See TracChangeset
for help on using the changeset viewer.