Article View: comp.std.c
Article #3566Re: printf() format extensions - looking for beta testers...
From: Sean 'Captain Napalm' Conner
Date: Wed, 17 Apr 1996 15:47
Date: Wed, 17 Apr 1996 15:47
44 lines
1968 bytes
1968 bytes
In article <4ksk72$rm6@solutions.solon.com> seebs@solon.com writes:
>In article <4kr74a$k8o@solutions.solon.com>,
>Sean 'Captain Napalm' Conner <spc@gate.net> wrote:
>>>%# would be a poor choice; the conversion func for %# is one which returns
>>>a magic cookie to set the alternate format flag. :)
>
>> Oh. Ah. Well. What IS available?
>
>Whatever you want; it's just that if you change %#, you change the behavior
>of existing legal programs.
>
Existing legal programs using your printf()?
I checked, and %#X is a legal (ANSI C) specification, wouldn't you know
8-)
>> Well, why not change the approach?
[ much snipped ]
>> Less chance of clashes, and more flexible I feel.
>
>Well, that would break existing code,
Again, existing code you wrote? Gee, just like make requiring tabs (and
only tabs). Can't fix it, because too many make files would "break" (sorry,
my anti-Unix bias is showing 8-)
>of course; you can actually
>do something similar;
> int funcconv(va_list *ap, char *into, int len, fmtspec *fs) {
> fmtconv fc;
>
> fc = va_arg(*ap, fmtconv);
> return fc(ap, into, len, fs);
> }
>
>And just bind this to whatever character you want. (In my sample
>implementation, it's %<.)
>
But you still have the problem of overloading (what if I wanted to use %<
for something?).
-spc (Hmmm ... I think we're straying here ... )
Technical Details
Message-ID:
<4l33qn$7rv@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4koecq$8up@solutions.solon.com> <4kr74a$k8o@solutions.solon.com> <4ksk72$rm6@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: spc@gate.net (Sean 'Captain Napalm' Conner) Newsgroups: comp.std.c,comp.lang.c.moderated Subject: Re: printf() format extensions - looking for beta testers... Date: 17 Apr 1996 10:47:35 -0500 Organization: CyberGate, Inc. Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4l33qn$7rv@solutions.solon.com> References: <4koecq$8up@solutions.solon.com> <4kr74a$k8o@solutions.solon.com> <4ksk72$rm6@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com