Article View: comp.std.c
Article #3554Re: printf() format extensions - looking for beta testers...
From: Ari Lukumies
Date: Fri, 12 Apr 1996 12:30
Date: Fri, 12 Apr 1996 12:30
28 lines
1314 bytes
1314 bytes
Peter Seebach wrote:
>
>
> The basic idea of the proposed feature is that users would be able to install
> new formats; for instance, the user would
> do something like
> int bangcvt(va_list *ap, char *s, int len, fmtspec *f) {
> strncpy(s, strerror(errno), len);
> s[len - 1] = '\0';
> return strlen(s);
> }
>
> main() {
> format('!', bangcvt);
>
> /* do something which can generate an error */
> fprintf(stderr, "%s: %!\n", "open failed");
> }
Given the above, how about calls like (well, not a pretty one, but you get the
idea...):
fprintf(stderr, "%-*.2!", something);
Later,
AriL
--
All my opinions are mine and mine alone.
Technical Details
Message-ID:
<4klicn$ndl@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4kgljv$l2p@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi> Newsgroups: comp.std.c,comp.lang.c.moderated Subject: Re: printf() format extensions - looking for beta testers... Date: 12 Apr 1996 07:30:15 -0500 Organization: Carelcomp Products Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4klicn$ndl@solutions.solon.com> References: <4kgljv$l2p@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Mailer: Mozilla 2.0 (WinNT; I)