implement asnprintf, take 2
Eric Blake
ebb9@byu.net
Mon Apr 30 14:41:00 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Jeff Johnston on 4/24/2007 1:03 PM:
> Eric,
>
> A number of issues regarding ELIX_LEVEL. These new functions should be
> level 4. That means you need a new set of ELIX_4_SOURCES and you simply
> verify that the level is not 1, 2, or 3. Add ELIX_4_SOURCES to the list
> of sources below. Very straightforward.
>
> This patch has revealed an error I hadn't spotted before. The dprintf
> family cannot refer to a higher level ELIX function so they must be put
> into the LEVEL 2 sources with asprintf, etc..
>
> Finally, the dprintf changes you have made need to either be left out
> or you need to fork the code based on the ELIX level and call the new
> LEVEL 4 functions when the _ELIX_LEVEL flag is undefined or >3.
This version is a bit bigger, because it also improves the documentation
(let me know if I need to split it into two independent patches). I went
ahead and documented %a, even though it is not implemented yet (I'm still
working on that). This version also fixes Makefile.am to put dprintf and
asnprintf in ELIX_4_SOURCES. I've tested that cygwin can still be built
with this patch.
2007-04-28 Eric Blake <ebb9@byu.net>
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/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.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGM1KT84KuGfSFAYARAvX4AJ9HpH8BcsJtcyBf11rzU6HjwhFk8wCgzxjX
HF7HgEjdRe5puwXX1tP5r1M=
=irsJ
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: newlib.patch13
URL: <http://sourceware.org/pipermail/newlib/attachments/20070430/124a8cdd/attachment.ksh>
More information about the Newlib
mailing list