see stk(3) and stkopen() that retruns an Sfio_t* call sfputr() sfputc() sfwrite() sfprintf() to add to the stack and stktell() to get the offset of each item appended to the stack and stkptr() to get the actual pointers ksh93 uses uses stk*() and stak*() throughout the code src/cmd/ksh93/*/*.c -- grep for stak[a-z]*( stak*() is a stk*() variant that write to one global stack
or see sfio.h and sfstropen() that returns an Sfio_t* the sfstr*() function macros are not defined in sfio(3) -- this will be fixed this summer libast and nmake use sfstr*() throughout the code src/cmd/nmake/*.c -- grep for sfstropen()...sfstrclose() pairs (across multiple lines) stk*() is typically used for manipulating a collection of related items sfstr*() is typically used for manipulating one item, typically a path On Tue, 24 Jul 2012 11:51:44 +0200 Simon Toedt wrote: > I'm looking for code examples which show how I can allocate C strings > using sfio string streams. Has anyone an example how I can get the > sfio equivalent of strdup() for "aaaa", "bbbbbb" and "cccccccc" and a > malloc(256), get pointers back to the strings and allocated memory in > the sfio stream and finally deallocate the whole memory after all work > has been done? > Simon > _______________________________________________ > ast-developers mailing list > ast-developers@research.att.com > https://mailman.research.att.com/mailman/listinfo/ast-developers _______________________________________________ ast-developers mailing list ast-developers@research.att.com https://mailman.research.att.com/mailman/listinfo/ast-developers