Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ne_buffer_finish(3) [redhat man page]

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); } SEE ALSO
ne_buffer(3), ne_buffer_create(3), ne_buffer_zappend(3) AUTHOR
Joe Orton <neon@webdav.org>. neon 0.23.5 8 October 2002 NE_BUFFER_DESTROY(3)

Check Out this Related Man Page

NE_BUFFER_APPEND(3)						neon API reference					       NE_BUFFER_APPEND(3)

NAME
ne_buffer_append, ne_buffer_zappend, ne_buffer_concat - append data to a string buffer SYNOPSIS
#include <ne_string.h> void ne_buffer_append (ne_buffer *buf, const char *string, size_t len); void ne_buffer_zappend (ne_buffer *buf, const char *string); void ne_buffer_concat (ne_buffer *buf, const char *str, ...); DESCRIPTION
The ne_buffer_append and ne_buffer_zappend functions append a string to the end of a buffer; extending the buffer as necessary. The len passed to ne_buffer_append specifies the length of the string to append; there must be no NUL terminator in the first len bytes of the string. ne_buffer_zappend must be passed a NUL-terminated string. The ne_buffer_concat function takes a variable-length argument list following str; each argument must be a char * pointer to a NUL-termi- nated string. A NULL pointer must be given as the last argument to mark the end of the list. The strings (including str) are appended to the buffer in the order given. None of the strings passed to ne_buffer_concat are modified. EXAMPLES
The following code will output "Hello, world. And goodbye.". ne_buffer *buf = ne_buffer_create(); ne_buffer_zappend(buf, "Hello"); ne_buffer_concat(buf, ", world. ", "And ", "goodbye.", NULL); puts(buf->data); ne_buffer_destroy(buf); SEE ALSO
ne_buffer(3), ne_buffer_create(3), ne_buffer_destroy(3) AUTHOR
Joe Orton <neon@webdav.org>. neon 0.23.5 8 October 2002 NE_BUFFER_APPEND(3)
Man Page

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding duplicate data in a file

A pogram named LOGGEDON returns an output of: Ref_num IP Address Logged on User 12000 10.10.12.12 12-02-2002 11:00 john 12004 10.10.12.13 12-03-2002 14:00 mary 12012 10.10.12.14 12-03-2002 11:30 bob 12024 ... (1 Reply)
Discussion started by: dinplant
1 Replies

2. Shell Programming and Scripting

Regular expression match

Hi all, any idea how to match the following: char*<no or any string or space> buf and char *<no or any string or space> buf i need to capture the buf characters too. currently i need two checks to cover this: #search char* <any string> buf or char *<any string> buf @noarray =... (2 Replies)
Discussion started by: ChaMeN
2 Replies

3. Shell Programming and Scripting

Deleting lines of a file if they exist in another file

I have a reference file that needs to remain static and another file that may or may not have duplicate rows that match the reference file. I need help with a command that will delete any duplicate rows from the second file while leaving reference file intact For example reference file would... (4 Replies)
Discussion started by: bjdamon
4 Replies

4. Programming

What is use of "char __user *buf"?

I have seen several function containing "char __user *buf" as parameter. this is disturbing my basic knowledge of c the basic syntax says char *buf means buf is a pointer which points to a char now what does char __user *buf means? Please reply (2 Replies)
Discussion started by: kg_gaurav
2 Replies