Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

viscanf.html 4.7KB

3 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>viscanf (The Red Hat newlib C Library)</title>
  7. <meta name="description" content="viscanf (The Red Hat newlib C Library)">
  8. <meta name="keywords" content="viscanf (The Red Hat newlib C Library)">
  9. <meta name="resource-type" content="document">
  10. <meta name="distribution" content="global">
  11. <meta name="Generator" content="makeinfo">
  12. <link href="index.html#Top" rel="start" title="Top">
  13. <link href="Document-Index.html#Document-Index" rel="index" title="Document Index">
  14. <link href="Document-Index.html#SEC_Contents" rel="contents" title="Table of Contents">
  15. <link href="Stdio.html#Stdio" rel="up" title="Stdio">
  16. <link href="Strings.html#Strings" rel="next" title="Strings">
  17. <link href="viprintf.html#viprintf" rel="prev" title="viprintf">
  18. <style type="text/css">
  19. <!--
  20. a.summary-letter {text-decoration: none}
  21. blockquote.indentedblock {margin-right: 0em}
  22. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  23. blockquote.smallquotation {font-size: smaller}
  24. div.display {margin-left: 3.2em}
  25. div.example {margin-left: 3.2em}
  26. div.lisp {margin-left: 3.2em}
  27. div.smalldisplay {margin-left: 3.2em}
  28. div.smallexample {margin-left: 3.2em}
  29. div.smalllisp {margin-left: 3.2em}
  30. kbd {font-style: oblique}
  31. pre.display {font-family: inherit}
  32. pre.format {font-family: inherit}
  33. pre.menu-comment {font-family: serif}
  34. pre.menu-preformatted {font-family: serif}
  35. pre.smalldisplay {font-family: inherit; font-size: smaller}
  36. pre.smallexample {font-size: smaller}
  37. pre.smallformat {font-family: inherit; font-size: smaller}
  38. pre.smalllisp {font-size: smaller}
  39. span.nolinebreak {white-space: nowrap}
  40. span.roman {font-family: initial; font-weight: normal}
  41. span.sansserif {font-family: sans-serif; font-weight: normal}
  42. ul.no-bullet {list-style: none}
  43. -->
  44. </style>
  45. </head>
  46. <body lang="en">
  47. <a name="viscanf"></a>
  48. <div class="header">
  49. <p>
  50. Previous: <a href="viprintf.html#viprintf" accesskey="p" rel="prev">viprintf</a>, Up: <a href="Stdio.html#Stdio" accesskey="u" rel="up">Stdio</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  51. </div>
  52. <hr>
  53. <a name="viscanf_002c-vfiscanf_002c-vsiscanf_002d_002d_002dformat-argument-list"></a>
  54. <h3 class="section">4.75 <code>viscanf</code>, <code>vfiscanf</code>, <code>vsiscanf</code>&mdash;format argument list</h3>
  55. <a name="index-viscanf"></a>
  56. <a name="index-_005fviscanf_005fr"></a>
  57. <a name="index-vfiscanf"></a>
  58. <a name="index-_005fvfiscanf_005fr"></a>
  59. <a name="index-vsiscanf"></a>
  60. <a name="index-_005fvsiscanf_005fr"></a>
  61. <p><strong>Synopsis</strong>
  62. </p><div class="example">
  63. <pre class="example">#include &lt;stdio.h&gt;
  64. #include &lt;stdarg.h&gt;
  65. int viscanf(const char *<var>fmt</var>, va_list <var>list</var>);
  66. int vfiscanf(FILE *<var>fp</var>, const char *<var>fmt</var>, va_list <var>list</var>);
  67. int vsiscanf(const char *<var>str</var>, const char *<var>fmt</var>, va_list <var>list</var>);
  68. int _viscanf_r(struct _reent *<var>reent</var>, const char *<var>fmt</var>,
  69. va_list <var>list</var>);
  70. int _vfiscanf_r(struct _reent *<var>reent</var>, FILE *<var>fp</var>, const char *<var>fmt</var>,
  71. va_list <var>list</var>);
  72. int _vsiscanf_r(struct _reent *<var>reent</var>, const char *<var>str</var>,
  73. const char *<var>fmt</var>, va_list <var>list</var>);
  74. </pre></div>
  75. <p><strong>Description</strong><br>
  76. <code>viscanf</code>, <code>vfiscanf</code>, and <code>vsiscanf</code> are (respectively) variants
  77. of <code>iscanf</code>, <code>fiscanf</code>, and <code>siscanf</code>. They differ only in
  78. allowing their caller to pass the variable argument list as a
  79. <code>va_list</code> object (initialized by <code>va_start</code>) rather than
  80. directly accepting a variable number of arguments.
  81. </p>
  82. <br>
  83. <p><strong>Returns</strong><br>
  84. The return values are consistent with the corresponding functions:
  85. <code>viscanf</code> returns the number of input fields successfully scanned,
  86. converted, and stored; the return value does not include scanned
  87. fields which were not stored.
  88. </p>
  89. <p>If <code>viscanf</code> attempts to read at end-of-file, the return value
  90. is <code>EOF</code>.
  91. </p>
  92. <p>If no fields were stored, the return value is <code>0</code>.
  93. </p>
  94. <p>The routines <code>_viscanf_r</code>, <code>_vfiscanf_f</code>, and <code>_vsiscanf_r</code> are
  95. reentrant versions which take an additional first parameter which points to the
  96. reentrancy structure.
  97. </p>
  98. <br>
  99. <p><strong>Portability</strong><br>
  100. These are newlib extensions.
  101. </p>
  102. <p>Supporting OS subroutines required:
  103. </p>
  104. <br>
  105. </body>
  106. </html>