Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fmtutil/fmtutil.c

    r38d150e r1d6dd2a  
    3131#include <fmtutil.h>
    3232#include <stdlib.h>
     33#include <str.h>
    3334
    3435typedef struct {
     
    3839} printmode_t;
    3940
    40 int print_wrapped_console(const char *str, align_mode_t alignment)
     41errno_t print_wrapped_console(const char *str, align_mode_t alignment)
    4142{
    4243        console_ctrl_t *console = console_init(stdin, stdout);
     
    4647        }
    4748        sysarg_t con_rows, con_cols, con_col, con_row;
    48         int rc = console_get_size(console, &con_cols, &con_rows);
     49        errno_t rc = console_get_size(console, &con_cols, &con_rows);
    4950        if (rc != EOK) {
    5051                return rc;
     
    6364 *
    6465 **/
    65 static int print_line(wchar_t *wstr, size_t chars, bool last, void *data)
     66static errno_t print_line(wchar_t *wstr, size_t chars, bool last, void *data)
    6667{
    6768        printmode_t *pm = (printmode_t *) data;
    6869        wchar_t old_char = wstr[chars];
    6970        wstr[chars] = 0;
    70         int rc = print_aligned_w(wstr, pm->width, last, pm->alignment);
     71        errno_t rc = print_aligned_w(wstr, pm->width, last, pm->alignment);
    7172        wstr[chars] = old_char;
    7273        return rc;
    7374}
    7475
    75 int print_wrapped(const char *str, size_t width, align_mode_t mode)
     76errno_t print_wrapped(const char *str, size_t width, align_mode_t mode)
    7677{
    7778        printmode_t pm;
     
    8384                return ENOMEM;
    8485        }
    85         int rc = wrap(wstr, width, print_line, &pm);
     86        errno_t rc = wrap(wstr, width, print_line, &pm);
    8687        free(wstr);
    8788        return rc;
    8889}
    8990
    90 int print_aligned_w(const wchar_t *wstr, size_t width, bool last,
     91errno_t print_aligned_w(const wchar_t *wstr, size_t width, bool last,
    9192    align_mode_t mode)
    9293{
     
    169170        return EOK;
    170171}
    171 int print_aligned(const char *str, size_t width, bool last, align_mode_t mode)
     172errno_t print_aligned(const char *str, size_t width, bool last, align_mode_t mode)
    172173{
    173174        wchar_t *wstr = str_to_awstr(str);
     
    175176                return ENOMEM;
    176177        }
    177         int rc = print_aligned_w(wstr, width, last, mode);
     178        errno_t rc = print_aligned_w(wstr, width, last, mode);
    178179        free(wstr);
    179180        return rc;
    180181}
    181182
    182 int wrap(wchar_t *wstr, size_t width, line_consumer_fn consumer, void *data)
     183errno_t wrap(wchar_t *wstr, size_t width, line_consumer_fn consumer, void *data)
    183184{
    184185        size_t word_start = 0;
Note: See TracChangeset for help on using the changeset viewer.