c-snippets  Update of "clob"

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.


Artifact ID: ebfac31607fba1e4238f2e9b6902c868722ce4ed
Page Name:clob
Date: 2008-05-19 12:16:01
Original User: stephan
Parent: 64874f3b39400ab0fc25f927f3d7b2965af9f725

The "clob" API is a dynamically-resizing "blob" (binary large object) class conceptually derived from code in the Fossil source tree (their APIs are also very similar, but this is a re-implementation for licensing reasons). Its primary uses are:

  • Creating and management of dynamic strings. (This is especially easy in conjunction with vappendf.)
  • Output buffering. This is sometimes useful, e.g., when building up output across several different functions.
  • Has some support for compressing/decompressing blobs. Not on-the-fly de/compression, but useful nonetheless.

The original intention of this class was to provide output buffering support for the cgi3 toolkit.

It's used something like this:

Clob * c;
clob_init( &c, 0, 0 );
clob_appendf( c, "Hello, %s!", "world");
clob_finalize( c );

clob_appendf() is based on vappendf() and therefor uses its extensions.