Home
Highly Reusable Software By activity User Interface Text Strings Math Processing
Stored Data
Communications
Hard World File System
|
#License - #Source code - #Example Use -
#include <librock/mstruct.h> void librock_VSBDelete( struct librock_VSB_s *v, int loc, /* index into buffer */ int len ); void librock_VSBClear( struct librock_VSB_s *v ); void librock_VSBSetLength( struct librock_VSB_s *v, int appsize );
librock_VSBClear sets the count of bytes in the buffer to 0.
librock_VSBSetLength sets the count of bytes in the buffer to appsize. If lengthened, the contents of the additional section is undefined.
The librock_VSB must not be WriteDisable'd.
Since a realloc can be performed (to give back excess space), any externally held pointers into the buffer are stale after these calls. This is a very common programmer error.
Typical use is
#ifdef librock_TYPICAL_USE_VSBDelete struct librock_VSB_s *v = librock_VSBalloc(); librock_VSBAppend(v,"AAAThis is ",11); librock_VSBDelete(v,0,3); printf("%s\n",librock_VSBsz(v)); librock_VSBfree(v); #endif
librock_VSBrealloc() librock_assert() memmove() // #ifndef librock_memcpy //Uses macros for memory operations librock_memmove. //If not defined at compile time, set to memmove().
Copyright 1998-2002 Forrest J. Cavalier III, http://www.mibsoftware.com Licensed under BSD-ish license, NO WARRANTY. Copies must retain this block. License text in <librock/license/librock.txt> librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45
librock_VSBClear passed tests in tvsbop (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_VSBClear passed tests in tvsbop_main (WIN32: 2002/08/08 sys=NT 4.0 using MSVC)
librock_VSBDelete passed tests in tvsbop (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_VSBDelete passed tests in tvsbop_main (WIN32: 2002/08/08 sys=NT 4.0 using MSVC)
librock_VSBSetLength passed tests in tvsbop (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_VSBSetLength passed tests in tvsbop_main (WIN32: 2002/08/08 sys=NT 4.0 using MSVC)
Verbatim copying and distribution of this generated page is permitted in any medium provided that no changes are made.
(The source of this manual page may be covered by a more permissive license which allows modifications.)
Want to help? We welcome comments, patches. -- Need help? Request paid support.