Xref: utzoo comp.unix.wizards:15150 comp.lang.c:17106 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!eecae!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards,comp.lang.c Subject: Re: How to predict size of outcome of vsprintf? Message-ID: <16491@mimsy.UUCP> Date: 22 Mar 89 10:53:47 GMT References: <993@etnibsd.UUCP> <9872@smoke.BRL.MIL> <28831@bu-cs.BU.EDU> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 18 In article bader+@andrew.cmu.edu (Miles Bader) writes: >What I'd really like would be a new function that could act as a basis >for all the other printf functions, and make it possible to emulate >them in nice ways. > >I would make it a varargs function that takes a bounded output buffer >and is restartable at the point where it stops due to running into the >end of the buffer. This is fairly difficult to implement (one wants coroutines for something like this). Instead, why not allow stdio streams to `read' and `write' via user-provided functions? Everyone knows how to use read() and write(); simply provide your own write() that mallocs space, or prints in a window, or whatever. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris