Changes in uspace/lib/fmtutil/fmtutil.c [b7fd2a0:38d150e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fmtutil/fmtutil.c
rb7fd2a0 r38d150e 38 38 } printmode_t; 39 39 40 errno_t print_wrapped_console(const char *str, align_mode_t alignment)40 int print_wrapped_console(const char *str, align_mode_t alignment) 41 41 { 42 42 console_ctrl_t *console = console_init(stdin, stdout); … … 46 46 } 47 47 sysarg_t con_rows, con_cols, con_col, con_row; 48 errno_t rc = console_get_size(console, &con_cols, &con_rows);48 int rc = console_get_size(console, &con_cols, &con_rows); 49 49 if (rc != EOK) { 50 50 return rc; … … 63 63 * 64 64 **/ 65 static errno_t print_line(wchar_t *wstr, size_t chars, bool last, void *data)65 static int print_line(wchar_t *wstr, size_t chars, bool last, void *data) 66 66 { 67 67 printmode_t *pm = (printmode_t *) data; 68 68 wchar_t old_char = wstr[chars]; 69 69 wstr[chars] = 0; 70 errno_t rc = print_aligned_w(wstr, pm->width, last, pm->alignment);70 int rc = print_aligned_w(wstr, pm->width, last, pm->alignment); 71 71 wstr[chars] = old_char; 72 72 return rc; 73 73 } 74 74 75 errno_t print_wrapped(const char *str, size_t width, align_mode_t mode)75 int print_wrapped(const char *str, size_t width, align_mode_t mode) 76 76 { 77 77 printmode_t pm; … … 83 83 return ENOMEM; 84 84 } 85 errno_t rc = wrap(wstr, width, print_line, &pm);85 int rc = wrap(wstr, width, print_line, &pm); 86 86 free(wstr); 87 87 return rc; 88 88 } 89 89 90 errno_t print_aligned_w(const wchar_t *wstr, size_t width, bool last,90 int print_aligned_w(const wchar_t *wstr, size_t width, bool last, 91 91 align_mode_t mode) 92 92 { … … 169 169 return EOK; 170 170 } 171 errno_t print_aligned(const char *str, size_t width, bool last, align_mode_t mode)171 int print_aligned(const char *str, size_t width, bool last, align_mode_t mode) 172 172 { 173 173 wchar_t *wstr = str_to_awstr(str); … … 175 175 return ENOMEM; 176 176 } 177 errno_t rc = print_aligned_w(wstr, width, last, mode);177 int rc = print_aligned_w(wstr, width, last, mode); 178 178 free(wstr); 179 179 return rc; 180 180 } 181 181 182 errno_t wrap(wchar_t *wstr, size_t width, line_consumer_fn consumer, void *data)182 int wrap(wchar_t *wstr, size_t width, line_consumer_fn consumer, void *data) 183 183 { 184 184 size_t word_start = 0;
Note:
See TracChangeset
for help on using the changeset viewer.