Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/io.c

    r3f7fe9e r28a5ebd  
    4848#include <adt/list.h>
    4949#include <wchar.h>
     50#include <uchar.h>
    5051#include "../private/io.h"
    5152#include "../private/stdio.h"
     
    749750}
    750751
     752wint_t fputuc(char32_t wc, FILE *stream)
     753{
     754        char buf[STR_BOUNDS(1)];
     755        size_t sz = 0;
     756
     757        if (chr_encode(wc, buf, &sz, STR_BOUNDS(1)) != EOK) {
     758                errno = EILSEQ;
     759                return WEOF;
     760        }
     761
     762        size_t wr = fwrite(buf, 1, sz, stream);
     763        if (wr < sz)
     764                return WEOF;
     765
     766        return wc;
     767}
     768
    751769wint_t putwchar(wchar_t wc)
    752770{
    753771        return fputwc(wc, stdout);
     772}
     773
     774wint_t putuchar(char32_t wc)
     775{
     776        return fputuc(wc, stdout);
    754777}
    755778
Note: See TracChangeset for help on using the changeset viewer.