+/* Return the number of items in the bin from the given category (or
+ * from all categories if category == NULL) */
+static int
+mnemon_bin_num_items_in_category (mnemon_t *mnemon,
+ bin_t *bin,
+ category_t *category)
+{
+ int i, num_items = 0;
+
+ if (category == NULL)
+ return bin->num_items;
+
+ for (i = 0; i < bin->num_items; i++)
+ if (mnemon_item_category (mnemon, bin->items[i]) == category)
+ num_items++;
+
+ return num_items;
+}
+