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
> --
> , _ _ ,
> { \/`o;====- Olga Kryzhanovska -====;o`\/ }
> .----'-/`-/ [email protected] \-`\-'----.
> `'-..-| / Solaris/BSD//C/C++ programmer \ |-..-'`
> /\/\ /\/\
> `--` `--`
> _______________________________________________
> ast-developers mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-developers
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers