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

wcstombs.3p (3506B)


  1. '\" et
  2. .TH WCSTOMBS "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. wcstombs
  12. \(em convert a wide-character string to a character string
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdlib.h>
  17. .P
  18. size_t wcstombs(char *restrict \fIs\fP, const wchar_t *restrict \fIpwcs\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. \fIwcstombs\fR()
  28. function shall convert the sequence of wide-character codes that are
  29. in the array pointed to by
  30. .IR pwcs
  31. into a sequence of characters that begins in the initial shift state
  32. and store these characters into the array pointed to by
  33. .IR s ,
  34. stopping if a character would exceed the limit of
  35. .IR n
  36. total bytes or if a null byte is stored. Each wide-character code
  37. shall be converted as if by a call to
  38. \fIwctomb\fR(),
  39. except that the shift state of
  40. \fIwctomb\fR()
  41. shall not be affected.
  42. .P
  43. The behavior of this function shall be affected by the
  44. .IR LC_CTYPE
  45. category of the current locale.
  46. .P
  47. No more than
  48. .IR n
  49. bytes shall be modified in the array pointed to by
  50. .IR s .
  51. If copying takes place between objects that overlap, the behavior is
  52. undefined.
  53. If
  54. .IR s
  55. is a null pointer,
  56. \fIwcstombs\fR()
  57. shall return the length required to convert the entire array
  58. regardless of the value of
  59. .IR n ,
  60. but no values are stored.
  61. .SH "RETURN VALUE"
  62. If a wide-character code is encountered that does not correspond to a
  63. valid character (of one or more bytes each),
  64. \fIwcstombs\fR()
  65. shall return (\fBsize_t\fP)\-1. Otherwise,
  66. \fIwcstombs\fR()
  67. shall return the number of bytes stored in the character array, not
  68. including any terminating null byte. The array shall not be
  69. null-terminated if the value returned is
  70. .IR n .
  71. .SH ERRORS
  72. The
  73. \fIwcstombs\fR()
  74. function shall fail if:
  75. .TP
  76. .BR EILSEQ
  77. A wide-character code does not correspond to a valid character.
  78. .LP
  79. .IR "The following sections are informative."
  80. .SH EXAMPLES
  81. None.
  82. .SH "APPLICATION USAGE"
  83. None.
  84. .SH RATIONALE
  85. None.
  86. .SH "FUTURE DIRECTIONS"
  87. None.
  88. .SH "SEE ALSO"
  89. .IR "\fImblen\fR\^(\|)",
  90. .IR "\fImbtowc\fR\^(\|)",
  91. .IR "\fImbstowcs\fR\^(\|)",
  92. .IR "\fIwctomb\fR\^(\|)"
  93. .P
  94. The Base Definitions volume of POSIX.1\(hy2017,
  95. .IR "\fB<stdlib.h>\fP"
  96. .\"
  97. .SH COPYRIGHT
  98. Portions of this text are reprinted and reproduced in electronic form
  99. from IEEE Std 1003.1-2017, Standard for Information Technology
  100. -- Portable Operating System Interface (POSIX), The Open Group Base
  101. Specifications Issue 7, 2018 Edition,
  102. Copyright (C) 2018 by the Institute of
  103. Electrical and Electronics Engineers, Inc and The Open Group.
  104. In the event of any discrepancy between this version and the original IEEE and
  105. The Open Group Standard, the original IEEE and The Open Group Standard
  106. is the referee document. The original Standard can be obtained online at
  107. http://www.opengroup.org/unix/online.html .
  108. .PP
  109. Any typographical or formatting errors that appear
  110. in this page are most likely
  111. to have been introduced during the conversion of the source files to
  112. man page format. To report such errors, see
  113. https://www.kernel.org/doc/man-pages/reporting_bugs.html .