logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

buffer_tosa - initialize buffer for writing to stralloc

Description

       buffer_tosa  makes a virtual write buffer from a stralloc.  The buffer writing functions will append data
       to the stralloc until the stralloc fails to allocate more memory.  You still need to flush the buffer.

       Note that in the end the stralloc will have allocated more memory than  is  needed  to  hold  the  actual
       contents.  The waste is 1024 bytes.

Name

       buffer_tosa - initialize buffer for writing to stralloc

Return Value

       buffer_tosa  returns  0 if everything was fine, -1 if it failed to allocate space for the initial data in
       the stralloc.

See Also

buffer_tosa(3), buffer_init(3), buffer(3)

                                                                                                  buffer_tosa(3)

Syntax

#include<libowfat/buffer.h>

       int buffer_tosa(buffer* b,stralloc* sa);

See Also