Growing buffers =============== It is quite usual situation when you need an array of items and you don not know how large it will be in the time you allocate it. Then you need some kind of dynamically growing buffer. You can either use <>, which has similar functionality, or this module. - <> - <> [[gbuf]] Generic growing buffers ----------------------- The generic buffers are in `ucw/gbuf.h`. They are <>. To use them, you need to define: - `GBUF_PREFIX(name)` -- the identifier generating macro. - `GBUF_TYPE` -- the data type they operate with. You may define `GBUF_TRACE(\...)` macro. If you do, it will be used to log the growing of the buffer. The macro should act like printf() -- the first parameter will be format, the rest variables for it. !!ucw/gbuf.h GBUF_PREFIX [[bbuf]] Growing buffers for byte-sized items ------------------------------------ It is often needed to allocate the buffer by bytes (if you handle some anonymous data) or characters (strings of unknown length). With the `ucw/bbuf.h` header, you get an instance of growing buffers with type `byte` and prefix `bb_`. Aside from that, you get few functions to manipulate strings in the buffers. !!ucw/bbuf.h