Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/mbsrtowcs.3c
Real path: /usr/share/man/man3c/mbsrtowcs.3c
Zurück
'\" te .\" Copyright (c) 1992, The X/Open Company Ltd. All rights reserved. .\" Portions Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. .\" Oracle gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in The Oracle Solaris, from IEEE Std 1003.1, 2008 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2001-2008 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .TH mbsrtowcs 3C "11 Jun 2018" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME mbsrtowcs, mbsnrtowcs \- convert a character string to a wide-character string (restartable) .br mbsrtowcs_s \- wide-character string operations with additional safety checks .SH SYNOPSIS .LP .nf #include <wchar.h> \fBsize_t\fR \fBmbsrtowcs\fR(\fBwchar_t *restrict\fR \fIdst\fR, \fBconst char **restrict\fR \fIsrc\fR, \fBsize_t\fR \fIlen\fR, \fBmbstate_t *restrict\fR \fIps\fR); .fi .LP .nf \fBsize_t\fR \fBmbsnrtowcs\fR(\fBwchar_t *restrict\fR \fIdst\fR, \fBconst char **restrict\fR \fIsrc\fR, \fBsize_t\fR \fInmc\fR, \fBsize_t\fR \fIlen\fR, \fBmbstate_t *restrict\fR \fIps\fR); .fi .LP .nf #define __STDC_WANT_LIB_EXT1__ 1 #include <wchar.h> errno_t mbsrtowcs_s(size_t *restrict \fIretval\fR, wchar_t *restrict \fIdst\fR, rsize_t \fIdstmax\fR, const char **restrict \fIsrc\fR, rsize_t \fIlen\fR, mbstate_t *restrict \fIps\fR); .fi .SH DESCRIPTION .sp .LP The \fBmbsrtowcs()\fR function converts a sequence of characters, beginning in the conversion state described by the object pointed to by \fIps\fR, from the array indirectly pointed to by \fIsrc\fR into a sequence of corresponding wide-characters. If \fIdst\fR is not a null pointer, the converted characters are stored into the array pointed to by \fIdst\fR. Conversion continues up to and including a terminating null character, which is also stored. Conversion stops early in either of the following cases: .RS +4 .TP .ie t \(bu .el o When a sequence of bytes is encountered that does not form a valid character. .RE .RS +4 .TP .ie t \(bu .el o When \fIlen\fR codes have been stored into the array pointed to by \fIdst\fR (and \fIdst\fR is not a null pointer). .RE .sp .LP Each conversion takes place as if by a call to the \fBmbrtowc()\fR function. .sp .LP If \fIdst\fR is not a null pointer, the pointer object pointed to by \fIsrc\fR is assigned either a null pointer (if conversion stopped due to reaching a terminating null character) or the address just past the last character converted (if any). If conversion stopped due to reaching a terminating null character, and if \fIdst\fR is not a null pointer, the resulting state described is the initial conversion state. .sp .LP If \fIps\fR is a null pointer, the \fBmbsrtowcs()\fR function uses its own internal \fBmbstate_t\fR object, which is initialized at program startup to the initial conversion state. Otherwise, the \fBmbstate_t\fR object pointed to by \fIps\fR is used to completely describe the current conversion state of the associated character sequence. Solaris will behave as if no function defined in the Solaris Reference Manual calls these functions. .sp .LP The \fBmbsnrtowcs()\fR function is equivalent to the \fBmbsrtowcs()\fR function, except that the conversion of characters pointed to by \fIsrc\fR is limited to at most \fInmc\fR bytes (the size of the input buffer). .sp .LP The behavior of these functions are affected by the \fBLC_CTYPE\fR category of the current locale. See \fBenviron\fR(7). .sp .LP The \fBmbsrtowcs_s()\fR function is part of the bounds checking interfaces specified in the C11 standard, Annex K. It is similar to \fBmbsrtowcs()\fR in that it converts a sequence of multibyte characters into a sequence of corresponding wide characters, but with additional safety checks for explicit runtime constraints as defined by the C11 standard. See \fBruntime_constraint_handler\fR(3C) and INCITS/ISO/IEC 9899:2011. .SH RETURN VALUES .sp .LP If the input conversion encounters a sequence of bytes that do not form a valid character, an encoding error occurs. In this case, these functions store the value of the macro \fBEILSEQ\fR in \fBerrno\fR and returns \fB(size_t)-1\fR; the conversion state is undefined. Otherwise, it returns the number of characters successfully converted, not including the terminating null (if any). .sp .LP Additionally, if there is no runtime-constraint violation, the \fBmbsrtowcs_s()\fR function returns zero. Otherwise, it returns a non-zero value. .SH ERRORS .sp .LP The \fBmbsrtowcs()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fIps\fR argument points to an object that contains an invalid conversion state. .RE .sp .ne 2 .mk .na \fB\fBEILSEQ\fR\fR .ad .RS 10n .rt Invalid character sequence is detected. .RE .sp .LP The \fBmbsrtowcs_s()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 13n .rt Null pointer is passed or source and destination overlaps. .RE .sp .ne 2 .mk .na \fB\fBERANGE\fR\fR .ad .RS 13n .rt \fBsize\fR argument is not a valid value. .RE .sp .ne 2 .mk .na \fB\fBEOVERFLOW\fR\fR .ad .RS 13n .rt Destination array is too small. .RE .sp .ne 2 .mk .na \fB\fBEILSEQ\fR\fR .ad .RS 13n .rt Illegal byte sequence. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level See NOTES below _ Standard See \fBstandards\fR(7). .TE .sp .SH SEE ALSO .sp .LP \fBmbrtowc\fR(3C), \fBmbsinit\fR(3C), \fBsetlocale\fR(3C), \fBattributes\fR(7), \fBenviron\fR(7), \fBstandards\fR(7) .SH NOTES .sp .LP If \fIps\fR is not a null pointer, \fBmbsrtowcs()\fR and \fBmbsnrtowcs()\fR use the \fBxmbstate_t\fR object pointed to by \fIps\fR and the functions can be used safely in multithreaded applications. If \fIps\fR is a null pointer, \fBmbsrtowcs()\fR and \fBmbsnrtowcs()\fR use their internal \fBmbstate_t\fR object and the function is Unsafe in multithreaded applications. .sp .LP The \fBmbsrtowcs()\fR function can be used safely in multithreaded applications. .sp .LP The \fBmbsrtowcs_s()\fR function cannot be used safely in a multithreaded application due to the runtime constraint handler. For more information, see the \fBruntime_constraint_handler\fR(3C) man page.