Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/hbuf.c @ 1227:79c396678f1b
Make buffer list display the number of allocated HBB blocks
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 19 May 2007 12:18:25 +0200 |
parents | 2de8f8ba1f34 |
children | 3a4018f18bdf |
comparison
equal
deleted
inserted
replaced
1226:2521efbf3b72 | 1227:79c396678f1b |
---|---|
393 hlen = g_list_length(hbuf); | 393 hlen = g_list_length(hbuf); |
394 | 394 |
395 return g_list_nth(hbuf, pc*hlen/100); | 395 return g_list_nth(hbuf, pc*hlen/100); |
396 } | 396 } |
397 | 397 |
398 #ifdef DEBUG_ENABLE | |
399 // hbuf_get_blocks_number() | |
400 // Returns the number of allocated hbuf_block's. | |
401 guint hbuf_get_blocks_number(GList *hbuf) | |
402 { | |
403 hbuf_block *hbuf_b_elt; | |
404 guint count = 0U; | |
405 | |
406 for (hbuf = g_list_first(hbuf); hbuf; hbuf = g_list_next(hbuf)) { | |
407 hbuf_b_elt = (hbuf_block*)(hbuf->data); | |
408 if (hbuf_b_elt->flags & HBB_FLAG_ALLOC) | |
409 count++; | |
410 } | |
411 return count; | |
412 } | |
413 #endif | |
414 | |
398 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ | 415 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |