siscanf - Untitled
Description: Untitled

Next: sprintf, Previous: siprintf, Up: Stdio

### 4.59 `siscanf`, `fiscanf`, `iscanf`—scan and format non-floating input

Synopsis

         #include <stdio.h>

         int iscanf(const char *format, ...);
         int fiscanf(FILE *fd, const char *format, ...);
         int siscanf(const char *str, const char *format, ...);

         int _iscanf_r(struct _reent *ptr, const char *format, ...);
         int _fiscanf_r(struct _reent *ptr, FILE *fd,
             const char *format, ...);
         int _siscanf_r(struct _reent *ptr, const char *str,
             const char *format, ...);

Description
`iscanf`, `fiscanf`, and `siscanf` are the same as `scanf`, `fscanf`, and `sscanf` respectively, only that they restrict the available formats to non-floating-point format specifiers.

The routines `_iscanf_r`, `_fiscanf_r`, and `_siscanf_r` are reentrant versions of `iscanf`, `fiscanf`, and `siscanf` that take an additional first argument pointing to a reentrancy structure.

Returns
`iscanf` returns the number of input fields successfully scanned, converted and stored; the return value does not include scanned fields which were not stored.

If `iscanf` attempts to read at end-of-file, the return value is `EOF`.

If no fields were stored, the return value is `0`.

Portability
`iscanf`, `fiscanf`, and `siscanf` are newlib extensions.

Supporting OS subroutines required: `close`, `fstat`, `isatty`, `lseek`, `read`, `sbrk`, `write`.