]> mj.ucw.cz Git - libucw.git/commitdiff
Even better GBUF_TRACE -- the caller supplies his own logging function.
authorMartin Mares <mj@ucw.cz>
Mon, 29 Aug 2005 16:43:51 +0000 (16:43 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 29 Aug 2005 16:43:51 +0000 (16:43 +0000)
Also documented the new switch.

lib/gbuf.h

index d202adb6f1b05e5e2f03fef90cf847d0f67b10a5..a188f5d0aa0a7bf3e8d185ea52b001f2be5ebaa2 100644 (file)
@@ -8,6 +8,7 @@
  *
  *     GBUF_TYPE       data type of records stored in the buffer
  *     GBUF_PREFIX(x)  add a name prefix to all global symbols
+ *     GBUF_TRACE(msg...) log growing of buffer [optional]
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
@@ -46,7 +47,7 @@ GBUF_PREFIX(realloc)(BUF_T *b, uns len)
   b->len = len;
   b->ptr = xrealloc(b->ptr, len * sizeof(GBUF_TYPE));
 #ifdef GBUF_TRACE
-  log(L_DEBUG, STRINGIFY_EXPANDED(BUF_T) " growing to %u items", len);
+  GBUF_TRACE(STRINGIFY_EXPANDED(BUF_T) " growing to %u items", len);
 #endif
 }