one note on the sfstr*() functions
a few are macros that call underlying sfio functions directly
        sfstropen() calls sfnew()
        sfstrclose() calls sfclose()
        sfstruse() calls sfputc()
        sfstrrsrv() calls sfreserve() and sfwrite()
        sfstrbuf() calls sfsetbuf()
the rest are macros on the Sfio_t stream with no function call

On Tue, 20 Apr 2010 15:56:09 -0400 Glenn Fowler wrote:
> error checking left to the reader

> #include <sfio.h>
> Sfio_t*       sp = sfstropen();
>       sfprintf(sp, ...), sfputc(sp, ...), sfwrite(sp, ...)
> sfwrite(sfstdout, sfstrbase(sp), sfstrtell(sp));
> sfstrclose(sp);

> in the ast code you'll also see the sfstropen() string left open
> for multiple uses with this when the consructed string is to be used:
>       char* s = sfstruse(sp);
> this adds a '\0', rewinds the string stream to 0, and returns a pointer to 
> the base

> On Tue, 20 Apr 2010 19:44:15 +0200 =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= 
> wrote:
> > List, I am looking for a simple example how I can create a sfio
> > stream, which keeps all data in memory, write to it and then flush the
> > content of this string to sfstdout and then destroy the stream.

> > Olga

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to