Article View: comp.std.c
Article #3562Re: printf() format extensions - looking for beta testers...
From: Peter Seebach
Date: Mon, 15 Apr 1996 04:43
Date: Mon, 15 Apr 1996 04:43
38 lines
2097 bytes
2097 bytes
In article <4kr78t$kao@solutions.solon.com>, Casper H.S. Dik - Network Security Engineer <Casper.Dik@Holland.Sun.COM> wrote: >Yes, it seems that the format call back function (bangcvt) should take >a number of flags (leading 0/- found, precision, maximum width) and >a generic way to make the user defined format specifier output characters, >as it can be called from functions like "snprintf", which limit the output. >Passing a buffer to but the output in doesn't strike me as sufficient; >if "bangcvt" can have unlimited output, it must be possible for the >mechanism to cater for that. But, of course, the current language only guarantees up to 509 characters. It does get the flags; a fmtspec is a struct containing those and other info. >And, of course, you want a input conversion as well :-) Still working on that. >So instead of: >You'd get something more like: > bangcvt (va_list *ap, int flags, int width, int precision, > char fmt, int (*putit)(char c, void *output), void *output) >(Where you call "putit" for each character of output with *output >as magic for the call back) The problem is that function calls tend to be expensive. The flags, width, and precision are already in the fmtspec *. -s -- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach. C/Unix wizard -- C/Unix questions? Send mail for help. No, really! FUCK the communications decency act. Goddamned government. [literally.] The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
Technical Details
Message-ID:
<4ksk6a$rl5@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4kgljv$l2p@solutions.solon.com> <4klicn$ndl@solutions.solon.com> <4kr78t$kao@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: seebs@solon.com (Peter Seebach) Newsgroups: comp.std.c,comp.lang.c.moderated Subject: Re: printf() format extensions - looking for beta testers... Date: 14 Apr 1996 23:43:54 -0500 Organization: Usenet Fact Police (Undercover) Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4ksk6a$rl5@solutions.solon.com> References: <4kgljv$l2p@solutions.solon.com> <4klicn$ndl@solutions.solon.com> <4kr78t$kao@solutions.solon.com> Reply-To: seebs@solon.com NNTP-Posting-Host: solutions.solon.com