9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] srprint...
@ 2004-01-26 18:11 steve-simon
  2004-01-26 18:53 ` rog
  0 siblings, 1 reply; 3+ messages in thread
From: steve-simon @ 2004-01-26 18:11 UTC (permalink / raw)
  To: 9fans

Hi,

I copied and modified the standard libraries smprint()
producing a mutant srprint(Fmt *f, char *fmt, ...);

The idea is that you can call it with a zero'ed Fmt pointer
and then keep srprint()ing into an growing buffer.

I have a filesystem which generates largeish virtual files
(<= 10 Kbytes) which is generated when the file is opened,
This seemed to be the best way to do it but I cannot beleive
noone has had this problem before.

The srprint() returns a pointer to the buffer like smprint()
for disposition and eventual free()ing.

If there is a cleaner way to do this I would like to know.
If people think its nice I could submit it.

Not sure if I'am proud or ashamed...

-Steve


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-27 10:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-26 18:11 [9fans] srprint steve-simon
2004-01-26 18:53 ` rog
2004-01-27 10:15   ` Steve Simon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).