wiki
libshare_membuf

Dynamic Memory Buffers

A dynamic memory buffer is a vector of binary data. Allocation is handled automatically. This functionality is primarily used for the case where the final size of a data segment is variable. The function is used in order to allocate a new memory-based buffer. Alternatively, the may be used in order to mirror the contents of the file to the buffer. Note that this functionality may alter the file size to accomodate the system call. shbuf_init() group__libshare__membuf_1gafac914ba170c0f2a9bc8c2add3a63a41 member shbuf_file() group__libshare__membuf_1ga69b8fb1599d680886b2ca13deff39c18 member mmap() The function is used in order to de-allocate the buffer. Alternatively, the function can be used in order to return the underlying data segment while also de-allocation the resources used to store it in the buffer. shbuf_free() group__libshare__membuf_1ga8192e9e8db3fe89bcf93676230f693e9 member shbuf_unmap() The and functions are used to append binary and ascii data, respectively, onto the buffer. The can be used to return the current data content and the function can be used to return the current size of the data content. shbuf_cat() group__libshare__membuf_1ga2d5423cb4f2f81c682865273be9b13a4 member shbuf_catstr() group__libshare__membuf_1ga56d0f66573d2b73619ac9ee6550fda66 member shbuf_data() shbuf_size() group__libshare__membuf_1ga0d2961e1d67436bb57d628fc502d09f5 member Dynamic memory buffers are used through-out the libshare runtime library.
{
const
char
*test=
"test"
;
*buff=(); shbuf_t structshbuf__t compound A memory buffer that utilizes that re-uses available memory to reduce OS overhead... shbuf_init group__libshare__membuf_1gafac914ba170c0f2a9bc8c2add3a63a41 member Initialize a memory buffer for use.
*cmp_buff=shbuf_wrap(test,strlen(test)); shbuf_t structshbuf__t compound A memory buffer that utilizes that re-uses available memory to reduce OS overhead...
(buff,test); shbuf_catstr group__libshare__membuf_1ga56d0f66573d2b73619ac9ee6550fda66 member Inserts a string into a shbuf_t memory pool.
(TRUE==(buff,cmp_buff)); shbuf_cmp group__libshare__membuf_1ga73378702cf29c93cc1951f113d61e7c3 member
(&buff); shbuf_free group__libshare__membuf_1ga8192e9e8db3fe89bcf93676230f693e9 member Frees the resources utilizited by the memory buffer.
(&cmp_buff); shbuf_free group__libshare__membuf_1ga8192e9e8db3fe89bcf93676230f693e9 member Frees the resources utilizited by the memory buffer.
}