MirOS Manual: ambsntowcs(3), ambstowcs(3), awcsntombs(3), awcstombs(3)

AMBSTOWCS(3)               BSD Programmer's Manual                AMBSTOWCS(3)

NAME

     ambsntowcs, ambstowcs, awcsntombs, awcstombs - convert between multibyte
     and wide strings with allocation

SYNOPSIS

     #define _ALL_SOURCE
     #include <wchar.h>

     wchar_t *
     ambsntowcs(const char *s, size_t n);

     wchar_t *
     ambstowcs(const char *s);

     char *
     awcsntombs(const wchar_t *s, size_t n);

     char *
     awcstombs(const wchar_t *s);

DESCRIPTION

     The ambsntowcs() and ambstowcs() functions convert the NUL-terminated
     multibyte (MirOS OPTU-8 encoded) string s into a wide (MirOS OPTU-16
     encoded) string, requesting just enough storage via calloc(3) from the
     system to store the result, including a terminating WNUL character. The
     awcsntombs() and awcstombs() functions convert the WNUL-terminated wide
     (MirOS OPTU-16 encoded) string s into a multibyte (MirOS OPTU-8 encoded)
     string, requesting just enough storage via malloc(3) from the system to
     store the result, including a terminating NUL byte. The ambsntowcs() and
     awcsntombs() functions convert at most n characters; the ambstowcs() and
     awcstombs() functions convert the entire string.

RETURN VALUES

     ambsntowcs() and ambstowcs() return the newly allocated wide character
     string. awcsntombs() and awcstombs() return the newly allocated multibyte
     character string. Failure to allocate enough memory will terminate the
     calling programme, xmalloc style, with errorlevel 1 and an appropriate
     error message. Passing a NULL pointer results in undefined behaviour.

SEE ALSO

     mbsrtowcs(3), wcsrtombs(3)

HISTORY

     The ambsntowcs, ambstowcs, awcsntombs, and awcstombs functions are
     MirOS BSD extensions and first appeared in MirOS #11.

AUTHORS

     Thorsten Glaser <tg@mirbsd.de> wrote the entire internationalisation im-
     plementation in MirOS. He is also the steward for the OPTU encoding.

MirOS BSD #10-current         February 19, 2014                              1

Generated on 2017-04-03 16:26:17 by $MirOS: src/scripts/roff2htm,v 1.88 2017/01/29 00:51:06 tg Exp $

These manual pages and other documentation are copyrighted by their respective writers; their source is available at our CVSweb, AnonCVS, and other mirrors. The rest is Copyright © 2002–2017 The MirOS Project, Germany.
This product includes material provided by mirabilos.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.