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

wcstok.3p (4145B)


  1. '\" et
  2. .TH WCSTOK "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. wcstok
  12. \(em split a wide-character string into tokens
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <wchar.h>
  17. .P
  18. wchar_t *wcstok(wchar_t *restrict \fIws1\fP, const wchar_t *restrict \fIws2\fP,
  19. wchar_t **restrict \fIptr\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. A sequence of calls to
  27. \fIwcstok\fR()
  28. shall break the wide-character string pointed to by
  29. .IR ws1
  30. into a sequence of tokens, each of which shall be delimited by a
  31. wide-character code from the wide-character string pointed to by
  32. .IR ws2 .
  33. The
  34. .IR ptr
  35. argument points to a caller-provided
  36. .BR wchar_t
  37. pointer into which the
  38. \fIwcstok\fR()
  39. function shall store information necessary for it to continue
  40. scanning the same wide-character string.
  41. .P
  42. The first call in the sequence has
  43. .IR ws1
  44. as its first argument, and is followed by calls with a null pointer as
  45. their first argument. The separator string pointed to by
  46. .IR ws2
  47. may be different from call to call.
  48. .P
  49. The first call in the sequence shall search the wide-character string
  50. pointed to by
  51. .IR ws1
  52. for the first wide-character code that is
  53. .IR not
  54. contained in the current separator string pointed to by
  55. .IR ws2 .
  56. If no such wide-character code is found, then there are no tokens in
  57. the wide-character string pointed to by
  58. .IR ws1
  59. and
  60. \fIwcstok\fR()
  61. shall return a null pointer. If such a wide-character code is found,
  62. it shall be the start of the first token.
  63. .P
  64. The
  65. \fIwcstok\fR()
  66. function shall then search from there for a wide-character code that
  67. .IR is
  68. contained in the current separator string. If no such wide-character
  69. code is found, the current token extends to the end of the
  70. wide-character string pointed to by
  71. .IR ws1 ,
  72. and subsequent searches for a token shall return a null pointer. If
  73. such a wide-character code is found, it shall be overwritten by a null
  74. wide character, which terminates the current token. The
  75. \fIwcstok\fR()
  76. function shall save a pointer to the following wide-character code,
  77. from which the next search for a token shall start.
  78. .P
  79. Each subsequent call, with a null pointer as the value of the first
  80. argument, shall start searching from the saved pointer and behave as
  81. described above.
  82. .P
  83. The implementation shall behave as if no function calls
  84. \fIwcstok\fR().
  85. .SH "RETURN VALUE"
  86. Upon successful completion, the
  87. \fIwcstok\fR()
  88. function shall return a pointer to the first wide-character code of a
  89. token. Otherwise, if there is no token,
  90. \fIwcstok\fR()
  91. shall return a null pointer.
  92. .SH ERRORS
  93. No errors are defined.
  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. The Base Definitions volume of POSIX.1\(hy2017,
  106. .IR "\fB<wchar.h>\fP"
  107. .\"
  108. .SH COPYRIGHT
  109. Portions of this text are reprinted and reproduced in electronic form
  110. from IEEE Std 1003.1-2017, Standard for Information Technology
  111. -- Portable Operating System Interface (POSIX), The Open Group Base
  112. Specifications Issue 7, 2018 Edition,
  113. Copyright (C) 2018 by the Institute of
  114. Electrical and Electronics Engineers, Inc and The Open Group.
  115. In the event of any discrepancy between this version and the original IEEE and
  116. The Open Group Standard, the original IEEE and The Open Group Standard
  117. is the referee document. The original Standard can be obtained online at
  118. http://www.opengroup.org/unix/online.html .
  119. .PP
  120. Any typographical or formatting errors that appear
  121. in this page are most likely
  122. to have been introduced during the conversion of the source files to
  123. man page format. To report such errors, see
  124. https://www.kernel.org/doc/man-pages/reporting_bugs.html .