Implements WriteBuffer.
WriteBuffer impl | Implements WriteBuffer. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file WriteBuffer. |
C-kern/ | Implementation file WriteBuffer impl. |
wbuffer_t | |
static variables | |
s_wbuffer_errtimer | Simulates an error in <reserve_memblock_wbuffer> and <reserve_cstring_wbuffer>. |
interface implementation | |
alloc_cstring_wbuffer | Resizes cstring_t if necessary and returns additional memory in memstr. |
shrink_cstring_wbuffer | Sets memstr to whole allocated buffer of impl (cstring_t) except for the first new_size bytes. |
size_cstring_wbuffer | Returns size in use of impl (cstring_t). |
alloc_memblock_wbuffer | Resizes memblock_t if necessary and returns additional memory in memstr. |
shrink_memblock_wbuffer | Sets memstr to whole allocated buffer of impl (memblock_t) except for the first new_size bytes. |
size_memblock_wbuffer | Returns number of appended bytes of impl (memblock_t). |
alloc_static_wbuffer | Returns always ENOMEM. |
shrink_static_wbuffer | Sets wbuf->next to start+new_size of static buffer. |
size_static_wbuffer | Returns number of appended bytes. |
global variables | |
change | |
test |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2011 Jörg Seebohn
Header file WriteBuffer.
Implementation file WriteBuffer impl.
static variables | |
s_wbuffer_errtimer | Simulates an error in <reserve_memblock_wbuffer> and <reserve_cstring_wbuffer>. |
interface implementation | |
alloc_cstring_wbuffer | Resizes cstring_t if necessary and returns additional memory in memstr. |
shrink_cstring_wbuffer | Sets memstr to whole allocated buffer of impl (cstring_t) except for the first new_size bytes. |
size_cstring_wbuffer | Returns size in use of impl (cstring_t). |
alloc_memblock_wbuffer | Resizes memblock_t if necessary and returns additional memory in memstr. |
shrink_memblock_wbuffer | Sets memstr to whole allocated buffer of impl (memblock_t) except for the first new_size bytes. |
size_memblock_wbuffer | Returns number of appended bytes of impl (memblock_t). |
alloc_static_wbuffer | Returns always ENOMEM. |
shrink_static_wbuffer | Sets wbuf->next to start+new_size of static buffer. |
size_static_wbuffer | Returns number of appended bytes. |
global variables | |
change | |
test |
static int alloc_cstring_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Resizes cstring_t if necessary and returns additional memory in memstr.
static int shrink_cstring_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Sets memstr to whole allocated buffer of impl (cstring_t) except for the first new_size bytes.
static size_t size_cstring_wbuffer( void * impl, const memstream_t * memstr )
Returns size in use of impl (cstring_t).
static int alloc_memblock_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Resizes memblock_t if necessary and returns additional memory in memstr.
static int shrink_memblock_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Sets memstr to whole allocated buffer of impl (memblock_t) except for the first new_size bytes.
static size_t size_memblock_wbuffer( void * impl, const memstream_t * memstr )
Returns number of appended bytes of impl (memblock_t).
Simulates an error in reserve_memblock_wbuffer and reserve_cstring_wbuffer.
static test_errortimer_t s_wbuffer_errtimer
Resizes cstring_t if necessary and returns additional memory in memstr.
static int alloc_cstring_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Dynamically growing C string with trailing ‘\0’ byte.
struct cstring_t
Sets memstr to whole allocated buffer of impl (cstring_t) except for the first new_size bytes.
static int shrink_cstring_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Returns size in use of impl (cstring_t).
static size_t size_cstring_wbuffer( void * impl, const memstream_t * memstr )
Resizes memblock_t if necessary and returns additional memory in memstr.
static int alloc_memblock_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Describes memory block.
struct memblock_t
Sets memstr to whole allocated buffer of impl (memblock_t) except for the first new_size bytes.
static int shrink_memblock_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Returns number of appended bytes of impl (memblock_t).
static size_t size_memblock_wbuffer( void * impl, const memstream_t * memstr )
Returns always ENOMEM.
static int alloc_static_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Sets wbuf->next to start+new_size of static buffer.
static int shrink_static_wbuffer( void * impl, size_t new_size, /*inout*/memstream_t * memstr )
Returns number of appended bytes.
static size_t size_static_wbuffer( void * impl, const memstream_t * memstr )