Next: siscanf, Previous: setvbuf, Up: Stdio

### 4.58 `siprintf`, `fiprintf`, `iprintf`, `sniprintf`, `asiprintf`, `asniprintf`—format output (integer only)

Synopsis

         #include <stdio.h>

         int iprintf(const char *format, ...);
         int fiprintf(FILE *fd, const char *format , ...);
         int siprintf(char *str, const char *format, ...);
         int sniprintf(char *str, size_t size, const char *format,
             ...);
         int asiprintf(char **strp, const char *format, ...);
         char *asniprintf(char *str, size_t *size,
             const char *format, ...);

         int _iprintf_r(struct _reent *ptr, const char *format, ...);
         int _fiprintf_r(struct _reent *ptr, FILE *fd,
             const char *format, ...);
         int _siprintf_r(struct _reent *ptr, char *str,
             const char *format, ...);
         int _sniprintf_r(struct _reent *ptr, char *str, size_t size,
             const char *format, ...);
         int _asiprintf_r(struct _reent *ptr, char **strp,
             const char *format, ...);
         char *_asniprintf_r(struct _reent *ptr, char *str,
             size_t *size, const char *format, ...);

Description
`iprintf`, `fiprintf`, `siprintf`, `sniprintf`, `asiprintf`, and `asniprintf` are the same as `printf`, `fprintf`, `sprintf`, `snprintf`, `asprintf`, and `asnprintf`, respectively, except that they restrict usage to non-floating-point format specifiers.

`_iprintf_r`, `_fiprintf_r`, `_asiprintf_r`, `_siprintf_r`, `_sniprintf_r`, `_asniprintf_r` are simply reentrant versions of the functions above.

Returns
Similar to `printf`, `fprintf`, `sprintf`, `snprintf`, `asprintf`, and `asnprintf`.

Portability
`iprintf`, `fiprintf`, `siprintf`, `sniprintf`, `asiprintf`, and `asniprintf` are newlib extensions.

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