Logo Search packages:      
Sourcecode: libnl version File versions  Download package

int nl_cache_nitems_filter ( struct nl_cache *  cache,
struct nl_object *  filter 
)

Return the number of items matching a filter in the cache

  • cache Cache object.
  • filter Filter object.

Definition at line 68 of file cache.c.

{
      struct nl_cache_ops *ops = cache->c_ops;
      struct nl_object *obj;
      int nitems = 0;
      
      nl_list_for_each_entry(obj, &cache->c_items, ce_list) {
            if (filter && ops->co_filter && !ops->co_filter(obj, filter))
                  continue;

            nitems++;
      }

      return nitems;
}


Generated by  Doxygen 1.6.0   Back to index