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_VSBWriteDisable( struct librock_VSB_s *v ); void * librock_VSBWriteEnable( struct librock_VSB_s *v ); void librock_VSBSetXA( struct librock_VSB_s *v, const void *p,int len );
librock_VSBWriteEnable reallocates the librock_VSB buffer so that librock_VSB calls can modify the buffer contents. Returns non-zero if successful.
Use librock_VSBSetXA() to replace the buffer with one that is already externally allocated. It will be "WriteDisabled."
#ifdef librock_TYPICAL_USE_VSBSetXA #include <librock/mstruct.h> struct librock_VSB_s *v = librock_VSBalloc(); librock_VSBSetXA(v,"External Allocation.",10); /* Error to call VSBAppend, VSBInsert, or even VSBsz when buffer is WriteDisabled. librock_VSBAppend(v,"is ",3); librock_VSBInsert(v,0,"this ",5); printf("%s\n",librock_VSBsz(v)); */ printf("%.*s\n",v->inbuf,v->buf); librock_VSBfree(v); #endif
librock_assert() librock_VSBrealloc() free() // #ifndef librock_fmalloc memcpy() // #ifndef librock_memcpy //librock_VSBSetXA uses macros for memory operations //librock_memcpy and librock_ffree. If not defined //at compile time, they are set to memcpy() and free()
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_VSBWriteDisable passed tests in tvsbop (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_VSBWriteDisable passed tests in tvsbop_main (WIN32: 2002/08/08 sys=NT 4.0 using MSVC)
librock_VSBWriteEnable passed tests in tvsbop (Unix/Linux/BSD: 2002/08/08 sys=FreeBSD using gcc)
librock_VSBWriteEnable 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.