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

strtoimax.3p (3389B)


  1. '\" et
  2. .TH STRTOIMAX "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. strtoimax,
  12. strtoumax
  13. \(em convert string to integer type
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <inttypes.h>
  18. .P
  19. intmax_t strtoimax(const char *restrict \fInptr\fP, char **restrict \fIendptr\fP,
  20. int \fIbase\fP);
  21. uintmax_t strtoumax(const char *restrict \fInptr\fP, char **restrict \fIendptr\fP,
  22. int \fIbase\fP);
  23. .fi
  24. .SH DESCRIPTION
  25. The functionality described on this reference page is aligned with the
  26. ISO\ C standard. Any conflict between the requirements described here and the
  27. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  28. .P
  29. These functions shall be equivalent to the
  30. \fIstrtol\fR(),
  31. \fIstrtoll\fR(),
  32. \fIstrtoul\fR(),
  33. and
  34. \fIstrtoull\fR()
  35. functions, except that the initial portion of the string shall be
  36. converted to
  37. .BR intmax_t
  38. and
  39. .BR uintmax_t
  40. representation, respectively.
  41. .SH "RETURN VALUE"
  42. These functions shall return the converted value, if any.
  43. .P
  44. If no conversion could be performed, zero shall be returned
  45. and
  46. .IR errno
  47. may be set to
  48. .BR [EINVAL] .
  49. .P
  50. If the value of
  51. .IR base
  52. is not supported, 0 shall be returned and
  53. .IR errno
  54. shall be set to
  55. .BR [EINVAL] .
  56. .P
  57. If the correct value is outside the range of representable values,
  58. {INTMAX_MAX},
  59. {INTMAX_MIN},
  60. or
  61. {UINTMAX_MAX}
  62. shall be returned (according to the return type and sign of the value,
  63. if any), and
  64. .IR errno
  65. shall be set to
  66. .BR [ERANGE] .
  67. .SH ERRORS
  68. These functions shall fail if:
  69. .TP
  70. .BR EINVAL
  71. The value of
  72. .IR base
  73. is not supported.
  74. .TP
  75. .BR ERANGE
  76. The value to be returned is not representable.
  77. .P
  78. These functions may fail if:
  79. .TP
  80. .BR EINVAL
  81. No conversion could be performed.
  82. .LP
  83. .IR "The following sections are informative."
  84. .SH EXAMPLES
  85. None.
  86. .SH "APPLICATION USAGE"
  87. Since the value of
  88. .IR *endptr
  89. is unspecified if the value of
  90. .IR base
  91. is not supported, applications should either ensure that
  92. .IR base
  93. has a supported value (0 or between 2 and 36) before the call, or check
  94. for an
  95. .BR [EINVAL]
  96. error before examining
  97. .IR *endptr .
  98. .SH RATIONALE
  99. None.
  100. .SH "FUTURE DIRECTIONS"
  101. None.
  102. .SH "SEE ALSO"
  103. .IR "\fIstrtol\fR\^(\|)",
  104. .IR "\fIstrtoul\fR\^(\|)"
  105. .P
  106. The Base Definitions volume of POSIX.1\(hy2017,
  107. .IR "\fB<inttypes.h>\fP"
  108. .\"
  109. .SH COPYRIGHT
  110. Portions of this text are reprinted and reproduced in electronic form
  111. from IEEE Std 1003.1-2017, Standard for Information Technology
  112. -- Portable Operating System Interface (POSIX), The Open Group Base
  113. Specifications Issue 7, 2018 Edition,
  114. Copyright (C) 2018 by the Institute of
  115. Electrical and Electronics Engineers, Inc and The Open Group.
  116. In the event of any discrepancy between this version and the original IEEE and
  117. The Open Group Standard, the original IEEE and The Open Group Standard
  118. is the referee document. The original Standard can be obtained online at
  119. http://www.opengroup.org/unix/online.html .
  120. .PP
  121. Any typographical or formatting errors that appear
  122. in this page are most likely
  123. to have been introduced during the conversion of the source files to
  124. man page format. To report such errors, see
  125. https://www.kernel.org/doc/man-pages/reporting_bugs.html .