Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2007-05-04 06:55:16 +0400
committerEric Blake <eblake@redhat.com>2007-05-04 06:55:16 +0400
commitb9db5292223d1e716a126b5db8a69391ba4ef73e (patch)
tree15865fe52e65c81bee2654b162c38aeed9743c29 /newlib/libc/stdio/siprintf.c
parentfb3937fade3487b7bd181bc6ab50c74637b6757f (diff)
Add support for asnprintf, and improve *printf documentation.
* libc/stdio/Makefile.am (ELIX_SOURCES): Rename... (ELIX_2_SOURCES): ...to this. (ELIX_4_SOURCES): Add new variable. Build asnprintf. (GENERAL_SOURCES): Move dprintf to ELIX_4_SOURCES. (CHEWOUT_FILES): Include diprintf in documentation. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/diprintf.c: Improve documentation. * libc/stdio/dprintf.c: Likewise. * libc/stdio/siprintf.c: Likewise. * libc/stdio/sprintf.c: Likewise. * libc/stdio/vfprintf.c: Likewise. * libc/stdio/viprintf.c: Likewise. * libc/stdio/vsniprintf.c: Consolidate documentation. * libc/stdio/asiprintf.c: Refer to documentation. * libc/stdio/asprintf.c: Likewise. * libc/stdio/fiprintf.c: Likewise. * libc/stdio/fprintf.c: Likewise. * libc/stdio/iprintf.c: Likewise. * libc/stdio/printf.c: Likewise. * libc/stdio/sniprintf.c: Likewise. * libc/stdio/vdiprintf.c: Likewise. * libc/stdio/vdprintf.c: Likewise. * libc/stdio/vsiprintf.c: Likewise. * libc/stdio/fvwrite.c (__sfvwrite_r): Handle asnprintf. * libc/stdio/asniprintf.c (asniprintf, _asniprintf_r): New file. * libc/stdio/asnprintf.c (asnprintf, _asnprintf_r): New file. * libc/stdio/vasniprintf.c (vasniprintf, _vasniprintf_r): New file. * libc/stdio/vasnprintf.c (vasnprintf, _vasnprintf_r): New file. * libc/stdio/vdprintf.c (_vdprintf_r): Rewrite to avoid malloc in typical case. * libc/stdio/vdiprintf.c (_vdiprintf_r): Likewise. * libc/include/stdio.h: Add prototypes for new functions; sort existing functions.
Diffstat (limited to 'newlib/libc/stdio/siprintf.c')
-rw-r--r--newlib/libc/stdio/siprintf.c72
1 files changed, 34 insertions, 38 deletions
diff --git a/newlib/libc/stdio/siprintf.c b/newlib/libc/stdio/siprintf.c
index 4e8e95aaa..d2b4e76c9 100644
--- a/newlib/libc/stdio/siprintf.c
+++ b/newlib/libc/stdio/siprintf.c
@@ -17,18 +17,20 @@
/*
FUNCTION
- <<iprintf>>, <<fiprintf>>, <<asiprintf>>, <<siprintf>>, <<sniprintf>>---format output
+<<iprintf>>, <<fiprintf>>, <<siprintf>>, <<sniprintf>>, <<asiprintf>>, <<asniprintf>>---format output (integer only)
INDEX
fiprintf
INDEX
iprintf
INDEX
- asiprintf
-INDEX
siprintf
INDEX
sniprintf
+INDEX
+ asiprintf
+INDEX
+ asniprintf
ANSI_SYNOPSIS
#include <stdio.h>
@@ -36,50 +38,44 @@ ANSI_SYNOPSIS
int iprintf(const char *<[format]> [, <[arg]>, ...]);
int fiprintf(FILE *<[fd]>, const char *<[format]> [, <[arg]>, ...]);
int siprintf(char *<[str]>, const char *<[format]> [, <[arg]>, ...]);
- int asiprintf(char **<[strp]>, const char *<[format]> [, <[arg]>, ...]);
int sniprintf(char *<[str]>, size_t <[size]>, const char *<[format]>
[, <[arg]>, ...]);
-
-TRAD_SYNOPSIS
- #include <stdio.h>
-
- int iprintf(<[format]> [, <[arg]>, ...])
- char *<[format]>;
-
- int fiprintf(<[fd]>, <[format]> [, <[arg]>, ...]);
- FILE *<[fd]>;
- char *<[format]>;
-
- int asiprintf(<[strp]>, <[format]> [, <[arg]>, ...]);
- char **<[strp]>;
- char *<[format]>;
-
- int siprintf(<[str]>, <[format]> [, <[arg]>, ...]);
- char *<[str]>;
- char *<[format]>;
-
- int sniprintf(<[str]>, size_t <[size]>, <[format]> [, <[arg]>, ...]);
- char *<[str]>;
- size_t <[size]>;
- char *<[format]>;
+ int asiprintf(char **<[strp]>, const char *<[format]> [, <[arg]>, ...]);
+ char *asniprintf(char *<[str]>, size_t *<[size]>, const char *<[format]>
+ [, <[arg]>, ...]);
+
+ int _iprintf_r(struct _reent *<[ptr]>, const char *<[format]>
+ [, <[arg]>, ...]);
+ int _fiprintf_r(struct _reent *<[ptr]>, FILE *<[fd]>,
+ const char *<[format]> [, <[arg]>, ...]);
+ int _siprintf_r(struct _reent *<[ptr]>, char *<[str]>,
+ const char *<[format]> [, <[arg]>, ...]);
+ int _sniprintf_r(struct _reent *<[ptr]>, char *<[str]>, size_t <[size]>,
+ const char *<[format]> [, <[arg]>, ...]);
+ int _asiprintf_r(struct _reent *<[ptr]>, char **<[strp]>,
+ const char *<[format]> [, <[arg]>, ...]);
+ char *_asniprintf_r(struct _reent *<[ptr]>, char *<[str]>,
+ size_t *<[size]>, const char *<[format]>
+ [, <[arg]>, ...]);
DESCRIPTION
<<iprintf>>, <<fiprintf>>, <<siprintf>>, <<sniprintf>>,
- <<asiprintf>>, are the same as <<printf>>, <<fprintf>>,
- <<sprintf>>, <<snprintf>>, and <<asprintf>>, respectively,
- only that they restrict usage to non-floating-point format
- specifiers.
+ <<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
-<<siprintf>> and <<asiprintf>> return the number of bytes in the output string,
-save that the concluding <<NULL>> is not counted.
-<<iprintf>> and <<fiprintf>> return the number of characters transmitted.
-If an error occurs, <<iprintf>> and <<fiprintf>> return <<EOF>> and
-<<asiprintf>> returns -1. No error returns occur for <<siprintf>>.
+Similar to <<printf>>, <<fprintf>>, <<sprintf>>, <<snprintf>>, <<asprintf>>,
+and <<asnprintf>>.
PORTABILITY
-<<iprintf>>, <<fiprintf>>, <<siprintf>>, <<sniprintf>>, and <<asprintf>>
-are newlib extensions.
+<<iprintf>>, <<fiprintf>>, <<siprintf>>, <<sniprintf>>, <<asiprintf>>,
+and <<asniprintf>> are newlib extensions.
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.