1<html lang="en"> 2<head> 3<title>siscanf - Untitled</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Untitled"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Stdio.html#Stdio" title="Stdio"> 9<link rel="prev" href="siprintf.html#siprintf" title="siprintf"> 10<link rel="next" href="sprintf.html#sprintf" title="sprintf"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<meta http-equiv="Content-Style-Type" content="text/css"> 13<style type="text/css"><!-- 14 pre.display { font-family:inherit } 15 pre.format { font-family:inherit } 16 pre.smalldisplay { font-family:inherit; font-size:smaller } 17 pre.smallformat { font-family:inherit; font-size:smaller } 18 pre.smallexample { font-size:smaller } 19 pre.smalllisp { font-size:smaller } 20 span.sc { font-variant:small-caps } 21 span.roman { font-family:serif; font-weight:normal; } 22 span.sansserif { font-family:sans-serif; font-weight:normal; } 23--></style> 24<link rel="stylesheet" type="text/css" href="../cs.css"> 25</head> 26<body> 27<div class="node"> 28<a name="siscanf"></a> 29<p> 30Next: <a rel="next" accesskey="n" href="sprintf.html#sprintf">sprintf</a>, 31Previous: <a rel="previous" accesskey="p" href="siprintf.html#siprintf">siprintf</a>, 32Up: <a rel="up" accesskey="u" href="Stdio.html#Stdio">Stdio</a> 33<hr> 34</div> 35 36<h3 class="section">4.59 <code>siscanf</code>, <code>fiscanf</code>, <code>iscanf</code>—scan and format non-floating input</h3> 37 38<p><a name="index-iscanf-279"></a><a name="index-g_t_005fiscanf_005fr-280"></a><a name="index-fiscanf-281"></a><a name="index-g_t_005ffiscanf_005fr-282"></a><a name="index-siscanf-283"></a><a name="index-g_t_005fsiscanf_005fr-284"></a><strong>Synopsis</strong> 39<pre class="example"> #include <stdio.h> 40 41 int iscanf(const char *<var>format</var>, ...); 42 int fiscanf(FILE *<var>fd</var>, const char *<var>format</var>, ...); 43 int siscanf(const char *<var>str</var>, const char *<var>format</var>, ...); 44 45 int _iscanf_r(struct _reent *<var>ptr</var>, const char *<var>format</var>, ...); 46 int _fiscanf_r(struct _reent *<var>ptr</var>, FILE *<var>fd</var>, 47 const char *<var>format</var>, ...); 48 int _siscanf_r(struct _reent *<var>ptr</var>, const char *<var>str</var>, 49 const char *<var>format</var>, ...); 50 51</pre> 52 <p><strong>Description</strong><br> 53<code>iscanf</code>, <code>fiscanf</code>, and <code>siscanf</code> are the same as 54<code>scanf</code>, <code>fscanf</code>, and <code>sscanf</code> respectively, only that 55they restrict the available formats to non-floating-point 56format specifiers. 57 58 <p>The routines <code>_iscanf_r</code>, <code>_fiscanf_r</code>, and <code>_siscanf_r</code> are reentrant 59versions of <code>iscanf</code>, <code>fiscanf</code>, and <code>siscanf</code> that take an additional 60first argument pointing to a reentrancy structure. 61 62 <p><br> 63<strong>Returns</strong><br> 64<code>iscanf</code> returns the number of input fields successfully 65scanned, converted and stored; the return value does 66not include scanned fields which were not stored. 67 68 <p>If <code>iscanf</code> attempts to read at end-of-file, the return 69value is <code>EOF</code>. 70 71 <p>If no fields were stored, the return value is <code>0</code>. 72 73 <p><br> 74<strong>Portability</strong><br> 75<code>iscanf</code>, <code>fiscanf</code>, and <code>siscanf</code> are newlib extensions. 76 77 <p>Supporting OS subroutines required: <code>close</code>, <code>fstat</code>, <code>isatty</code>, 78<code>lseek</code>, <code>read</code>, <code>sbrk</code>, <code>write</code>. 79 80 <p><br> 81 82 </body></html> 83 84