From 0c84af4c4f4cb6c63487830c8e2b943d28d3221a Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 11 Nov 2017 14:25:38 -0500 Subject: added u16_mbrtowc(). --- project/common.mk | 1 + src/u16_mbrtowc.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/u16_mbrtowc.c diff --git a/project/common.mk b/project/common.mk index ecf55c3..49fdcae 100644 --- a/project/common.mk +++ b/project/common.mk @@ -1,5 +1,6 @@ API_SRCS = \ src/u16_mbsinit.c \ + src/u16_mbrtowc.c \ INTERNAL_SRCS = \ diff --git a/src/u16_mbrtowc.c b/src/u16_mbrtowc.c new file mode 100644 index 0000000..9a83554 --- /dev/null +++ b/src/u16_mbrtowc.c @@ -0,0 +1,16 @@ +/*******************************************************************/ +/* u16ports: u16 variants of wide character string functions. */ +/* Copyright (C) 2017 Z. Gilboa */ +/* Released under the Standard MIT License; see COPYING.U16PORTS. */ +/*******************************************************************/ + +#include +#include +#include + +static mbstate_t internal_state = {0}; + +size_t u16_mbrtowc(uint16_t * dst, const char * src, size_t len, mbstate_t * ps) +{ + return mbrtoc16(dst,src,len, ps ? ps : &internal_state); +} -- cgit v1.2.3