logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

mbstowcs.3p (3650B)


  1. '\" et
  2. .TH MBSTOWCS "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. mbstowcs
  12. \(em convert a character string to a wide-character string
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdlib.h>
  17. .P
  18. size_t mbstowcs(wchar_t *restrict \fIpwcs\fP, const char *restrict \fIs\fP,
  19. size_t \fIn\fP);
  20. .fi
  21. .SH DESCRIPTION
  22. The functionality described on this reference page is aligned with the
  23. ISO\ C standard. Any conflict between the requirements described here and the
  24. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  25. .P
  26. The
  27. \fImbstowcs\fR()
  28. function shall convert a sequence of characters that begins in the
  29. initial shift state from the array pointed to by
  30. .IR s
  31. into a sequence of corresponding wide-character codes and shall store
  32. not more than
  33. .IR n
  34. wide-character codes into the array pointed to by
  35. .IR pwcs .
  36. No characters that follow a null byte (which is converted into a
  37. wide-character code with value 0) shall be examined or converted. Each
  38. character shall be converted as if by a call to
  39. \fImbtowc\fR(),
  40. except that the shift state of
  41. \fImbtowc\fR()
  42. is not affected.
  43. .P
  44. No more than
  45. .IR n
  46. elements shall be modified in the array pointed to by
  47. .IR pwcs .
  48. If copying takes place between objects that overlap, the behavior is
  49. undefined.
  50. .P
  51. The behavior of this function shall be affected by the
  52. .IR LC_CTYPE
  53. category of the current locale.
  54. If
  55. .IR pwcs
  56. is a null pointer,
  57. \fImbstowcs\fR()
  58. shall return the length required to convert the entire array regardless
  59. of the value of
  60. .IR n ,
  61. but no values are stored.
  62. .SH "RETURN VALUE"
  63. If an invalid character is encountered,
  64. \fImbstowcs\fR()
  65. shall return (\fBsize_t\fP)\-1
  66. and shall set
  67. .IR errno
  68. to indicate the error.
  69. .P
  70. Otherwise,
  71. \fImbstowcs\fR()
  72. shall return the number of the array elements modified
  73. (or required if
  74. .IR pwcs
  75. is null),
  76. not including a terminating 0 code, if any. The array shall
  77. not be zero-terminated if the value returned is
  78. .IR n .
  79. .SH ERRORS
  80. The
  81. \fImbstowcs\fR()
  82. function shall fail if:
  83. .TP
  84. .BR EILSEQ
  85. An invalid character sequence is detected. In the POSIX locale an
  86. .BR [EILSEQ]
  87. error cannot occur since all byte values are valid characters.
  88. .LP
  89. .IR "The following sections are informative."
  90. .SH EXAMPLES
  91. None.
  92. .SH "APPLICATION USAGE"
  93. None.
  94. .SH RATIONALE
  95. None.
  96. .SH "FUTURE DIRECTIONS"
  97. None.
  98. .SH "SEE ALSO"
  99. .IR "\fImblen\fR\^(\|)",
  100. .IR "\fImbtowc\fR\^(\|)",
  101. .IR "\fIwctomb\fR\^(\|)",
  102. .IR "\fIwcstombs\fR\^(\|)"
  103. .P
  104. The Base Definitions volume of POSIX.1\(hy2017,
  105. .IR "\fB<stdlib.h>\fP"
  106. .\"
  107. .SH COPYRIGHT
  108. Portions of this text are reprinted and reproduced in electronic form
  109. from IEEE Std 1003.1-2017, Standard for Information Technology
  110. -- Portable Operating System Interface (POSIX), The Open Group Base
  111. Specifications Issue 7, 2018 Edition,
  112. Copyright (C) 2018 by the Institute of
  113. Electrical and Electronics Engineers, Inc and The Open Group.
  114. In the event of any discrepancy between this version and the original IEEE and
  115. The Open Group Standard, the original IEEE and The Open Group Standard
  116. is the referee document. The original Standard can be obtained online at
  117. http://www.opengroup.org/unix/online.html .
  118. .PP
  119. Any typographical or formatting errors that appear
  120. in this page are most likely
  121. to have been introduced during the conversion of the source files to
  122. man page format. To report such errors, see
  123. https://www.kernel.org/doc/man-pages/reporting_bugs.html .