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

wctomb.3p (4032B)


  1. '\" et
  2. .TH WCTOMB "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. wctomb
  12. \(em convert a wide-character code to a character
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdlib.h>
  17. .P
  18. int wctomb(char *\fIs\fP, wchar_t \fIwchar\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The functionality described on this reference page is aligned with the
  22. ISO\ C standard. Any conflict between the requirements described here and the
  23. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  24. .P
  25. The
  26. \fIwctomb\fR()
  27. function shall determine the number of bytes needed to represent the
  28. character corresponding to the wide-character code whose value is
  29. .IR wchar
  30. (including any change in the shift state). It shall store the character
  31. representation (possibly multiple bytes and any special bytes to change
  32. shift state) in the array object pointed to by
  33. .IR s
  34. (if
  35. .IR s
  36. is not a null pointer). At most
  37. {MB_CUR_MAX}
  38. bytes shall be stored. If
  39. .IR wchar
  40. is 0, a null byte shall be stored, preceded by any shift sequence
  41. needed to restore the initial shift state, and
  42. \fIwctomb\fR()
  43. shall be left in the initial shift state.
  44. .P
  45. The behavior of this function is affected by the
  46. .IR LC_CTYPE
  47. category of the current locale. For a state-dependent encoding, this
  48. function shall be placed into its initial state by a call for which its
  49. character pointer argument,
  50. .IR s ,
  51. is a null pointer. Subsequent calls with
  52. .IR s
  53. as other than a null pointer shall cause the internal state of the
  54. function to be altered as necessary. A call with
  55. .IR s
  56. as a null pointer shall cause this function to return a non-zero value
  57. if encodings have state dependency, and 0 otherwise. Changing the
  58. .IR LC_CTYPE
  59. category causes the shift state of this function to be unspecified.
  60. .P
  61. The
  62. \fIwctomb\fR()
  63. function need not be thread-safe.
  64. .P
  65. The implementation shall behave as if no function defined in this volume of POSIX.1\(hy2017
  66. calls
  67. \fIwctomb\fR().
  68. .SH "RETURN VALUE"
  69. If
  70. .IR s
  71. is a null pointer,
  72. \fIwctomb\fR()
  73. shall return a non-zero or 0 value, if character encodings,
  74. respectively, do or do not have state-dependent encodings. If
  75. .IR s
  76. is not a null pointer,
  77. \fIwctomb\fR()
  78. shall return \-1 if the value of
  79. .IR wchar
  80. does not correspond to a valid character, or return the number of
  81. bytes that constitute the character corresponding to the value of
  82. .IR wchar .
  83. .P
  84. In no case shall the value returned be greater than the value of the
  85. {MB_CUR_MAX}
  86. macro.
  87. .SH ERRORS
  88. The
  89. \fIwctomb\fR()
  90. function shall fail if:
  91. .TP
  92. .BR EILSEQ
  93. An invalid wide-character code is detected.
  94. .LP
  95. .IR "The following sections are informative."
  96. .SH EXAMPLES
  97. None.
  98. .SH "APPLICATION USAGE"
  99. None.
  100. .SH RATIONALE
  101. None.
  102. .SH "FUTURE DIRECTIONS"
  103. None.
  104. .SH "SEE ALSO"
  105. .IR "\fImblen\fR\^(\|)",
  106. .IR "\fImbtowc\fR\^(\|)",
  107. .IR "\fImbstowcs\fR\^(\|)",
  108. .IR "\fIwcstombs\fR\^(\|)"
  109. .P
  110. The Base Definitions volume of POSIX.1\(hy2017,
  111. .IR "\fB<stdlib.h>\fP"
  112. .\"
  113. .SH COPYRIGHT
  114. Portions of this text are reprinted and reproduced in electronic form
  115. from IEEE Std 1003.1-2017, Standard for Information Technology
  116. -- Portable Operating System Interface (POSIX), The Open Group Base
  117. Specifications Issue 7, 2018 Edition,
  118. Copyright (C) 2018 by the Institute of
  119. Electrical and Electronics Engineers, Inc and The Open Group.
  120. In the event of any discrepancy between this version and the original IEEE and
  121. The Open Group Standard, the original IEEE and The Open Group Standard
  122. is the referee document. The original Standard can be obtained online at
  123. http://www.opengroup.org/unix/online.html .
  124. .PP
  125. Any typographical or formatting errors that appear
  126. in this page are most likely
  127. to have been introduced during the conversion of the source files to
  128. man page format. To report such errors, see
  129. https://www.kernel.org/doc/man-pages/reporting_bugs.html .