Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

ne_buffer_finish (3)

Name

ne_buffer_finish - destroy a buffer object

Synopsis

#include <ne_string.h>

void ne_buffer_destroy(ne_buffer *buf);

char *ne_buffer_finish(ne_buffer *buf);

Description

NE_BUFFER_DESTROY(3)          neon API reference          NE_BUFFER_DESTROY(3)



NAME
       ne_buffer_destroy, ne_buffer_finish - destroy a buffer object

SYNOPSIS
       #include <ne_string.h>

       void ne_buffer_destroy(ne_buffer *buf);

       char *ne_buffer_finish(ne_buffer *buf);

DESCRIPTION
       ne_buffer_destroy frees all memory associated with the buffer.
       ne_buffer_finish frees the buffer structure, but not the actual string
       stored in the buffer, which is returned and must be free()d by the
       caller.

       Any use of the buffer object after calling either of these functions
       gives undefined behaviour.

RETURN VALUE
       ne_buffer_finish returns the malloc-allocated string stored in the
       buffer.

EXAMPLES
       An example use of ne_buffer_finish; the duplicate function returns a
       string made up of n copies of str:

           static char *duplicate(int n, const char *str)
           {
             ne_buffer *buf = ne_buffer_create();
             while (n--) {
               ne_buffer_zappend(buf, str);
             }
             return ne_buffer_finish(buf);
           }


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------+
       |ATTRIBUTE TYPE | ATTRIBUTE VALUE  |
       +---------------+------------------+
       |Availability   | library/neon     |
       +---------------+------------------+
       |Stability      | Volatile         |
       +---------------+------------------+

SEE ALSO
       ne_buffer, ne_buffer_create, ne_buffer_zappend

AUTHOR
       Joe Orton <neon@lists.manyfish.co.uk>
           Author.

COPYRIGHT
NOTES
       Source code for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This software was built from source available at
       https://github.com/oracle/solaris-userland.  The original community
       source was downloaded from
       http://www.webdav.org/neon/neon-0.30.1.tar.gz.

       Further information about this software can be found on the open source
       community website at http://www.webdav.org/neon/.



neon 0.30.1                    23 September 2014          NE_BUFFER_DESTROY(3)