Changes in uspace/lib/c/generic/io/kio.c [28a5ebd:690ad20] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/kio.c
r28a5ebd r690ad20 34 34 */ 35 35 36 #include <abi/syscall.h> 36 37 #include <stddef.h> 37 38 #include <libc.h> … … 42 43 #include <abi/kio.h> 43 44 #include <io/kio.h> 44 #include < io/printf_core.h>45 #include <printf_core.h> 45 46 #include <macros.h> 46 47 #include <libarch/config.h> … … 112 113 } 113 114 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 114 120 /** Print formatted text to kio. 115 121 * … … 131 137 } 132 138 133 static int kio_vprintf_str_write(const char *str, size_t size, void *data)139 static errno_t kio_vprintf_str_write(const char *str, size_t size, void *data) 134 140 { 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; 141 size_t wr = 0; 142 return kio_write(str, size, &wr); 160 143 } 161 144 … … 172 155 printf_spec_t ps = { 173 156 kio_vprintf_str_write, 174 kio_vprintf_wstr_write,175 157 NULL 176 158 };
Note:
See TracChangeset
for help on using the changeset viewer.